ruạṛ
var Ddt=Object.defineProperty;var Adt=(n,e,t)=>e in n?Ddt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ra=(n,e,t)=>(Adt(n,typeof e!="symbol"?e+"":e,t),t);function c5e(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hfe(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var u5e={exports:{}},VU={},d5e={exports:{}},is={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var K5=Symbol.for("react.element"),Ndt=Symbol.for("react.portal"),Rdt=Symbol.for("react.fragment"),Odt=Symbol.for("react.strict_mode"),Pdt=Symbol.for("react.profiler"),Mdt=Symbol.for("react.provider"),Fdt=Symbol.for("react.context"),Bdt=Symbol.for("react.forward_ref"),$dt=Symbol.for("react.suspense"),Vdt=Symbol.for("react.memo"),Hdt=Symbol.for("react.lazy"),eSe=Symbol.iterator;function Wdt(n){return n===null||typeof n!="object"?null:(n=eSe&&n[eSe]||n["@@iterator"],typeof n=="function"?n:null)}var h5e={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f5e=Object.assign,p5e={};function uN(n,e,t){this.props=n,this.context=e,this.refs=p5e,this.updater=t||h5e}uN.prototype.isReactComponent={};uN.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};uN.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function g5e(){}g5e.prototype=uN.prototype;function ffe(n,e,t){this.props=n,this.context=e,this.refs=p5e,this.updater=t||h5e}var pfe=ffe.prototype=new g5e;pfe.constructor=ffe;f5e(pfe,uN.prototype);pfe.isPureReactComponent=!0;var tSe=Array.isArray,m5e=Object.prototype.hasOwnProperty,gfe={current:null},_5e={key:!0,ref:!0,__self:!0,__source:!0};function v5e(n,e,t){var i,r={},o=null,s=null;if(e!=null)for(i in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)m5e.call(e,i)&&!_5e.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(n&&n.defaultProps)for(i in a=n.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:K5,type:n,key:o,ref:s,props:r,_owner:gfe.current}}function zdt(n,e){return{$$typeof:K5,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function mfe(n){return typeof n=="object"&&n!==null&&n.$$typeof===K5}function Udt(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var nSe=/\/+/g;function fX(n,e){return typeof n=="object"&&n!==null&&n.key!=null?Udt(""+n.key):e.toString(36)}function z7(n,e,t,i,r){var o=typeof n;(o==="undefined"||o==="boolean")&&(n=null);var s=!1;if(n===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(n.$$typeof){case K5:case Ndt:s=!0}}if(s)return s=n,r=r(s),n=i===""?"."+fX(s,0):i,tSe(r)?(t="",n!=null&&(t=n.replace(nSe,"$&/")+"/"),z7(r,e,t,"",function(c){return c})):r!=null&&(mfe(r)&&(r=zdt(r,t+(!r.key||s&&s.key===r.key?"":(""+r.key).replace(nSe,"$&/")+"/")+n)),e.push(r)),1;if(s=0,i=i===""?".":i+":",tSe(n))for(var a=0;a<n.length;a++){o=n[a];var l=i+fX(o,a);s+=z7(o,e,t,l,r)}else if(l=Wdt(n),typeof l=="function")for(n=l.call(n),a=0;!(o=n.next()).done;)o=o.value,l=i+fX(o,a++),s+=z7(o,e,t,l,r);else if(o==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function GB(n,e,t){if(n==null)return n;var i=[],r=0;return z7(n,i,"","",function(o){return e.call(t,o,r++)}),i}function jdt(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var Jh={current:null},U7={transition:null},qdt={ReactCurrentDispatcher:Jh,ReactCurrentBatchConfig:U7,ReactCurrentOwner:gfe};is.Children={map:GB,forEach:function(n,e,t){GB(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return GB(n,function(){e++}),e},toArray:function(n){return GB(n,function(e){return e})||[]},only:function(n){if(!mfe(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};is.Component=uN;is.Fragment=Rdt;is.Profiler=Pdt;is.PureComponent=ffe;is.StrictMode=Odt;is.Suspense=$dt;is.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qdt;is.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var i=f5e({},n.props),r=n.key,o=n.ref,s=n._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=gfe.current),e.key!==void 0&&(r=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in e)m5e.call(e,l)&&!_5e.hasOwnProperty(l)&&(i[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)i.children=t;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];i.children=a}return{$$typeof:K5,type:n.type,key:r,ref:o,props:i,_owner:s}};is.createContext=function(n){return n={$$typeof:Fdt,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:Mdt,_context:n},n.Consumer=n};is.createElement=v5e;is.createFactory=function(n){var e=v5e.bind(null,n);return e.type=n,e};is.createRef=function(){return{current:null}};is.forwardRef=function(n){return{$$typeof:Bdt,render:n}};is.isValidElement=mfe;is.lazy=function(n){return{$$typeof:Hdt,_payload:{_status:-1,_result:n},_init:jdt}};is.memo=function(n,e){return{$$typeof:Vdt,type:n,compare:e===void 0?null:e}};is.startTransition=function(n){var e=U7.transition;U7.transition={};try{n()}finally{U7.transition=e}};is.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};is.useCallback=function(n,e){return Jh.current.useCallback(n,e)};is.useContext=function(n){return Jh.current.useContext(n)};is.useDebugValue=function(){};is.useDeferredValue=function(n){return Jh.current.useDeferredValue(n)};is.useEffect=function(n,e){return Jh.current.useEffect(n,e)};is.useId=function(){return Jh.current.useId()};is.useImperativeHandle=function(n,e,t){return Jh.current.useImperativeHandle(n,e,t)};is.useInsertionEffect=function(n,e){return Jh.current.useInsertionEffect(n,e)};is.useLayoutEffect=function(n,e){return Jh.current.useLayoutEffect(n,e)};is.useMemo=function(n,e){return Jh.current.useMemo(n,e)};is.useReducer=function(n,e,t){return Jh.current.useReducer(n,e,t)};is.useRef=function(n){return Jh.current.useRef(n)};is.useState=function(n){return Jh.current.useState(n)};is.useSyncExternalStore=function(n,e,t){return Jh.current.useSyncExternalStore(n,e,t)};is.useTransition=function(){return Jh.current.useTransition()};is.version="18.2.0";d5e.exports=is;var w=d5e.exports;const ae=nl(w),Am=c5e({__proto__:null,default:ae},[w]);/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Kdt=w,Gdt=Symbol.for("react.element"),Ydt=Symbol.for("react.fragment"),Qdt=Object.prototype.hasOwnProperty,Xdt=Kdt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Zdt={key:!0,ref:!0,__self:!0,__source:!0};function b5e(n,e,t){var i,r={},o=null,s=null;t!==void 0&&(o=""+t),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(i in e)Qdt.call(e,i)&&!Zdt.hasOwnProperty(i)&&(r[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:Gdt,type:n,key:o,ref:s,props:r,_owner:Xdt.current}}VU.Fragment=Ydt;VU.jsx=b5e;VU.jsxs=b5e;u5e.exports=VU;var _fe=u5e.exports;const dt=_fe.Fragment,p=_fe.jsx,N=_fe.jsxs,Jdt="/ar-6c12ad54.json",eht="/bg-b99e83e6.json",tht="/ca-d690bf04.json",nht="/cs-133bffbb.json",iht="/da-917469f3.json",rht="/de-54d92142.json",oht="/el-27910051.json",sht="/en-de30d839.json",aht="/en_GB-29588f3a.json",lht="/es-b3dad249.json",cht="/es_ES-36530ed2.json",uht="/et-b13fd773.json",dht="/fa-06b54cd4.json",hht="/fi-affb05b4.json",fht="/fr-4e65eed9.json",pht="/fr_CA-99f2d129.json",ght="/fr_CH-ab1c4044.json",mht="/he-d7f36bfb.json",_ht="/hr-67d94a1f.json",vht="/hu-b4436abb.json",bht="/it-e2d28b16.json",yht="/ja-ec51c9f6.json",Cht="/km_KH-b8fe5b86.json",wht="/lo_LA-b1ead10e.json",Sht="/lt-e29cbdd4.json",Eht="/lv_LV-ecb6ebba.json",xht="/mk_MK-158f75c4.json",Tht="/nb_NO-24b70e27.json",kht="/nl-fcff64e0.json",Iht="/pl-4c6aa4bc.json",Lht="/pt_BR-bb1635c0.json",Dht="/pt_PT-4144d579.json",Aht="/ro-497bd154.json",Nht="/ru_RU-038d4a59.json",Rht="/sk-9b64aab2.json",Oht="/sl-4ea1f7e6.json",Pht="/sq-516499eb.json",Mht="/sr-204b100e.json",Fht="/sv-a353cc44.json",Bht="/th-22776486.json",$ht="/tr_TR-efed8f17.json",Vht="/vi-93df9c9e.json",Hht="/zh_TW-f9bffefd.json";var y5e={exports:{}},C5e={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ED=w;function Wht(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var zht=typeof Object.is=="function"?Object.is:Wht,Uht=ED.useState,jht=ED.useEffect,qht=ED.useLayoutEffect,Kht=ED.useDebugValue;function Ght(n,e){var t=e(),i=Uht({inst:{value:t,getSnapshot:e}}),r=i[0].inst,o=i[1];return qht(function(){r.value=t,r.getSnapshot=e,pX(r)&&o({inst:r})},[n,t,e]),jht(function(){return pX(r)&&o({inst:r}),n(function(){pX(r)&&o({inst:r})})},[n]),Kht(t),t}function pX(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!zht(n,t)}catch{return!0}}function Yht(n,e){return e()}var Qht=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Yht:Ght;C5e.useSyncExternalStore=ED.useSyncExternalStore!==void 0?ED.useSyncExternalStore:Qht;y5e.exports=C5e;var w5e=y5e.exports,S5e={exports:{}},E5e={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var HU=w,Xht=w5e;function Zht(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Jht=typeof Object.is=="function"?Object.is:Zht,eft=Xht.useSyncExternalStore,tft=HU.useRef,nft=HU.useEffect,ift=HU.useMemo,rft=HU.useDebugValue;E5e.useSyncExternalStoreWithSelector=function(n,e,t,i,r){var o=tft(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=ift(function(){function l(f){if(!c){if(c=!0,u=f,f=i(f),r!==void 0&&s.hasValue){var g=s.value;if(r(g,f))return d=g}return d=f}if(g=d,Jht(u,f))return g;var m=i(f);return r!==void 0&&r(g,m)?g:(u=f,d=m)}var c=!1,u,d,h=t===void 0?null:t;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,t,i,r]);var a=eft(n,o[0],o[1]);return nft(function(){s.hasValue=!0,s.value=a},[a]),rft(a),a};S5e.exports=E5e;var oft=S5e.exports,x5e={exports:{}},Sg={},T5e={exports:{}},k5e={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(n){function e(W,q){var H=W.length;W.push(q);e:for(;0<H;){var ie=H-1>>>1,se=W[ie];if(0<r(se,q))W[ie]=q,W[H]=se,H=ie;else break e}}function t(W){return W.length===0?null:W[0]}function i(W){if(W.length===0)return null;var q=W[0],H=W.pop();if(H!==q){W[0]=H;e:for(var ie=0,se=W.length,Q=se>>>1;ie<Q;){var Ee=2*(ie+1)-1,Fe=W[Ee],He=Ee+1,ke=W[He];if(0>r(Fe,H))He<se&&0>r(ke,Fe)?(W[ie]=ke,W[He]=H,ie=He):(W[ie]=Fe,W[Ee]=H,ie=Ee);else if(He<se&&0>r(ke,H))W[ie]=ke,W[He]=H,ie=He;else break e}}return q}function r(W,q){var H=W.sortIndex-q.sortIndex;return H!==0?H:W.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();n.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,h=3,f=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(W){for(var q=t(c);q!==null;){if(q.callback===null)i(c);else if(q.startTime<=W)i(c),q.sortIndex=q.expirationTime,e(l,q);else break;q=t(c)}}function C(W){if(m=!1,y(W),!g)if(t(l)!==null)g=!0,V(x);else{var q=t(c);q!==null&&U(C,q.startTime-W)}}function x(W,q){g=!1,m&&(m=!1,_(L),L=-1),f=!0;var H=h;try{for(y(q),d=t(l);d!==null&&(!(d.expirationTime>q)||W&&!O());){var ie=d.callback;if(typeof ie=="function"){d.callback=null,h=d.priorityLevel;var se=ie(d.expirationTime<=q);q=n.unstable_now(),typeof se=="function"?d.callback=se:d===t(l)&&i(l),y(q)}else i(l);d=t(l)}if(d!==null)var Q=!0;else{var Ee=t(c);Ee!==null&&U(C,Ee.startTime-q),Q=!1}return Q}finally{d=null,h=H,f=!1}}var E=!1,k=null,L=-1,D=5,A=-1;function O(){return!(n.unstable_now()-A<D)}function P(){if(k!==null){var W=n.unstable_now();A=W;var q=!0;try{q=k(!0,W)}finally{q?F():(E=!1,k=null)}}else E=!1}var F;if(typeof b=="function")F=function(){b(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=P,F=function(){M.postMessage(null)}}else F=function(){v(P,0)};function V(W){k=W,E||(E=!0,F())}function U(W,q){L=v(function(){W(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(W){W.callback=null},n.unstable_continueExecution=function(){g||f||(g=!0,V(x))},n.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<W?Math.floor(1e3/W):5},n.unstable_getCurrentPriorityLevel=function(){return h},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(W){switch(h){case 1:case 2:case 3:var q=3;break;default:q=h}var H=h;h=q;try{return W()}finally{h=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(W,q){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var H=h;h=W;try{return q()}finally{h=H}},n.unstable_scheduleCallback=function(W,q,H){var ie=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?ie+H:ie):H=ie,W){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=H+se,W={id:u++,callback:q,priorityLevel:W,startTime:H,expirationTime:se,sortIndex:-1},H>ie?(W.sortIndex=H,e(c,W),t(l)===null&&W===t(c)&&(m?(_(L),L=-1):m=!0,U(C,H-ie))):(W.sortIndex=se,e(l,W),g||f||(g=!0,V(x))),W},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(W){var q=h;return function(){var H=h;h=q;try{return W.apply(this,arguments)}finally{h=H}}}})(k5e);T5e.exports=k5e;var sft=T5e.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var I5e=w,ug=sft;function Rn(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var L5e=new Set,s4={};function Ik(n,e){xD(n,e),xD(n+"Capture",e)}function xD(n,e){for(s4[n]=e,n=0;n<e.length;n++)L5e.add(e[n])}var s1=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),One=Object.prototype.hasOwnProperty,aft=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,iSe={},rSe={};function lft(n){return One.call(rSe,n)?!0:One.call(iSe,n)?!1:aft.test(n)?rSe[n]=!0:(iSe[n]=!0,!1)}function cft(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function uft(n,e,t,i){if(e===null||typeof e>"u"||cft(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ef(n,e,t,i,r,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Md={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Md[n]=new ef(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Md[e]=new ef(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Md[n]=new ef(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Md[n]=new ef(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Md[n]=new ef(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Md[n]=new ef(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Md[n]=new ef(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Md[n]=new ef(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Md[n]=new ef(n,5,!1,n.toLowerCase(),null,!1,!1)});var vfe=/[\-:]([a-z])/g;function bfe(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(vfe,bfe);Md[e]=new ef(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(vfe,bfe);Md[e]=new ef(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(vfe,bfe);Md[e]=new ef(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Md[n]=new ef(n,1,!1,n.toLowerCase(),null,!1,!1)});Md.xlinkHref=new ef("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Md[n]=new ef(n,1,!1,n.toLowerCase(),null,!0,!0)});function yfe(n,e,t,i){var r=Md.hasOwnProperty(e)?Md[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(uft(e,t,r,i)&&(t=null),i||r===null?lft(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):r.mustUseProperty?n[r.propertyName]=t===null?r.type===3?!1:"":t:(e=r.attributeName,i=r.attributeNamespace,t===null?n.removeAttribute(e):(r=r.type,t=r===3||r===4&&t===!0?"":""+t,i?n.setAttributeNS(i,e,t):n.setAttribute(e,t))))}var x1=I5e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,YB=Symbol.for("react.element"),N2=Symbol.for("react.portal"),R2=Symbol.for("react.fragment"),Cfe=Symbol.for("react.strict_mode"),Pne=Symbol.for("react.profiler"),D5e=Symbol.for("react.provider"),A5e=Symbol.for("react.context"),wfe=Symbol.for("react.forward_ref"),Mne=Symbol.for("react.suspense"),Fne=Symbol.for("react.suspense_list"),Sfe=Symbol.for("react.memo"),wC=Symbol.for("react.lazy"),N5e=Symbol.for("react.offscreen"),oSe=Symbol.iterator;function WR(n){return n===null||typeof n!="object"?null:(n=oSe&&n[oSe]||n["@@iterator"],typeof n=="function"?n:null)}var $l=Object.assign,gX;function JO(n){if(gX===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);gX=e&&e[1]||""}return` `+gX+n}var mX=!1;function _X(n,e){if(!n||mX)return"";mX=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var i=c}Reflect.construct(n,[],e)}else{try{e.call()}catch(c){i=c}n.call(e.prototype)}else{try{throw Error()}catch(c){i=c}n()}}catch(c){if(c&&i&&typeof c.stack=="string"){for(var r=c.stack.split(` `),o=i.stack.split(` `),s=r.length-1,a=o.length-1;1<=s&&0<=a&&r[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(r[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||r[s]!==o[a]){var l=` `+r[s].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=s&&0<=a);break}}}finally{mX=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?JO(n):""}function dft(n){switch(n.tag){case 5:return JO(n.type);case 16:return JO("Lazy");case 13:return JO("Suspense");case 19:return JO("SuspenseList");case 0:case 2:case 15:return n=_X(n.type,!1),n;case 11:return n=_X(n.type.render,!1),n;case 1:return n=_X(n.type,!0),n;default:return""}}function Bne(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case R2:return"Fragment";case N2:return"Portal";case Pne:return"Profiler";case Cfe:return"StrictMode";case Mne:return"Suspense";case Fne:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case A5e:return(n.displayName||"Context")+".Consumer";case D5e:return(n._context.displayName||"Context")+".Provider";case wfe:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Sfe:return e=n.displayName||null,e!==null?e:Bne(n.type)||"Memo";case wC:e=n._payload,n=n._init;try{return Bne(n(e))}catch{}}return null}function hft(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Bne(e);case 8:return e===Cfe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Xw(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function R5e(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function fft(n){var e=R5e(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,o.call(this,s)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function QB(n){n._valueTracker||(n._valueTracker=fft(n))}function O5e(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=R5e(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function wV(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function $ne(n,e){var t=e.checked;return $l({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function sSe(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Xw(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function P5e(n,e){e=e.checked,e!=null&&yfe(n,"checked",e,!1)}function Vne(n,e){P5e(n,e);var t=Xw(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?Hne(n,e.type,t):e.hasOwnProperty("defaultValue")&&Hne(n,e.type,Xw(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function aSe(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function Hne(n,e,t){(e!=="number"||wV(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var eP=Array.isArray;function LL(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r<t.length;r++)e["$"+t[r]]=!0;for(t=0;t<n.length;t++)r=e.hasOwnProperty("$"+n[t].value),n[t].selected!==r&&(n[t].selected=r),r&&i&&(n[t].defaultSelected=!0)}else{for(t=""+Xw(t),e=null,r=0;r<n.length;r++){if(n[r].value===t){n[r].selected=!0,i&&(n[r].defaultSelected=!0);return}e!==null||n[r].disabled||(e=n[r])}e!==null&&(e.selected=!0)}}function Wne(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Rn(91));return $l({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function lSe(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Rn(92));if(eP(t)){if(1<t.length)throw Error(Rn(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Xw(t)}}function M5e(n,e){var t=Xw(e.value),i=Xw(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),i!=null&&(n.defaultValue=""+i)}function cSe(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function F5e(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function zne(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?F5e(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var XB,B5e=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,i,r){MSApp.execUnsafeLocalFunction(function(){return n(e,t,i,r)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(XB=XB||document.createElement("div"),XB.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=XB.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function a4(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var MP={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pft=["Webkit","ms","Moz","O"];Object.keys(MP).forEach(function(n){pft.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),MP[e]=MP[n]})});function $5e(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||MP.hasOwnProperty(n)&&MP[n]?(""+e).trim():e+"px"}function V5e(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=$5e(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var gft=$l({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Une(n,e){if(e){if(gft[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Rn(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Rn(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Rn(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Rn(62))}}function jne(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qne=null;function Efe(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Kne=null,DL=null,AL=null;function uSe(n){if(n=Q5(n)){if(typeof Kne!="function")throw Error(Rn(280));var e=n.stateNode;e&&(e=qU(e),Kne(n.stateNode,n.type,e))}}function H5e(n){DL?AL?AL.push(n):AL=[n]:DL=n}function W5e(){if(DL){var n=DL,e=AL;if(AL=DL=null,uSe(n),e)for(n=0;n<e.length;n++)uSe(e[n])}}function z5e(n,e){return n(e)}function U5e(){}var vX=!1;function j5e(n,e,t){if(vX)return n(e,t);vX=!0;try{return z5e(n,e,t)}finally{vX=!1,(DL!==null||AL!==null)&&(U5e(),W5e())}}function l4(n,e){var t=n.stateNode;if(t===null)return null;var i=qU(t);if(i===null)return null;t=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(n=n.type,i=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!i;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Rn(231,e,typeof t));return t}var Gne=!1;if(s1)try{var zR={};Object.defineProperty(zR,"passive",{get:function(){Gne=!0}}),window.addEventListener("test",zR,zR),window.removeEventListener("test",zR,zR)}catch{Gne=!1}function mft(n,e,t,i,r,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var FP=!1,SV=null,EV=!1,Yne=null,_ft={onError:function(n){FP=!0,SV=n}};function vft(n,e,t,i,r,o,s,a,l){FP=!1,SV=null,mft.apply(_ft,arguments)}function bft(n,e,t,i,r,o,s,a,l){if(vft.apply(this,arguments),FP){if(FP){var c=SV;FP=!1,SV=null}else throw Error(Rn(198));EV||(EV=!0,Yne=c)}}function Lk(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function q5e(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function dSe(n){if(Lk(n)!==n)throw Error(Rn(188))}function yft(n){var e=n.alternate;if(!e){if(e=Lk(n),e===null)throw Error(Rn(188));return e!==n?null:n}for(var t=n,i=e;;){var r=t.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){t=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===t)return dSe(r),n;if(o===i)return dSe(r),e;o=o.sibling}throw Error(Rn(188))}if(t.return!==i.return)t=r,i=o;else{for(var s=!1,a=r.child;a;){if(a===t){s=!0,t=r,i=o;break}if(a===i){s=!0,i=r,t=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===t){s=!0,t=o,i=r;break}if(a===i){s=!0,i=o,t=r;break}a=a.sibling}if(!s)throw Error(Rn(189))}}if(t.alternate!==i)throw Error(Rn(190))}if(t.tag!==3)throw Error(Rn(188));return t.stateNode.current===t?n:e}function K5e(n){return n=yft(n),n!==null?G5e(n):null}function G5e(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=G5e(n);if(e!==null)return e;n=n.sibling}return null}var Y5e=ug.unstable_scheduleCallback,hSe=ug.unstable_cancelCallback,Cft=ug.unstable_shouldYield,wft=ug.unstable_requestPaint,yc=ug.unstable_now,Sft=ug.unstable_getCurrentPriorityLevel,xfe=ug.unstable_ImmediatePriority,Q5e=ug.unstable_UserBlockingPriority,xV=ug.unstable_NormalPriority,Eft=ug.unstable_LowPriority,X5e=ug.unstable_IdlePriority,WU=null,Hb=null;function xft(n){if(Hb&&typeof Hb.onCommitFiberRoot=="function")try{Hb.onCommitFiberRoot(WU,n,void 0,(n.current.flags&128)===128)}catch{}}var iv=Math.clz32?Math.clz32:Ift,Tft=Math.log,kft=Math.LN2;function Ift(n){return n>>>=0,n===0?32:31-(Tft(n)/kft|0)|0}var ZB=64,JB=4194304;function tP(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function TV(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,o=n.pingedLanes,s=t&268435455;if(s!==0){var a=s&~r;a!==0?i=tP(a):(o&=s,o!==0&&(i=tP(o)))}else s=t&~r,s!==0?i=tP(s):o!==0&&(i=tP(o));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,o=e&-e,r>=o||r===16&&(o&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0<e;)t=31-iv(e),r=1<<t,i|=n[t],e&=~r;return i}function Lft(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dft(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,o=n.pendingLanes;0<o;){var s=31-iv(o),a=1<<s,l=r[s];l===-1?(!(a&t)||a&i)&&(r[s]=Lft(a,e)):l<=e&&(n.expiredLanes|=a),o&=~a}}function Qne(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function Z5e(){var n=ZB;return ZB<<=1,!(ZB&4194240)&&(ZB=64),n}function bX(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function G5(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-iv(e),n[e]=t}function Aft(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0<t;){var r=31-iv(t),o=1<<r;e[r]=0,i[r]=-1,n[r]=-1,t&=~o}}function Tfe(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-iv(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}var da=0;function J5e(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var eFe,kfe,tFe,nFe,iFe,Xne=!1,e8=[],fw=null,pw=null,gw=null,c4=new Map,u4=new Map,NC=[],Nft="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fSe(n,e){switch(n){case"focusin":case"focusout":fw=null;break;case"dragenter":case"dragleave":pw=null;break;case"mouseover":case"mouseout":gw=null;break;case"pointerover":case"pointerout":c4.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":u4.delete(e.pointerId)}}function UR(n,e,t,i,r,o){return n===null||n.nativeEvent!==o?(n={blockedOn:e,domEventName:t,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},e!==null&&(e=Q5(e),e!==null&&kfe(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function Rft(n,e,t,i,r){switch(e){case"focusin":return fw=UR(fw,n,e,t,i,r),!0;case"dragenter":return pw=UR(pw,n,e,t,i,r),!0;case"mouseover":return gw=UR(gw,n,e,t,i,r),!0;case"pointerover":var o=r.pointerId;return c4.set(o,UR(c4.get(o)||null,n,e,t,i,r)),!0;case"gotpointercapture":return o=r.pointerId,u4.set(o,UR(u4.get(o)||null,n,e,t,i,r)),!0}return!1}function rFe(n){var e=Nx(n.target);if(e!==null){var t=Lk(e);if(t!==null){if(e=t.tag,e===13){if(e=q5e(t),e!==null){n.blockedOn=e,iFe(n.priority,function(){tFe(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function j7(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=Zne(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);qne=i,t.target.dispatchEvent(i),qne=null}else return e=Q5(t),e!==null&&kfe(e),n.blockedOn=t,!1;e.shift()}return!0}function pSe(n,e,t){j7(n)&&t.delete(e)}function Oft(){Xne=!1,fw!==null&&j7(fw)&&(fw=null),pw!==null&&j7(pw)&&(pw=null),gw!==null&&j7(gw)&&(gw=null),c4.forEach(pSe),u4.forEach(pSe)}function jR(n,e){n.blockedOn===e&&(n.blockedOn=null,Xne||(Xne=!0,ug.unstable_scheduleCallback(ug.unstable_NormalPriority,Oft)))}function d4(n){function e(r){return jR(r,n)}if(0<e8.length){jR(e8[0],n);for(var t=1;t<e8.length;t++){var i=e8[t];i.blockedOn===n&&(i.blockedOn=null)}}for(fw!==null&&jR(fw,n),pw!==null&&jR(pw,n),gw!==null&&jR(gw,n),c4.forEach(e),u4.forEach(e),t=0;t<NC.length;t++)i=NC[t],i.blockedOn===n&&(i.blockedOn=null);for(;0<NC.length&&(t=NC[0],t.blockedOn===null);)rFe(t),t.blockedOn===null&&NC.shift()}var NL=x1.ReactCurrentBatchConfig,kV=!0;function Pft(n,e,t,i){var r=da,o=NL.transition;NL.transition=null;try{da=1,Ife(n,e,t,i)}finally{da=r,NL.transition=o}}function Mft(n,e,t,i){var r=da,o=NL.transition;NL.transition=null;try{da=4,Ife(n,e,t,i)}finally{da=r,NL.transition=o}}function Ife(n,e,t,i){if(kV){var r=Zne(n,e,t,i);if(r===null)LX(n,e,i,IV,t),fSe(n,i);else if(Rft(r,n,e,t,i))i.stopPropagation();else if(fSe(n,i),e&4&&-1<Nft.indexOf(n)){for(;r!==null;){var o=Q5(r);if(o!==null&&eFe(o),o=Zne(n,e,t,i),o===null&&LX(n,e,i,IV,t),o===r)break;r=o}r!==null&&i.stopPropagation()}else LX(n,e,i,null,t)}}var IV=null;function Zne(n,e,t,i){if(IV=null,n=Efe(i),n=Nx(n),n!==null)if(e=Lk(n),e===null)n=null;else if(t=e.tag,t===13){if(n=q5e(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return IV=n,null}function oFe(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Sft()){case xfe:return 1;case Q5e:return 4;case xV:case Eft:return 16;case X5e:return 536870912;default:return 16}default:return 16}}var zC=null,Lfe=null,q7=null;function sFe(){if(q7)return q7;var n,e=Lfe,t=e.length,i,r="value"in zC?zC.value:zC.textContent,o=r.length;for(n=0;n<t&&e[n]===r[n];n++);var s=t-n;for(i=1;i<=s&&e[t-i]===r[o-i];i++);return q7=r.slice(n,1<i?1-i:void 0)}function K7(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function t8(){return!0}function gSe(){return!1}function Eg(n){function e(t,i,r,o,s){this._reactName=t,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?t8:gSe,this.isPropagationStopped=gSe,this}return $l(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=t8)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=t8)},persist:function(){},isPersistent:t8}),e}var dN={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dfe=Eg(dN),Y5=$l({},dN,{view:0,detail:0}),Fft=Eg(Y5),yX,CX,qR,zU=$l({},Y5,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Afe,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==qR&&(qR&&n.type==="mousemove"?(yX=n.screenX-qR.screenX,CX=n.screenY-qR.screenY):CX=yX=0,qR=n),yX)},movementY:function(n){return"movementY"in n?n.movementY:CX}}),mSe=Eg(zU),Bft=$l({},zU,{dataTransfer:0}),$ft=Eg(Bft),Vft=$l({},Y5,{relatedTarget:0}),wX=Eg(Vft),Hft=$l({},dN,{animationName:0,elapsedTime:0,pseudoElement:0}),Wft=Eg(Hft),zft=$l({},dN,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Uft=Eg(zft),jft=$l({},dN,{data:0}),_Se=Eg(jft),qft={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kft={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Gft={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yft(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=Gft[n])?!!e[n]:!1}function Afe(){return Yft}var Qft=$l({},Y5,{key:function(n){if(n.key){var e=qft[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=K7(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Kft[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Afe,charCode:function(n){return n.type==="keypress"?K7(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?K7(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Xft=Eg(Qft),Zft=$l({},zU,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vSe=Eg(Zft),Jft=$l({},Y5,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Afe}),ept=Eg(Jft),tpt=$l({},dN,{propertyName:0,elapsedTime:0,pseudoElement:0}),npt=Eg(tpt),ipt=$l({},zU,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),rpt=Eg(ipt),opt=[9,13,27,32],Nfe=s1&&"CompositionEvent"in window,BP=null;s1&&"documentMode"in document&&(BP=document.documentMode);var spt=s1&&"TextEvent"in window&&!BP,aFe=s1&&(!Nfe||BP&&8<BP&&11>=BP),bSe=String.fromCharCode(32),ySe=!1;function lFe(n,e){switch(n){case"keyup":return opt.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cFe(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var O2=!1;function apt(n,e){switch(n){case"compositionend":return cFe(e);case"keypress":return e.which!==32?null:(ySe=!0,bSe);case"textInput":return n=e.data,n===bSe&&ySe?null:n;default:return null}}function lpt(n,e){if(O2)return n==="compositionend"||!Nfe&&lFe(n,e)?(n=sFe(),q7=Lfe=zC=null,O2=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return aFe&&e.locale!=="ko"?null:e.data;default:return null}}var cpt={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function CSe(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!cpt[n.type]:e==="textarea"}function uFe(n,e,t,i){H5e(i),e=LV(e,"onChange"),0<e.length&&(t=new Dfe("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var $P=null,h4=null;function upt(n){CFe(n,0)}function UU(n){var e=F2(n);if(O5e(e))return n}function dpt(n,e){if(n==="change")return e}var dFe=!1;if(s1){var SX;if(s1){var EX="oninput"in document;if(!EX){var wSe=document.createElement("div");wSe.setAttribute("oninput","return;"),EX=typeof wSe.oninput=="function"}SX=EX}else SX=!1;dFe=SX&&(!document.documentMode||9<document.documentMode)}function SSe(){$P&&($P.detachEvent("onpropertychange",hFe),h4=$P=null)}function hFe(n){if(n.propertyName==="value"&&UU(h4)){var e=[];uFe(e,h4,n,Efe(n)),j5e(upt,e)}}function hpt(n,e,t){n==="focusin"?(SSe(),$P=e,h4=t,$P.attachEvent("onpropertychange",hFe)):n==="focusout"&&SSe()}function fpt(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return UU(h4)}function ppt(n,e){if(n==="click")return UU(e)}function gpt(n,e){if(n==="input"||n==="change")return UU(e)}function mpt(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var gv=typeof Object.is=="function"?Object.is:mpt;function f4(n,e){if(gv(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(i=0;i<t.length;i++){var r=t[i];if(!One.call(e,r)||!gv(n[r],e[r]))return!1}return!0}function ESe(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function xSe(n,e){var t=ESe(n);n=0;for(var i;t;){if(t.nodeType===3){if(i=n+t.textContent.length,n<=e&&i>=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=ESe(t)}}function fFe(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?fFe(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function pFe(){for(var n=window,e=wV();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=wV(n.document)}return e}function Rfe(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function _pt(n){var e=pFe(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&fFe(t.ownerDocument.documentElement,t)){if(i!==null&&Rfe(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,o=Math.min(i.start,r);i=i.end===void 0?o:Math.min(i.end,r),!n.extend&&o>i&&(r=i,i=o,o=r),r=xSe(t,o);var s=xSe(t,i);r&&s&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==s.node||n.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),o>i?(n.addRange(e),n.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var vpt=s1&&"documentMode"in document&&11>=document.documentMode,P2=null,Jne=null,VP=null,eie=!1;function TSe(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;eie||P2==null||P2!==wV(i)||(i=P2,"selectionStart"in i&&Rfe(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),VP&&f4(VP,i)||(VP=i,i=LV(Jne,"onSelect"),0<i.length&&(e=new Dfe("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=P2)))}function n8(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var M2={animationend:n8("Animation","AnimationEnd"),animationiteration:n8("Animation","AnimationIteration"),animationstart:n8("Animation","AnimationStart"),transitionend:n8("Transition","TransitionEnd")},xX={},gFe={};s1&&(gFe=document.createElement("div").style,"AnimationEvent"in window||(delete M2.animationend.animation,delete M2.animationiteration.animation,delete M2.animationstart.animation),"TransitionEvent"in window||delete M2.transitionend.transition);function jU(n){if(xX[n])return xX[n];if(!M2[n])return n;var e=M2[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in gFe)return xX[n]=e[t];return n}var mFe=jU("animationend"),_Fe=jU("animationiteration"),vFe=jU("animationstart"),bFe=jU("transitionend"),yFe=new Map,kSe="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function VS(n,e){yFe.set(n,e),Ik(e,[n])}for(var TX=0;TX<kSe.length;TX++){var kX=kSe[TX],bpt=kX.toLowerCase(),ypt=kX[0].toUpperCase()+kX.slice(1);VS(bpt,"on"+ypt)}VS(mFe,"onAnimationEnd");VS(_Fe,"onAnimationIteration");VS(vFe,"onAnimationStart");VS("dblclick","onDoubleClick");VS("focusin","onFocus");VS("focusout","onBlur");VS(bFe,"onTransitionEnd");xD("onMouseEnter",["mouseout","mouseover"]);xD("onMouseLeave",["mouseout","mouseover"]);xD("onPointerEnter",["pointerout","pointerover"]);xD("onPointerLeave",["pointerout","pointerover"]);Ik("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ik("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ik("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ik("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ik("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ik("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nP="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cpt=new Set("cancel close invalid load scroll toggle".split(" ").concat(nP));function ISe(n,e,t){var i=n.type||"unknown-event";n.currentTarget=t,bft(i,e,void 0,n),n.currentTarget=null}function CFe(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var i=n[t],r=i.event;i=i.listeners;e:{var o=void 0;if(e)for(var s=i.length-1;0<=s;s--){var a=i[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&r.isPropagationStopped())break e;ISe(r,a,c),o=l}else for(s=0;s<i.length;s++){if(a=i[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&r.isPropagationStopped())break e;ISe(r,a,c),o=l}}}if(EV)throw n=Yne,EV=!1,Yne=null,n}function sl(n,e){var t=e[oie];t===void 0&&(t=e[oie]=new Set);var i=n+"__bubble";t.has(i)||(wFe(e,n,2,!1),t.add(i))}function IX(n,e,t){var i=0;e&&(i|=4),wFe(t,n,i,e)}var i8="_reactListening"+Math.random().toString(36).slice(2);function p4(n){if(!n[i8]){n[i8]=!0,L5e.forEach(function(t){t!=="selectionchange"&&(Cpt.has(t)||IX(t,!1,n),IX(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[i8]||(e[i8]=!0,IX("selectionchange",!1,e))}}function wFe(n,e,t,i){switch(oFe(e)){case 1:var r=Pft;break;case 4:r=Mft;break;default:r=Ife}t=r.bind(null,e,t,n),r=void 0,!Gne||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?n.addEventListener(e,t,{capture:!0,passive:r}):n.addEventListener(e,t,!0):r!==void 0?n.addEventListener(e,t,{passive:r}):n.addEventListener(e,t,!1)}function LX(n,e,t,i,r){var o=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var a=i.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;s=s.return}for(;a!==null;){if(s=Nx(a),s===null)return;if(l=s.tag,l===5||l===6){i=o=s;continue e}a=a.parentNode}}i=i.return}j5e(function(){var c=o,u=Efe(t),d=[];e:{var h=yFe.get(n);if(h!==void 0){var f=Dfe,g=n;switch(n){case"keypress":if(K7(t)===0)break e;case"keydown":case"keyup":f=Xft;break;case"focusin":g="focus",f=wX;break;case"focusout":g="blur",f=wX;break;case"beforeblur":case"afterblur":f=wX;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=mSe;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=$ft;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=ept;break;case mFe:case _Fe:case vFe:f=Wft;break;case bFe:f=npt;break;case"scroll":f=Fft;break;case"wheel":f=rpt;break;case"copy":case"cut":case"paste":f=Uft;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=vSe}var m=(e&4)!==0,v=!m&&n==="scroll",_=m?h!==null?h+"Capture":null:h;m=[];for(var b=c,y;b!==null;){y=b;var C=y.stateNode;if(y.tag===5&&C!==null&&(y=C,_!==null&&(C=l4(b,_),C!=null&&m.push(g4(b,C,y)))),v)break;b=b.return}0<m.length&&(h=new f(h,g,null,t,u),d.push({event:h,listeners:m}))}}if(!(e&7)){e:{if(h=n==="mouseover"||n==="pointerover",f=n==="mouseout"||n==="pointerout",h&&t!==qne&&(g=t.relatedTarget||t.fromElement)&&(Nx(g)||g[a1]))break e;if((f||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,f?(g=t.relatedTarget||t.toElement,f=c,g=g?Nx(g):null,g!==null&&(v=Lk(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(f=null,g=c),f!==g)){if(m=mSe,C="onMouseLeave",_="onMouseEnter",b="mouse",(n==="pointerout"||n==="pointerover")&&(m=vSe,C="onPointerLeave",_="onPointerEnter",b="pointer"),v=f==null?h:F2(f),y=g==null?h:F2(g),h=new m(C,b+"leave",f,t,u),h.target=v,h.relatedTarget=y,C=null,Nx(u)===c&&(m=new m(_,b+"enter",g,t,u),m.target=y,m.relatedTarget=v,C=m),v=C,f&&g)t:{for(m=f,_=g,b=0,y=m;y;y=NI(y))b++;for(y=0,C=_;C;C=NI(C))y++;for(;0<b-y;)m=NI(m),b--;for(;0<y-b;)_=NI(_),y--;for(;b--;){if(m===_||_!==null&&m===_.alternate)break t;m=NI(m),_=NI(_)}m=null}else m=null;f!==null&&LSe(d,h,f,m,!1),g!==null&&v!==null&&LSe(d,v,g,m,!0)}}e:{if(h=c?F2(c):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var x=dpt;else if(CSe(h))if(dFe)x=gpt;else{x=fpt;var E=hpt}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(x=ppt);if(x&&(x=x(n,c))){uFe(d,x,t,u);break e}E&&E(n,h,c),n==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Hne(h,"number",h.value)}switch(E=c?F2(c):window,n){case"focusin":(CSe(E)||E.contentEditable==="true")&&(P2=E,Jne=c,VP=null);break;case"focusout":VP=Jne=P2=null;break;case"mousedown":eie=!0;break;case"contextmenu":case"mouseup":case"dragend":eie=!1,TSe(d,t,u);break;case"selectionchange":if(vpt)break;case"keydown":case"keyup":TSe(d,t,u)}var k;if(Nfe)e:{switch(n){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else O2?lFe(n,t)&&(L="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(L="onCompositionStart");L&&(aFe&&t.locale!=="ko"&&(O2||L!=="onCompositionStart"?L==="onCompositionEnd"&&O2&&(k=sFe()):(zC=u,Lfe="value"in zC?zC.value:zC.textContent,O2=!0)),E=LV(c,L),0<E.length&&(L=new _Se(L,n,null,t,u),d.push({event:L,listeners:E}),k?L.data=k:(k=cFe(t),k!==null&&(L.data=k)))),(k=spt?apt(n,t):lpt(n,t))&&(c=LV(c,"onBeforeInput"),0<c.length&&(u=new _Se("onBeforeInput","beforeinput",null,t,u),d.push({event:u,listeners:c}),u.data=k))}CFe(d,e)})}function g4(n,e,t){return{instance:n,listener:e,currentTarget:t}}function LV(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,o=r.stateNode;r.tag===5&&o!==null&&(r=o,o=l4(n,t),o!=null&&i.unshift(g4(n,o,r)),o=l4(n,e),o!=null&&i.push(g4(n,o,r))),n=n.return}return i}function NI(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function LSe(n,e,t,i,r){for(var o=e._reactName,s=[];t!==null&&t!==i;){var a=t,l=a.alternate,c=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&c!==null&&(a=c,r?(l=l4(t,o),l!=null&&s.unshift(g4(t,l,a))):r||(l=l4(t,o),l!=null&&s.push(g4(t,l,a)))),t=t.return}s.length!==0&&n.push({event:e,listeners:s})}var wpt=/\r\n?/g,Spt=/\u0000|\uFFFD/g;function DSe(n){return(typeof n=="string"?n:""+n).replace(wpt,` `).replace(Spt,"")}function r8(n,e,t){if(e=DSe(e),DSe(n)!==e&&t)throw Error(Rn(425))}function DV(){}var tie=null,nie=null;function iie(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var rie=typeof setTimeout=="function"?setTimeout:void 0,Ept=typeof clearTimeout=="function"?clearTimeout:void 0,ASe=typeof Promise=="function"?Promise:void 0,xpt=typeof queueMicrotask=="function"?queueMicrotask:typeof ASe<"u"?function(n){return ASe.resolve(null).then(n).catch(Tpt)}:rie;function Tpt(n){setTimeout(function(){throw n})}function DX(n,e){var t=e,i=0;do{var r=t.nextSibling;if(n.removeChild(t),r&&r.nodeType===8)if(t=r.data,t==="/$"){if(i===0){n.removeChild(r),d4(e);return}i--}else t!=="$"&&t!=="$?"&&t!=="$!"||i++;t=r}while(t);d4(e)}function mw(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function NSe(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var hN=Math.random().toString(36).slice(2),ub="__reactFiber$"+hN,m4="__reactProps$"+hN,a1="__reactContainer$"+hN,oie="__reactEvents$"+hN,kpt="__reactListeners$"+hN,Ipt="__reactHandles$"+hN;function Nx(n){var e=n[ub];if(e)return e;for(var t=n.parentNode;t;){if(e=t[a1]||t[ub]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=NSe(n);n!==null;){if(t=n[ub])return t;n=NSe(n)}return e}n=t,t=n.parentNode}return null}function Q5(n){return n=n[ub]||n[a1],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function F2(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Rn(33))}function qU(n){return n[m4]||null}var sie=[],B2=-1;function HS(n){return{current:n}}function fl(n){0>B2||(n.current=sie[B2],sie[B2]=null,B2--)}function Za(n,e){B2++,sie[B2]=n.current,n.current=e}var Zw={},uh=HS(Zw),$f=HS(!1),kT=Zw;function TD(n,e){var t=n.type.contextTypes;if(!t)return Zw;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in t)r[o]=e[o];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Vf(n){return n=n.childContextTypes,n!=null}function AV(){fl($f),fl(uh)}function RSe(n,e,t){if(uh.current!==Zw)throw Error(Rn(168));Za(uh,e),Za($f,t)}function SFe(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Rn(108,hft(n)||"Unknown",r));return $l({},t,i)}function NV(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Zw,kT=uh.current,Za(uh,n),Za($f,$f.current),!0}function OSe(n,e,t){var i=n.stateNode;if(!i)throw Error(Rn(169));t?(n=SFe(n,e,kT),i.__reactInternalMemoizedMergedChildContext=n,fl($f),fl(uh),Za(uh,n)):fl($f),Za($f,t)}var my=null,KU=!1,AX=!1;function EFe(n){my===null?my=[n]:my.push(n)}function Lpt(n){KU=!0,EFe(n)}function WS(){if(!AX&&my!==null){AX=!0;var n=0,e=da;try{var t=my;for(da=1;n<t.length;n++){var i=t[n];do i=i(!0);while(i!==null)}my=null,KU=!1}catch(r){throw my!==null&&(my=my.slice(n+1)),Y5e(xfe,WS),r}finally{da=e,AX=!1}}return null}var $2=[],V2=0,RV=null,OV=0,cm=[],um=0,IT=null,Ly=1,Dy="";function qE(n,e){$2[V2++]=OV,$2[V2++]=RV,RV=n,OV=e}function xFe(n,e,t){cm[um++]=Ly,cm[um++]=Dy,cm[um++]=IT,IT=n;var i=Ly;n=Dy;var r=32-iv(i)-1;i&=~(1<<r),t+=1;var o=32-iv(e)+r;if(30<o){var s=r-r%5;o=(i&(1<<s)-1).toString(32),i>>=s,r-=s,Ly=1<<32-iv(e)+r|t<<r|i,Dy=o+n}else Ly=1<<o|t<<r|i,Dy=n}function Ofe(n){n.return!==null&&(qE(n,1),xFe(n,1,0))}function Pfe(n){for(;n===RV;)RV=$2[--V2],$2[V2]=null,OV=$2[--V2],$2[V2]=null;for(;n===IT;)IT=cm[--um],cm[um]=null,Dy=cm[--um],cm[um]=null,Ly=cm[--um],cm[um]=null}var tg=null,Up=null,Cl=!1,P_=null;function TFe(n,e){var t=fm(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function PSe(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,tg=n,Up=mw(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,tg=n,Up=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=IT!==null?{id:Ly,overflow:Dy}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=fm(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,tg=n,Up=null,!0):!1;default:return!1}}function aie(n){return(n.mode&1)!==0&&(n.flags&128)===0}function lie(n){if(Cl){var e=Up;if(e){var t=e;if(!PSe(n,e)){if(aie(n))throw Error(Rn(418));e=mw(t.nextSibling);var i=tg;e&&PSe(n,e)?TFe(i,t):(n.flags=n.flags&-4097|2,Cl=!1,tg=n)}}else{if(aie(n))throw Error(Rn(418));n.flags=n.flags&-4097|2,Cl=!1,tg=n}}}function MSe(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;tg=n}function o8(n){if(n!==tg)return!1;if(!Cl)return MSe(n),Cl=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!iie(n.type,n.memoizedProps)),e&&(e=Up)){if(aie(n))throw kFe(),Error(Rn(418));for(;e;)TFe(n,e),e=mw(e.nextSibling)}if(MSe(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Rn(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Up=mw(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Up=null}}else Up=tg?mw(n.stateNode.nextSibling):null;return!0}function kFe(){for(var n=Up;n;)n=mw(n.nextSibling)}function kD(){Up=tg=null,Cl=!1}function Mfe(n){P_===null?P_=[n]:P_.push(n)}var Dpt=x1.ReactCurrentBatchConfig;function E_(n,e){if(n&&n.defaultProps){e=$l({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var PV=HS(null),MV=null,H2=null,Ffe=null;function Bfe(){Ffe=H2=MV=null}function $fe(n){var e=PV.current;fl(PV),n._currentValue=e}function cie(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function RL(n,e){MV=n,Ffe=H2=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Df=!0),n.firstContext=null)}function Nm(n){var e=n._currentValue;if(Ffe!==n)if(n={context:n,memoizedValue:e,next:null},H2===null){if(MV===null)throw Error(Rn(308));H2=n,MV.dependencies={lanes:0,firstContext:n}}else H2=H2.next=n;return e}var Rx=null;function Vfe(n){Rx===null?Rx=[n]:Rx.push(n)}function IFe(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,Vfe(e)):(t.next=r.next,r.next=t),e.interleaved=t,l1(n,i)}function l1(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var SC=!1;function Hfe(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LFe(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function jy(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function _w(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,Es&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,l1(n,t)}return r=i.interleaved,r===null?(e.next=e,Vfe(i)):(e.next=r.next,r.next=e),i.interleaved=e,l1(n,t)}function G7(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Tfe(n,t)}}function FSe(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var s={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};o===null?r=o=s:o=o.next=s,t=t.next}while(t!==null);o===null?r=o=e:o=o.next=e}else r=o=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function FV(n,e,t,i){var r=n.updateQueue;SC=!1;var o=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,f=a.eventTime;if((i&h)===h){u!==null&&(u=u.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,m=a;switch(h=e,f=t,m.tag){case 1:if(g=m.payload,typeof g=="function"){d=g.call(f,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(f,d,h):g,h==null)break e;d=$l({},d,h);break e;case 2:SC=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=f,l=d):u=u.next=f,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(1);if(u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,e=r.shared.interleaved,e!==null){r=e;do s|=r.lane,r=r.next;while(r!==e)}else o===null&&(r.shared.lanes=0);DT|=s,n.lanes=s,n.memoizedState=d}}function BSe(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var i=n[e],r=i.callback;if(r!==null){if(i.callback=null,i=t,typeof r!="function")throw Error(Rn(191,r));r.call(i)}}}var DFe=new I5e.Component().refs;function uie(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:$l({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var GU={isMounted:function(n){return(n=n._reactInternals)?Lk(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var i=Hh(),r=bw(n),o=jy(i,r);o.payload=e,t!=null&&(o.callback=t),e=_w(n,o,r),e!==null&&(rv(e,n,r,i),G7(e,n,r))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=Hh(),r=bw(n),o=jy(i,r);o.tag=1,o.payload=e,t!=null&&(o.callback=t),e=_w(n,o,r),e!==null&&(rv(e,n,r,i),G7(e,n,r))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Hh(),i=bw(n),r=jy(t,i);r.tag=2,e!=null&&(r.callback=e),e=_w(n,r,i),e!==null&&(rv(e,n,i,t),G7(e,n,i))}};function $Se(n,e,t,i,r,o,s){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(i,o,s):e.prototype&&e.prototype.isPureReactComponent?!f4(t,i)||!f4(r,o):!0}function AFe(n,e,t){var i=!1,r=Zw,o=e.contextType;return typeof o=="object"&&o!==null?o=Nm(o):(r=Vf(e)?kT:uh.current,i=e.contextTypes,o=(i=i!=null)?TD(n,r):Zw),e=new e(t,o),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=GU,n.stateNode=e,e._reactInternals=n,i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=o),e}function VSe(n,e,t,i){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,i),e.state!==n&&GU.enqueueReplaceState(e,e.state,null)}function die(n,e,t,i){var r=n.stateNode;r.props=t,r.state=n.memoizedState,r.refs=DFe,Hfe(n);var o=e.contextType;typeof o=="object"&&o!==null?r.context=Nm(o):(o=Vf(e)?kT:uh.current,r.context=TD(n,o)),r.state=n.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(uie(n,e,o,t),r.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&GU.enqueueReplaceState(r,r.state,null),FV(n,t,r,i),r.state=n.memoizedState),typeof r.componentDidMount=="function"&&(n.flags|=4194308)}function KR(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(Rn(309));var i=t.stateNode}if(!i)throw Error(Rn(147,n));var r=i,o=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var a=r.refs;a===DFe&&(a=r.refs={}),s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof n!="string")throw Error(Rn(284));if(!t._owner)throw Error(Rn(290,n))}return n}function s8(n,e){throw n=Object.prototype.toString.call(e),Error(Rn(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function HSe(n){var e=n._init;return e(n._payload)}function NFe(n){function e(_,b){if(n){var y=_.deletions;y===null?(_.deletions=[b],_.flags|=16):y.push(b)}}function t(_,b){if(!n)return null;for(;b!==null;)e(_,b),b=b.sibling;return null}function i(_,b){for(_=new Map;b!==null;)b.key!==null?_.set(b.key,b):_.set(b.index,b),b=b.sibling;return _}function r(_,b){return _=yw(_,b),_.index=0,_.sibling=null,_}function o(_,b,y){return _.index=y,n?(y=_.alternate,y!==null?(y=y.index,y<b?(_.flags|=2,b):y):(_.flags|=2,b)):(_.flags|=1048576,b)}function s(_){return n&&_.alternate===null&&(_.flags|=2),_}function a(_,b,y,C){return b===null||b.tag!==6?(b=BX(y,_.mode,C),b.return=_,b):(b=r(b,y),b.return=_,b)}function l(_,b,y,C){var x=y.type;return x===R2?u(_,b,y.props.children,C,y.key):b!==null&&(b.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===wC&&HSe(x)===b.type)?(C=r(b,y.props),C.ref=KR(_,b,y),C.return=_,C):(C=e$(y.type,y.key,y.props,null,_.mode,C),C.ref=KR(_,b,y),C.return=_,C)}function c(_,b,y,C){return b===null||b.tag!==4||b.stateNode.containerInfo!==y.containerInfo||b.stateNode.implementation!==y.implementation?(b=$X(y,_.mode,C),b.return=_,b):(b=r(b,y.children||[]),b.return=_,b)}function u(_,b,y,C,x){return b===null||b.tag!==7?(b=tT(y,_.mode,C,x),b.return=_,b):(b=r(b,y),b.return=_,b)}function d(_,b,y){if(typeof b=="string"&&b!==""||typeof b=="number")return b=BX(""+b,_.mode,y),b.return=_,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case YB:return y=e$(b.type,b.key,b.props,null,_.mode,y),y.ref=KR(_,null,b),y.return=_,y;case N2:return b=$X(b,_.mode,y),b.return=_,b;case wC:var C=b._init;return d(_,C(b._payload),y)}if(eP(b)||WR(b))return b=tT(b,_.mode,y,null),b.return=_,b;s8(_,b)}return null}function h(_,b,y,C){var x=b!==null?b.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return x!==null?null:a(_,b,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case YB:return y.key===x?l(_,b,y,C):null;case N2:return y.key===x?c(_,b,y,C):null;case wC:return x=y._init,h(_,b,x(y._payload),C)}if(eP(y)||WR(y))return x!==null?null:u(_,b,y,C,null);s8(_,y)}return null}function f(_,b,y,C,x){if(typeof C=="string"&&C!==""||typeof C=="number")return _=_.get(y)||null,a(b,_,""+C,x);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case YB:return _=_.get(C.key===null?y:C.key)||null,l(b,_,C,x);case N2:return _=_.get(C.key===null?y:C.key)||null,c(b,_,C,x);case wC:var E=C._init;return f(_,b,y,E(C._payload),x)}if(eP(C)||WR(C))return _=_.get(y)||null,u(b,_,C,x,null);s8(b,C)}return null}function g(_,b,y,C){for(var x=null,E=null,k=b,L=b=0,D=null;k!==null&&L<y.length;L++){k.index>L?(D=k,k=null):D=k.sibling;var A=h(_,k,y[L],C);if(A===null){k===null&&(k=D);break}n&&k&&A.alternate===null&&e(_,k),b=o(A,b,L),E===null?x=A:E.sibling=A,E=A,k=D}if(L===y.length)return t(_,k),Cl&&qE(_,L),x;if(k===null){for(;L<y.length;L++)k=d(_,y[L],C),k!==null&&(b=o(k,b,L),E===null?x=k:E.sibling=k,E=k);return Cl&&qE(_,L),x}for(k=i(_,k);L<y.length;L++)D=f(k,_,L,y[L],C),D!==null&&(n&&D.alternate!==null&&k.delete(D.key===null?L:D.key),b=o(D,b,L),E===null?x=D:E.sibling=D,E=D);return n&&k.forEach(function(O){return e(_,O)}),Cl&&qE(_,L),x}function m(_,b,y,C){var x=WR(y);if(typeof x!="function")throw Error(Rn(150));if(y=x.call(y),y==null)throw Error(Rn(151));for(var E=x=null,k=b,L=b=0,D=null,A=y.next();k!==null&&!A.done;L++,A=y.next()){k.index>L?(D=k,k=null):D=k.sibling;var O=h(_,k,A.value,C);if(O===null){k===null&&(k=D);break}n&&k&&O.alternate===null&&e(_,k),b=o(O,b,L),E===null?x=O:E.sibling=O,E=O,k=D}if(A.done)return t(_,k),Cl&&qE(_,L),x;if(k===null){for(;!A.done;L++,A=y.next())A=d(_,A.value,C),A!==null&&(b=o(A,b,L),E===null?x=A:E.sibling=A,E=A);return Cl&&qE(_,L),x}for(k=i(_,k);!A.done;L++,A=y.next())A=f(k,_,L,A.value,C),A!==null&&(n&&A.alternate!==null&&k.delete(A.key===null?L:A.key),b=o(A,b,L),E===null?x=A:E.sibling=A,E=A);return n&&k.forEach(function(P){return e(_,P)}),Cl&&qE(_,L),x}function v(_,b,y,C){if(typeof y=="object"&&y!==null&&y.type===R2&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case YB:e:{for(var x=y.key,E=b;E!==null;){if(E.key===x){if(x=y.type,x===R2){if(E.tag===7){t(_,E.sibling),b=r(E,y.props.children),b.return=_,_=b;break e}}else if(E.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===wC&&HSe(x)===E.type){t(_,E.sibling),b=r(E,y.props),b.ref=KR(_,E,y),b.return=_,_=b;break e}t(_,E);break}else e(_,E);E=E.sibling}y.type===R2?(b=tT(y.props.children,_.mode,C,y.key),b.return=_,_=b):(C=e$(y.type,y.key,y.props,null,_.mode,C),C.ref=KR(_,b,y),C.return=_,_=C)}return s(_);case N2:e:{for(E=y.key;b!==null;){if(b.key===E)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){t(_,b.sibling),b=r(b,y.children||[]),b.return=_,_=b;break e}else{t(_,b);break}else e(_,b);b=b.sibling}b=$X(y,_.mode,C),b.return=_,_=b}return s(_);case wC:return E=y._init,v(_,b,E(y._payload),C)}if(eP(y))return g(_,b,y,C);if(WR(y))return m(_,b,y,C);s8(_,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(t(_,b.sibling),b=r(b,y),b.return=_,_=b):(t(_,b),b=BX(y,_.mode,C),b.return=_,_=b),s(_)):t(_,b)}return v}var ID=NFe(!0),RFe=NFe(!1),X5={},Wb=HS(X5),_4=HS(X5),v4=HS(X5);function Ox(n){if(n===X5)throw Error(Rn(174));return n}function Wfe(n,e){switch(Za(v4,e),Za(_4,n),Za(Wb,X5),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:zne(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=zne(e,n)}fl(Wb),Za(Wb,e)}function LD(){fl(Wb),fl(_4),fl(v4)}function OFe(n){Ox(v4.current);var e=Ox(Wb.current),t=zne(e,n.type);e!==t&&(Za(_4,n),Za(Wb,t))}function zfe(n){_4.current===n&&(fl(Wb),fl(_4))}var Nl=HS(0);function BV(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var NX=[];function Ufe(){for(var n=0;n<NX.length;n++)NX[n]._workInProgressVersionPrimary=null;NX.length=0}var Y7=x1.ReactCurrentDispatcher,RX=x1.ReactCurrentBatchConfig,LT=0,Ml=null,du=null,Vu=null,$V=!1,HP=!1,b4=0,Apt=0;function jd(){throw Error(Rn(321))}function jfe(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!gv(n[t],e[t]))return!1;return!0}function qfe(n,e,t,i,r,o){if(LT=o,Ml=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Y7.current=n===null||n.memoizedState===null?Ppt:Mpt,n=t(i,r),HP){o=0;do{if(HP=!1,b4=0,25<=o)throw Error(Rn(301));o+=1,Vu=du=null,e.updateQueue=null,Y7.current=Fpt,n=t(i,r)}while(HP)}if(Y7.current=VV,e=du!==null&&du.next!==null,LT=0,Vu=du=Ml=null,$V=!1,e)throw Error(Rn(300));return n}function Kfe(){var n=b4!==0;return b4=0,n}function Gv(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vu===null?Ml.memoizedState=Vu=n:Vu=Vu.next=n,Vu}function Rm(){if(du===null){var n=Ml.alternate;n=n!==null?n.memoizedState:null}else n=du.next;var e=Vu===null?Ml.memoizedState:Vu.next;if(e!==null)Vu=e,du=n;else{if(n===null)throw Error(Rn(310));du=n,n={memoizedState:du.memoizedState,baseState:du.baseState,baseQueue:du.baseQueue,queue:du.queue,next:null},Vu===null?Ml.memoizedState=Vu=n:Vu=Vu.next=n}return Vu}function y4(n,e){return typeof e=="function"?e(n):e}function OX(n){var e=Rm(),t=e.queue;if(t===null)throw Error(Rn(311));t.lastRenderedReducer=n;var i=du,r=i.baseQueue,o=t.pending;if(o!==null){if(r!==null){var s=r.next;r.next=o.next,o.next=s}i.baseQueue=r=o,t.pending=null}if(r!==null){o=r.next,i=i.baseState;var a=s=null,l=null,c=o;do{var u=c.lane;if((LT&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),i=c.hasEagerState?c.eagerState:n(i,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=i):l=l.next=d,Ml.lanes|=u,DT|=u}c=c.next}while(c!==null&&c!==o);l===null?s=i:l.next=a,gv(i,e.memoizedState)||(Df=!0),e.memoizedState=i,e.baseState=s,e.baseQueue=l,t.lastRenderedState=i}if(n=t.interleaved,n!==null){r=n;do o=r.lane,Ml.lanes|=o,DT|=o,r=r.next;while(r!==n)}else r===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function PX(n){var e=Rm(),t=e.queue;if(t===null)throw Error(Rn(311));t.lastRenderedReducer=n;var i=t.dispatch,r=t.pending,o=e.memoizedState;if(r!==null){t.pending=null;var s=r=r.next;do o=n(o,s.action),s=s.next;while(s!==r);gv(o,e.memoizedState)||(Df=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),t.lastRenderedState=o}return[o,i]}function PFe(){}function MFe(n,e){var t=Ml,i=Rm(),r=e(),o=!gv(i.memoizedState,r);if(o&&(i.memoizedState=r,Df=!0),i=i.queue,Gfe($Fe.bind(null,t,i,n),[n]),i.getSnapshot!==e||o||Vu!==null&&Vu.memoizedState.tag&1){if(t.flags|=2048,C4(9,BFe.bind(null,t,i,r,e),void 0,null),Gu===null)throw Error(Rn(349));LT&30||FFe(t,e,r)}return r}function FFe(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=Ml.updateQueue,e===null?(e={lastEffect:null,stores:null},Ml.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function BFe(n,e,t,i){e.value=t,e.getSnapshot=i,VFe(e)&&HFe(n)}function $Fe(n,e,t){return t(function(){VFe(e)&&HFe(n)})}function VFe(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!gv(n,t)}catch{return!0}}function HFe(n){var e=l1(n,1);e!==null&&rv(e,n,1,-1)}function WSe(n){var e=Gv();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:y4,lastRenderedState:n},e.queue=n,n=n.dispatch=Opt.bind(null,Ml,n),[e.memoizedState,n]}function C4(n,e,t,i){return n={tag:n,create:e,destroy:t,deps:i,next:null},e=Ml.updateQueue,e===null?(e={lastEffect:null,stores:null},Ml.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(i=t.next,t.next=n,n.next=i,e.lastEffect=n)),n}function WFe(){return Rm().memoizedState}function Q7(n,e,t,i){var r=Gv();Ml.flags|=n,r.memoizedState=C4(1|e,t,void 0,i===void 0?null:i)}function YU(n,e,t,i){var r=Rm();i=i===void 0?null:i;var o=void 0;if(du!==null){var s=du.memoizedState;if(o=s.destroy,i!==null&&jfe(i,s.deps)){r.memoizedState=C4(e,t,o,i);return}}Ml.flags|=n,r.memoizedState=C4(1|e,t,o,i)}function zSe(n,e){return Q7(8390656,8,n,e)}function Gfe(n,e){return YU(2048,8,n,e)}function zFe(n,e){return YU(4,2,n,e)}function UFe(n,e){return YU(4,4,n,e)}function jFe(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function qFe(n,e,t){return t=t!=null?t.concat([n]):null,YU(4,4,jFe.bind(null,e,n),t)}function Yfe(){}function KFe(n,e){var t=Rm();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&jfe(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function GFe(n,e){var t=Rm();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&jfe(e,i[1])?i[0]:(n=n(),t.memoizedState=[n,e],n)}function YFe(n,e,t){return LT&21?(gv(t,e)||(t=Z5e(),Ml.lanes|=t,DT|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Df=!0),n.memoizedState=t)}function Npt(n,e){var t=da;da=t!==0&&4>t?t:4,n(!0);var i=RX.transition;RX.transition={};try{n(!1),e()}finally{da=t,RX.transition=i}}function QFe(){return Rm().memoizedState}function Rpt(n,e,t){var i=bw(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},XFe(n))ZFe(e,t);else if(t=IFe(n,e,t,i),t!==null){var r=Hh();rv(t,n,i,r),JFe(t,e,i)}}function Opt(n,e,t){var i=bw(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(XFe(n))ZFe(e,r);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,t);if(r.hasEagerState=!0,r.eagerState=a,gv(a,s)){var l=e.interleaved;l===null?(r.next=r,Vfe(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=IFe(n,e,r,i),t!==null&&(r=Hh(),rv(t,n,i,r),JFe(t,e,i))}}function XFe(n){var e=n.alternate;return n===Ml||e!==null&&e===Ml}function ZFe(n,e){HP=$V=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function JFe(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Tfe(n,t)}}var VV={readContext:Nm,useCallback:jd,useContext:jd,useEffect:jd,useImperativeHandle:jd,useInsertionEffect:jd,useLayoutEffect:jd,useMemo:jd,useReducer:jd,useRef:jd,useState:jd,useDebugValue:jd,useDeferredValue:jd,useTransition:jd,useMutableSource:jd,useSyncExternalStore:jd,useId:jd,unstable_isNewReconciler:!1},Ppt={readContext:Nm,useCallback:function(n,e){return Gv().memoizedState=[n,e===void 0?null:e],n},useContext:Nm,useEffect:zSe,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Q7(4194308,4,jFe.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Q7(4194308,4,n,e)},useInsertionEffect:function(n,e){return Q7(4,2,n,e)},useMemo:function(n,e){var t=Gv();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Gv();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=Rpt.bind(null,Ml,n),[i.memoizedState,n]},useRef:function(n){var e=Gv();return n={current:n},e.memoizedState=n},useState:WSe,useDebugValue:Yfe,useDeferredValue:function(n){return Gv().memoizedState=n},useTransition:function(){var n=WSe(!1),e=n[0];return n=Npt.bind(null,n[1]),Gv().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Ml,r=Gv();if(Cl){if(t===void 0)throw Error(Rn(407));t=t()}else{if(t=e(),Gu===null)throw Error(Rn(349));LT&30||FFe(i,e,t)}r.memoizedState=t;var o={value:t,getSnapshot:e};return r.queue=o,zSe($Fe.bind(null,i,o,n),[n]),i.flags|=2048,C4(9,BFe.bind(null,i,o,t,e),void 0,null),t},useId:function(){var n=Gv(),e=Gu.identifierPrefix;if(Cl){var t=Dy,i=Ly;t=(i&~(1<<32-iv(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=b4++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=Apt++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},Mpt={readContext:Nm,useCallback:KFe,useContext:Nm,useEffect:Gfe,useImperativeHandle:qFe,useInsertionEffect:zFe,useLayoutEffect:UFe,useMemo:GFe,useReducer:OX,useRef:WFe,useState:function(){return OX(y4)},useDebugValue:Yfe,useDeferredValue:function(n){var e=Rm();return YFe(e,du.memoizedState,n)},useTransition:function(){var n=OX(y4)[0],e=Rm().memoizedState;return[n,e]},useMutableSource:PFe,useSyncExternalStore:MFe,useId:QFe,unstable_isNewReconciler:!1},Fpt={readContext:Nm,useCallback:KFe,useContext:Nm,useEffect:Gfe,useImperativeHandle:qFe,useInsertionEffect:zFe,useLayoutEffect:UFe,useMemo:GFe,useReducer:PX,useRef:WFe,useState:function(){return PX(y4)},useDebugValue:Yfe,useDeferredValue:function(n){var e=Rm();return du===null?e.memoizedState=n:YFe(e,du.memoizedState,n)},useTransition:function(){var n=PX(y4)[0],e=Rm().memoizedState;return[n,e]},useMutableSource:PFe,useSyncExternalStore:MFe,useId:QFe,unstable_isNewReconciler:!1};function DD(n,e){try{var t="",i=e;do t+=dft(i),i=i.return;while(i);var r=t}catch(o){r=` Error generating stack: `+o.message+` `+o.stack}return{value:n,source:e,stack:r,digest:null}}function MX(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function hie(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var Bpt=typeof WeakMap=="function"?WeakMap:Map;function e6e(n,e,t){t=jy(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){WV||(WV=!0,wie=i),hie(n,e)},t}function t6e(n,e,t){t=jy(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){hie(n,e)}}var o=n.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){hie(n,e),typeof i!="function"&&(vw===null?vw=new Set([this]):vw.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),t}function USe(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new Bpt;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=Zpt.bind(null,n,e,t),e.then(n,n))}function jSe(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function qSe(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=jy(-1,1),e.tag=2,_w(t,e,1))),t.lanes|=1),n)}var $pt=x1.ReactCurrentOwner,Df=!1;function Ah(n,e,t,i){e.child=n===null?RFe(e,null,t,i):ID(e,n.child,t,i)}function KSe(n,e,t,i,r){t=t.render;var o=e.ref;return RL(e,r),i=qfe(n,e,t,i,o,r),t=Kfe(),n!==null&&!Df?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,c1(n,e,r)):(Cl&&t&&Ofe(e),e.flags|=1,Ah(n,e,i,r),e.child)}function GSe(n,e,t,i,r){if(n===null){var o=t.type;return typeof o=="function"&&!ipe(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=o,n6e(n,e,o,i,r)):(n=e$(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(o=n.child,!(n.lanes&r)){var s=o.memoizedProps;if(t=t.compare,t=t!==null?t:f4,t(s,i)&&n.ref===e.ref)return c1(n,e,r)}return e.flags|=1,n=yw(o,i),n.ref=e.ref,n.return=e,e.child=n}function n6e(n,e,t,i,r){if(n!==null){var o=n.memoizedProps;if(f4(o,i)&&n.ref===e.ref)if(Df=!1,e.pendingProps=i=o,(n.lanes&r)!==0)n.flags&131072&&(Df=!0);else return e.lanes=n.lanes,c1(n,e,r)}return fie(n,e,t,i,r)}function i6e(n,e,t){var i=e.pendingProps,r=i.children,o=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Za(z2,Rp),Rp|=t;else{if(!(t&1073741824))return n=o!==null?o.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Za(z2,Rp),Rp|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=o!==null?o.baseLanes:t,Za(z2,Rp),Rp|=i}else o!==null?(i=o.baseLanes|t,e.memoizedState=null):i=t,Za(z2,Rp),Rp|=i;return Ah(n,e,r,t),e.child}function r6e(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function fie(n,e,t,i,r){var o=Vf(t)?kT:uh.current;return o=TD(e,o),RL(e,r),t=qfe(n,e,t,i,o,r),i=Kfe(),n!==null&&!Df?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,c1(n,e,r)):(Cl&&i&&Ofe(e),e.flags|=1,Ah(n,e,t,r),e.child)}function YSe(n,e,t,i,r){if(Vf(t)){var o=!0;NV(e)}else o=!1;if(RL(e,r),e.stateNode===null)X7(n,e),AFe(e,t,i),die(e,t,i,r),i=!0;else if(n===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=t.contextType;typeof c=="object"&&c!==null?c=Nm(c):(c=Vf(t)?kT:uh.current,c=TD(e,c));var u=t.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==i||l!==c)&&VSe(e,s,i,c),SC=!1;var h=e.memoizedState;s.state=h,FV(e,i,s,r),l=e.memoizedState,a!==i||h!==l||$f.current||SC?(typeof u=="function"&&(uie(e,t,u,i),l=e.memoizedState),(a=SC||$Se(e,t,a,i,h,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),s.props=i,s.state=l,s.context=c,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,LFe(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:E_(e.type,a),s.props=c,d=e.pendingProps,h=s.context,l=t.contextType,typeof l=="object"&&l!==null?l=Nm(l):(l=Vf(t)?kT:uh.current,l=TD(e,l));var f=t.getDerivedStateFromProps;(u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||h!==l)&&VSe(e,s,i,l),SC=!1,h=e.memoizedState,s.state=h,FV(e,i,s,r);var g=e.memoizedState;a!==d||h!==g||$f.current||SC?(typeof f=="function"&&(uie(e,t,f,i),g=e.memoizedState),(c=SC||$Se(e,t,c,i,h,g,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,g,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=g),s.props=i,s.state=g,s.context=l,i=c):(typeof s.componentDidUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=1024),i=!1)}return pie(n,e,t,i,o,r)}function pie(n,e,t,i,r,o){r6e(n,e);var s=(e.flags&128)!==0;if(!i&&!s)return r&&OSe(e,t,!1),c1(n,e,o);i=e.stateNode,$pt.current=e;var a=s&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&s?(e.child=ID(e,n.child,null,o),e.child=ID(e,null,a,o)):Ah(n,e,a,o),e.memoizedState=i.state,r&&OSe(e,t,!0),e.child}function o6e(n){var e=n.stateNode;e.pendingContext?RSe(n,e.pendingContext,e.pendingContext!==e.context):e.context&&RSe(n,e.context,!1),Wfe(n,e.containerInfo)}function QSe(n,e,t,i,r){return kD(),Mfe(r),e.flags|=256,Ah(n,e,t,i),e.child}var gie={dehydrated:null,treeContext:null,retryLane:0};function mie(n){return{baseLanes:n,cachePool:null,transitions:null}}function s6e(n,e,t){var i=e.pendingProps,r=Nl.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(o=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),Za(Nl,r&1),n===null)return lie(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=i.children,n=i.fallback,o?(i=e.mode,o=e.child,s={mode:"hidden",children:s},!(i&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=ZU(s,i,0,null),n=tT(n,i,t,null),o.return=e,n.return=e,o.sibling=n,e.child=o,e.child.memoizedState=mie(t),e.memoizedState=gie,n):Qfe(e,s));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Vpt(n,e,s,i,a,r,t);if(o){o=i.fallback,s=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(s&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=yw(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?o=yw(a,o):(o=tT(o,s,t,null),o.flags|=2),o.return=e,i.return=e,i.sibling=o,e.child=i,i=o,o=e.child,s=n.child.memoizedState,s=s===null?mie(t):{baseLanes:s.baseLanes|t,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=n.childLanes&~t,e.memoizedState=gie,i}return o=n.child,n=o.sibling,i=yw(o,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function Qfe(n,e){return e=ZU({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function a8(n,e,t,i){return i!==null&&Mfe(i),ID(e,n.child,null,t),n=Qfe(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function Vpt(n,e,t,i,r,o,s){if(t)return e.flags&256?(e.flags&=-257,i=MX(Error(Rn(422))),a8(n,e,s,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(o=i.fallback,r=e.mode,i=ZU({mode:"visible",children:i.children},r,0,null),o=tT(o,r,s,null),o.flags|=2,i.return=e,o.return=e,i.sibling=o,e.child=i,e.mode&1&&ID(e,n.child,null,s),e.child.memoizedState=mie(s),e.memoizedState=gie,o);if(!(e.mode&1))return a8(n,e,s,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,o=Error(Rn(419)),i=MX(o,i,void 0),a8(n,e,s,i)}if(a=(s&n.childLanes)!==0,Df||a){if(i=Gu,i!==null){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|s)?0:r,r!==0&&r!==o.retryLane&&(o.retryLane=r,l1(n,r),rv(i,n,r,-1))}return npe(),i=MX(Error(Rn(421))),a8(n,e,s,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=Jpt.bind(null,n),r._reactRetry=e,null):(n=o.treeContext,Up=mw(r.nextSibling),tg=e,Cl=!0,P_=null,n!==null&&(cm[um++]=Ly,cm[um++]=Dy,cm[um++]=IT,Ly=n.id,Dy=n.overflow,IT=e),e=Qfe(e,i.children),e.flags|=4096,e)}function XSe(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),cie(n.return,e,t)}function FX(n,e,t,i,r){var o=n.memoizedState;o===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=t,o.tailMode=r)}function a6e(n,e,t){var i=e.pendingProps,r=i.revealOrder,o=i.tail;if(Ah(n,e,i.children,t),i=Nl.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&XSe(n,t,e);else if(n.tag===19)XSe(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(Za(Nl,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&BV(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),FX(e,!1,r,t,o);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&BV(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}FX(e,!0,t,null,o);break;case"together":FX(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function X7(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function c1(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),DT|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Rn(153));if(e.child!==null){for(n=e.child,t=yw(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=yw(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function Hpt(n,e,t){switch(e.tag){case 3:o6e(e),kD();break;case 5:OFe(e);break;case 1:Vf(e.type)&&NV(e);break;case 4:Wfe(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;Za(PV,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(Za(Nl,Nl.current&1),e.flags|=128,null):t&e.child.childLanes?s6e(n,e,t):(Za(Nl,Nl.current&1),n=c1(n,e,t),n!==null?n.sibling:null);Za(Nl,Nl.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return a6e(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Za(Nl,Nl.current),i)break;return null;case 22:case 23:return e.lanes=0,i6e(n,e,t)}return c1(n,e,t)}var l6e,_ie,c6e,u6e;l6e=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};_ie=function(){};c6e=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,Ox(Wb.current);var o=null;switch(t){case"input":r=$ne(n,r),i=$ne(n,i),o=[];break;case"select":r=$l({},r,{value:void 0}),i=$l({},i,{value:void 0}),o=[];break;case"textarea":r=Wne(n,r),i=Wne(n,i),o=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=DV)}Une(t,i);var s;t=null;for(c in r)if(!i.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(s in a)a.hasOwnProperty(s)&&(t||(t={}),t[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(s4.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in i){var l=i[c];if(a=r!=null?r[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(t||(t={}),t[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(t||(t={}),t[s]=l[s])}else t||(o||(o=[]),o.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(s4.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&sl("scroll",n),o||a===l||(o=[])):(o=o||[]).push(c,l))}t&&(o=o||[]).push("style",t);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};u6e=function(n,e,t,i){t!==i&&(e.flags|=4)};function GR(n,e){if(!Cl)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function qd(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function Wpt(n,e,t){var i=e.pendingProps;switch(Pfe(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qd(e),null;case 1:return Vf(e.type)&&AV(),qd(e),null;case 3:return i=e.stateNode,LD(),fl($f),fl(uh),Ufe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(o8(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,P_!==null&&(xie(P_),P_=null))),_ie(n,e),qd(e),null;case 5:zfe(e);var r=Ox(v4.current);if(t=e.type,n!==null&&e.stateNode!=null)c6e(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Rn(166));return qd(e),null}if(n=Ox(Wb.current),o8(e)){i=e.stateNode,t=e.type;var o=e.memoizedProps;switch(i[ub]=e,i[m4]=o,n=(e.mode&1)!==0,t){case"dialog":sl("cancel",i),sl("close",i);break;case"iframe":case"object":case"embed":sl("load",i);break;case"video":case"audio":for(r=0;r<nP.length;r++)sl(nP[r],i);break;case"source":sl("error",i);break;case"img":case"image":case"link":sl("error",i),sl("load",i);break;case"details":sl("toggle",i);break;case"input":sSe(i,o),sl("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!o.multiple},sl("invalid",i);break;case"textarea":lSe(i,o),sl("invalid",i)}Une(t,o),r=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?i.textContent!==a&&(o.suppressHydrationWarning!==!0&&r8(i.textContent,a,n),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&r8(i.textContent,a,n),r=["children",""+a]):s4.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&sl("scroll",i)}switch(t){case"input":QB(i),aSe(i,o,!0);break;case"textarea":QB(i),cSe(i);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(i.onclick=DV)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{s=r.nodeType===9?r:r.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=F5e(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=s.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=s.createElement(t,{is:i.is}):(n=s.createElement(t),t==="select"&&(s=n,i.multiple?s.multiple=!0:i.size&&(s.size=i.size))):n=s.createElementNS(n,t),n[ub]=e,n[m4]=i,l6e(n,e,!1,!1),e.stateNode=n;e:{switch(s=jne(t,i),t){case"dialog":sl("cancel",n),sl("close",n),r=i;break;case"iframe":case"object":case"embed":sl("load",n),r=i;break;case"video":case"audio":for(r=0;r<nP.length;r++)sl(nP[r],n);r=i;break;case"source":sl("error",n),r=i;break;case"img":case"image":case"link":sl("error",n),sl("load",n),r=i;break;case"details":sl("toggle",n),r=i;break;case"input":sSe(n,i),r=$ne(n,i),sl("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=$l({},i,{value:void 0}),sl("invalid",n);break;case"textarea":lSe(n,i),r=Wne(n,i),sl("invalid",n);break;default:r=i}Une(t,r),a=r;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?V5e(n,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&B5e(n,l)):o==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&a4(n,l):typeof l=="number"&&a4(n,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(s4.hasOwnProperty(o)?l!=null&&o==="onScroll"&&sl("scroll",n):l!=null&&yfe(n,o,l,s))}switch(t){case"input":QB(n),aSe(n,i,!1);break;case"textarea":QB(n),cSe(n);break;case"option":i.value!=null&&n.setAttribute("value",""+Xw(i.value));break;case"select":n.multiple=!!i.multiple,o=i.value,o!=null?LL(n,!!i.multiple,o,!1):i.defaultValue!=null&&LL(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=DV)}switch(t){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return qd(e),null;case 6:if(n&&e.stateNode!=null)u6e(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Rn(166));if(t=Ox(v4.current),Ox(Wb.current),o8(e)){if(i=e.stateNode,t=e.memoizedProps,i[ub]=e,(o=i.nodeValue!==t)&&(n=tg,n!==null))switch(n.tag){case 3:r8(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&r8(i.nodeValue,t,(n.mode&1)!==0)}o&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[ub]=e,e.stateNode=i}return qd(e),null;case 13:if(fl(Nl),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Cl&&Up!==null&&e.mode&1&&!(e.flags&128))kFe(),kD(),e.flags|=98560,o=!1;else if(o=o8(e),i!==null&&i.dehydrated!==null){if(n===null){if(!o)throw Error(Rn(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Rn(317));o[ub]=e}else kD(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;qd(e),o=!1}else P_!==null&&(xie(P_),P_=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(i=i!==null,i!==(n!==null&&n.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(n===null||Nl.current&1?_u===0&&(_u=3):npe())),e.updateQueue!==null&&(e.flags|=4),qd(e),null);case 4:return LD(),_ie(n,e),n===null&&p4(e.stateNode.containerInfo),qd(e),null;case 10:return $fe(e.type._context),qd(e),null;case 17:return Vf(e.type)&&AV(),qd(e),null;case 19:if(fl(Nl),o=e.memoizedState,o===null)return qd(e),null;if(i=(e.flags&128)!==0,s=o.rendering,s===null)if(i)GR(o,!1);else{if(_u!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(s=BV(n),s!==null){for(e.flags|=128,GR(o,!1),i=s.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=t,t=e.child;t!==null;)o=t,n=i,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=n,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,n=s.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Za(Nl,Nl.current&1|2),e.child}n=n.sibling}o.tail!==null&&yc()>AD&&(e.flags|=128,i=!0,GR(o,!1),e.lanes=4194304)}else{if(!i)if(n=BV(s),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),GR(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Cl)return qd(e),null}else 2*yc()-o.renderingStartTime>AD&&t!==1073741824&&(e.flags|=128,i=!0,GR(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(t=o.last,t!==null?t.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=yc(),e.sibling=null,t=Nl.current,Za(Nl,i?t&1|2:t&1),e):(qd(e),null);case 22:case 23:return tpe(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Rp&1073741824&&(qd(e),e.subtreeFlags&6&&(e.flags|=8192)):qd(e),null;case 24:return null;case 25:return null}throw Error(Rn(156,e.tag))}function zpt(n,e){switch(Pfe(e),e.tag){case 1:return Vf(e.type)&&AV(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return LD(),fl($f),fl(uh),Ufe(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return zfe(e),null;case 13:if(fl(Nl),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Rn(340));kD()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return fl(Nl),null;case 4:return LD(),null;case 10:return $fe(e.type._context),null;case 22:case 23:return tpe(),null;case 24:return null;default:return null}}var l8=!1,rh=!1,Upt=typeof WeakSet=="function"?WeakSet:Set,Ni=null;function W2(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Xl(n,e,i)}else t.current=null}function vie(n,e,t){try{t()}catch(i){Xl(n,e,i)}}var ZSe=!1;function jpt(n,e){if(tie=kV,n=pFe(),Rfe(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=n,h=null;t:for(;;){for(var f;d!==t||r!==0&&d.nodeType!==3||(a=s+r),d!==o||i!==0&&d.nodeType!==3||(l=s+i),d.nodeType===3&&(s+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===n)break t;if(h===t&&++c===r&&(a=s),h===o&&++u===i&&(l=s),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(nie={focusedElem:n,selectionRange:t},kV=!1,Ni=e;Ni!==null;)if(e=Ni,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ni=n;else for(;Ni!==null;){e=Ni;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,_=e.stateNode,b=_.getSnapshotBeforeUpdate(e.elementType===e.type?m:E_(e.type,m),v);_.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Rn(163))}}catch(C){Xl(e,e.return,C)}if(n=e.sibling,n!==null){n.return=e.return,Ni=n;break}Ni=e.return}return g=ZSe,ZSe=!1,g}function WP(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var o=r.destroy;r.destroy=void 0,o!==void 0&&vie(e,t,o)}r=r.next}while(r!==i)}}function QU(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function bie(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function d6e(n){var e=n.alternate;e!==null&&(n.alternate=null,d6e(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[ub],delete e[m4],delete e[oie],delete e[kpt],delete e[Ipt])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function h6e(n){return n.tag===5||n.tag===3||n.tag===4}function JSe(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||h6e(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function yie(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=DV));else if(i!==4&&(n=n.child,n!==null))for(yie(n,e,t),n=n.sibling;n!==null;)yie(n,e,t),n=n.sibling}function Cie(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(Cie(n,e,t),n=n.sibling;n!==null;)Cie(n,e,t),n=n.sibling}var ud=null,k_=!1;function Y1(n,e,t){for(t=t.child;t!==null;)f6e(n,e,t),t=t.sibling}function f6e(n,e,t){if(Hb&&typeof Hb.onCommitFiberUnmount=="function")try{Hb.onCommitFiberUnmount(WU,t)}catch{}switch(t.tag){case 5:rh||W2(t,e);case 6:var i=ud,r=k_;ud=null,Y1(n,e,t),ud=i,k_=r,ud!==null&&(k_?(n=ud,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):ud.removeChild(t.stateNode));break;case 18:ud!==null&&(k_?(n=ud,t=t.stateNode,n.nodeType===8?DX(n.parentNode,t):n.nodeType===1&&DX(n,t),d4(n)):DX(ud,t.stateNode));break;case 4:i=ud,r=k_,ud=t.stateNode.containerInfo,k_=!0,Y1(n,e,t),ud=i,k_=r;break;case 0:case 11:case 14:case 15:if(!rh&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&vie(t,e,s),r=r.next}while(r!==i)}Y1(n,e,t);break;case 1:if(!rh&&(W2(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Xl(t,e,a)}Y1(n,e,t);break;case 21:Y1(n,e,t);break;case 22:t.mode&1?(rh=(i=rh)||t.memoizedState!==null,Y1(n,e,t),rh=i):Y1(n,e,t);break;default:Y1(n,e,t)}}function eEe(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new Upt),e.forEach(function(i){var r=egt.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function u_(n,e){var t=e.deletions;if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];try{var o=n,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:ud=a.stateNode,k_=!1;break e;case 3:ud=a.stateNode.containerInfo,k_=!0;break e;case 4:ud=a.stateNode.containerInfo,k_=!0;break e}a=a.return}if(ud===null)throw Error(Rn(160));f6e(o,s,r),ud=null,k_=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(c){Xl(r,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)p6e(e,n),e=e.sibling}function p6e(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(u_(e,n),Bv(n),i&4){try{WP(3,n,n.return),QU(3,n)}catch(m){Xl(n,n.return,m)}try{WP(5,n,n.return)}catch(m){Xl(n,n.return,m)}}break;case 1:u_(e,n),Bv(n),i&512&&t!==null&&W2(t,t.return);break;case 5:if(u_(e,n),Bv(n),i&512&&t!==null&&W2(t,t.return),n.flags&32){var r=n.stateNode;try{a4(r,"")}catch(m){Xl(n,n.return,m)}}if(i&4&&(r=n.stateNode,r!=null)){var o=n.memoizedProps,s=t!==null?t.memoizedProps:o,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&P5e(r,o),jne(a,s);var c=jne(a,o);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?V5e(r,d):u==="dangerouslySetInnerHTML"?B5e(r,d):u==="children"?a4(r,d):yfe(r,u,d,c)}switch(a){case"input":Vne(r,o);break;case"textarea":M5e(r,o);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!o.multiple;var f=o.value;f!=null?LL(r,!!o.multiple,f,!1):h!==!!o.multiple&&(o.defaultValue!=null?LL(r,!!o.multiple,o.defaultValue,!0):LL(r,!!o.multiple,o.multiple?[]:"",!1))}r[m4]=o}catch(m){Xl(n,n.return,m)}}break;case 6:if(u_(e,n),Bv(n),i&4){if(n.stateNode===null)throw Error(Rn(162));r=n.stateNode,o=n.memoizedProps;try{r.nodeValue=o}catch(m){Xl(n,n.return,m)}}break;case 3:if(u_(e,n),Bv(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{d4(e.containerInfo)}catch(m){Xl(n,n.return,m)}break;case 4:u_(e,n),Bv(n);break;case 13:u_(e,n),Bv(n),r=n.child,r.flags&8192&&(o=r.memoizedState!==null,r.stateNode.isHidden=o,!o||r.alternate!==null&&r.alternate.memoizedState!==null||(Jfe=yc())),i&4&&eEe(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(rh=(c=rh)||u,u_(e,n),rh=c):u_(e,n),Bv(n),i&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(Ni=n,u=n.child;u!==null;){for(d=Ni=u;Ni!==null;){switch(h=Ni,f=h.child,h.tag){case 0:case 11:case 14:case 15:WP(4,h,h.return);break;case 1:W2(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){i=h,t=h.return;try{e=i,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(m){Xl(i,t,m)}}break;case 5:W2(h,h.return);break;case 22:if(h.memoizedState!==null){nEe(d);continue}}f!==null?(f.return=h,Ni=f):nEe(d)}u=u.sibling}e:for(u=null,d=n;;){if(d.tag===5){if(u===null){u=d;try{r=d.stateNode,c?(o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=$5e("display",s))}catch(m){Xl(n,n.return,m)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(m){Xl(n,n.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===n)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===n)break e;for(;d.sibling===null;){if(d.return===null||d.return===n)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:u_(e,n),Bv(n),i&4&&eEe(n);break;case 21:break;default:u_(e,n),Bv(n)}}function Bv(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(h6e(t)){var i=t;break e}t=t.return}throw Error(Rn(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(a4(r,""),i.flags&=-33);var o=JSe(n);Cie(n,o,r);break;case 3:case 4:var s=i.stateNode.containerInfo,a=JSe(n);yie(n,a,s);break;default:throw Error(Rn(161))}}catch(l){Xl(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function qpt(n,e,t){Ni=n,g6e(n)}function g6e(n,e,t){for(var i=(n.mode&1)!==0;Ni!==null;){var r=Ni,o=r.child;if(r.tag===22&&i){var s=r.memoizedState!==null||l8;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||rh;a=l8;var c=rh;if(l8=s,(rh=l)&&!c)for(Ni=r;Ni!==null;)s=Ni,l=s.child,s.tag===22&&s.memoizedState!==null?iEe(r):l!==null?(l.return=s,Ni=l):iEe(r);for(;o!==null;)Ni=o,g6e(o),o=o.sibling;Ni=r,l8=a,rh=c}tEe(n)}else r.subtreeFlags&8772&&o!==null?(o.return=r,Ni=o):tEe(n)}}function tEe(n){for(;Ni!==null;){var e=Ni;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:rh||QU(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!rh)if(t===null)i.componentDidMount();else{var r=e.elementType===e.type?t.memoizedProps:E_(e.type,t.memoizedProps);i.componentDidUpdate(r,t.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&BSe(e,o,i);break;case 3:var s=e.updateQueue;if(s!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}BSe(e,s,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&d4(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Rn(163))}rh||e.flags&512&&bie(e)}catch(h){Xl(e,e.return,h)}}if(e===n){Ni=null;break}if(t=e.sibling,t!==null){t.return=e.return,Ni=t;break}Ni=e.return}}function nEe(n){for(;Ni!==null;){var e=Ni;if(e===n){Ni=null;break}var t=e.sibling;if(t!==null){t.return=e.return,Ni=t;break}Ni=e.return}}function iEe(n){for(;Ni!==null;){var e=Ni;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{QU(4,e)}catch(l){Xl(e,t,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){Xl(e,r,l)}}var o=e.return;try{bie(e)}catch(l){Xl(e,o,l)}break;case 5:var s=e.return;try{bie(e)}catch(l){Xl(e,s,l)}}}catch(l){Xl(e,e.return,l)}if(e===n){Ni=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Ni=a;break}Ni=e.return}}var Kpt=Math.ceil,HV=x1.ReactCurrentDispatcher,Xfe=x1.ReactCurrentOwner,wm=x1.ReactCurrentBatchConfig,Es=0,Gu=null,Yc=null,Ad=0,Rp=0,z2=HS(0),_u=0,w4=null,DT=0,XU=0,Zfe=0,zP=null,Cf=null,Jfe=0,AD=1/0,ly=null,WV=!1,wie=null,vw=null,c8=!1,UC=null,zV=0,UP=0,Sie=null,Z7=-1,J7=0;function Hh(){return Es&6?yc():Z7!==-1?Z7:Z7=yc()}function bw(n){return n.mode&1?Es&2&&Ad!==0?Ad&-Ad:Dpt.transition!==null?(J7===0&&(J7=Z5e()),J7):(n=da,n!==0||(n=window.event,n=n===void 0?16:oFe(n.type)),n):1}function rv(n,e,t,i){if(50<UP)throw UP=0,Sie=null,Error(Rn(185));G5(n,t,i),(!(Es&2)||n!==Gu)&&(n===Gu&&(!(Es&2)&&(XU|=t),_u===4&&RC(n,Ad)),Hf(n,i),t===1&&Es===0&&!(e.mode&1)&&(AD=yc()+500,KU&&WS()))}function Hf(n,e){var t=n.callbackNode;Dft(n,e);var i=TV(n,n===Gu?Ad:0);if(i===0)t!==null&&hSe(t),n.callbackNode=null,n.callbackPriority=0;else if(e=i&-i,n.callbackPriority!==e){if(t!=null&&hSe(t),e===1)n.tag===0?Lpt(rEe.bind(null,n)):EFe(rEe.bind(null,n)),xpt(function(){!(Es&6)&&WS()}),t=null;else{switch(J5e(i)){case 1:t=xfe;break;case 4:t=Q5e;break;case 16:t=xV;break;case 536870912:t=X5e;break;default:t=xV}t=S6e(t,m6e.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function m6e(n,e){if(Z7=-1,J7=0,Es&6)throw Error(Rn(327));var t=n.callbackNode;if(OL()&&n.callbackNode!==t)return null;var i=TV(n,n===Gu?Ad:0);if(i===0)return null;if(i&30||i&n.expiredLanes||e)e=UV(n,i);else{e=i;var r=Es;Es|=2;var o=v6e();(Gu!==n||Ad!==e)&&(ly=null,AD=yc()+500,eT(n,e));do try{Qpt();break}catch(a){_6e(n,a)}while(1);Bfe(),HV.current=o,Es=r,Yc!==null?e=0:(Gu=null,Ad=0,e=_u)}if(e!==0){if(e===2&&(r=Qne(n),r!==0&&(i=r,e=Eie(n,r))),e===1)throw t=w4,eT(n,0),RC(n,i),Hf(n,yc()),t;if(e===6)RC(n,i);else{if(r=n.current.alternate,!(i&30)&&!Gpt(r)&&(e=UV(n,i),e===2&&(o=Qne(n),o!==0&&(i=o,e=Eie(n,o))),e===1))throw t=w4,eT(n,0),RC(n,i),Hf(n,yc()),t;switch(n.finishedWork=r,n.finishedLanes=i,e){case 0:case 1:throw Error(Rn(345));case 2:KE(n,Cf,ly);break;case 3:if(RC(n,i),(i&130023424)===i&&(e=Jfe+500-yc(),10<e)){if(TV(n,0)!==0)break;if(r=n.suspendedLanes,(r&i)!==i){Hh(),n.pingedLanes|=n.suspendedLanes&r;break}n.timeoutHandle=rie(KE.bind(null,n,Cf,ly),e);break}KE(n,Cf,ly);break;case 4:if(RC(n,i),(i&4194240)===i)break;for(e=n.eventTimes,r=-1;0<i;){var s=31-iv(i);o=1<<s,s=e[s],s>r&&(r=s),i&=~o}if(i=r,i=yc()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Kpt(i/1960))-i,10<i){n.timeoutHandle=rie(KE.bind(null,n,Cf,ly),i);break}KE(n,Cf,ly);break;case 5:KE(n,Cf,ly);break;default:throw Error(Rn(329))}}}return Hf(n,yc()),n.callbackNode===t?m6e.bind(null,n):null}function Eie(n,e){var t=zP;return n.current.memoizedState.isDehydrated&&(eT(n,e).flags|=256),n=UV(n,e),n!==2&&(e=Cf,Cf=t,e!==null&&xie(e)),n}function xie(n){Cf===null?Cf=n:Cf.push.apply(Cf,n)}function Gpt(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var i=0;i<t.length;i++){var r=t[i],o=r.getSnapshot;r=r.value;try{if(!gv(o(),r))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function RC(n,e){for(e&=~Zfe,e&=~XU,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-iv(e),i=1<<t;n[t]=-1,e&=~i}}function rEe(n){if(Es&6)throw Error(Rn(327));OL();var e=TV(n,0);if(!(e&1))return Hf(n,yc()),null;var t=UV(n,e);if(n.tag!==0&&t===2){var i=Qne(n);i!==0&&(e=i,t=Eie(n,i))}if(t===1)throw t=w4,eT(n,0),RC(n,e),Hf(n,yc()),t;if(t===6)throw Error(Rn(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,KE(n,Cf,ly),Hf(n,yc()),null}function epe(n,e){var t=Es;Es|=1;try{return n(e)}finally{Es=t,Es===0&&(AD=yc()+500,KU&&WS())}}function AT(n){UC!==null&&UC.tag===0&&!(Es&6)&&OL();var e=Es;Es|=1;var t=wm.transition,i=da;try{if(wm.transition=null,da=1,n)return n()}finally{da=i,wm.transition=t,Es=e,!(Es&6)&&WS()}}function tpe(){Rp=z2.current,fl(z2)}function eT(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,Ept(t)),Yc!==null)for(t=Yc.return;t!==null;){var i=t;switch(Pfe(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&AV();break;case 3:LD(),fl($f),fl(uh),Ufe();break;case 5:zfe(i);break;case 4:LD();break;case 13:fl(Nl);break;case 19:fl(Nl);break;case 10:$fe(i.type._context);break;case 22:case 23:tpe()}t=t.return}if(Gu=n,Yc=n=yw(n.current,null),Ad=Rp=e,_u=0,w4=null,Zfe=XU=DT=0,Cf=zP=null,Rx!==null){for(e=0;e<Rx.length;e++)if(t=Rx[e],i=t.interleaved,i!==null){t.interleaved=null;var r=i.next,o=t.pending;if(o!==null){var s=o.next;o.next=r,i.next=s}t.pending=i}Rx=null}return n}function _6e(n,e){do{var t=Yc;try{if(Bfe(),Y7.current=VV,$V){for(var i=Ml.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}$V=!1}if(LT=0,Vu=du=Ml=null,HP=!1,b4=0,Xfe.current=null,t===null||t.return===null){_u=1,w4=e,Yc=null;break}e:{var o=n,s=t.return,a=t,l=e;if(e=Ad,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=jSe(s);if(f!==null){f.flags&=-257,qSe(f,s,a,o,e),f.mode&1&&USe(o,c,e),e=f,l=c;var g=e.updateQueue;if(g===null){var m=new Set;m.add(l),e.updateQueue=m}else g.add(l);break e}else{if(!(e&1)){USe(o,c,e),npe();break e}l=Error(Rn(426))}}else if(Cl&&a.mode&1){var v=jSe(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),qSe(v,s,a,o,e),Mfe(DD(l,a));break e}}o=l=DD(l,a),_u!==4&&(_u=2),zP===null?zP=[o]:zP.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var _=e6e(o,l,e);FSe(o,_);break e;case 1:a=l;var b=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof b.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(vw===null||!vw.has(y)))){o.flags|=65536,e&=-e,o.lanes|=e;var C=t6e(o,a,e);FSe(o,C);break e}}o=o.return}while(o!==null)}y6e(t)}catch(x){e=x,Yc===t&&t!==null&&(Yc=t=t.return);continue}break}while(1)}function v6e(){var n=HV.current;return HV.current=VV,n===null?VV:n}function npe(){(_u===0||_u===3||_u===2)&&(_u=4),Gu===null||!(DT&268435455)&&!(XU&268435455)||RC(Gu,Ad)}function UV(n,e){var t=Es;Es|=2;var i=v6e();(Gu!==n||Ad!==e)&&(ly=null,eT(n,e));do try{Ypt();break}catch(r){_6e(n,r)}while(1);if(Bfe(),Es=t,HV.current=i,Yc!==null)throw Error(Rn(261));return Gu=null,Ad=0,_u}function Ypt(){for(;Yc!==null;)b6e(Yc)}function Qpt(){for(;Yc!==null&&!Cft();)b6e(Yc)}function b6e(n){var e=w6e(n.alternate,n,Rp);n.memoizedProps=n.pendingProps,e===null?y6e(n):Yc=e,Xfe.current=null}function y6e(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=zpt(t,e),t!==null){t.flags&=32767,Yc=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{_u=6,Yc=null;return}}else if(t=Wpt(t,e,Rp),t!==null){Yc=t;return}if(e=e.sibling,e!==null){Yc=e;return}Yc=e=n}while(e!==null);_u===0&&(_u=5)}function KE(n,e,t){var i=da,r=wm.transition;try{wm.transition=null,da=1,Xpt(n,e,t,i)}finally{wm.transition=r,da=i}return null}function Xpt(n,e,t,i){do OL();while(UC!==null);if(Es&6)throw Error(Rn(327));t=n.finishedWork;var r=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(Rn(177));n.callbackNode=null,n.callbackPriority=0;var o=t.lanes|t.childLanes;if(Aft(n,o),n===Gu&&(Yc=Gu=null,Ad=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||c8||(c8=!0,S6e(xV,function(){return OL(),null})),o=(t.flags&15990)!==0,t.subtreeFlags&15990||o){o=wm.transition,wm.transition=null;var s=da;da=1;var a=Es;Es|=4,Xfe.current=null,jpt(n,t),p6e(t,n),_pt(nie),kV=!!tie,nie=tie=null,n.current=t,qpt(t),wft(),Es=a,da=s,wm.transition=o}else n.current=t;if(c8&&(c8=!1,UC=n,zV=r),o=n.pendingLanes,o===0&&(vw=null),xft(t.stateNode),Hf(n,yc()),e!==null)for(i=n.onRecoverableError,t=0;t<e.length;t++)r=e[t],i(r.value,{componentStack:r.stack,digest:r.digest});if(WV)throw WV=!1,n=wie,wie=null,n;return zV&1&&n.tag!==0&&OL(),o=n.pendingLanes,o&1?n===Sie?UP++:(UP=0,Sie=n):UP=0,WS(),null}function OL(){if(UC!==null){var n=J5e(zV),e=wm.transition,t=da;try{if(wm.transition=null,da=16>n?16:n,UC===null)var i=!1;else{if(n=UC,UC=null,zV=0,Es&6)throw Error(Rn(331));var r=Es;for(Es|=4,Ni=n.current;Ni!==null;){var o=Ni,s=o.child;if(Ni.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Ni=c;Ni!==null;){var u=Ni;switch(u.tag){case 0:case 11:case 15:WP(8,u,o)}var d=u.child;if(d!==null)d.return=u,Ni=d;else for(;Ni!==null;){u=Ni;var h=u.sibling,f=u.return;if(d6e(u),u===c){Ni=null;break}if(h!==null){h.return=f,Ni=h;break}Ni=f}}}var g=o.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}Ni=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Ni=s;else e:for(;Ni!==null;){if(o=Ni,o.flags&2048)switch(o.tag){case 0:case 11:case 15:WP(9,o,o.return)}var _=o.sibling;if(_!==null){_.return=o.return,Ni=_;break e}Ni=o.return}}var b=n.current;for(Ni=b;Ni!==null;){s=Ni;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,Ni=y;else e:for(s=b;Ni!==null;){if(a=Ni,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:QU(9,a)}}catch(x){Xl(a,a.return,x)}if(a===s){Ni=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,Ni=C;break e}Ni=a.return}}if(Es=r,WS(),Hb&&typeof Hb.onPostCommitFiberRoot=="function")try{Hb.onPostCommitFiberRoot(WU,n)}catch{}i=!0}return i}finally{da=t,wm.transition=e}}return!1}function oEe(n,e,t){e=DD(t,e),e=e6e(n,e,1),n=_w(n,e,1),e=Hh(),n!==null&&(G5(n,1,e),Hf(n,e))}function Xl(n,e,t){if(n.tag===3)oEe(n,n,t);else for(;e!==null;){if(e.tag===3){oEe(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(vw===null||!vw.has(i))){n=DD(t,n),n=t6e(e,n,1),e=_w(e,n,1),n=Hh(),e!==null&&(G5(e,1,n),Hf(e,n));break}}e=e.return}}function Zpt(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),e=Hh(),n.pingedLanes|=n.suspendedLanes&t,Gu===n&&(Ad&t)===t&&(_u===4||_u===3&&(Ad&130023424)===Ad&&500>yc()-Jfe?eT(n,0):Zfe|=t),Hf(n,e)}function C6e(n,e){e===0&&(n.mode&1?(e=JB,JB<<=1,!(JB&130023424)&&(JB=4194304)):e=1);var t=Hh();n=l1(n,e),n!==null&&(G5(n,e,t),Hf(n,t))}function Jpt(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),C6e(n,t)}function egt(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Rn(314))}i!==null&&i.delete(e),C6e(n,t)}var w6e;w6e=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||$f.current)Df=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Df=!1,Hpt(n,e,t);Df=!!(n.flags&131072)}else Df=!1,Cl&&e.flags&1048576&&xFe(e,OV,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;X7(n,e),n=e.pendingProps;var r=TD(e,uh.current);RL(e,t),r=qfe(null,e,i,n,r,t);var o=Kfe();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Vf(i)?(o=!0,NV(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Hfe(e),r.updater=GU,e.stateNode=r,r._reactInternals=e,die(e,i,n,t),e=pie(null,e,i,!0,o,t)):(e.tag=0,Cl&&o&&Ofe(e),Ah(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(X7(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=ngt(i),n=E_(i,n),r){case 0:e=fie(null,e,i,n,t);break e;case 1:e=YSe(null,e,i,n,t);break e;case 11:e=KSe(null,e,i,n,t);break e;case 14:e=GSe(null,e,i,E_(i.type,n),t);break e}throw Error(Rn(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:E_(i,r),fie(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:E_(i,r),YSe(n,e,i,r,t);case 3:e:{if(o6e(e),n===null)throw Error(Rn(387));i=e.pendingProps,o=e.memoizedState,r=o.element,LFe(n,e),FV(e,i,null,t);var s=e.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){r=DD(Error(Rn(423)),e),e=QSe(n,e,i,t,r);break e}else if(i!==r){r=DD(Error(Rn(424)),e),e=QSe(n,e,i,t,r);break e}else for(Up=mw(e.stateNode.containerInfo.firstChild),tg=e,Cl=!0,P_=null,t=RFe(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(kD(),i===r){e=c1(n,e,t);break e}Ah(n,e,i,t)}e=e.child}return e;case 5:return OFe(e),n===null&&lie(e),i=e.type,r=e.pendingProps,o=n!==null?n.memoizedProps:null,s=r.children,iie(i,r)?s=null:o!==null&&iie(i,o)&&(e.flags|=32),r6e(n,e),Ah(n,e,s,t),e.child;case 6:return n===null&&lie(e),null;case 13:return s6e(n,e,t);case 4:return Wfe(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=ID(e,null,i,t):Ah(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:E_(i,r),KSe(n,e,i,r,t);case 7:return Ah(n,e,e.pendingProps,t),e.child;case 8:return Ah(n,e,e.pendingProps.children,t),e.child;case 12:return Ah(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,o=e.memoizedProps,s=r.value,Za(PV,i._currentValue),i._currentValue=s,o!==null)if(gv(o.value,s)){if(o.children===r.children&&!$f.current){e=c1(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=jy(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),cie(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Rn(341));s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),cie(s,t,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ah(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,RL(e,t),r=Nm(r),i=i(r),e.flags|=1,Ah(n,e,i,t),e.child;case 14:return i=e.type,r=E_(i,e.pendingProps),r=E_(i.type,r),GSe(n,e,i,r,t);case 15:return n6e(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:E_(i,r),X7(n,e),e.tag=1,Vf(i)?(n=!0,NV(e)):n=!1,RL(e,t),AFe(e,i,r),die(e,i,r,t),pie(null,e,i,!0,n,t);case 19:return a6e(n,e,t);case 22:return i6e(n,e,t)}throw Error(Rn(156,e.tag))};function S6e(n,e){return Y5e(n,e)}function tgt(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fm(n,e,t,i){return new tgt(n,e,t,i)}function ipe(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ngt(n){if(typeof n=="function")return ipe(n)?1:0;if(n!=null){if(n=n.$$typeof,n===wfe)return 11;if(n===Sfe)return 14}return 2}function yw(n,e){var t=n.alternate;return t===null?(t=fm(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function e$(n,e,t,i,r,o){var s=2;if(i=n,typeof n=="function")ipe(n)&&(s=1);else if(typeof n=="string")s=5;else e:switch(n){case R2:return tT(t.children,r,o,e);case Cfe:s=8,r|=8;break;case Pne:return n=fm(12,t,e,r|2),n.elementType=Pne,n.lanes=o,n;case Mne:return n=fm(13,t,e,r),n.elementType=Mne,n.lanes=o,n;case Fne:return n=fm(19,t,e,r),n.elementType=Fne,n.lanes=o,n;case N5e:return ZU(t,r,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case D5e:s=10;break e;case A5e:s=9;break e;case wfe:s=11;break e;case Sfe:s=14;break e;case wC:s=16,i=null;break e}throw Error(Rn(130,n==null?n:typeof n,""))}return e=fm(s,t,e,r),e.elementType=n,e.type=i,e.lanes=o,e}function tT(n,e,t,i){return n=fm(7,n,i,e),n.lanes=t,n}function ZU(n,e,t,i){return n=fm(22,n,i,e),n.elementType=N5e,n.lanes=t,n.stateNode={isHidden:!1},n}function BX(n,e,t){return n=fm(6,n,null,e),n.lanes=t,n}function $X(n,e,t){return e=fm(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function igt(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bX(0),this.expirationTimes=bX(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bX(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function rpe(n,e,t,i,r,o,s,a,l){return n=new igt(n,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=fm(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hfe(o),n}function rgt(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N2,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}function E6e(n){if(!n)return Zw;n=n._reactInternals;e:{if(Lk(n)!==n||n.tag!==1)throw Error(Rn(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Vf(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Rn(171))}if(n.tag===1){var t=n.type;if(Vf(t))return SFe(n,t,e)}return e}function x6e(n,e,t,i,r,o,s,a,l){return n=rpe(t,i,!0,n,r,o,s,a,l),n.context=E6e(null),t=n.current,i=Hh(),r=bw(t),o=jy(i,r),o.callback=e??null,_w(t,o,r),n.current.lanes=r,G5(n,r,i),Hf(n,i),n}function JU(n,e,t,i){var r=e.current,o=Hh(),s=bw(r);return t=E6e(t),e.context===null?e.context=t:e.pendingContext=t,e=jy(o,s),e.payload={element:n},i=i===void 0?null:i,i!==null&&(e.callback=i),n=_w(r,e,s),n!==null&&(rv(n,r,s,o),G7(n,r,s)),s}function jV(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function sEe(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function ope(n,e){sEe(n,e),(n=n.alternate)&&sEe(n,e)}function ogt(){return null}var T6e=typeof reportError=="function"?reportError:function(n){console.error(n)};function spe(n){this._internalRoot=n}ej.prototype.render=spe.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Rn(409));JU(n,e,null,null)};ej.prototype.unmount=spe.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;AT(function(){JU(null,n,null,null)}),e[a1]=null}};function ej(n){this._internalRoot=n}ej.prototype.unstable_scheduleHydration=function(n){if(n){var e=nFe();n={blockedOn:null,target:n,priority:e};for(var t=0;t<NC.length&&e!==0&&e<NC[t].priority;t++);NC.splice(t,0,n),t===0&&rFe(n)}};function ape(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function tj(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function aEe(){}function sgt(n,e,t,i,r){if(r){if(typeof i=="function"){var o=i;i=function(){var c=jV(s);o.call(c)}}var s=x6e(e,i,n,0,null,!1,!1,"",aEe);return n._reactRootContainer=s,n[a1]=s.current,p4(n.nodeType===8?n.parentNode:n),AT(),s}for(;r=n.lastChild;)n.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var c=jV(l);a.call(c)}}var l=rpe(n,0,!1,null,null,!1,!1,"",aEe);return n._reactRootContainer=l,n[a1]=l.current,p4(n.nodeType===8?n.parentNode:n),AT(function(){JU(e,l,t,i)}),l}function nj(n,e,t,i,r){var o=t._reactRootContainer;if(o){var s=o;if(typeof r=="function"){var a=r;r=function(){var l=jV(s);a.call(l)}}JU(e,s,n,r)}else s=sgt(t,e,n,r,i);return jV(s)}eFe=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=tP(e.pendingLanes);t!==0&&(Tfe(e,t|1),Hf(e,yc()),!(Es&6)&&(AD=yc()+500,WS()))}break;case 13:AT(function(){var i=l1(n,1);if(i!==null){var r=Hh();rv(i,n,1,r)}}),ope(n,1)}};kfe=function(n){if(n.tag===13){var e=l1(n,134217728);if(e!==null){var t=Hh();rv(e,n,134217728,t)}ope(n,134217728)}};tFe=function(n){if(n.tag===13){var e=bw(n),t=l1(n,e);if(t!==null){var i=Hh();rv(t,n,e,i)}ope(n,e)}};nFe=function(){return da};iFe=function(n,e){var t=da;try{return da=n,e()}finally{da=t}};Kne=function(n,e,t){switch(e){case"input":if(Vne(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var i=t[e];if(i!==n&&i.form===n.form){var r=qU(i);if(!r)throw Error(Rn(90));O5e(i),Vne(i,r)}}}break;case"textarea":M5e(n,t);break;case"select":e=t.value,e!=null&&LL(n,!!t.multiple,e,!1)}};z5e=epe;U5e=AT;var agt={usingClientEntryPoint:!1,Events:[Q5,F2,qU,H5e,W5e,epe]},YR={findFiberByHostInstance:Nx,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},lgt={bundleType:YR.bundleType,version:YR.version,rendererPackageName:YR.rendererPackageName,rendererConfig:YR.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x1.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=K5e(n),n===null?null:n.stateNode},findFiberByHostInstance:YR.findFiberByHostInstance||ogt,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var u8=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!u8.isDisabled&&u8.supportsFiber)try{WU=u8.inject(lgt),Hb=u8}catch{}}Sg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=agt;Sg.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ape(e))throw Error(Rn(200));return rgt(n,e,null,t)};Sg.createRoot=function(n,e){if(!ape(n))throw Error(Rn(299));var t=!1,i="",r=T6e;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=rpe(n,1,!1,null,null,t,!1,i,r),n[a1]=e.current,p4(n.nodeType===8?n.parentNode:n),new spe(e)};Sg.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Rn(188)):(n=Object.keys(n).join(","),Error(Rn(268,n)));return n=K5e(e),n=n===null?null:n.stateNode,n};Sg.flushSync=function(n){return AT(n)};Sg.hydrate=function(n,e,t){if(!tj(e))throw Error(Rn(200));return nj(null,n,e,!0,t)};Sg.hydrateRoot=function(n,e,t){if(!ape(n))throw Error(Rn(405));var i=t!=null&&t.hydratedSources||null,r=!1,o="",s=T6e;if(t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),e=x6e(e,null,n,1,t??null,r,!1,o,s),n[a1]=e.current,p4(n),i)for(n=0;n<i.length;n++)t=i[n],r=t._getVersion,r=r(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r);return new ej(e)};Sg.render=function(n,e,t){if(!tj(e))throw Error(Rn(200));return nj(null,n,e,!1,t)};Sg.unmountComponentAtNode=function(n){if(!tj(n))throw Error(Rn(40));return n._reactRootContainer?(AT(function(){nj(null,null,n,!1,function(){n._reactRootContainer=null,n[a1]=null})}),!0):!1};Sg.unstable_batchedUpdates=epe;Sg.unstable_renderSubtreeIntoContainer=function(n,e,t,i){if(!tj(t))throw Error(Rn(200));if(n==null||n._reactInternals===void 0)throw Error(Rn(38));return nj(n,e,t,!1,i)};Sg.version="18.2.0-next-9e3b772b8-20220608";function k6e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k6e)}catch(n){console.error(n)}}k6e(),x5e.exports=Sg;var sp=x5e.exports;const ij=nl(sp),cgt=c5e({__proto__:null,default:ij},[sp]);function ugt(n){n()}let I6e=ugt;const dgt=n=>I6e=n,hgt=()=>I6e,lEe=Symbol.for("react-redux-context"),cEe=typeof globalThis<"u"?globalThis:{};function fgt(){var n;if(!w.createContext)return{};const e=(n=cEe[lEe])!=null?n:cEe[lEe]=new Map;let t=e.get(w.createContext);return t||(t=w.createContext(null),e.set(w.createContext,t)),t}const u1=fgt();function lpe(n=u1){return function(){return w.useContext(n)}}const L6e=lpe(),D6e=()=>{throw new Error("uSES not initialized!")};let A6e=D6e;const pgt=n=>{A6e=n},ggt=(n,e)=>n===e;function mgt(n=u1){const e=n===u1?L6e:lpe(n);return function(i,r={}){const{equalityFn:o=ggt,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof r=="function"?{equalityFn:r}:r,{store:l,subscription:c,getServerState:u,stabilityCheck:d,noopCheck:h}=e();w.useRef(!0);const f=w.useCallback({[i.name](m){return i(m)}}[i.name],[i,d,s]),g=A6e(c.addNestedSub,l.getState,u||l.getState,f,o);return w.useDebugValue(g),g}}const Oc=mgt();function Ct(){return Ct=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ct.apply(this,arguments)}function cpe(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var N6e={exports:{}},ha={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ju=typeof Symbol=="function"&&Symbol.for,upe=Ju?Symbol.for("react.element"):60103,dpe=Ju?Symbol.for("react.portal"):60106,rj=Ju?Symbol.for("react.fragment"):60107,oj=Ju?Symbol.for("react.strict_mode"):60108,sj=Ju?Symbol.for("react.profiler"):60114,aj=Ju?Symbol.for("react.provider"):60109,lj=Ju?Symbol.for("react.context"):60110,hpe=Ju?Symbol.for("react.async_mode"):60111,cj=Ju?Symbol.for("react.concurrent_mode"):60111,uj=Ju?Symbol.for("react.forward_ref"):60112,dj=Ju?Symbol.for("react.suspense"):60113,_gt=Ju?Symbol.for("react.suspense_list"):60120,hj=Ju?Symbol.for("react.memo"):60115,fj=Ju?Symbol.for("react.lazy"):60116,vgt=Ju?Symbol.for("react.block"):60121,bgt=Ju?Symbol.for("react.fundamental"):60117,ygt=Ju?Symbol.for("react.responder"):60118,Cgt=Ju?Symbol.for("react.scope"):60119;function xg(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case upe:switch(n=n.type,n){case hpe:case cj:case rj:case sj:case oj:case dj:return n;default:switch(n=n&&n.$$typeof,n){case lj:case uj:case fj:case hj:case aj:return n;default:return e}}case dpe:return e}}}function R6e(n){return xg(n)===cj}ha.AsyncMode=hpe;ha.ConcurrentMode=cj;ha.ContextConsumer=lj;ha.ContextProvider=aj;ha.Element=upe;ha.ForwardRef=uj;ha.Fragment=rj;ha.Lazy=fj;ha.Memo=hj;ha.Portal=dpe;ha.Profiler=sj;ha.StrictMode=oj;ha.Suspense=dj;ha.isAsyncMode=function(n){return R6e(n)||xg(n)===hpe};ha.isConcurrentMode=R6e;ha.isContextConsumer=function(n){return xg(n)===lj};ha.isContextProvider=function(n){return xg(n)===aj};ha.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===upe};ha.isForwardRef=function(n){return xg(n)===uj};ha.isFragment=function(n){return xg(n)===rj};ha.isLazy=function(n){return xg(n)===fj};ha.isMemo=function(n){return xg(n)===hj};ha.isPortal=function(n){return xg(n)===dpe};ha.isProfiler=function(n){return xg(n)===sj};ha.isStrictMode=function(n){return xg(n)===oj};ha.isSuspense=function(n){return xg(n)===dj};ha.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===rj||n===cj||n===sj||n===oj||n===dj||n===_gt||typeof n=="object"&&n!==null&&(n.$$typeof===fj||n.$$typeof===hj||n.$$typeof===aj||n.$$typeof===lj||n.$$typeof===uj||n.$$typeof===bgt||n.$$typeof===ygt||n.$$typeof===Cgt||n.$$typeof===vgt)};ha.typeOf=xg;N6e.exports=ha;var wgt=N6e.exports,fpe=wgt,Sgt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Egt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},xgt={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},O6e={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ppe={};ppe[fpe.ForwardRef]=xgt;ppe[fpe.Memo]=O6e;function uEe(n){return fpe.isMemo(n)?O6e:ppe[n.$$typeof]||Sgt}var Tgt=Object.defineProperty,kgt=Object.getOwnPropertyNames,dEe=Object.getOwnPropertySymbols,Igt=Object.getOwnPropertyDescriptor,Lgt=Object.getPrototypeOf,hEe=Object.prototype;function P6e(n,e,t){if(typeof e!="string"){if(hEe){var i=Lgt(e);i&&i!==hEe&&P6e(n,i,t)}var r=kgt(e);dEe&&(r=r.concat(dEe(e)));for(var o=uEe(n),s=uEe(e),a=0;a<r.length;++a){var l=r[a];if(!Egt[l]&&!(t&&t[l])&&!(s&&s[l])&&!(o&&o[l])){var c=Igt(e,l);try{Tgt(n,l,c)}catch{}}}}return n}var Dgt=P6e;const fEe=nl(Dgt);var M6e={exports:{}},fa={};/** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var gpe=Symbol.for("react.element"),mpe=Symbol.for("react.portal"),pj=Symbol.for("react.fragment"),gj=Symbol.for("react.strict_mode"),mj=Symbol.for("react.profiler"),_j=Symbol.for("react.provider"),vj=Symbol.for("react.context"),Agt=Symbol.for("react.server_context"),bj=Symbol.for("react.forward_ref"),yj=Symbol.for("react.suspense"),Cj=Symbol.for("react.suspense_list"),wj=Symbol.for("react.memo"),Sj=Symbol.for("react.lazy"),Ngt=Symbol.for("react.offscreen"),F6e;F6e=Symbol.for("react.module.reference");function qm(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case gpe:switch(n=n.type,n){case pj:case mj:case gj:case yj:case Cj:return n;default:switch(n=n&&n.$$typeof,n){case Agt:case vj:case bj:case Sj:case wj:case _j:return n;default:return e}}case mpe:return e}}}fa.ContextConsumer=vj;fa.ContextProvider=_j;fa.Element=gpe;fa.ForwardRef=bj;fa.Fragment=pj;fa.Lazy=Sj;fa.Memo=wj;fa.Portal=mpe;fa.Profiler=mj;fa.StrictMode=gj;fa.Suspense=yj;fa.SuspenseList=Cj;fa.isAsyncMode=function(){return!1};fa.isConcurrentMode=function(){return!1};fa.isContextConsumer=function(n){return qm(n)===vj};fa.isContextProvider=function(n){return qm(n)===_j};fa.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===gpe};fa.isForwardRef=function(n){return qm(n)===bj};fa.isFragment=function(n){return qm(n)===pj};fa.isLazy=function(n){return qm(n)===Sj};fa.isMemo=function(n){return qm(n)===wj};fa.isPortal=function(n){return qm(n)===mpe};fa.isProfiler=function(n){return qm(n)===mj};fa.isStrictMode=function(n){return qm(n)===gj};fa.isSuspense=function(n){return qm(n)===yj};fa.isSuspenseList=function(n){return qm(n)===Cj};fa.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===pj||n===mj||n===gj||n===yj||n===Cj||n===Ngt||typeof n=="object"&&n!==null&&(n.$$typeof===Sj||n.$$typeof===wj||n.$$typeof===_j||n.$$typeof===vj||n.$$typeof===bj||n.$$typeof===F6e||n.getModuleId!==void 0)};fa.typeOf=qm;M6e.exports=fa;var Rgt=M6e.exports;const Ogt=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Pgt(n,e,t,i,{areStatesEqual:r,areOwnPropsEqual:o,areStatePropsEqual:s}){let a=!1,l,c,u,d,h;function f(b,y){return l=b,c=y,u=n(l,c),d=e(i,c),h=t(u,d,c),a=!0,h}function g(){return u=n(l,c),e.dependsOnOwnProps&&(d=e(i,c)),h=t(u,d,c),h}function m(){return n.dependsOnOwnProps&&(u=n(l,c)),e.dependsOnOwnProps&&(d=e(i,c)),h=t(u,d,c),h}function v(){const b=n(l,c),y=!s(b,u);return u=b,y&&(h=t(u,d,c)),h}function _(b,y){const C=!o(y,c),x=!r(b,l,y,c);return l=b,c=y,C&&x?g():C?m():x?v():h}return function(y,C){return a?_(y,C):f(y,C)}}function Mgt(n,e){let{initMapStateToProps:t,initMapDispatchToProps:i,initMergeProps:r}=e,o=cpe(e,Ogt);const s=t(n,o),a=i(n,o),l=r(n,o);return Pgt(s,a,l,n,o)}function Fgt(n,e){const t={};for(const i in n){const r=n[i];typeof r=="function"&&(t[i]=(...o)=>e(r(...o)))}return t}function Tie(n){return function(t){const i=n(t);function r(){return i}return r.dependsOnOwnProps=!1,r}}function pEe(n){return n.dependsOnOwnProps?!!n.dependsOnOwnProps:n.length!==1}function B6e(n,e){return function(i,{displayName:r}){const o=function(a,l){return o.dependsOnOwnProps?o.mapToProps(a,l):o.mapToProps(a,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(a,l){o.mapToProps=n,o.dependsOnOwnProps=pEe(n);let c=o(a,l);return typeof c=="function"&&(o.mapToProps=c,o.dependsOnOwnProps=pEe(c),c=o(a,l)),c},o}}function _pe(n,e){return(t,i)=>{throw new Error(`Invalid value of type ${typeof n} for ${e} argument when connecting component ${i.wrappedComponentName}.`)}}function Bgt(n){return n&&typeof n=="object"?Tie(e=>Fgt(n,e)):n?typeof n=="function"?B6e(n):_pe(n,"mapDispatchToProps"):Tie(e=>({dispatch:e}))}function $gt(n){return n?typeof n=="function"?B6e(n):_pe(n,"mapStateToProps"):Tie(()=>({}))}function Vgt(n,e,t){return Ct({},t,n,e)}function Hgt(n){return function(t,{displayName:i,areMergedPropsEqual:r}){let o=!1,s;return function(l,c,u){const d=n(l,c,u);return o?r(d,s)||(s=d):(o=!0,s=d),s}}}function Wgt(n){return n?typeof n=="function"?Hgt(n):_pe(n,"mergeProps"):()=>Vgt}function zgt(){const n=hgt();let e=null,t=null;return{clear(){e=null,t=null},notify(){n(()=>{let i=e;for(;i;)i.callback(),i=i.next})},get(){let i=[],r=e;for(;r;)i.push(r),r=r.next;return i},subscribe(i){let r=!0,o=t={callback:i,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}const gEe={notify(){},get:()=>[]};function $6e(n,e){let t,i=gEe,r=0,o=!1;function s(m){u();const v=i.subscribe(m);let _=!1;return()=>{_||(_=!0,v(),d())}}function a(){i.notify()}function l(){g.onStateChange&&g.onStateChange()}function c(){return o}function u(){r++,t||(t=e?e.addNestedSub(l):n.subscribe(l),i=zgt())}function d(){r--,t&&r===0&&(t(),t=void 0,i.clear(),i=gEe)}function h(){o||(o=!0,u())}function f(){o&&(o=!1,d())}const g={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:h,tryUnsubscribe:f,getListeners:()=>i};return g}const Ugt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qV=Ugt?w.useLayoutEffect:w.useEffect;function mEe(n,e){return n===e?n!==0||e!==0||1/n===1/e:n!==n&&e!==e}function VX(n,e){if(mEe(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(!Object.prototype.hasOwnProperty.call(e,t[r])||!mEe(n[t[r]],e[t[r]]))return!1;return!0}const jgt=["reactReduxForwardedRef"];let V6e=D6e;const qgt=n=>{V6e=n},Kgt=[null,null];function Ggt(n,e,t){qV(()=>n(...e),t)}function Ygt(n,e,t,i,r,o){n.current=i,t.current=!1,r.current&&(r.current=null,o())}function Qgt(n,e,t,i,r,o,s,a,l,c,u){if(!n)return()=>{};let d=!1,h=null;const f=()=>{if(d||!a.current)return;const m=e.getState();let v,_;try{v=i(m,r.current)}catch(b){_=b,h=b}_||(h=null),v===o.current?s.current||c():(o.current=v,l.current=v,s.current=!0,u())};return t.onStateChange=f,t.trySubscribe(),f(),()=>{if(d=!0,t.tryUnsubscribe(),t.onStateChange=null,h)throw h}}function Xgt(n,e){return n===e}function H6e(n,e,t,{pure:i,areStatesEqual:r=Xgt,areOwnPropsEqual:o=VX,areStatePropsEqual:s=VX,areMergedPropsEqual:a=VX,forwardRef:l=!1,context:c=u1}={}){const u=c,d=$gt(n),h=Bgt(e),f=Wgt(t),g=!!n;return v=>{const _=v.displayName||v.name||"Component",b=`Connect(${_})`,y={shouldHandleStateChanges:g,displayName:b,wrappedComponentName:_,WrappedComponent:v,initMapStateToProps:d,initMapDispatchToProps:h,initMergeProps:f,areStatesEqual:r,areStatePropsEqual:s,areOwnPropsEqual:o,areMergedPropsEqual:a};function C(k){const[L,D,A]=w.useMemo(()=>{const{reactReduxForwardedRef:_t}=k,Wt=cpe(k,jgt);return[k.context,_t,Wt]},[k]),O=w.useMemo(()=>L&&L.Consumer&&Rgt.isContextConsumer(w.createElement(L.Consumer,null))?L:u,[L,u]),P=w.useContext(O),F=!!k.store&&!!k.store.getState&&!!k.store.dispatch,B=!!P&&!!P.store,M=F?k.store:P.store,V=B?P.getServerState:M.getState,U=w.useMemo(()=>Mgt(M.dispatch,y),[M]),[W,q]=w.useMemo(()=>{if(!g)return Kgt;const _t=$6e(M,F?void 0:P.subscription),Wt=_t.notifyNestedSubs.bind(_t);return[_t,Wt]},[M,F,P]),H=w.useMemo(()=>F?P:Ct({},P,{subscription:W}),[F,P,W]),ie=w.useRef(),se=w.useRef(A),Q=w.useRef(),Ee=w.useRef(!1);w.useRef(!1);const Fe=w.useRef(!1),He=w.useRef();qV(()=>(Fe.current=!0,()=>{Fe.current=!1}),[]);const ke=w.useMemo(()=>()=>Q.current&&A===se.current?Q.current:U(M.getState(),A),[M,A]),Me=w.useMemo(()=>Wt=>W?Qgt(g,M,W,U,se,ie,Ee,Fe,Q,q,Wt):()=>{},[W]);Ggt(Ygt,[se,ie,Ee,A,Q,q]);let je;try{je=V6e(Me,ke,V?()=>U(V(),A):ke)}catch(_t){throw He.current&&(_t.message+=` The error may be correlated with this previous error: ${He.current.stack} `),_t}qV(()=>{He.current=void 0,Q.current=void 0,ie.current=je});const qe=w.useMemo(()=>w.createElement(v,Ct({},je,{ref:D})),[D,v,je]);return w.useMemo(()=>g?w.createElement(O.Provider,{value:H},qe):qe,[O,qe,H])}const E=w.memo(C);if(E.WrappedComponent=v,E.displayName=C.displayName=b,l){const L=w.forwardRef(function(A,O){return w.createElement(E,Ct({},A,{reactReduxForwardedRef:O}))});return L.displayName=b,L.WrappedComponent=v,fEe(L,v)}return fEe(E,v)}}function W6e({store:n,context:e,children:t,serverState:i,stabilityCheck:r="once",noopCheck:o="once"}){const s=w.useMemo(()=>{const c=$6e(n);return{store:n,subscription:c,getServerState:i?()=>i:void 0,stabilityCheck:r,noopCheck:o}},[n,i,r,o]),a=w.useMemo(()=>n.getState(),[n]);qV(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==n.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,a]);const l=e||u1;return w.createElement(l.Provider,{value:s},t)}function z6e(n=u1){const e=n===u1?L6e:lpe(n);return function(){const{store:i}=e();return i}}const U6e=z6e();function Zgt(n=u1){const e=n===u1?U6e:z6e(n);return function(){return e().dispatch}}const Qi=Zgt();pgt(oft.useSyncExternalStoreWithSelector);qgt(w5e.useSyncExternalStore);dgt(sp.unstable_batchedUpdates);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ji(){return Oc(n=>n.companyUsers.changes.company)}var KV={exports:{}};/** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */KV.exports;(function(n,e){(function(){var t,i="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,f=4,g=1,m=2,v=1,_=2,b=4,y=8,C=16,x=32,E=64,k=128,L=256,D=512,A=30,O="...",P=800,F=16,B=1,M=2,V=3,U=1/0,W=9007199254740991,q=17976931348623157e292,H=0/0,ie=4294967295,se=ie-1,Q=ie>>>1,Ee=[["ary",k],["bind",v],["bindKey",_],["curry",y],["curryRight",C],["flip",D],["partial",x],["partialRight",E],["rearg",L]],Fe="[object Arguments]",He="[object Array]",ke="[object AsyncFunction]",Me="[object Boolean]",je="[object Date]",qe="[object DOMException]",Be="[object Error]",_t="[object Function]",Wt="[object GeneratorFunction]",Tt="[object Map]",rn="[object Number]",_n="[object Null]",wt="[object Object]",pt="[object Promise]",ot="[object Proxy]",we="[object RegExp]",Se="[object Set]",re="[object String]",Y="[object Symbol]",Z="[object Undefined]",le="[object WeakMap]",te="[object WeakSet]",me="[object ArrayBuffer]",Oe="[object DataView]",et="[object Float32Array]",Et="[object Float64Array]",Qe="[object Int8Array]",At="[object Int16Array]",Ut="[object Int32Array]",fe="[object Uint8Array]",Re="[object Uint8ClampedArray]",Je="[object Uint16Array]",Ot="[object Uint32Array]",Ft=/\b__p \+= '';/g,jt=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ei=/&(?:amp|lt|gt|quot|#39);/g,sr=/[&<>"']/g,zn=RegExp(ei.source),Tn=RegExp(sr.source),pi=/<%-([\s\S]+?)%>/g,Ei=/<%([\s\S]+?)%>/g,$i=/<%=([\s\S]+?)%>/g,Pr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ro=/^\w*$/,Vo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oo=/[\\^$.*+?()[\]{}|]/g,ta=RegExp(oo.source),Mr=/^\s+/,er=/\s/,on=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hi=/\{\n\/\* \[wrapped with (.+)\] \*/,to=/,? & /,Ge=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xt=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,hn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ut=/\w*$/,Ie=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,Ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,Xe=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,it=/($^)/,fn=/['\n\r\u2028\u2029\\]/g,In="\\ud800-\\udfff",ti="\\u0300-\\u036f",gi="\\ufe20-\\ufe2f",Vi="\\u20d0-\\u20ff",Hn=ti+gi+Vi,pn="\\u2700-\\u27bf",ii="a-z\\xdf-\\xf6\\xf8-\\xff",lr="\\xac\\xb1\\xd7\\xf7",hr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",na="\\u2000-\\u206f",va=" \\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",Ua="A-Z\\xc0-\\xd6\\xd8-\\xde",os="\\ufe0e\\ufe0f",gs=lr+hr+na+va,Ho="['’]",kl="["+In+"]",cc="["+gs+"]",xi="["+Hn+"]",co="\\d+",bo="["+pn+"]",Ws="["+ii+"]",Wo="[^"+In+gs+co+pn+ii+Ua+"]",zs="\\ud83c[\\udffb-\\udfff]",Mo="(?:"+xi+"|"+zs+")",Kr="[^"+In+"]",uo="(?:\\ud83c[\\udde6-\\uddff]){2}",Tr="[\\ud800-\\udbff][\\udc00-\\udfff]",Fr="["+Ua+"]",so="\\u200d",qi="(?:"+Ws+"|"+Wo+")",Xn="(?:"+Fr+"|"+Wo+")",bi="(?:"+Ho+"(?:d|ll|m|re|s|t|ve))?",qn="(?:"+Ho+"(?:D|LL|M|RE|S|T|VE))?",oi=Mo+"?",Si="["+os+"]?",Ki="(?:"+so+"(?:"+[Kr,uo,Tr].join("|")+")"+Si+oi+")*",Sn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kn=Si+oi+Ki,gt="(?:"+[bo,uo,Tr].join("|")+")"+Kn,Pt="(?:"+[Kr+xi+"?",xi,uo,Tr,kl].join("|")+")",vn=RegExp(Ho,"g"),Zn=RegExp(xi,"g"),Wn=RegExp(zs+"(?="+zs+")|"+Pt+Kn,"g"),ui=RegExp([Fr+"?"+Ws+"+"+bi+"(?="+[cc,Fr,"$"].join("|")+")",Xn+"+"+qn+"(?="+[cc,Fr+qi,"$"].join("|")+")",Fr+"?"+qi+"+"+bi,Fr+"+"+qn,wn,Sn,co,gt].join("|"),"g"),Br=RegExp("["+so+In+Hn+os+"]"),ho=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xr=["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"],ja=-1,kr={};kr[et]=kr[Et]=kr[Qe]=kr[At]=kr[Ut]=kr[fe]=kr[Re]=kr[Je]=kr[Ot]=!0,kr[Fe]=kr[He]=kr[me]=kr[Me]=kr[Oe]=kr[je]=kr[Be]=kr[_t]=kr[Tt]=kr[rn]=kr[wt]=kr[we]=kr[Se]=kr[re]=kr[le]=!1;var Dn={};Dn[Fe]=Dn[He]=Dn[me]=Dn[Oe]=Dn[Me]=Dn[je]=Dn[et]=Dn[Et]=Dn[Qe]=Dn[At]=Dn[Ut]=Dn[Tt]=Dn[rn]=Dn[wt]=Dn[we]=Dn[Se]=Dn[re]=Dn[Y]=Dn[fe]=Dn[Re]=Dn[Je]=Dn[Ot]=!0,Dn[Be]=Dn[_t]=Dn[le]=!1;var Ts={À:"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"},Il={"&":"&","<":"<",">":">",'"':""","'":"'"},nu={"&":"&","<":"<",">":">",""":'"',"'":"'"},ms={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wl=parseFloat,zl=parseInt,Fg=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,R0=typeof self=="object"&&self&&self.Object===Object&&self,_l=Fg||R0||Function("return this")(),o_=e&&!e.nodeType&&e,yh=o_&&!0&&n&&!n.nodeType&&n,Bg=yh&&yh.exports===o_,Iu=Bg&&Fg.process,iu=function(){try{var rt=yh&&yh.require&&yh.require("util").types;return rt||Iu&&Iu.binding&&Iu.binding("util")}catch{}}(),O0=iu&&iu.isArrayBuffer,$g=iu&&iu.isDate,Vg=iu&&iu.isMap,of=iu&&iu.isRegExp,vI=iu&&iu.isSet,bI=iu&&iu.isTypedArray;function id(rt,Xt,Mt){switch(Mt.length){case 0:return rt.call(Xt);case 1:return rt.call(Xt,Mt[0]);case 2:return rt.call(Xt,Mt[0],Mt[1]);case 3:return rt.call(Xt,Mt[0],Mt[1],Mt[2])}return rt.apply(Xt,Mt)}function wR(rt,Xt,Mt,Ii){for(var no=-1,As=rt==null?0:rt.length;++no<As;){var su=rt[no];Xt(Ii,su,Mt(su),rt)}return Ii}function ru(rt,Xt){for(var Mt=-1,Ii=rt==null?0:rt.length;++Mt<Ii&&Xt(rt[Mt],Mt,rt)!==!1;);return rt}function SR(rt,Xt){for(var Mt=rt==null?0:rt.length;Mt--&&Xt(rt[Mt],Mt,rt)!==!1;);return rt}function yI(rt,Xt){for(var Mt=-1,Ii=rt==null?0:rt.length;++Mt<Ii;)if(!Xt(rt[Mt],Mt,rt))return!1;return!0}function sf(rt,Xt){for(var Mt=-1,Ii=rt==null?0:rt.length,no=0,As=[];++Mt<Ii;){var su=rt[Mt];Xt(su,Mt,rt)&&(As[no++]=su)}return As}function Ch(rt,Xt){var Mt=rt==null?0:rt.length;return!!Mt&&Kt(rt,Xt,0)>-1}function V1(rt,Xt,Mt){for(var Ii=-1,no=rt==null?0:rt.length;++Ii<no;)if(Mt(Xt,rt[Ii]))return!0;return!1}function ba(rt,Xt){for(var Mt=-1,Ii=rt==null?0:rt.length,no=Array(Ii);++Mt<Ii;)no[Mt]=Xt(rt[Mt],Mt,rt);return no}function pp(rt,Xt){for(var Mt=-1,Ii=Xt.length,no=rt.length;++Mt<Ii;)rt[no+Mt]=Xt[Mt];return rt}function vl(rt,Xt,Mt,Ii){var no=-1,As=rt==null?0:rt.length;for(Ii&&As&&(Mt=rt[++no]);++no<As;)Mt=Xt(Mt,rt[no],no,rt);return Mt}function wE(rt,Xt,Mt,Ii){var no=rt==null?0:rt.length;for(Ii&&no&&(Mt=rt[--no]);no--;)Mt=Xt(Mt,rt[no],no,rt);return Mt}function SE(rt,Xt){for(var Mt=-1,Ii=rt==null?0:rt.length;++Mt<Ii;)if(Xt(rt[Mt],Mt,rt))return!0;return!1}var ee=Fo("length");function z(rt){return rt.split("")}function X(rt){return rt.match(Ge)||[]}function Ce(rt,Xt,Mt){var Ii;return Mt(rt,function(no,As,su){if(Xt(no,As,su))return Ii=As,!1}),Ii}function Ne(rt,Xt,Mt,Ii){for(var no=rt.length,As=Mt+(Ii?1:-1);Ii?As--:++As<no;)if(Xt(rt[As],As,rt))return As;return-1}function Kt(rt,Xt,Mt){return Xt===Xt?mot(rt,Xt,Mt):Ne(rt,ki,Mt)}function Fn(rt,Xt,Mt,Ii){for(var no=Mt-1,As=rt.length;++no<As;)if(Ii(rt[no],Xt))return no;return-1}function ki(rt){return rt!==rt}function $r(rt,Xt){var Mt=rt==null?0:rt.length;return Mt?Hr(rt,Xt)/Mt:H}function Fo(rt){return function(Xt){return Xt==null?t:Xt[rt]}}function yi(rt){return function(Xt){return rt==null?t:rt[Xt]}}function An(rt,Xt,Mt,Ii,no){return no(rt,function(As,su,Aa){Mt=Ii?(Ii=!1,As):Xt(Mt,As,su,Aa)}),Mt}function Rr(rt,Xt){var Mt=rt.length;for(rt.sort(Xt);Mt--;)rt[Mt]=rt[Mt].value;return rt}function Hr(rt,Xt){for(var Mt,Ii=-1,no=rt.length;++Ii<no;){var As=Xt(rt[Ii]);As!==t&&(Mt=Mt===t?As:Mt+As)}return Mt}function _s(rt,Xt){for(var Mt=-1,Ii=Array(rt);++Mt<rt;)Ii[Mt]=Xt(Mt);return Ii}function Mc(rt,Xt){return ba(Xt,function(Mt){return[Mt,rt[Mt]]})}function rd(rt){return rt&&rt.slice(0,uCe(rt)+1).replace(Mr,"")}function ol(rt){return function(Xt){return rt(Xt)}}function wh(rt,Xt){return ba(Xt,function(Mt){return rt[Mt]})}function gp(rt,Xt){return rt.has(Xt)}function Hg(rt,Xt){for(var Mt=-1,Ii=rt.length;++Mt<Ii&&Kt(Xt,rt[Mt],0)>-1;);return Mt}function ou(rt,Xt){for(var Mt=rt.length;Mt--&&Kt(Xt,rt[Mt],0)>-1;);return Mt}function lB(rt,Xt){for(var Mt=rt.length,Ii=0;Mt--;)rt[Mt]===Xt&&++Ii;return Ii}var cB=yi(Ts),ER=yi(Il);function xR(rt){return"\\"+ms[rt]}function uB(rt,Xt){return rt==null?t:rt[Xt]}function H1(rt){return Br.test(rt)}function _Q(rt){return ho.test(rt)}function vQ(rt){for(var Xt,Mt=[];!(Xt=rt.next()).done;)Mt.push(Xt.value);return Mt}function TR(rt){var Xt=-1,Mt=Array(rt.size);return rt.forEach(function(Ii,no){Mt[++Xt]=[no,Ii]}),Mt}function kR(rt,Xt){return function(Mt){return rt(Xt(Mt))}}function W1(rt,Xt){for(var Mt=-1,Ii=rt.length,no=0,As=[];++Mt<Ii;){var su=rt[Mt];(su===Xt||su===u)&&(rt[Mt]=u,As[no++]=Mt)}return As}function dB(rt){var Xt=-1,Mt=Array(rt.size);return rt.forEach(function(Ii){Mt[++Xt]=Ii}),Mt}function got(rt){var Xt=-1,Mt=Array(rt.size);return rt.forEach(function(Ii){Mt[++Xt]=[Ii,Ii]}),Mt}function mot(rt,Xt,Mt){for(var Ii=Mt-1,no=rt.length;++Ii<no;)if(rt[Ii]===Xt)return Ii;return-1}function _ot(rt,Xt,Mt){for(var Ii=Mt+1;Ii--;)if(rt[Ii]===Xt)return Ii;return Ii}function CI(rt){return H1(rt)?bot(rt):ee(rt)}function s_(rt){return H1(rt)?yot(rt):z(rt)}function uCe(rt){for(var Xt=rt.length;Xt--&&er.test(rt.charAt(Xt)););return Xt}var vot=yi(nu);function bot(rt){for(var Xt=Wn.lastIndex=0;Wn.test(rt);)++Xt;return Xt}function yot(rt){return rt.match(Wn)||[]}function Cot(rt){return rt.match(ui)||[]}var wot=function rt(Xt){Xt=Xt==null?_l:wI.defaults(_l.Object(),Xt,wI.pick(_l,Xr));var Mt=Xt.Array,Ii=Xt.Date,no=Xt.Error,As=Xt.Function,su=Xt.Math,Aa=Xt.Object,bQ=Xt.RegExp,Sot=Xt.String,Wg=Xt.TypeError,hB=Mt.prototype,Eot=As.prototype,SI=Aa.prototype,fB=Xt["__core-js_shared__"],pB=Eot.toString,ia=SI.hasOwnProperty,xot=0,dCe=function(){var S=/[^.]+$/.exec(fB&&fB.keys&&fB.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),gB=SI.toString,Tot=pB.call(Aa),kot=_l._,Iot=bQ("^"+pB.call(ia).replace(oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mB=Bg?Xt.Buffer:t,z1=Xt.Symbol,_B=Xt.Uint8Array,hCe=mB?mB.allocUnsafe:t,vB=kR(Aa.getPrototypeOf,Aa),fCe=Aa.create,pCe=SI.propertyIsEnumerable,bB=hB.splice,gCe=z1?z1.isConcatSpreadable:t,IR=z1?z1.iterator:t,EE=z1?z1.toStringTag:t,yB=function(){try{var S=LE(Aa,"defineProperty");return S({},"",{}),S}catch{}}(),Lot=Xt.clearTimeout!==_l.clearTimeout&&Xt.clearTimeout,Dot=Ii&&Ii.now!==_l.Date.now&&Ii.now,Aot=Xt.setTimeout!==_l.setTimeout&&Xt.setTimeout,CB=su.ceil,wB=su.floor,yQ=Aa.getOwnPropertySymbols,Not=mB?mB.isBuffer:t,mCe=Xt.isFinite,Rot=hB.join,Oot=kR(Aa.keys,Aa),au=su.max,zd=su.min,Pot=Ii.now,Mot=Xt.parseInt,_Ce=su.random,Fot=hB.reverse,CQ=LE(Xt,"DataView"),LR=LE(Xt,"Map"),wQ=LE(Xt,"Promise"),EI=LE(Xt,"Set"),DR=LE(Xt,"WeakMap"),AR=LE(Aa,"create"),SB=DR&&new DR,xI={},Bot=DE(CQ),$ot=DE(LR),Vot=DE(wQ),Hot=DE(EI),Wot=DE(DR),EB=z1?z1.prototype:t,NR=EB?EB.valueOf:t,vCe=EB?EB.toString:t;function ge(S){if(Ul(S)&&!ao(S)&&!(S instanceof Xo)){if(S instanceof zg)return S;if(ia.call(S,"__wrapped__"))return bwe(S)}return new zg(S)}var TI=function(){function S(){}return function(I){if(!Ll(I))return{};if(fCe)return fCe(I);S.prototype=I;var R=new S;return S.prototype=t,R}}();function xB(){}function zg(S,I){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!I,this.__index__=0,this.__values__=t}ge.templateSettings={escape:pi,evaluate:Ei,interpolate:$i,variable:"",imports:{_:ge}},ge.prototype=xB.prototype,ge.prototype.constructor=ge,zg.prototype=TI(xB.prototype),zg.prototype.constructor=zg;function Xo(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function zot(){var S=new Xo(this.__wrapped__);return S.__actions__=af(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=af(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=af(this.__views__),S}function Uot(){if(this.__filtered__){var S=new Xo(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function jot(){var S=this.__wrapped__.value(),I=this.__dir__,R=ao(S),j=I<0,oe=R?S.length:0,ve=iat(0,oe,this.__views__),Pe=ve.start,Ye=ve.end,st=Ye-Pe,cn=j?Ye:Pe-1,dn=this.__iteratees__,yn=dn.length,li=0,Wi=zd(st,this.__takeCount__);if(!R||!j&&oe==st&&Wi==st)return WCe(S,this.__actions__);var Ir=[];e:for(;st--&&li<Wi;){cn+=I;for(var Eo=-1,Lr=S[cn];++Eo<yn;){var zo=dn[Eo],ss=zo.iteratee,vp=zo.type,xh=ss(Lr);if(vp==M)Lr=xh;else if(!xh){if(vp==B)continue e;break e}}Ir[li++]=Lr}return Ir}Xo.prototype=TI(xB.prototype),Xo.prototype.constructor=Xo;function xE(S){var I=-1,R=S==null?0:S.length;for(this.clear();++I<R;){var j=S[I];this.set(j[0],j[1])}}function qot(){this.__data__=AR?AR(null):{},this.size=0}function Kot(S){var I=this.has(S)&&delete this.__data__[S];return this.size-=I?1:0,I}function Got(S){var I=this.__data__;if(AR){var R=I[S];return R===l?t:R}return ia.call(I,S)?I[S]:t}function Yot(S){var I=this.__data__;return AR?I[S]!==t:ia.call(I,S)}function Qot(S,I){var R=this.__data__;return this.size+=this.has(S)?0:1,R[S]=AR&&I===t?l:I,this}xE.prototype.clear=qot,xE.prototype.delete=Kot,xE.prototype.get=Got,xE.prototype.has=Yot,xE.prototype.set=Qot;function P0(S){var I=-1,R=S==null?0:S.length;for(this.clear();++I<R;){var j=S[I];this.set(j[0],j[1])}}function Xot(){this.__data__=[],this.size=0}function Zot(S){var I=this.__data__,R=TB(I,S);if(R<0)return!1;var j=I.length-1;return R==j?I.pop():bB.call(I,R,1),--this.size,!0}function Jot(S){var I=this.__data__,R=TB(I,S);return R<0?t:I[R][1]}function est(S){return TB(this.__data__,S)>-1}function tst(S,I){var R=this.__data__,j=TB(R,S);return j<0?(++this.size,R.push([S,I])):R[j][1]=I,this}P0.prototype.clear=Xot,P0.prototype.delete=Zot,P0.prototype.get=Jot,P0.prototype.has=est,P0.prototype.set=tst;function M0(S){var I=-1,R=S==null?0:S.length;for(this.clear();++I<R;){var j=S[I];this.set(j[0],j[1])}}function nst(){this.size=0,this.__data__={hash:new xE,map:new(LR||P0),string:new xE}}function ist(S){var I=BB(this,S).delete(S);return this.size-=I?1:0,I}function rst(S){return BB(this,S).get(S)}function ost(S){return BB(this,S).has(S)}function sst(S,I){var R=BB(this,S),j=R.size;return R.set(S,I),this.size+=R.size==j?0:1,this}M0.prototype.clear=nst,M0.prototype.delete=ist,M0.prototype.get=rst,M0.prototype.has=ost,M0.prototype.set=sst;function TE(S){var I=-1,R=S==null?0:S.length;for(this.__data__=new M0;++I<R;)this.add(S[I])}function ast(S){return this.__data__.set(S,l),this}function lst(S){return this.__data__.has(S)}TE.prototype.add=TE.prototype.push=ast,TE.prototype.has=lst;function a_(S){var I=this.__data__=new P0(S);this.size=I.size}function cst(){this.__data__=new P0,this.size=0}function ust(S){var I=this.__data__,R=I.delete(S);return this.size=I.size,R}function dst(S){return this.__data__.get(S)}function hst(S){return this.__data__.has(S)}function fst(S,I){var R=this.__data__;if(R instanceof P0){var j=R.__data__;if(!LR||j.length<r-1)return j.push([S,I]),this.size=++R.size,this;R=this.__data__=new M0(j)}return R.set(S,I),this.size=R.size,this}a_.prototype.clear=cst,a_.prototype.delete=ust,a_.prototype.get=dst,a_.prototype.has=hst,a_.prototype.set=fst;function bCe(S,I){var R=ao(S),j=!R&&AE(S),oe=!R&&!j&&G1(S),ve=!R&&!j&&!oe&&DI(S),Pe=R||j||oe||ve,Ye=Pe?_s(S.length,Sot):[],st=Ye.length;for(var cn in S)(I||ia.call(S,cn))&&!(Pe&&(cn=="length"||oe&&(cn=="offset"||cn=="parent")||ve&&(cn=="buffer"||cn=="byteLength"||cn=="byteOffset")||V0(cn,st)))&&Ye.push(cn);return Ye}function yCe(S){var I=S.length;return I?S[RQ(0,I-1)]:t}function pst(S,I){return $B(af(S),kE(I,0,S.length))}function gst(S){return $B(af(S))}function SQ(S,I,R){(R!==t&&!l_(S[I],R)||R===t&&!(I in S))&&F0(S,I,R)}function RR(S,I,R){var j=S[I];(!(ia.call(S,I)&&l_(j,R))||R===t&&!(I in S))&&F0(S,I,R)}function TB(S,I){for(var R=S.length;R--;)if(l_(S[R][0],I))return R;return-1}function mst(S,I,R,j){return U1(S,function(oe,ve,Pe){I(j,oe,R(oe),Pe)}),j}function CCe(S,I){return S&&Mv(I,Lu(I),S)}function _st(S,I){return S&&Mv(I,cf(I),S)}function F0(S,I,R){I=="__proto__"&&yB?yB(S,I,{configurable:!0,enumerable:!0,value:R,writable:!0}):S[I]=R}function EQ(S,I){for(var R=-1,j=I.length,oe=Mt(j),ve=S==null;++R<j;)oe[R]=ve?t:rX(S,I[R]);return oe}function kE(S,I,R){return S===S&&(R!==t&&(S=S<=R?S:R),I!==t&&(S=S>=I?S:I)),S}function Ug(S,I,R,j,oe,ve){var Pe,Ye=I&d,st=I&h,cn=I&f;if(R&&(Pe=oe?R(S,j,oe,ve):R(S)),Pe!==t)return Pe;if(!Ll(S))return S;var dn=ao(S);if(dn){if(Pe=oat(S),!Ye)return af(S,Pe)}else{var yn=Ud(S),li=yn==_t||yn==Wt;if(G1(S))return jCe(S,Ye);if(yn==wt||yn==Fe||li&&!oe){if(Pe=st||li?{}:uwe(S),!Ye)return st?Gst(S,_st(Pe,S)):Kst(S,CCe(Pe,S))}else{if(!Dn[yn])return oe?S:{};Pe=sat(S,yn,Ye)}}ve||(ve=new a_);var Wi=ve.get(S);if(Wi)return Wi;ve.set(S,Pe),$we(S)?S.forEach(function(Lr){Pe.add(Ug(Lr,I,R,Lr,S,ve))}):Fwe(S)&&S.forEach(function(Lr,zo){Pe.set(zo,Ug(Lr,I,R,zo,S,ve))});var Ir=cn?st?UQ:zQ:st?cf:Lu,Eo=dn?t:Ir(S);return ru(Eo||S,function(Lr,zo){Eo&&(zo=Lr,Lr=S[zo]),RR(Pe,zo,Ug(Lr,I,R,zo,S,ve))}),Pe}function vst(S){var I=Lu(S);return function(R){return wCe(R,S,I)}}function wCe(S,I,R){var j=R.length;if(S==null)return!j;for(S=Aa(S);j--;){var oe=R[j],ve=I[oe],Pe=S[oe];if(Pe===t&&!(oe in S)||!ve(Pe))return!1}return!0}function SCe(S,I,R){if(typeof S!="function")throw new Wg(s);return VR(function(){S.apply(t,R)},I)}function OR(S,I,R,j){var oe=-1,ve=Ch,Pe=!0,Ye=S.length,st=[],cn=I.length;if(!Ye)return st;R&&(I=ba(I,ol(R))),j?(ve=V1,Pe=!1):I.length>=r&&(ve=gp,Pe=!1,I=new TE(I));e:for(;++oe<Ye;){var dn=S[oe],yn=R==null?dn:R(dn);if(dn=j||dn!==0?dn:0,Pe&&yn===yn){for(var li=cn;li--;)if(I[li]===yn)continue e;st.push(dn)}else ve(I,yn,j)||st.push(dn)}return st}var U1=QCe(Pv),ECe=QCe(TQ,!0);function bst(S,I){var R=!0;return U1(S,function(j,oe,ve){return R=!!I(j,oe,ve),R}),R}function kB(S,I,R){for(var j=-1,oe=S.length;++j<oe;){var ve=S[j],Pe=I(ve);if(Pe!=null&&(Ye===t?Pe===Pe&&!_p(Pe):R(Pe,Ye)))var Ye=Pe,st=ve}return st}function yst(S,I,R,j){var oe=S.length;for(R=yo(R),R<0&&(R=-R>oe?0:oe+R),j=j===t||j>oe?oe:yo(j),j<0&&(j+=oe),j=R>j?0:Hwe(j);R<j;)S[R++]=I;return S}function xCe(S,I){var R=[];return U1(S,function(j,oe,ve){I(j,oe,ve)&&R.push(j)}),R}function od(S,I,R,j,oe){var ve=-1,Pe=S.length;for(R||(R=lat),oe||(oe=[]);++ve<Pe;){var Ye=S[ve];I>0&&R(Ye)?I>1?od(Ye,I-1,R,j,oe):pp(oe,Ye):j||(oe[oe.length]=Ye)}return oe}var xQ=XCe(),TCe=XCe(!0);function Pv(S,I){return S&&xQ(S,I,Lu)}function TQ(S,I){return S&&TCe(S,I,Lu)}function IB(S,I){return sf(I,function(R){return H0(S[R])})}function IE(S,I){I=q1(I,S);for(var R=0,j=I.length;S!=null&&R<j;)S=S[Fv(I[R++])];return R&&R==j?S:t}function kCe(S,I,R){var j=I(S);return ao(S)?j:pp(j,R(S))}function Sh(S){return S==null?S===t?Z:_n:EE&&EE in Aa(S)?nat(S):gat(S)}function kQ(S,I){return S>I}function Cst(S,I){return S!=null&&ia.call(S,I)}function wst(S,I){return S!=null&&I in Aa(S)}function Sst(S,I,R){return S>=zd(I,R)&&S<au(I,R)}function IQ(S,I,R){for(var j=R?V1:Ch,oe=S[0].length,ve=S.length,Pe=ve,Ye=Mt(ve),st=1/0,cn=[];Pe--;){var dn=S[Pe];Pe&&I&&(dn=ba(dn,ol(I))),st=zd(dn.length,st),Ye[Pe]=!R&&(I||oe>=120&&dn.length>=120)?new TE(Pe&&dn):t}dn=S[0];var yn=-1,li=Ye[0];e:for(;++yn<oe&&cn.length<st;){var Wi=dn[yn],Ir=I?I(Wi):Wi;if(Wi=R||Wi!==0?Wi:0,!(li?gp(li,Ir):j(cn,Ir,R))){for(Pe=ve;--Pe;){var Eo=Ye[Pe];if(!(Eo?gp(Eo,Ir):j(S[Pe],Ir,R)))continue e}li&&li.push(Ir),cn.push(Wi)}}return cn}function Est(S,I,R,j){return Pv(S,function(oe,ve,Pe){I(j,R(oe),ve,Pe)}),j}function PR(S,I,R){I=q1(I,S),S=pwe(S,I);var j=S==null?S:S[Fv(qg(I))];return j==null?t:id(j,S,R)}function ICe(S){return Ul(S)&&Sh(S)==Fe}function xst(S){return Ul(S)&&Sh(S)==me}function Tst(S){return Ul(S)&&Sh(S)==je}function MR(S,I,R,j,oe){return S===I?!0:S==null||I==null||!Ul(S)&&!Ul(I)?S!==S&&I!==I:kst(S,I,R,j,MR,oe)}function kst(S,I,R,j,oe,ve){var Pe=ao(S),Ye=ao(I),st=Pe?He:Ud(S),cn=Ye?He:Ud(I);st=st==Fe?wt:st,cn=cn==Fe?wt:cn;var dn=st==wt,yn=cn==wt,li=st==cn;if(li&&G1(S)){if(!G1(I))return!1;Pe=!0,dn=!1}if(li&&!dn)return ve||(ve=new a_),Pe||DI(S)?awe(S,I,R,j,oe,ve):eat(S,I,st,R,j,oe,ve);if(!(R&g)){var Wi=dn&&ia.call(S,"__wrapped__"),Ir=yn&&ia.call(I,"__wrapped__");if(Wi||Ir){var Eo=Wi?S.value():S,Lr=Ir?I.value():I;return ve||(ve=new a_),oe(Eo,Lr,R,j,ve)}}return li?(ve||(ve=new a_),tat(S,I,R,j,oe,ve)):!1}function Ist(S){return Ul(S)&&Ud(S)==Tt}function LQ(S,I,R,j){var oe=R.length,ve=oe,Pe=!j;if(S==null)return!ve;for(S=Aa(S);oe--;){var Ye=R[oe];if(Pe&&Ye[2]?Ye[1]!==S[Ye[0]]:!(Ye[0]in S))return!1}for(;++oe<ve;){Ye=R[oe];var st=Ye[0],cn=S[st],dn=Ye[1];if(Pe&&Ye[2]){if(cn===t&&!(st in S))return!1}else{var yn=new a_;if(j)var li=j(cn,dn,st,S,I,yn);if(!(li===t?MR(dn,cn,g|m,j,yn):li))return!1}}return!0}function LCe(S){if(!Ll(S)||uat(S))return!1;var I=H0(S)?Iot:Ve;return I.test(DE(S))}function Lst(S){return Ul(S)&&Sh(S)==we}function Dst(S){return Ul(S)&&Ud(S)==Se}function Ast(S){return Ul(S)&&jB(S.length)&&!!kr[Sh(S)]}function DCe(S){return typeof S=="function"?S:S==null?uf:typeof S=="object"?ao(S)?RCe(S[0],S[1]):NCe(S):Zwe(S)}function DQ(S){if(!$R(S))return Oot(S);var I=[];for(var R in Aa(S))ia.call(S,R)&&R!="constructor"&&I.push(R);return I}function Nst(S){if(!Ll(S))return pat(S);var I=$R(S),R=[];for(var j in S)j=="constructor"&&(I||!ia.call(S,j))||R.push(j);return R}function AQ(S,I){return S<I}function ACe(S,I){var R=-1,j=lf(S)?Mt(S.length):[];return U1(S,function(oe,ve,Pe){j[++R]=I(oe,ve,Pe)}),j}function NCe(S){var I=qQ(S);return I.length==1&&I[0][2]?hwe(I[0][0],I[0][1]):function(R){return R===S||LQ(R,S,I)}}function RCe(S,I){return GQ(S)&&dwe(I)?hwe(Fv(S),I):function(R){var j=rX(R,S);return j===t&&j===I?oX(R,S):MR(I,j,g|m)}}function LB(S,I,R,j,oe){S!==I&&xQ(I,function(ve,Pe){if(oe||(oe=new a_),Ll(ve))Rst(S,I,Pe,R,LB,j,oe);else{var Ye=j?j(QQ(S,Pe),ve,Pe+"",S,I,oe):t;Ye===t&&(Ye=ve),SQ(S,Pe,Ye)}},cf)}function Rst(S,I,R,j,oe,ve,Pe){var Ye=QQ(S,R),st=QQ(I,R),cn=Pe.get(st);if(cn){SQ(S,R,cn);return}var dn=ve?ve(Ye,st,R+"",S,I,Pe):t,yn=dn===t;if(yn){var li=ao(st),Wi=!li&&G1(st),Ir=!li&&!Wi&&DI(st);dn=st,li||Wi||Ir?ao(Ye)?dn=Ye:uc(Ye)?dn=af(Ye):Wi?(yn=!1,dn=jCe(st,!0)):Ir?(yn=!1,dn=qCe(st,!0)):dn=[]:HR(st)||AE(st)?(dn=Ye,AE(Ye)?dn=Wwe(Ye):(!Ll(Ye)||H0(Ye))&&(dn=uwe(st))):yn=!1}yn&&(Pe.set(st,dn),oe(dn,st,j,ve,Pe),Pe.delete(st)),SQ(S,R,dn)}function OCe(S,I){var R=S.length;if(R)return I+=I<0?R:0,V0(I,R)?S[I]:t}function PCe(S,I,R){I.length?I=ba(I,function(ve){return ao(ve)?function(Pe){return IE(Pe,ve.length===1?ve[0]:ve)}:ve}):I=[uf];var j=-1;I=ba(I,ol(br()));var oe=ACe(S,function(ve,Pe,Ye){var st=ba(I,function(cn){return cn(ve)});return{criteria:st,index:++j,value:ve}});return Rr(oe,function(ve,Pe){return qst(ve,Pe,R)})}function Ost(S,I){return MCe(S,I,function(R,j){return oX(S,j)})}function MCe(S,I,R){for(var j=-1,oe=I.length,ve={};++j<oe;){var Pe=I[j],Ye=IE(S,Pe);R(Ye,Pe)&&FR(ve,q1(Pe,S),Ye)}return ve}function Pst(S){return function(I){return IE(I,S)}}function NQ(S,I,R,j){var oe=j?Fn:Kt,ve=-1,Pe=I.length,Ye=S;for(S===I&&(I=af(I)),R&&(Ye=ba(S,ol(R)));++ve<Pe;)for(var st=0,cn=I[ve],dn=R?R(cn):cn;(st=oe(Ye,dn,st,j))>-1;)Ye!==S&&bB.call(Ye,st,1),bB.call(S,st,1);return S}function FCe(S,I){for(var R=S?I.length:0,j=R-1;R--;){var oe=I[R];if(R==j||oe!==ve){var ve=oe;V0(oe)?bB.call(S,oe,1):MQ(S,oe)}}return S}function RQ(S,I){return S+wB(_Ce()*(I-S+1))}function Mst(S,I,R,j){for(var oe=-1,ve=au(CB((I-S)/(R||1)),0),Pe=Mt(ve);ve--;)Pe[j?ve:++oe]=S,S+=R;return Pe}function OQ(S,I){var R="";if(!S||I<1||I>W)return R;do I%2&&(R+=S),I=wB(I/2),I&&(S+=S);while(I);return R}function Lo(S,I){return XQ(fwe(S,I,uf),S+"")}function Fst(S){return yCe(AI(S))}function Bst(S,I){var R=AI(S);return $B(R,kE(I,0,R.length))}function FR(S,I,R,j){if(!Ll(S))return S;I=q1(I,S);for(var oe=-1,ve=I.length,Pe=ve-1,Ye=S;Ye!=null&&++oe<ve;){var st=Fv(I[oe]),cn=R;if(st==="__proto__"||st==="constructor"||st==="prototype")return S;if(oe!=Pe){var dn=Ye[st];cn=j?j(dn,st,Ye):t,cn===t&&(cn=Ll(dn)?dn:V0(I[oe+1])?[]:{})}RR(Ye,st,cn),Ye=Ye[st]}return S}var BCe=SB?function(S,I){return SB.set(S,I),S}:uf,$st=yB?function(S,I){return yB(S,"toString",{configurable:!0,enumerable:!1,value:aX(I),writable:!0})}:uf;function Vst(S){return $B(AI(S))}function jg(S,I,R){var j=-1,oe=S.length;I<0&&(I=-I>oe?0:oe+I),R=R>oe?oe:R,R<0&&(R+=oe),oe=I>R?0:R-I>>>0,I>>>=0;for(var ve=Mt(oe);++j<oe;)ve[j]=S[j+I];return ve}function Hst(S,I){var R;return U1(S,function(j,oe,ve){return R=I(j,oe,ve),!R}),!!R}function DB(S,I,R){var j=0,oe=S==null?j:S.length;if(typeof I=="number"&&I===I&&oe<=Q){for(;j<oe;){var ve=j+oe>>>1,Pe=S[ve];Pe!==null&&!_p(Pe)&&(R?Pe<=I:Pe<I)?j=ve+1:oe=ve}return oe}return PQ(S,I,uf,R)}function PQ(S,I,R,j){var oe=0,ve=S==null?0:S.length;if(ve===0)return 0;I=R(I);for(var Pe=I!==I,Ye=I===null,st=_p(I),cn=I===t;oe<ve;){var dn=wB((oe+ve)/2),yn=R(S[dn]),li=yn!==t,Wi=yn===null,Ir=yn===yn,Eo=_p(yn);if(Pe)var Lr=j||Ir;else cn?Lr=Ir&&(j||li):Ye?Lr=Ir&&li&&(j||!Wi):st?Lr=Ir&&li&&!Wi&&(j||!Eo):Wi||Eo?Lr=!1:Lr=j?yn<=I:yn<I;Lr?oe=dn+1:ve=dn}return zd(ve,se)}function $Ce(S,I){for(var R=-1,j=S.length,oe=0,ve=[];++R<j;){var Pe=S[R],Ye=I?I(Pe):Pe;if(!R||!l_(Ye,st)){var st=Ye;ve[oe++]=Pe===0?0:Pe}}return ve}function VCe(S){return typeof S=="number"?S:_p(S)?H:+S}function mp(S){if(typeof S=="string")return S;if(ao(S))return ba(S,mp)+"";if(_p(S))return vCe?vCe.call(S):"";var I=S+"";return I=="0"&&1/S==-U?"-0":I}function j1(S,I,R){var j=-1,oe=Ch,ve=S.length,Pe=!0,Ye=[],st=Ye;if(R)Pe=!1,oe=V1;else if(ve>=r){var cn=I?null:Zst(S);if(cn)return dB(cn);Pe=!1,oe=gp,st=new TE}else st=I?[]:Ye;e:for(;++j<ve;){var dn=S[j],yn=I?I(dn):dn;if(dn=R||dn!==0?dn:0,Pe&&yn===yn){for(var li=st.length;li--;)if(st[li]===yn)continue e;I&&st.push(yn),Ye.push(dn)}else oe(st,yn,R)||(st!==Ye&&st.push(yn),Ye.push(dn))}return Ye}function MQ(S,I){return I=q1(I,S),S=pwe(S,I),S==null||delete S[Fv(qg(I))]}function HCe(S,I,R,j){return FR(S,I,R(IE(S,I)),j)}function AB(S,I,R,j){for(var oe=S.length,ve=j?oe:-1;(j?ve--:++ve<oe)&&I(S[ve],ve,S););return R?jg(S,j?0:ve,j?ve+1:oe):jg(S,j?ve+1:0,j?oe:ve)}function WCe(S,I){var R=S;return R instanceof Xo&&(R=R.value()),vl(I,function(j,oe){return oe.func.apply(oe.thisArg,pp([j],oe.args))},R)}function FQ(S,I,R){var j=S.length;if(j<2)return j?j1(S[0]):[];for(var oe=-1,ve=Mt(j);++oe<j;)for(var Pe=S[oe],Ye=-1;++Ye<j;)Ye!=oe&&(ve[oe]=OR(ve[oe]||Pe,S[Ye],I,R));return j1(od(ve,1),I,R)}function zCe(S,I,R){for(var j=-1,oe=S.length,ve=I.length,Pe={};++j<oe;){var Ye=j<ve?I[j]:t;R(Pe,S[j],Ye)}return Pe}function BQ(S){return uc(S)?S:[]}function $Q(S){return typeof S=="function"?S:uf}function q1(S,I){return ao(S)?S:GQ(S,I)?[S]:vwe(Us(S))}var Wst=Lo;function K1(S,I,R){var j=S.length;return R=R===t?j:R,!I&&R>=j?S:jg(S,I,R)}var UCe=Lot||function(S){return _l.clearTimeout(S)};function jCe(S,I){if(I)return S.slice();var R=S.length,j=hCe?hCe(R):new S.constructor(R);return S.copy(j),j}function VQ(S){var I=new S.constructor(S.byteLength);return new _B(I).set(new _B(S)),I}function zst(S,I){var R=I?VQ(S.buffer):S.buffer;return new S.constructor(R,S.byteOffset,S.byteLength)}function Ust(S){var I=new S.constructor(S.source,ut.exec(S));return I.lastIndex=S.lastIndex,I}function jst(S){return NR?Aa(NR.call(S)):{}}function qCe(S,I){var R=I?VQ(S.buffer):S.buffer;return new S.constructor(R,S.byteOffset,S.length)}function KCe(S,I){if(S!==I){var R=S!==t,j=S===null,oe=S===S,ve=_p(S),Pe=I!==t,Ye=I===null,st=I===I,cn=_p(I);if(!Ye&&!cn&&!ve&&S>I||ve&&Pe&&st&&!Ye&&!cn||j&&Pe&&st||!R&&st||!oe)return 1;if(!j&&!ve&&!cn&&S<I||cn&&R&&oe&&!j&&!ve||Ye&&R&&oe||!Pe&&oe||!st)return-1}return 0}function qst(S,I,R){for(var j=-1,oe=S.criteria,ve=I.criteria,Pe=oe.length,Ye=R.length;++j<Pe;){var st=KCe(oe[j],ve[j]);if(st){if(j>=Ye)return st;var cn=R[j];return st*(cn=="desc"?-1:1)}}return S.index-I.index}function GCe(S,I,R,j){for(var oe=-1,ve=S.length,Pe=R.length,Ye=-1,st=I.length,cn=au(ve-Pe,0),dn=Mt(st+cn),yn=!j;++Ye<st;)dn[Ye]=I[Ye];for(;++oe<Pe;)(yn||oe<ve)&&(dn[R[oe]]=S[oe]);for(;cn--;)dn[Ye++]=S[oe++];return dn}function YCe(S,I,R,j){for(var oe=-1,ve=S.length,Pe=-1,Ye=R.length,st=-1,cn=I.length,dn=au(ve-Ye,0),yn=Mt(dn+cn),li=!j;++oe<dn;)yn[oe]=S[oe];for(var Wi=oe;++st<cn;)yn[Wi+st]=I[st];for(;++Pe<Ye;)(li||oe<ve)&&(yn[Wi+R[Pe]]=S[oe++]);return yn}function af(S,I){var R=-1,j=S.length;for(I||(I=Mt(j));++R<j;)I[R]=S[R];return I}function Mv(S,I,R,j){var oe=!R;R||(R={});for(var ve=-1,Pe=I.length;++ve<Pe;){var Ye=I[ve],st=j?j(R[Ye],S[Ye],Ye,R,S):t;st===t&&(st=S[Ye]),oe?F0(R,Ye,st):RR(R,Ye,st)}return R}function Kst(S,I){return Mv(S,KQ(S),I)}function Gst(S,I){return Mv(S,lwe(S),I)}function NB(S,I){return function(R,j){var oe=ao(R)?wR:mst,ve=I?I():{};return oe(R,S,br(j,2),ve)}}function kI(S){return Lo(function(I,R){var j=-1,oe=R.length,ve=oe>1?R[oe-1]:t,Pe=oe>2?R[2]:t;for(ve=S.length>3&&typeof ve=="function"?(oe--,ve):t,Pe&&Eh(R[0],R[1],Pe)&&(ve=oe<3?t:ve,oe=1),I=Aa(I);++j<oe;){var Ye=R[j];Ye&&S(I,Ye,j,ve)}return I})}function QCe(S,I){return function(R,j){if(R==null)return R;if(!lf(R))return S(R,j);for(var oe=R.length,ve=I?oe:-1,Pe=Aa(R);(I?ve--:++ve<oe)&&j(Pe[ve],ve,Pe)!==!1;);return R}}function XCe(S){return function(I,R,j){for(var oe=-1,ve=Aa(I),Pe=j(I),Ye=Pe.length;Ye--;){var st=Pe[S?Ye:++oe];if(R(ve[st],st,ve)===!1)break}return I}}function Yst(S,I,R){var j=I&v,oe=BR(S);function ve(){var Pe=this&&this!==_l&&this instanceof ve?oe:S;return Pe.apply(j?R:this,arguments)}return ve}function ZCe(S){return function(I){I=Us(I);var R=H1(I)?s_(I):t,j=R?R[0]:I.charAt(0),oe=R?K1(R,1).join(""):I.slice(1);return j[S]()+oe}}function II(S){return function(I){return vl(Qwe(Ywe(I).replace(vn,"")),S,"")}}function BR(S){return function(){var I=arguments;switch(I.length){case 0:return new S;case 1:return new S(I[0]);case 2:return new S(I[0],I[1]);case 3:return new S(I[0],I[1],I[2]);case 4:return new S(I[0],I[1],I[2],I[3]);case 5:return new S(I[0],I[1],I[2],I[3],I[4]);case 6:return new S(I[0],I[1],I[2],I[3],I[4],I[5]);case 7:return new S(I[0],I[1],I[2],I[3],I[4],I[5],I[6])}var R=TI(S.prototype),j=S.apply(R,I);return Ll(j)?j:R}}function Qst(S,I,R){var j=BR(S);function oe(){for(var ve=arguments.length,Pe=Mt(ve),Ye=ve,st=LI(oe);Ye--;)Pe[Ye]=arguments[Ye];var cn=ve<3&&Pe[0]!==st&&Pe[ve-1]!==st?[]:W1(Pe,st);if(ve-=cn.length,ve<R)return iwe(S,I,RB,oe.placeholder,t,Pe,cn,t,t,R-ve);var dn=this&&this!==_l&&this instanceof oe?j:S;return id(dn,this,Pe)}return oe}function JCe(S){return function(I,R,j){var oe=Aa(I);if(!lf(I)){var ve=br(R,3);I=Lu(I),R=function(Ye){return ve(oe[Ye],Ye,oe)}}var Pe=S(I,R,j);return Pe>-1?oe[ve?I[Pe]:Pe]:t}}function ewe(S){return $0(function(I){var R=I.length,j=R,oe=zg.prototype.thru;for(S&&I.reverse();j--;){var ve=I[j];if(typeof ve!="function")throw new Wg(s);if(oe&&!Pe&&FB(ve)=="wrapper")var Pe=new zg([],!0)}for(j=Pe?j:R;++j<R;){ve=I[j];var Ye=FB(ve),st=Ye=="wrapper"?jQ(ve):t;st&&YQ(st[0])&&st[1]==(k|y|x|L)&&!st[4].length&&st[9]==1?Pe=Pe[FB(st[0])].apply(Pe,st[3]):Pe=ve.length==1&&YQ(ve)?Pe[Ye]():Pe.thru(ve)}return function(){var cn=arguments,dn=cn[0];if(Pe&&cn.length==1&&ao(dn))return Pe.plant(dn).value();for(var yn=0,li=R?I[yn].apply(this,cn):dn;++yn<R;)li=I[yn].call(this,li);return li}})}function RB(S,I,R,j,oe,ve,Pe,Ye,st,cn){var dn=I&k,yn=I&v,li=I&_,Wi=I&(y|C),Ir=I&D,Eo=li?t:BR(S);function Lr(){for(var zo=arguments.length,ss=Mt(zo),vp=zo;vp--;)ss[vp]=arguments[vp];if(Wi)var xh=LI(Lr),bp=lB(ss,xh);if(j&&(ss=GCe(ss,j,oe,Wi)),ve&&(ss=YCe(ss,ve,Pe,Wi)),zo-=bp,Wi&&zo<cn){var dc=W1(ss,xh);return iwe(S,I,RB,Lr.placeholder,R,ss,dc,Ye,st,cn-zo)}var c_=yn?R:this,z0=li?c_[S]:S;return zo=ss.length,Ye?ss=mat(ss,Ye):Ir&&zo>1&&ss.reverse(),dn&&st<zo&&(ss.length=st),this&&this!==_l&&this instanceof Lr&&(z0=Eo||BR(z0)),z0.apply(c_,ss)}return Lr}function twe(S,I){return function(R,j){return Est(R,S,I(j),{})}}function OB(S,I){return function(R,j){var oe;if(R===t&&j===t)return I;if(R!==t&&(oe=R),j!==t){if(oe===t)return j;typeof R=="string"||typeof j=="string"?(R=mp(R),j=mp(j)):(R=VCe(R),j=VCe(j)),oe=S(R,j)}return oe}}function HQ(S){return $0(function(I){return I=ba(I,ol(br())),Lo(function(R){var j=this;return S(I,function(oe){return id(oe,j,R)})})})}function PB(S,I){I=I===t?" ":mp(I);var R=I.length;if(R<2)return R?OQ(I,S):I;var j=OQ(I,CB(S/CI(I)));return H1(I)?K1(s_(j),0,S).join(""):j.slice(0,S)}function Xst(S,I,R,j){var oe=I&v,ve=BR(S);function Pe(){for(var Ye=-1,st=arguments.length,cn=-1,dn=j.length,yn=Mt(dn+st),li=this&&this!==_l&&this instanceof Pe?ve:S;++cn<dn;)yn[cn]=j[cn];for(;st--;)yn[cn++]=arguments[++Ye];return id(li,oe?R:this,yn)}return Pe}function nwe(S){return function(I,R,j){return j&&typeof j!="number"&&Eh(I,R,j)&&(R=j=t),I=W0(I),R===t?(R=I,I=0):R=W0(R),j=j===t?I<R?1:-1:W0(j),Mst(I,R,j,S)}}function MB(S){return function(I,R){return typeof I=="string"&&typeof R=="string"||(I=Kg(I),R=Kg(R)),S(I,R)}}function iwe(S,I,R,j,oe,ve,Pe,Ye,st,cn){var dn=I&y,yn=dn?Pe:t,li=dn?t:Pe,Wi=dn?ve:t,Ir=dn?t:ve;I|=dn?x:E,I&=~(dn?E:x),I&b||(I&=~(v|_));var Eo=[S,I,oe,Wi,yn,Ir,li,Ye,st,cn],Lr=R.apply(t,Eo);return YQ(S)&&gwe(Lr,Eo),Lr.placeholder=j,mwe(Lr,S,I)}function WQ(S){var I=su[S];return function(R,j){if(R=Kg(R),j=j==null?0:zd(yo(j),292),j&&mCe(R)){var oe=(Us(R)+"e").split("e"),ve=I(oe[0]+"e"+(+oe[1]+j));return oe=(Us(ve)+"e").split("e"),+(oe[0]+"e"+(+oe[1]-j))}return I(R)}}var Zst=EI&&1/dB(new EI([,-0]))[1]==U?function(S){return new EI(S)}:uX;function rwe(S){return function(I){var R=Ud(I);return R==Tt?TR(I):R==Se?got(I):Mc(I,S(I))}}function B0(S,I,R,j,oe,ve,Pe,Ye){var st=I&_;if(!st&&typeof S!="function")throw new Wg(s);var cn=j?j.length:0;if(cn||(I&=~(x|E),j=oe=t),Pe=Pe===t?Pe:au(yo(Pe),0),Ye=Ye===t?Ye:yo(Ye),cn-=oe?oe.length:0,I&E){var dn=j,yn=oe;j=oe=t}var li=st?t:jQ(S),Wi=[S,I,R,j,oe,dn,yn,ve,Pe,Ye];if(li&&fat(Wi,li),S=Wi[0],I=Wi[1],R=Wi[2],j=Wi[3],oe=Wi[4],Ye=Wi[9]=Wi[9]===t?st?0:S.length:au(Wi[9]-cn,0),!Ye&&I&(y|C)&&(I&=~(y|C)),!I||I==v)var Ir=Yst(S,I,R);else I==y||I==C?Ir=Qst(S,I,Ye):(I==x||I==(v|x))&&!oe.length?Ir=Xst(S,I,R,j):Ir=RB.apply(t,Wi);var Eo=li?BCe:gwe;return mwe(Eo(Ir,Wi),S,I)}function owe(S,I,R,j){return S===t||l_(S,SI[R])&&!ia.call(j,R)?I:S}function swe(S,I,R,j,oe,ve){return Ll(S)&&Ll(I)&&(ve.set(I,S),LB(S,I,t,swe,ve),ve.delete(I)),S}function Jst(S){return HR(S)?t:S}function awe(S,I,R,j,oe,ve){var Pe=R&g,Ye=S.length,st=I.length;if(Ye!=st&&!(Pe&&st>Ye))return!1;var cn=ve.get(S),dn=ve.get(I);if(cn&&dn)return cn==I&&dn==S;var yn=-1,li=!0,Wi=R&m?new TE:t;for(ve.set(S,I),ve.set(I,S);++yn<Ye;){var Ir=S[yn],Eo=I[yn];if(j)var Lr=Pe?j(Eo,Ir,yn,I,S,ve):j(Ir,Eo,yn,S,I,ve);if(Lr!==t){if(Lr)continue;li=!1;break}if(Wi){if(!SE(I,function(zo,ss){if(!gp(Wi,ss)&&(Ir===zo||oe(Ir,zo,R,j,ve)))return Wi.push(ss)})){li=!1;break}}else if(!(Ir===Eo||oe(Ir,Eo,R,j,ve))){li=!1;break}}return ve.delete(S),ve.delete(I),li}function eat(S,I,R,j,oe,ve,Pe){switch(R){case Oe:if(S.byteLength!=I.byteLength||S.byteOffset!=I.byteOffset)return!1;S=S.buffer,I=I.buffer;case me:return!(S.byteLength!=I.byteLength||!ve(new _B(S),new _B(I)));case Me:case je:case rn:return l_(+S,+I);case Be:return S.name==I.name&&S.message==I.message;case we:case re:return S==I+"";case Tt:var Ye=TR;case Se:var st=j&g;if(Ye||(Ye=dB),S.size!=I.size&&!st)return!1;var cn=Pe.get(S);if(cn)return cn==I;j|=m,Pe.set(S,I);var dn=awe(Ye(S),Ye(I),j,oe,ve,Pe);return Pe.delete(S),dn;case Y:if(NR)return NR.call(S)==NR.call(I)}return!1}function tat(S,I,R,j,oe,ve){var Pe=R&g,Ye=zQ(S),st=Ye.length,cn=zQ(I),dn=cn.length;if(st!=dn&&!Pe)return!1;for(var yn=st;yn--;){var li=Ye[yn];if(!(Pe?li in I:ia.call(I,li)))return!1}var Wi=ve.get(S),Ir=ve.get(I);if(Wi&&Ir)return Wi==I&&Ir==S;var Eo=!0;ve.set(S,I),ve.set(I,S);for(var Lr=Pe;++yn<st;){li=Ye[yn];var zo=S[li],ss=I[li];if(j)var vp=Pe?j(ss,zo,li,I,S,ve):j(zo,ss,li,S,I,ve);if(!(vp===t?zo===ss||oe(zo,ss,R,j,ve):vp)){Eo=!1;break}Lr||(Lr=li=="constructor")}if(Eo&&!Lr){var xh=S.constructor,bp=I.constructor;xh!=bp&&"constructor"in S&&"constructor"in I&&!(typeof xh=="function"&&xh instanceof xh&&typeof bp=="function"&&bp instanceof bp)&&(Eo=!1)}return ve.delete(S),ve.delete(I),Eo}function $0(S){return XQ(fwe(S,t,wwe),S+"")}function zQ(S){return kCe(S,Lu,KQ)}function UQ(S){return kCe(S,cf,lwe)}var jQ=SB?function(S){return SB.get(S)}:uX;function FB(S){for(var I=S.name+"",R=xI[I],j=ia.call(xI,I)?R.length:0;j--;){var oe=R[j],ve=oe.func;if(ve==null||ve==S)return oe.name}return I}function LI(S){var I=ia.call(ge,"placeholder")?ge:S;return I.placeholder}function br(){var S=ge.iteratee||lX;return S=S===lX?DCe:S,arguments.length?S(arguments[0],arguments[1]):S}function BB(S,I){var R=S.__data__;return cat(I)?R[typeof I=="string"?"string":"hash"]:R.map}function qQ(S){for(var I=Lu(S),R=I.length;R--;){var j=I[R],oe=S[j];I[R]=[j,oe,dwe(oe)]}return I}function LE(S,I){var R=uB(S,I);return LCe(R)?R:t}function nat(S){var I=ia.call(S,EE),R=S[EE];try{S[EE]=t;var j=!0}catch{}var oe=gB.call(S);return j&&(I?S[EE]=R:delete S[EE]),oe}var KQ=yQ?function(S){return S==null?[]:(S=Aa(S),sf(yQ(S),function(I){return pCe.call(S,I)}))}:dX,lwe=yQ?function(S){for(var I=[];S;)pp(I,KQ(S)),S=vB(S);return I}:dX,Ud=Sh;(CQ&&Ud(new CQ(new ArrayBuffer(1)))!=Oe||LR&&Ud(new LR)!=Tt||wQ&&Ud(wQ.resolve())!=pt||EI&&Ud(new EI)!=Se||DR&&Ud(new DR)!=le)&&(Ud=function(S){var I=Sh(S),R=I==wt?S.constructor:t,j=R?DE(R):"";if(j)switch(j){case Bot:return Oe;case $ot:return Tt;case Vot:return pt;case Hot:return Se;case Wot:return le}return I});function iat(S,I,R){for(var j=-1,oe=R.length;++j<oe;){var ve=R[j],Pe=ve.size;switch(ve.type){case"drop":S+=Pe;break;case"dropRight":I-=Pe;break;case"take":I=zd(I,S+Pe);break;case"takeRight":S=au(S,I-Pe);break}}return{start:S,end:I}}function rat(S){var I=S.match(hi);return I?I[1].split(to):[]}function cwe(S,I,R){I=q1(I,S);for(var j=-1,oe=I.length,ve=!1;++j<oe;){var Pe=Fv(I[j]);if(!(ve=S!=null&&R(S,Pe)))break;S=S[Pe]}return ve||++j!=oe?ve:(oe=S==null?0:S.length,!!oe&&jB(oe)&&V0(Pe,oe)&&(ao(S)||AE(S)))}function oat(S){var I=S.length,R=new S.constructor(I);return I&&typeof S[0]=="string"&&ia.call(S,"index")&&(R.index=S.index,R.input=S.input),R}function uwe(S){return typeof S.constructor=="function"&&!$R(S)?TI(vB(S)):{}}function sat(S,I,R){var j=S.constructor;switch(I){case me:return VQ(S);case Me:case je:return new j(+S);case Oe:return zst(S,R);case et:case Et:case Qe:case At:case Ut:case fe:case Re:case Je:case Ot:return qCe(S,R);case Tt:return new j;case rn:case re:return new j(S);case we:return Ust(S);case Se:return new j;case Y:return jst(S)}}function aat(S,I){var R=I.length;if(!R)return S;var j=R-1;return I[j]=(R>1?"& ":"")+I[j],I=I.join(R>2?", ":" "),S.replace(on,`{ /* [wrapped with `+I+`] */ `)}function lat(S){return ao(S)||AE(S)||!!(gCe&&S&&S[gCe])}function V0(S,I){var R=typeof S;return I=I??W,!!I&&(R=="number"||R!="symbol"&&Xe.test(S))&&S>-1&&S%1==0&&S<I}function Eh(S,I,R){if(!Ll(R))return!1;var j=typeof I;return(j=="number"?lf(R)&&V0(I,R.length):j=="string"&&I in R)?l_(R[I],S):!1}function GQ(S,I){if(ao(S))return!1;var R=typeof S;return R=="number"||R=="symbol"||R=="boolean"||S==null||_p(S)?!0:ro.test(S)||!Pr.test(S)||I!=null&&S in Aa(I)}function cat(S){var I=typeof S;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?S!=="__proto__":S===null}function YQ(S){var I=FB(S),R=ge[I];if(typeof R!="function"||!(I in Xo.prototype))return!1;if(S===R)return!0;var j=jQ(R);return!!j&&S===j[0]}function uat(S){return!!dCe&&dCe in S}var dat=fB?H0:hX;function $R(S){var I=S&&S.constructor,R=typeof I=="function"&&I.prototype||SI;return S===R}function dwe(S){return S===S&&!Ll(S)}function hwe(S,I){return function(R){return R==null?!1:R[S]===I&&(I!==t||S in Aa(R))}}function hat(S){var I=zB(S,function(j){return R.size===c&&R.clear(),j}),R=I.cache;return I}function fat(S,I){var R=S[1],j=I[1],oe=R|j,ve=oe<(v|_|k),Pe=j==k&&R==y||j==k&&R==L&&S[7].length<=I[8]||j==(k|L)&&I[7].length<=I[8]&&R==y;if(!(ve||Pe))return S;j&v&&(S[2]=I[2],oe|=R&v?0:b);var Ye=I[3];if(Ye){var st=S[3];S[3]=st?GCe(st,Ye,I[4]):Ye,S[4]=st?W1(S[3],u):I[4]}return Ye=I[5],Ye&&(st=S[5],S[5]=st?YCe(st,Ye,I[6]):Ye,S[6]=st?W1(S[5],u):I[6]),Ye=I[7],Ye&&(S[7]=Ye),j&k&&(S[8]=S[8]==null?I[8]:zd(S[8],I[8])),S[9]==null&&(S[9]=I[9]),S[0]=I[0],S[1]=oe,S}function pat(S){var I=[];if(S!=null)for(var R in Aa(S))I.push(R);return I}function gat(S){return gB.call(S)}function fwe(S,I,R){return I=au(I===t?S.length-1:I,0),function(){for(var j=arguments,oe=-1,ve=au(j.length-I,0),Pe=Mt(ve);++oe<ve;)Pe[oe]=j[I+oe];oe=-1;for(var Ye=Mt(I+1);++oe<I;)Ye[oe]=j[oe];return Ye[I]=R(Pe),id(S,this,Ye)}}function pwe(S,I){return I.length<2?S:IE(S,jg(I,0,-1))}function mat(S,I){for(var R=S.length,j=zd(I.length,R),oe=af(S);j--;){var ve=I[j];S[j]=V0(ve,R)?oe[ve]:t}return S}function QQ(S,I){if(!(I==="constructor"&&typeof S[I]=="function")&&I!="__proto__")return S[I]}var gwe=_we(BCe),VR=Aot||function(S,I){return _l.setTimeout(S,I)},XQ=_we($st);function mwe(S,I,R){var j=I+"";return XQ(S,aat(j,_at(rat(j),R)))}function _we(S){var I=0,R=0;return function(){var j=Pot(),oe=F-(j-R);if(R=j,oe>0){if(++I>=P)return arguments[0]}else I=0;return S.apply(t,arguments)}}function $B(S,I){var R=-1,j=S.length,oe=j-1;for(I=I===t?j:I;++R<I;){var ve=RQ(R,oe),Pe=S[ve];S[ve]=S[R],S[R]=Pe}return S.length=I,S}var vwe=hat(function(S){var I=[];return S.charCodeAt(0)===46&&I.push(""),S.replace(Vo,function(R,j,oe,ve){I.push(oe?ve.replace(qt,"$1"):j||R)}),I});function Fv(S){if(typeof S=="string"||_p(S))return S;var I=S+"";return I=="0"&&1/S==-U?"-0":I}function DE(S){if(S!=null){try{return pB.call(S)}catch{}try{return S+""}catch{}}return""}function _at(S,I){return ru(Ee,function(R){var j="_."+R[0];I&R[1]&&!Ch(S,j)&&S.push(j)}),S.sort()}function bwe(S){if(S instanceof Xo)return S.clone();var I=new zg(S.__wrapped__,S.__chain__);return I.__actions__=af(S.__actions__),I.__index__=S.__index__,I.__values__=S.__values__,I}function vat(S,I,R){(R?Eh(S,I,R):I===t)?I=1:I=au(yo(I),0);var j=S==null?0:S.length;if(!j||I<1)return[];for(var oe=0,ve=0,Pe=Mt(CB(j/I));oe<j;)Pe[ve++]=jg(S,oe,oe+=I);return Pe}function bat(S){for(var I=-1,R=S==null?0:S.length,j=0,oe=[];++I<R;){var ve=S[I];ve&&(oe[j++]=ve)}return oe}function yat(){var S=arguments.length;if(!S)return[];for(var I=Mt(S-1),R=arguments[0],j=S;j--;)I[j-1]=arguments[j];return pp(ao(R)?af(R):[R],od(I,1))}var Cat=Lo(function(S,I){return uc(S)?OR(S,od(I,1,uc,!0)):[]}),wat=Lo(function(S,I){var R=qg(I);return uc(R)&&(R=t),uc(S)?OR(S,od(I,1,uc,!0),br(R,2)):[]}),Sat=Lo(function(S,I){var R=qg(I);return uc(R)&&(R=t),uc(S)?OR(S,od(I,1,uc,!0),t,R):[]});function Eat(S,I,R){var j=S==null?0:S.length;return j?(I=R||I===t?1:yo(I),jg(S,I<0?0:I,j)):[]}function xat(S,I,R){var j=S==null?0:S.length;return j?(I=R||I===t?1:yo(I),I=j-I,jg(S,0,I<0?0:I)):[]}function Tat(S,I){return S&&S.length?AB(S,br(I,3),!0,!0):[]}function kat(S,I){return S&&S.length?AB(S,br(I,3),!0):[]}function Iat(S,I,R,j){var oe=S==null?0:S.length;return oe?(R&&typeof R!="number"&&Eh(S,I,R)&&(R=0,j=oe),yst(S,I,R,j)):[]}function ywe(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var oe=R==null?0:yo(R);return oe<0&&(oe=au(j+oe,0)),Ne(S,br(I,3),oe)}function Cwe(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var oe=j-1;return R!==t&&(oe=yo(R),oe=R<0?au(j+oe,0):zd(oe,j-1)),Ne(S,br(I,3),oe,!0)}function wwe(S){var I=S==null?0:S.length;return I?od(S,1):[]}function Lat(S){var I=S==null?0:S.length;return I?od(S,U):[]}function Dat(S,I){var R=S==null?0:S.length;return R?(I=I===t?1:yo(I),od(S,I)):[]}function Aat(S){for(var I=-1,R=S==null?0:S.length,j={};++I<R;){var oe=S[I];j[oe[0]]=oe[1]}return j}function Swe(S){return S&&S.length?S[0]:t}function Nat(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var oe=R==null?0:yo(R);return oe<0&&(oe=au(j+oe,0)),Kt(S,I,oe)}function Rat(S){var I=S==null?0:S.length;return I?jg(S,0,-1):[]}var Oat=Lo(function(S){var I=ba(S,BQ);return I.length&&I[0]===S[0]?IQ(I):[]}),Pat=Lo(function(S){var I=qg(S),R=ba(S,BQ);return I===qg(R)?I=t:R.pop(),R.length&&R[0]===S[0]?IQ(R,br(I,2)):[]}),Mat=Lo(function(S){var I=qg(S),R=ba(S,BQ);return I=typeof I=="function"?I:t,I&&R.pop(),R.length&&R[0]===S[0]?IQ(R,t,I):[]});function Fat(S,I){return S==null?"":Rot.call(S,I)}function qg(S){var I=S==null?0:S.length;return I?S[I-1]:t}function Bat(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var oe=j;return R!==t&&(oe=yo(R),oe=oe<0?au(j+oe,0):zd(oe,j-1)),I===I?_ot(S,I,oe):Ne(S,ki,oe,!0)}function $at(S,I){return S&&S.length?OCe(S,yo(I)):t}var Vat=Lo(Ewe);function Ewe(S,I){return S&&S.length&&I&&I.length?NQ(S,I):S}function Hat(S,I,R){return S&&S.length&&I&&I.length?NQ(S,I,br(R,2)):S}function Wat(S,I,R){return S&&S.length&&I&&I.length?NQ(S,I,t,R):S}var zat=$0(function(S,I){var R=S==null?0:S.length,j=EQ(S,I);return FCe(S,ba(I,function(oe){return V0(oe,R)?+oe:oe}).sort(KCe)),j});function Uat(S,I){var R=[];if(!(S&&S.length))return R;var j=-1,oe=[],ve=S.length;for(I=br(I,3);++j<ve;){var Pe=S[j];I(Pe,j,S)&&(R.push(Pe),oe.push(j))}return FCe(S,oe),R}function ZQ(S){return S==null?S:Fot.call(S)}function jat(S,I,R){var j=S==null?0:S.length;return j?(R&&typeof R!="number"&&Eh(S,I,R)?(I=0,R=j):(I=I==null?0:yo(I),R=R===t?j:yo(R)),jg(S,I,R)):[]}function qat(S,I){return DB(S,I)}function Kat(S,I,R){return PQ(S,I,br(R,2))}function Gat(S,I){var R=S==null?0:S.length;if(R){var j=DB(S,I);if(j<R&&l_(S[j],I))return j}return-1}function Yat(S,I){return DB(S,I,!0)}function Qat(S,I,R){return PQ(S,I,br(R,2),!0)}function Xat(S,I){var R=S==null?0:S.length;if(R){var j=DB(S,I,!0)-1;if(l_(S[j],I))return j}return-1}function Zat(S){return S&&S.length?$Ce(S):[]}function Jat(S,I){return S&&S.length?$Ce(S,br(I,2)):[]}function elt(S){var I=S==null?0:S.length;return I?jg(S,1,I):[]}function tlt(S,I,R){return S&&S.length?(I=R||I===t?1:yo(I),jg(S,0,I<0?0:I)):[]}function nlt(S,I,R){var j=S==null?0:S.length;return j?(I=R||I===t?1:yo(I),I=j-I,jg(S,I<0?0:I,j)):[]}function ilt(S,I){return S&&S.length?AB(S,br(I,3),!1,!0):[]}function rlt(S,I){return S&&S.length?AB(S,br(I,3)):[]}var olt=Lo(function(S){return j1(od(S,1,uc,!0))}),slt=Lo(function(S){var I=qg(S);return uc(I)&&(I=t),j1(od(S,1,uc,!0),br(I,2))}),alt=Lo(function(S){var I=qg(S);return I=typeof I=="function"?I:t,j1(od(S,1,uc,!0),t,I)});function llt(S){return S&&S.length?j1(S):[]}function clt(S,I){return S&&S.length?j1(S,br(I,2)):[]}function ult(S,I){return I=typeof I=="function"?I:t,S&&S.length?j1(S,t,I):[]}function JQ(S){if(!(S&&S.length))return[];var I=0;return S=sf(S,function(R){if(uc(R))return I=au(R.length,I),!0}),_s(I,function(R){return ba(S,Fo(R))})}function xwe(S,I){if(!(S&&S.length))return[];var R=JQ(S);return I==null?R:ba(R,function(j){return id(I,t,j)})}var dlt=Lo(function(S,I){return uc(S)?OR(S,I):[]}),hlt=Lo(function(S){return FQ(sf(S,uc))}),flt=Lo(function(S){var I=qg(S);return uc(I)&&(I=t),FQ(sf(S,uc),br(I,2))}),plt=Lo(function(S){var I=qg(S);return I=typeof I=="function"?I:t,FQ(sf(S,uc),t,I)}),glt=Lo(JQ);function mlt(S,I){return zCe(S||[],I||[],RR)}function _lt(S,I){return zCe(S||[],I||[],FR)}var vlt=Lo(function(S){var I=S.length,R=I>1?S[I-1]:t;return R=typeof R=="function"?(S.pop(),R):t,xwe(S,R)});function Twe(S){var I=ge(S);return I.__chain__=!0,I}function blt(S,I){return I(S),S}function VB(S,I){return I(S)}var ylt=$0(function(S){var I=S.length,R=I?S[0]:0,j=this.__wrapped__,oe=function(ve){return EQ(ve,S)};return I>1||this.__actions__.length||!(j instanceof Xo)||!V0(R)?this.thru(oe):(j=j.slice(R,+R+(I?1:0)),j.__actions__.push({func:VB,args:[oe],thisArg:t}),new zg(j,this.__chain__).thru(function(ve){return I&&!ve.length&&ve.push(t),ve}))});function Clt(){return Twe(this)}function wlt(){return new zg(this.value(),this.__chain__)}function Slt(){this.__values__===t&&(this.__values__=Vwe(this.value()));var S=this.__index__>=this.__values__.length,I=S?t:this.__values__[this.__index__++];return{done:S,value:I}}function Elt(){return this}function xlt(S){for(var I,R=this;R instanceof xB;){var j=bwe(R);j.__index__=0,j.__values__=t,I?oe.__wrapped__=j:I=j;var oe=j;R=R.__wrapped__}return oe.__wrapped__=S,I}function Tlt(){var S=this.__wrapped__;if(S instanceof Xo){var I=S;return this.__actions__.length&&(I=new Xo(this)),I=I.reverse(),I.__actions__.push({func:VB,args:[ZQ],thisArg:t}),new zg(I,this.__chain__)}return this.thru(ZQ)}function klt(){return WCe(this.__wrapped__,this.__actions__)}var Ilt=NB(function(S,I,R){ia.call(S,R)?++S[R]:F0(S,R,1)});function Llt(S,I,R){var j=ao(S)?yI:bst;return R&&Eh(S,I,R)&&(I=t),j(S,br(I,3))}function Dlt(S,I){var R=ao(S)?sf:xCe;return R(S,br(I,3))}var Alt=JCe(ywe),Nlt=JCe(Cwe);function Rlt(S,I){return od(HB(S,I),1)}function Olt(S,I){return od(HB(S,I),U)}function Plt(S,I,R){return R=R===t?1:yo(R),od(HB(S,I),R)}function kwe(S,I){var R=ao(S)?ru:U1;return R(S,br(I,3))}function Iwe(S,I){var R=ao(S)?SR:ECe;return R(S,br(I,3))}var Mlt=NB(function(S,I,R){ia.call(S,R)?S[R].push(I):F0(S,R,[I])});function Flt(S,I,R,j){S=lf(S)?S:AI(S),R=R&&!j?yo(R):0;var oe=S.length;return R<0&&(R=au(oe+R,0)),qB(S)?R<=oe&&S.indexOf(I,R)>-1:!!oe&&Kt(S,I,R)>-1}var Blt=Lo(function(S,I,R){var j=-1,oe=typeof I=="function",ve=lf(S)?Mt(S.length):[];return U1(S,function(Pe){ve[++j]=oe?id(I,Pe,R):PR(Pe,I,R)}),ve}),$lt=NB(function(S,I,R){F0(S,R,I)});function HB(S,I){var R=ao(S)?ba:ACe;return R(S,br(I,3))}function Vlt(S,I,R,j){return S==null?[]:(ao(I)||(I=I==null?[]:[I]),R=j?t:R,ao(R)||(R=R==null?[]:[R]),PCe(S,I,R))}var Hlt=NB(function(S,I,R){S[R?0:1].push(I)},function(){return[[],[]]});function Wlt(S,I,R){var j=ao(S)?vl:An,oe=arguments.length<3;return j(S,br(I,4),R,oe,U1)}function zlt(S,I,R){var j=ao(S)?wE:An,oe=arguments.length<3;return j(S,br(I,4),R,oe,ECe)}function Ult(S,I){var R=ao(S)?sf:xCe;return R(S,UB(br(I,3)))}function jlt(S){var I=ao(S)?yCe:Fst;return I(S)}function qlt(S,I,R){(R?Eh(S,I,R):I===t)?I=1:I=yo(I);var j=ao(S)?pst:Bst;return j(S,I)}function Klt(S){var I=ao(S)?gst:Vst;return I(S)}function Glt(S){if(S==null)return 0;if(lf(S))return qB(S)?CI(S):S.length;var I=Ud(S);return I==Tt||I==Se?S.size:DQ(S).length}function Ylt(S,I,R){var j=ao(S)?SE:Hst;return R&&Eh(S,I,R)&&(I=t),j(S,br(I,3))}var Qlt=Lo(function(S,I){if(S==null)return[];var R=I.length;return R>1&&Eh(S,I[0],I[1])?I=[]:R>2&&Eh(I[0],I[1],I[2])&&(I=[I[0]]),PCe(S,od(I,1),[])}),WB=Dot||function(){return _l.Date.now()};function Xlt(S,I){if(typeof I!="function")throw new Wg(s);return S=yo(S),function(){if(--S<1)return I.apply(this,arguments)}}function Lwe(S,I,R){return I=R?t:I,I=S&&I==null?S.length:I,B0(S,k,t,t,t,t,I)}function Dwe(S,I){var R;if(typeof I!="function")throw new Wg(s);return S=yo(S),function(){return--S>0&&(R=I.apply(this,arguments)),S<=1&&(I=t),R}}var eX=Lo(function(S,I,R){var j=v;if(R.length){var oe=W1(R,LI(eX));j|=x}return B0(S,j,I,R,oe)}),Awe=Lo(function(S,I,R){var j=v|_;if(R.length){var oe=W1(R,LI(Awe));j|=x}return B0(I,j,S,R,oe)});function Nwe(S,I,R){I=R?t:I;var j=B0(S,y,t,t,t,t,t,I);return j.placeholder=Nwe.placeholder,j}function Rwe(S,I,R){I=R?t:I;var j=B0(S,C,t,t,t,t,t,I);return j.placeholder=Rwe.placeholder,j}function Owe(S,I,R){var j,oe,ve,Pe,Ye,st,cn=0,dn=!1,yn=!1,li=!0;if(typeof S!="function")throw new Wg(s);I=Kg(I)||0,Ll(R)&&(dn=!!R.leading,yn="maxWait"in R,ve=yn?au(Kg(R.maxWait)||0,I):ve,li="trailing"in R?!!R.trailing:li);function Wi(dc){var c_=j,z0=oe;return j=oe=t,cn=dc,Pe=S.apply(z0,c_),Pe}function Ir(dc){return cn=dc,Ye=VR(zo,I),dn?Wi(dc):Pe}function Eo(dc){var c_=dc-st,z0=dc-cn,Jwe=I-c_;return yn?zd(Jwe,ve-z0):Jwe}function Lr(dc){var c_=dc-st,z0=dc-cn;return st===t||c_>=I||c_<0||yn&&z0>=ve}function zo(){var dc=WB();if(Lr(dc))return ss(dc);Ye=VR(zo,Eo(dc))}function ss(dc){return Ye=t,li&&j?Wi(dc):(j=oe=t,Pe)}function vp(){Ye!==t&&UCe(Ye),cn=0,j=st=oe=Ye=t}function xh(){return Ye===t?Pe:ss(WB())}function bp(){var dc=WB(),c_=Lr(dc);if(j=arguments,oe=this,st=dc,c_){if(Ye===t)return Ir(st);if(yn)return UCe(Ye),Ye=VR(zo,I),Wi(st)}return Ye===t&&(Ye=VR(zo,I)),Pe}return bp.cancel=vp,bp.flush=xh,bp}var Zlt=Lo(function(S,I){return SCe(S,1,I)}),Jlt=Lo(function(S,I,R){return SCe(S,Kg(I)||0,R)});function ect(S){return B0(S,D)}function zB(S,I){if(typeof S!="function"||I!=null&&typeof I!="function")throw new Wg(s);var R=function(){var j=arguments,oe=I?I.apply(this,j):j[0],ve=R.cache;if(ve.has(oe))return ve.get(oe);var Pe=S.apply(this,j);return R.cache=ve.set(oe,Pe)||ve,Pe};return R.cache=new(zB.Cache||M0),R}zB.Cache=M0;function UB(S){if(typeof S!="function")throw new Wg(s);return function(){var I=arguments;switch(I.length){case 0:return!S.call(this);case 1:return!S.call(this,I[0]);case 2:return!S.call(this,I[0],I[1]);case 3:return!S.call(this,I[0],I[1],I[2])}return!S.apply(this,I)}}function tct(S){return Dwe(2,S)}var nct=Wst(function(S,I){I=I.length==1&&ao(I[0])?ba(I[0],ol(br())):ba(od(I,1),ol(br()));var R=I.length;return Lo(function(j){for(var oe=-1,ve=zd(j.length,R);++oe<ve;)j[oe]=I[oe].call(this,j[oe]);return id(S,this,j)})}),tX=Lo(function(S,I){var R=W1(I,LI(tX));return B0(S,x,t,I,R)}),Pwe=Lo(function(S,I){var R=W1(I,LI(Pwe));return B0(S,E,t,I,R)}),ict=$0(function(S,I){return B0(S,L,t,t,t,I)});function rct(S,I){if(typeof S!="function")throw new Wg(s);return I=I===t?I:yo(I),Lo(S,I)}function oct(S,I){if(typeof S!="function")throw new Wg(s);return I=I==null?0:au(yo(I),0),Lo(function(R){var j=R[I],oe=K1(R,0,I);return j&&pp(oe,j),id(S,this,oe)})}function sct(S,I,R){var j=!0,oe=!0;if(typeof S!="function")throw new Wg(s);return Ll(R)&&(j="leading"in R?!!R.leading:j,oe="trailing"in R?!!R.trailing:oe),Owe(S,I,{leading:j,maxWait:I,trailing:oe})}function act(S){return Lwe(S,1)}function lct(S,I){return tX($Q(I),S)}function cct(){if(!arguments.length)return[];var S=arguments[0];return ao(S)?S:[S]}function uct(S){return Ug(S,f)}function dct(S,I){return I=typeof I=="function"?I:t,Ug(S,f,I)}function hct(S){return Ug(S,d|f)}function fct(S,I){return I=typeof I=="function"?I:t,Ug(S,d|f,I)}function pct(S,I){return I==null||wCe(S,I,Lu(I))}function l_(S,I){return S===I||S!==S&&I!==I}var gct=MB(kQ),mct=MB(function(S,I){return S>=I}),AE=ICe(function(){return arguments}())?ICe:function(S){return Ul(S)&&ia.call(S,"callee")&&!pCe.call(S,"callee")},ao=Mt.isArray,_ct=O0?ol(O0):xst;function lf(S){return S!=null&&jB(S.length)&&!H0(S)}function uc(S){return Ul(S)&&lf(S)}function vct(S){return S===!0||S===!1||Ul(S)&&Sh(S)==Me}var G1=Not||hX,bct=$g?ol($g):Tst;function yct(S){return Ul(S)&&S.nodeType===1&&!HR(S)}function Cct(S){if(S==null)return!0;if(lf(S)&&(ao(S)||typeof S=="string"||typeof S.splice=="function"||G1(S)||DI(S)||AE(S)))return!S.length;var I=Ud(S);if(I==Tt||I==Se)return!S.size;if($R(S))return!DQ(S).length;for(var R in S)if(ia.call(S,R))return!1;return!0}function wct(S,I){return MR(S,I)}function Sct(S,I,R){R=typeof R=="function"?R:t;var j=R?R(S,I):t;return j===t?MR(S,I,t,R):!!j}function nX(S){if(!Ul(S))return!1;var I=Sh(S);return I==Be||I==qe||typeof S.message=="string"&&typeof S.name=="string"&&!HR(S)}function Ect(S){return typeof S=="number"&&mCe(S)}function H0(S){if(!Ll(S))return!1;var I=Sh(S);return I==_t||I==Wt||I==ke||I==ot}function Mwe(S){return typeof S=="number"&&S==yo(S)}function jB(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=W}function Ll(S){var I=typeof S;return S!=null&&(I=="object"||I=="function")}function Ul(S){return S!=null&&typeof S=="object"}var Fwe=Vg?ol(Vg):Ist;function xct(S,I){return S===I||LQ(S,I,qQ(I))}function Tct(S,I,R){return R=typeof R=="function"?R:t,LQ(S,I,qQ(I),R)}function kct(S){return Bwe(S)&&S!=+S}function Ict(S){if(dat(S))throw new no(o);return LCe(S)}function Lct(S){return S===null}function Dct(S){return S==null}function Bwe(S){return typeof S=="number"||Ul(S)&&Sh(S)==rn}function HR(S){if(!Ul(S)||Sh(S)!=wt)return!1;var I=vB(S);if(I===null)return!0;var R=ia.call(I,"constructor")&&I.constructor;return typeof R=="function"&&R instanceof R&&pB.call(R)==Tot}var iX=of?ol(of):Lst;function Act(S){return Mwe(S)&&S>=-W&&S<=W}var $we=vI?ol(vI):Dst;function qB(S){return typeof S=="string"||!ao(S)&&Ul(S)&&Sh(S)==re}function _p(S){return typeof S=="symbol"||Ul(S)&&Sh(S)==Y}var DI=bI?ol(bI):Ast;function Nct(S){return S===t}function Rct(S){return Ul(S)&&Ud(S)==le}function Oct(S){return Ul(S)&&Sh(S)==te}var Pct=MB(AQ),Mct=MB(function(S,I){return S<=I});function Vwe(S){if(!S)return[];if(lf(S))return qB(S)?s_(S):af(S);if(IR&&S[IR])return vQ(S[IR]());var I=Ud(S),R=I==Tt?TR:I==Se?dB:AI;return R(S)}function W0(S){if(!S)return S===0?S:0;if(S=Kg(S),S===U||S===-U){var I=S<0?-1:1;return I*q}return S===S?S:0}function yo(S){var I=W0(S),R=I%1;return I===I?R?I-R:I:0}function Hwe(S){return S?kE(yo(S),0,ie):0}function Kg(S){if(typeof S=="number")return S;if(_p(S))return H;if(Ll(S)){var I=typeof S.valueOf=="function"?S.valueOf():S;S=Ll(I)?I+"":I}if(typeof S!="string")return S===0?S:+S;S=rd(S);var R=nt.test(S);return R||ye.test(S)?zl(S.slice(2),R?2:8):Ie.test(S)?H:+S}function Wwe(S){return Mv(S,cf(S))}function Fct(S){return S?kE(yo(S),-W,W):S===0?S:0}function Us(S){return S==null?"":mp(S)}var Bct=kI(function(S,I){if($R(I)||lf(I)){Mv(I,Lu(I),S);return}for(var R in I)ia.call(I,R)&&RR(S,R,I[R])}),zwe=kI(function(S,I){Mv(I,cf(I),S)}),KB=kI(function(S,I,R,j){Mv(I,cf(I),S,j)}),$ct=kI(function(S,I,R,j){Mv(I,Lu(I),S,j)}),Vct=$0(EQ);function Hct(S,I){var R=TI(S);return I==null?R:CCe(R,I)}var Wct=Lo(function(S,I){S=Aa(S);var R=-1,j=I.length,oe=j>2?I[2]:t;for(oe&&Eh(I[0],I[1],oe)&&(j=1);++R<j;)for(var ve=I[R],Pe=cf(ve),Ye=-1,st=Pe.length;++Ye<st;){var cn=Pe[Ye],dn=S[cn];(dn===t||l_(dn,SI[cn])&&!ia.call(S,cn))&&(S[cn]=ve[cn])}return S}),zct=Lo(function(S){return S.push(t,swe),id(Uwe,t,S)});function Uct(S,I){return Ce(S,br(I,3),Pv)}function jct(S,I){return Ce(S,br(I,3),TQ)}function qct(S,I){return S==null?S:xQ(S,br(I,3),cf)}function Kct(S,I){return S==null?S:TCe(S,br(I,3),cf)}function Gct(S,I){return S&&Pv(S,br(I,3))}function Yct(S,I){return S&&TQ(S,br(I,3))}function Qct(S){return S==null?[]:IB(S,Lu(S))}function Xct(S){return S==null?[]:IB(S,cf(S))}function rX(S,I,R){var j=S==null?t:IE(S,I);return j===t?R:j}function Zct(S,I){return S!=null&&cwe(S,I,Cst)}function oX(S,I){return S!=null&&cwe(S,I,wst)}var Jct=twe(function(S,I,R){I!=null&&typeof I.toString!="function"&&(I=gB.call(I)),S[I]=R},aX(uf)),eut=twe(function(S,I,R){I!=null&&typeof I.toString!="function"&&(I=gB.call(I)),ia.call(S,I)?S[I].push(R):S[I]=[R]},br),tut=Lo(PR);function Lu(S){return lf(S)?bCe(S):DQ(S)}function cf(S){return lf(S)?bCe(S,!0):Nst(S)}function nut(S,I){var R={};return I=br(I,3),Pv(S,function(j,oe,ve){F0(R,I(j,oe,ve),j)}),R}function iut(S,I){var R={};return I=br(I,3),Pv(S,function(j,oe,ve){F0(R,oe,I(j,oe,ve))}),R}var rut=kI(function(S,I,R){LB(S,I,R)}),Uwe=kI(function(S,I,R,j){LB(S,I,R,j)}),out=$0(function(S,I){var R={};if(S==null)return R;var j=!1;I=ba(I,function(ve){return ve=q1(ve,S),j||(j=ve.length>1),ve}),Mv(S,UQ(S),R),j&&(R=Ug(R,d|h|f,Jst));for(var oe=I.length;oe--;)MQ(R,I[oe]);return R});function sut(S,I){return jwe(S,UB(br(I)))}var aut=$0(function(S,I){return S==null?{}:Ost(S,I)});function jwe(S,I){if(S==null)return{};var R=ba(UQ(S),function(j){return[j]});return I=br(I),MCe(S,R,function(j,oe){return I(j,oe[0])})}function lut(S,I,R){I=q1(I,S);var j=-1,oe=I.length;for(oe||(oe=1,S=t);++j<oe;){var ve=S==null?t:S[Fv(I[j])];ve===t&&(j=oe,ve=R),S=H0(ve)?ve.call(S):ve}return S}function cut(S,I,R){return S==null?S:FR(S,I,R)}function uut(S,I,R,j){return j=typeof j=="function"?j:t,S==null?S:FR(S,I,R,j)}var qwe=rwe(Lu),Kwe=rwe(cf);function dut(S,I,R){var j=ao(S),oe=j||G1(S)||DI(S);if(I=br(I,4),R==null){var ve=S&&S.constructor;oe?R=j?new ve:[]:Ll(S)?R=H0(ve)?TI(vB(S)):{}:R={}}return(oe?ru:Pv)(S,function(Pe,Ye,st){return I(R,Pe,Ye,st)}),R}function hut(S,I){return S==null?!0:MQ(S,I)}function fut(S,I,R){return S==null?S:HCe(S,I,$Q(R))}function put(S,I,R,j){return j=typeof j=="function"?j:t,S==null?S:HCe(S,I,$Q(R),j)}function AI(S){return S==null?[]:wh(S,Lu(S))}function gut(S){return S==null?[]:wh(S,cf(S))}function mut(S,I,R){return R===t&&(R=I,I=t),R!==t&&(R=Kg(R),R=R===R?R:0),I!==t&&(I=Kg(I),I=I===I?I:0),kE(Kg(S),I,R)}function _ut(S,I,R){return I=W0(I),R===t?(R=I,I=0):R=W0(R),S=Kg(S),Sst(S,I,R)}function vut(S,I,R){if(R&&typeof R!="boolean"&&Eh(S,I,R)&&(I=R=t),R===t&&(typeof I=="boolean"?(R=I,I=t):typeof S=="boolean"&&(R=S,S=t)),S===t&&I===t?(S=0,I=1):(S=W0(S),I===t?(I=S,S=0):I=W0(I)),S>I){var j=S;S=I,I=j}if(R||S%1||I%1){var oe=_Ce();return zd(S+oe*(I-S+Wl("1e-"+((oe+"").length-1))),I)}return RQ(S,I)}var but=II(function(S,I,R){return I=I.toLowerCase(),S+(R?Gwe(I):I)});function Gwe(S){return sX(Us(S).toLowerCase())}function Ywe(S){return S=Us(S),S&&S.replace(yt,cB).replace(Zn,"")}function yut(S,I,R){S=Us(S),I=mp(I);var j=S.length;R=R===t?j:kE(yo(R),0,j);var oe=R;return R-=I.length,R>=0&&S.slice(R,oe)==I}function Cut(S){return S=Us(S),S&&Tn.test(S)?S.replace(sr,ER):S}function wut(S){return S=Us(S),S&&ta.test(S)?S.replace(oo,"\\$&"):S}var Sut=II(function(S,I,R){return S+(R?"-":"")+I.toLowerCase()}),Eut=II(function(S,I,R){return S+(R?" ":"")+I.toLowerCase()}),xut=ZCe("toLowerCase");function Tut(S,I,R){S=Us(S),I=yo(I);var j=I?CI(S):0;if(!I||j>=I)return S;var oe=(I-j)/2;return PB(wB(oe),R)+S+PB(CB(oe),R)}function kut(S,I,R){S=Us(S),I=yo(I);var j=I?CI(S):0;return I&&j<I?S+PB(I-j,R):S}function Iut(S,I,R){S=Us(S),I=yo(I);var j=I?CI(S):0;return I&&j<I?PB(I-j,R)+S:S}function Lut(S,I,R){return R||I==null?I=0:I&&(I=+I),Mot(Us(S).replace(Mr,""),I||0)}function Dut(S,I,R){return(R?Eh(S,I,R):I===t)?I=1:I=yo(I),OQ(Us(S),I)}function Aut(){var S=arguments,I=Us(S[0]);return S.length<3?I:I.replace(S[1],S[2])}var Nut=II(function(S,I,R){return S+(R?"_":"")+I.toLowerCase()});function Rut(S,I,R){return R&&typeof R!="number"&&Eh(S,I,R)&&(I=R=t),R=R===t?ie:R>>>0,R?(S=Us(S),S&&(typeof I=="string"||I!=null&&!iX(I))&&(I=mp(I),!I&&H1(S))?K1(s_(S),0,R):S.split(I,R)):[]}var Out=II(function(S,I,R){return S+(R?" ":"")+sX(I)});function Put(S,I,R){return S=Us(S),R=R==null?0:kE(yo(R),0,S.length),I=mp(I),S.slice(R,R+I.length)==I}function Mut(S,I,R){var j=ge.templateSettings;R&&Eh(S,I,R)&&(I=t),S=Us(S),I=KB({},I,j,owe);var oe=KB({},I.imports,j.imports,owe),ve=Lu(oe),Pe=wh(oe,ve),Ye,st,cn=0,dn=I.interpolate||it,yn="__p += '",li=bQ((I.escape||it).source+"|"+dn.source+"|"+(dn===$i?hn:it).source+"|"+(I.evaluate||it).source+"|$","g"),Wi="//# sourceURL="+(ia.call(I,"sourceURL")?(I.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ja+"]")+` `;S.replace(li,function(Lr,zo,ss,vp,xh,bp){return ss||(ss=vp),yn+=S.slice(cn,bp).replace(fn,xR),zo&&(Ye=!0,yn+=`' + __e(`+zo+`) + '`),xh&&(st=!0,yn+=`'; `+xh+`; __p += '`),ss&&(yn+=`' + ((__t = (`+ss+`)) == null ? '' : __t) + '`),cn=bp+Lr.length,Lr}),yn+=`'; `;var Ir=ia.call(I,"variable")&&I.variable;if(!Ir)yn=`with (obj) { `+yn+` } `;else if(xt.test(Ir))throw new no(a);yn=(st?yn.replace(Ft,""):yn).replace(jt,"$1").replace(Jt,"$1;"),yn="function("+(Ir||"obj")+`) { `+(Ir?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(Ye?", __e = _.escape":"")+(st?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+yn+`return __p }`;var Eo=Xwe(function(){return As(ve,Wi+"return "+yn).apply(t,Pe)});if(Eo.source=yn,nX(Eo))throw Eo;return Eo}function Fut(S){return Us(S).toLowerCase()}function But(S){return Us(S).toUpperCase()}function $ut(S,I,R){if(S=Us(S),S&&(R||I===t))return rd(S);if(!S||!(I=mp(I)))return S;var j=s_(S),oe=s_(I),ve=Hg(j,oe),Pe=ou(j,oe)+1;return K1(j,ve,Pe).join("")}function Vut(S,I,R){if(S=Us(S),S&&(R||I===t))return S.slice(0,uCe(S)+1);if(!S||!(I=mp(I)))return S;var j=s_(S),oe=ou(j,s_(I))+1;return K1(j,0,oe).join("")}function Hut(S,I,R){if(S=Us(S),S&&(R||I===t))return S.replace(Mr,"");if(!S||!(I=mp(I)))return S;var j=s_(S),oe=Hg(j,s_(I));return K1(j,oe).join("")}function Wut(S,I){var R=A,j=O;if(Ll(I)){var oe="separator"in I?I.separator:oe;R="length"in I?yo(I.length):R,j="omission"in I?mp(I.omission):j}S=Us(S);var ve=S.length;if(H1(S)){var Pe=s_(S);ve=Pe.length}if(R>=ve)return S;var Ye=R-CI(j);if(Ye<1)return j;var st=Pe?K1(Pe,0,Ye).join(""):S.slice(0,Ye);if(oe===t)return st+j;if(Pe&&(Ye+=st.length-Ye),iX(oe)){if(S.slice(Ye).search(oe)){var cn,dn=st;for(oe.global||(oe=bQ(oe.source,Us(ut.exec(oe))+"g")),oe.lastIndex=0;cn=oe.exec(dn);)var yn=cn.index;st=st.slice(0,yn===t?Ye:yn)}}else if(S.indexOf(mp(oe),Ye)!=Ye){var li=st.lastIndexOf(oe);li>-1&&(st=st.slice(0,li))}return st+j}function zut(S){return S=Us(S),S&&zn.test(S)?S.replace(ei,vot):S}var Uut=II(function(S,I,R){return S+(R?" ":"")+I.toUpperCase()}),sX=ZCe("toUpperCase");function Qwe(S,I,R){return S=Us(S),I=R?t:I,I===t?_Q(S)?Cot(S):X(S):S.match(I)||[]}var Xwe=Lo(function(S,I){try{return id(S,t,I)}catch(R){return nX(R)?R:new no(R)}}),jut=$0(function(S,I){return ru(I,function(R){R=Fv(R),F0(S,R,eX(S[R],S))}),S});function qut(S){var I=S==null?0:S.length,R=br();return S=I?ba(S,function(j){if(typeof j[1]!="function")throw new Wg(s);return[R(j[0]),j[1]]}):[],Lo(function(j){for(var oe=-1;++oe<I;){var ve=S[oe];if(id(ve[0],this,j))return id(ve[1],this,j)}})}function Kut(S){return vst(Ug(S,d))}function aX(S){return function(){return S}}function Gut(S,I){return S==null||S!==S?I:S}var Yut=ewe(),Qut=ewe(!0);function uf(S){return S}function lX(S){return DCe(typeof S=="function"?S:Ug(S,d))}function Xut(S){return NCe(Ug(S,d))}function Zut(S,I){return RCe(S,Ug(I,d))}var Jut=Lo(function(S,I){return function(R){return PR(R,S,I)}}),edt=Lo(function(S,I){return function(R){return PR(S,R,I)}});function cX(S,I,R){var j=Lu(I),oe=IB(I,j);R==null&&!(Ll(I)&&(oe.length||!j.length))&&(R=I,I=S,S=this,oe=IB(I,Lu(I)));var ve=!(Ll(R)&&"chain"in R)||!!R.chain,Pe=H0(S);return ru(oe,function(Ye){var st=I[Ye];S[Ye]=st,Pe&&(S.prototype[Ye]=function(){var cn=this.__chain__;if(ve||cn){var dn=S(this.__wrapped__),yn=dn.__actions__=af(this.__actions__);return yn.push({func:st,args:arguments,thisArg:S}),dn.__chain__=cn,dn}return st.apply(S,pp([this.value()],arguments))})}),S}function tdt(){return _l._===this&&(_l._=kot),this}function uX(){}function ndt(S){return S=yo(S),Lo(function(I){return OCe(I,S)})}var idt=HQ(ba),rdt=HQ(yI),odt=HQ(SE);function Zwe(S){return GQ(S)?Fo(Fv(S)):Pst(S)}function sdt(S){return function(I){return S==null?t:IE(S,I)}}var adt=nwe(),ldt=nwe(!0);function dX(){return[]}function hX(){return!1}function cdt(){return{}}function udt(){return""}function ddt(){return!0}function hdt(S,I){if(S=yo(S),S<1||S>W)return[];var R=ie,j=zd(S,ie);I=br(I),S-=ie;for(var oe=_s(j,I);++R<S;)I(R);return oe}function fdt(S){return ao(S)?ba(S,Fv):_p(S)?[S]:af(vwe(Us(S)))}function pdt(S){var I=++xot;return Us(S)+I}var gdt=OB(function(S,I){return S+I},0),mdt=WQ("ceil"),_dt=OB(function(S,I){return S/I},1),vdt=WQ("floor");function bdt(S){return S&&S.length?kB(S,uf,kQ):t}function ydt(S,I){return S&&S.length?kB(S,br(I,2),kQ):t}function Cdt(S){return $r(S,uf)}function wdt(S,I){return $r(S,br(I,2))}function Sdt(S){return S&&S.length?kB(S,uf,AQ):t}function Edt(S,I){return S&&S.length?kB(S,br(I,2),AQ):t}var xdt=OB(function(S,I){return S*I},1),Tdt=WQ("round"),kdt=OB(function(S,I){return S-I},0);function Idt(S){return S&&S.length?Hr(S,uf):0}function Ldt(S,I){return S&&S.length?Hr(S,br(I,2)):0}return ge.after=Xlt,ge.ary=Lwe,ge.assign=Bct,ge.assignIn=zwe,ge.assignInWith=KB,ge.assignWith=$ct,ge.at=Vct,ge.before=Dwe,ge.bind=eX,ge.bindAll=jut,ge.bindKey=Awe,ge.castArray=cct,ge.chain=Twe,ge.chunk=vat,ge.compact=bat,ge.concat=yat,ge.cond=qut,ge.conforms=Kut,ge.constant=aX,ge.countBy=Ilt,ge.create=Hct,ge.curry=Nwe,ge.curryRight=Rwe,ge.debounce=Owe,ge.defaults=Wct,ge.defaultsDeep=zct,ge.defer=Zlt,ge.delay=Jlt,ge.difference=Cat,ge.differenceBy=wat,ge.differenceWith=Sat,ge.drop=Eat,ge.dropRight=xat,ge.dropRightWhile=Tat,ge.dropWhile=kat,ge.fill=Iat,ge.filter=Dlt,ge.flatMap=Rlt,ge.flatMapDeep=Olt,ge.flatMapDepth=Plt,ge.flatten=wwe,ge.flattenDeep=Lat,ge.flattenDepth=Dat,ge.flip=ect,ge.flow=Yut,ge.flowRight=Qut,ge.fromPairs=Aat,ge.functions=Qct,ge.functionsIn=Xct,ge.groupBy=Mlt,ge.initial=Rat,ge.intersection=Oat,ge.intersectionBy=Pat,ge.intersectionWith=Mat,ge.invert=Jct,ge.invertBy=eut,ge.invokeMap=Blt,ge.iteratee=lX,ge.keyBy=$lt,ge.keys=Lu,ge.keysIn=cf,ge.map=HB,ge.mapKeys=nut,ge.mapValues=iut,ge.matches=Xut,ge.matchesProperty=Zut,ge.memoize=zB,ge.merge=rut,ge.mergeWith=Uwe,ge.method=Jut,ge.methodOf=edt,ge.mixin=cX,ge.negate=UB,ge.nthArg=ndt,ge.omit=out,ge.omitBy=sut,ge.once=tct,ge.orderBy=Vlt,ge.over=idt,ge.overArgs=nct,ge.overEvery=rdt,ge.overSome=odt,ge.partial=tX,ge.partialRight=Pwe,ge.partition=Hlt,ge.pick=aut,ge.pickBy=jwe,ge.property=Zwe,ge.propertyOf=sdt,ge.pull=Vat,ge.pullAll=Ewe,ge.pullAllBy=Hat,ge.pullAllWith=Wat,ge.pullAt=zat,ge.range=adt,ge.rangeRight=ldt,ge.rearg=ict,ge.reject=Ult,ge.remove=Uat,ge.rest=rct,ge.reverse=ZQ,ge.sampleSize=qlt,ge.set=cut,ge.setWith=uut,ge.shuffle=Klt,ge.slice=jat,ge.sortBy=Qlt,ge.sortedUniq=Zat,ge.sortedUniqBy=Jat,ge.split=Rut,ge.spread=oct,ge.tail=elt,ge.take=tlt,ge.takeRight=nlt,ge.takeRightWhile=ilt,ge.takeWhile=rlt,ge.tap=blt,ge.throttle=sct,ge.thru=VB,ge.toArray=Vwe,ge.toPairs=qwe,ge.toPairsIn=Kwe,ge.toPath=fdt,ge.toPlainObject=Wwe,ge.transform=dut,ge.unary=act,ge.union=olt,ge.unionBy=slt,ge.unionWith=alt,ge.uniq=llt,ge.uniqBy=clt,ge.uniqWith=ult,ge.unset=hut,ge.unzip=JQ,ge.unzipWith=xwe,ge.update=fut,ge.updateWith=put,ge.values=AI,ge.valuesIn=gut,ge.without=dlt,ge.words=Qwe,ge.wrap=lct,ge.xor=hlt,ge.xorBy=flt,ge.xorWith=plt,ge.zip=glt,ge.zipObject=mlt,ge.zipObjectDeep=_lt,ge.zipWith=vlt,ge.entries=qwe,ge.entriesIn=Kwe,ge.extend=zwe,ge.extendWith=KB,cX(ge,ge),ge.add=gdt,ge.attempt=Xwe,ge.camelCase=but,ge.capitalize=Gwe,ge.ceil=mdt,ge.clamp=mut,ge.clone=uct,ge.cloneDeep=hct,ge.cloneDeepWith=fct,ge.cloneWith=dct,ge.conformsTo=pct,ge.deburr=Ywe,ge.defaultTo=Gut,ge.divide=_dt,ge.endsWith=yut,ge.eq=l_,ge.escape=Cut,ge.escapeRegExp=wut,ge.every=Llt,ge.find=Alt,ge.findIndex=ywe,ge.findKey=Uct,ge.findLast=Nlt,ge.findLastIndex=Cwe,ge.findLastKey=jct,ge.floor=vdt,ge.forEach=kwe,ge.forEachRight=Iwe,ge.forIn=qct,ge.forInRight=Kct,ge.forOwn=Gct,ge.forOwnRight=Yct,ge.get=rX,ge.gt=gct,ge.gte=mct,ge.has=Zct,ge.hasIn=oX,ge.head=Swe,ge.identity=uf,ge.includes=Flt,ge.indexOf=Nat,ge.inRange=_ut,ge.invoke=tut,ge.isArguments=AE,ge.isArray=ao,ge.isArrayBuffer=_ct,ge.isArrayLike=lf,ge.isArrayLikeObject=uc,ge.isBoolean=vct,ge.isBuffer=G1,ge.isDate=bct,ge.isElement=yct,ge.isEmpty=Cct,ge.isEqual=wct,ge.isEqualWith=Sct,ge.isError=nX,ge.isFinite=Ect,ge.isFunction=H0,ge.isInteger=Mwe,ge.isLength=jB,ge.isMap=Fwe,ge.isMatch=xct,ge.isMatchWith=Tct,ge.isNaN=kct,ge.isNative=Ict,ge.isNil=Dct,ge.isNull=Lct,ge.isNumber=Bwe,ge.isObject=Ll,ge.isObjectLike=Ul,ge.isPlainObject=HR,ge.isRegExp=iX,ge.isSafeInteger=Act,ge.isSet=$we,ge.isString=qB,ge.isSymbol=_p,ge.isTypedArray=DI,ge.isUndefined=Nct,ge.isWeakMap=Rct,ge.isWeakSet=Oct,ge.join=Fat,ge.kebabCase=Sut,ge.last=qg,ge.lastIndexOf=Bat,ge.lowerCase=Eut,ge.lowerFirst=xut,ge.lt=Pct,ge.lte=Mct,ge.max=bdt,ge.maxBy=ydt,ge.mean=Cdt,ge.meanBy=wdt,ge.min=Sdt,ge.minBy=Edt,ge.stubArray=dX,ge.stubFalse=hX,ge.stubObject=cdt,ge.stubString=udt,ge.stubTrue=ddt,ge.multiply=xdt,ge.nth=$at,ge.noConflict=tdt,ge.noop=uX,ge.now=WB,ge.pad=Tut,ge.padEnd=kut,ge.padStart=Iut,ge.parseInt=Lut,ge.random=vut,ge.reduce=Wlt,ge.reduceRight=zlt,ge.repeat=Dut,ge.replace=Aut,ge.result=lut,ge.round=Tdt,ge.runInContext=rt,ge.sample=jlt,ge.size=Glt,ge.snakeCase=Nut,ge.some=Ylt,ge.sortedIndex=qat,ge.sortedIndexBy=Kat,ge.sortedIndexOf=Gat,ge.sortedLastIndex=Yat,ge.sortedLastIndexBy=Qat,ge.sortedLastIndexOf=Xat,ge.startCase=Out,ge.startsWith=Put,ge.subtract=kdt,ge.sum=Idt,ge.sumBy=Ldt,ge.template=Mut,ge.times=hdt,ge.toFinite=W0,ge.toInteger=yo,ge.toLength=Hwe,ge.toLower=Fut,ge.toNumber=Kg,ge.toSafeInteger=Fct,ge.toString=Us,ge.toUpper=But,ge.trim=$ut,ge.trimEnd=Vut,ge.trimStart=Hut,ge.truncate=Wut,ge.unescape=zut,ge.uniqueId=pdt,ge.upperCase=Uut,ge.upperFirst=sX,ge.each=kwe,ge.eachRight=Iwe,ge.first=Swe,cX(ge,function(){var S={};return Pv(ge,function(I,R){ia.call(ge.prototype,R)||(S[R]=I)}),S}(),{chain:!1}),ge.VERSION=i,ru(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){ge[S].placeholder=ge}),ru(["drop","take"],function(S,I){Xo.prototype[S]=function(R){R=R===t?1:au(yo(R),0);var j=this.__filtered__&&!I?new Xo(this):this.clone();return j.__filtered__?j.__takeCount__=zd(R,j.__takeCount__):j.__views__.push({size:zd(R,ie),type:S+(j.__dir__<0?"Right":"")}),j},Xo.prototype[S+"Right"]=function(R){return this.reverse()[S](R).reverse()}}),ru(["filter","map","takeWhile"],function(S,I){var R=I+1,j=R==B||R==V;Xo.prototype[S]=function(oe){var ve=this.clone();return ve.__iteratees__.push({iteratee:br(oe,3),type:R}),ve.__filtered__=ve.__filtered__||j,ve}}),ru(["head","last"],function(S,I){var R="take"+(I?"Right":"");Xo.prototype[S]=function(){return this[R](1).value()[0]}}),ru(["initial","tail"],function(S,I){var R="drop"+(I?"":"Right");Xo.prototype[S]=function(){return this.__filtered__?new Xo(this):this[R](1)}}),Xo.prototype.compact=function(){return this.filter(uf)},Xo.prototype.find=function(S){return this.filter(S).head()},Xo.prototype.findLast=function(S){return this.reverse().find(S)},Xo.prototype.invokeMap=Lo(function(S,I){return typeof S=="function"?new Xo(this):this.map(function(R){return PR(R,S,I)})}),Xo.prototype.reject=function(S){return this.filter(UB(br(S)))},Xo.prototype.slice=function(S,I){S=yo(S);var R=this;return R.__filtered__&&(S>0||I<0)?new Xo(R):(S<0?R=R.takeRight(-S):S&&(R=R.drop(S)),I!==t&&(I=yo(I),R=I<0?R.dropRight(-I):R.take(I-S)),R)},Xo.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},Xo.prototype.toArray=function(){return this.take(ie)},Pv(Xo.prototype,function(S,I){var R=/^(?:filter|find|map|reject)|While$/.test(I),j=/^(?:head|last)$/.test(I),oe=ge[j?"take"+(I=="last"?"Right":""):I],ve=j||/^find/.test(I);oe&&(ge.prototype[I]=function(){var Pe=this.__wrapped__,Ye=j?[1]:arguments,st=Pe instanceof Xo,cn=Ye[0],dn=st||ao(Pe),yn=function(zo){var ss=oe.apply(ge,pp([zo],Ye));return j&&li?ss[0]:ss};dn&&R&&typeof cn=="function"&&cn.length!=1&&(st=dn=!1);var li=this.__chain__,Wi=!!this.__actions__.length,Ir=ve&&!li,Eo=st&&!Wi;if(!ve&&dn){Pe=Eo?Pe:new Xo(this);var Lr=S.apply(Pe,Ye);return Lr.__actions__.push({func:VB,args:[yn],thisArg:t}),new zg(Lr,li)}return Ir&&Eo?S.apply(this,Ye):(Lr=this.thru(yn),Ir?j?Lr.value()[0]:Lr.value():Lr)})}),ru(["pop","push","shift","sort","splice","unshift"],function(S){var I=hB[S],R=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",j=/^(?:pop|shift)$/.test(S);ge.prototype[S]=function(){var oe=arguments;if(j&&!this.__chain__){var ve=this.value();return I.apply(ao(ve)?ve:[],oe)}return this[R](function(Pe){return I.apply(ao(Pe)?Pe:[],oe)})}}),Pv(Xo.prototype,function(S,I){var R=ge[I];if(R){var j=R.name+"";ia.call(xI,j)||(xI[j]=[]),xI[j].push({name:I,func:R})}}),xI[RB(t,_).name]=[{name:"wrapper",func:t}],Xo.prototype.clone=zot,Xo.prototype.reverse=Uot,Xo.prototype.value=jot,ge.prototype.at=ylt,ge.prototype.chain=Clt,ge.prototype.commit=wlt,ge.prototype.next=Slt,ge.prototype.plant=xlt,ge.prototype.reverse=Tlt,ge.prototype.toJSON=ge.prototype.valueOf=ge.prototype.value=klt,ge.prototype.first=ge.prototype.head,IR&&(ge.prototype[IR]=Elt),ge},wI=wot();yh?((yh.exports=wI)._=wI,o_._=wI):_l._=wI}).call(Bo)})(KV,KV.exports);var un=KV.exports;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ci(){var e;const n=Oc(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.company}function Jgt(){const n=ci(),e=ji();return()=>typeof e>"u"?!1:!un.isEqual(n,e)}var j6e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){var t=1e3,i=6e4,r=36e5,o="millisecond",s="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var M=["th","st","nd","rd"],V=B%100;return"["+B+(M[(V-20)%10]||M[V]||M[0])+"]"}},y=function(B,M,V){var U=String(B);return!U||U.length>=M?B:""+Array(M+1-U.length).join(V)+B},C={s:y,z:function(B){var M=-B.utcOffset(),V=Math.abs(M),U=Math.floor(V/60),W=V%60;return(M<=0?"+":"-")+y(U,2,"0")+":"+y(W,2,"0")},m:function B(M,V){if(M.date()<V.date())return-B(V,M);var U=12*(V.year()-M.year())+(V.month()-M.month()),W=M.clone().add(U,d),q=V-W<0,H=M.clone().add(U+(q?-1:1),d);return+(-(U+(V-W)/(q?W-H:H-W))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:d,y:f,w:u,d:c,D:g,h:l,m:a,s,ms:o,Q:h}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},x="en",E={};E[x]=b;var k="$isDayjsObject",L=function(B){return B instanceof P||!(!B||!B[k])},D=function B(M,V,U){var W;if(!M)return x;if(typeof M=="string"){var q=M.toLowerCase();E[q]&&(W=q),V&&(E[q]=V,W=q);var H=M.split("-");if(!W&&H.length>1)return B(H[0])}else{var ie=M.name;E[ie]=M,W=ie}return!U&&W&&(x=W),W||!U&&x},A=function(B,M){if(L(B))return B.clone();var V=typeof M=="object"?M:{};return V.date=B,V.args=arguments,new P(V)},O=C;O.l=D,O.i=L,O.w=function(B,M){return A(B,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var P=function(){function B(V){this.$L=D(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[k]=!0}var M=B.prototype;return M.parse=function(V){this.$d=function(U){var W=U.date,q=U.utc;if(W===null)return new Date(NaN);if(O.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var H=W.match(v);if(H){var ie=H[2]-1||0,se=(H[7]||"0").substring(0,3);return q?new Date(Date.UTC(H[1],ie,H[3]||1,H[4]||0,H[5]||0,H[6]||0,se)):new Date(H[1],ie,H[3]||1,H[4]||0,H[5]||0,H[6]||0,se)}}return new Date(W)}(V),this.init()},M.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},M.$utils=function(){return O},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(V,U){var W=A(V);return this.startOf(U)<=W&&W<=this.endOf(U)},M.isAfter=function(V,U){return A(V)<this.startOf(U)},M.isBefore=function(V,U){return this.endOf(U)<A(V)},M.$g=function(V,U,W){return O.u(V)?this[U]:this.set(W,V)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(V,U){var W=this,q=!!O.u(U)||U,H=O.p(V),ie=function(je,qe){var Be=O.w(W.$u?Date.UTC(W.$y,qe,je):new Date(W.$y,qe,je),W);return q?Be:Be.endOf(c)},se=function(je,qe){return O.w(W.toDate()[je].apply(W.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(qe)),W)},Q=this.$W,Ee=this.$M,Fe=this.$D,He="set"+(this.$u?"UTC":"");switch(H){case f:return q?ie(1,0):ie(31,11);case d:return q?ie(1,Ee):ie(0,Ee+1);case u:var ke=this.$locale().weekStart||0,Me=(Q<ke?Q+7:Q)-ke;return ie(q?Fe-Me:Fe+(6-Me),Ee);case c:case g:return se(He+"Hours",0);case l:return se(He+"Minutes",1);case a:return se(He+"Seconds",2);case s:return se(He+"Milliseconds",3);default:return this.clone()}},M.endOf=function(V){return this.startOf(V,!1)},M.$set=function(V,U){var W,q=O.p(V),H="set"+(this.$u?"UTC":""),ie=(W={},W[c]=H+"Date",W[g]=H+"Date",W[d]=H+"Month",W[f]=H+"FullYear",W[l]=H+"Hours",W[a]=H+"Minutes",W[s]=H+"Seconds",W[o]=H+"Milliseconds",W)[q],se=q===c?this.$D+(U-this.$W):U;if(q===d||q===f){var Q=this.clone().set(g,1);Q.$d[ie](se),Q.init(),this.$d=Q.set(g,Math.min(this.$D,Q.daysInMonth())).$d}else ie&&this.$d[ie](se);return this.init(),this},M.set=function(V,U){return this.clone().$set(V,U)},M.get=function(V){return this[O.p(V)]()},M.add=function(V,U){var W,q=this;V=Number(V);var H=O.p(U),ie=function(Ee){var Fe=A(q);return O.w(Fe.date(Fe.date()+Math.round(Ee*V)),q)};if(H===d)return this.set(d,this.$M+V);if(H===f)return this.set(f,this.$y+V);if(H===c)return ie(1);if(H===u)return ie(7);var se=(W={},W[a]=i,W[l]=r,W[s]=t,W)[H]||1,Q=this.$d.getTime()+V*se;return O.w(Q,this)},M.subtract=function(V,U){return this.add(-1*V,U)},M.format=function(V){var U=this,W=this.$locale();if(!this.isValid())return W.invalidDate||m;var q=V||"YYYY-MM-DDTHH:mm:ssZ",H=O.z(this),ie=this.$H,se=this.$m,Q=this.$M,Ee=W.weekdays,Fe=W.months,He=W.meridiem,ke=function(qe,Be,_t,Wt){return qe&&(qe[Be]||qe(U,q))||_t[Be].slice(0,Wt)},Me=function(qe){return O.s(ie%12||12,qe,"0")},je=He||function(qe,Be,_t){var Wt=qe<12?"AM":"PM";return _t?Wt.toLowerCase():Wt};return q.replace(_,function(qe,Be){return Be||function(_t){switch(_t){case"YY":return String(U.$y).slice(-2);case"YYYY":return O.s(U.$y,4,"0");case"M":return Q+1;case"MM":return O.s(Q+1,2,"0");case"MMM":return ke(W.monthsShort,Q,Fe,3);case"MMMM":return ke(Fe,Q);case"D":return U.$D;case"DD":return O.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return ke(W.weekdaysMin,U.$W,Ee,2);case"ddd":return ke(W.weekdaysShort,U.$W,Ee,3);case"dddd":return Ee[U.$W];case"H":return String(ie);case"HH":return O.s(ie,2,"0");case"h":return Me(1);case"hh":return Me(2);case"a":return je(ie,se,!0);case"A":return je(ie,se,!1);case"m":return String(se);case"mm":return O.s(se,2,"0");case"s":return String(U.$s);case"ss":return O.s(U.$s,2,"0");case"SSS":return O.s(U.$ms,3,"0");case"Z":return H}return null}(qe)||H.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(V,U,W){var q,H=this,ie=O.p(U),se=A(V),Q=(se.utcOffset()-this.utcOffset())*i,Ee=this-se,Fe=function(){return O.m(H,se)};switch(ie){case f:q=Fe()/12;break;case d:q=Fe();break;case h:q=Fe()/3;break;case u:q=(Ee-Q)/6048e5;break;case c:q=(Ee-Q)/864e5;break;case l:q=Ee/r;break;case a:q=Ee/i;break;case s:q=Ee/t;break;default:q=Ee}return W?q:O.a(q)},M.daysInMonth=function(){return this.endOf(d).$D},M.$locale=function(){return E[this.$L]},M.locale=function(V,U){if(!V)return this.$L;var W=this.clone(),q=D(V,U,!0);return q&&(W.$L=q),W},M.clone=function(){return O.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},B}(),F=P.prototype;return A.prototype=F,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",f],["$D",g]].forEach(function(B){F[B[1]]=function(M){return this.$g(M,B[0],B[1])}}),A.extend=function(B,M){return B.$i||(B(M,P,A),B.$i=!0),A},A.locale=D,A.isDayjs=L,A.unix=function(B){return A(1e3*B)},A.en=E[x],A.Ls=E,A.p={},A})})(j6e);var emt=j6e.exports;const Un=nl(emt);function Qr(n){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qr(n)}function El(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function tmt(n,e){if(Qr(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Qr(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function q6e(n){var e=tmt(n,"string");return Qr(e)==="symbol"?e:String(e)}function _Ee(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,q6e(i.key),i)}}function xl(n,e,t){return e&&_Ee(n.prototype,e),t&&_Ee(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Yr(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function GV(n,e){return GV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},GV(n,e)}function xv(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&GV(n,e)}function fN(n,e){if(e&&(Qr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yr(n)}function Om(n){return Om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Om(n)}function Ze(n,e,t){return e=q6e(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function K6e(n){if(Array.isArray(n))return n}function G6e(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function kie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function vpe(n,e){if(n){if(typeof n=="string")return kie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kie(n,e)}}function Y6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q6e(n){return K6e(n)||G6e(n)||vpe(n)||Y6e()}function vEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function bEe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vEe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var nmt={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},imt=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};El(this,n),this.init(e,t)}return xl(n,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||nmt,this.options=i,this.debug=i.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,i,r,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(r).concat(this.prefix," ").concat(t[0])),this.logger[i](t))}},{key:"create",value:function(t){return new n(this.logger,bEe(bEe({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new n(this.logger,t)}}]),n}(),xb=new imt,Jw=function(){function n(){El(this,n),this.observers={}}return xl(n,[{key:"on",value:function(t,i){var r=this;return t.split(" ").forEach(function(o){r.observers[o]=r.observers[o]||[],r.observers[o].push(i)}),this}},{key:"off",value:function(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(function(r){return r!==i})}}},{key:"emit",value:function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(this.observers[t]){var s=[].concat(this.observers[t]);s.forEach(function(l){l.apply(void 0,r)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[t].concat(r))})}}}]),n}();function QR(){var n,e,t=new Promise(function(i,r){n=i,e=r});return t.resolve=n,t.reject=e,t}function yEe(n){return n==null?"":""+n}function rmt(n,e,t){n.forEach(function(i){e[i]&&(t[i]=e[i])})}function bpe(n,e,t){function i(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function r(){return!n||typeof n=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(r())return{};var s=i(o.shift());!n[s]&&t&&(n[s]=new t),Object.prototype.hasOwnProperty.call(n,s)?n=n[s]:n={}}return r()?{}:{obj:n,k:i(o.shift())}}function CEe(n,e,t){var i=bpe(n,e,Object),r=i.obj,o=i.k;r[o]=t}function omt(n,e,t,i){var r=bpe(n,e,Object),o=r.obj,s=r.k;o[s]=o[s]||[],i&&(o[s]=o[s].concat(t)),i||o[s].push(t)}function YV(n,e){var t=bpe(n,e),i=t.obj,r=t.k;if(i)return i[r]}function smt(n,e,t){var i=YV(n,t);return i!==void 0?i:YV(e,t)}function X6e(n,e,t){for(var i in e)i!=="__proto__"&&i!=="constructor"&&(i in n?typeof n[i]=="string"||n[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?t&&(n[i]=e[i]):X6e(n[i],e[i],t):n[i]=e[i]);return n}function RI(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var amt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function lmt(n){return typeof n=="string"?n.replace(/[&<>"'\/]/g,function(e){return amt[e]}):n}var Ej=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,cmt=[" ",",","?","!",";"];function umt(n,e,t){e=e||"",t=t||"";var i=cmt.filter(function(a){return e.indexOf(a)<0&&t.indexOf(a)<0});if(i.length===0)return!0;var r=new RegExp("(".concat(i.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!r.test(n);if(!o){var s=n.indexOf(t);s>0&&!r.test(n.substring(0,s))&&(o=!0)}return o}function QV(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(n){if(n[e])return n[e];for(var i=e.split(t),r=n,o=0;o<i.length;++o){if(!r||typeof r[i[o]]=="string"&&o+1<i.length)return;if(r[i[o]]===void 0){for(var s=2,a=i.slice(o,o+s).join(t),l=r[a];l===void 0&&i.length>o+s;)s++,a=i.slice(o,o+s).join(t),l=r[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=i.slice(o+s).join(t);return c?QV(l,c,t):void 0}r=r[i[o]]}return r}}function wEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function d8(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wEe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function dmt(n){var e=hmt();return function(){var i=Om(n),r;if(e){var o=Om(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return fN(this,r)}}function hmt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var fmt=function(n){xv(t,n);var e=dmt(t);function t(i){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return El(this,t),r=e.call(this),Ej&&Jw.call(Yr(r)),r.data=i||{},r.options=o,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.options.ignoreJSONStructure===void 0&&(r.options.ignoreJSONStructure=!0),r}return xl(t,[{key:"addNamespaces",value:function(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}},{key:"removeNamespaces",value:function(r){var o=this.options.ns.indexOf(r);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(r,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[r,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),r.indexOf(".")>-1&&(u=r.split("."));var d=YV(this.data,u);return d||!c||typeof s!="string"?d:QV(this.data&&this.data[r]&&this.data[r][o],s,l)}},{key:"addResource",value:function(r,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,u=[r,o];s&&(u=u.concat(c?s.split(c):s)),r.indexOf(".")>-1&&(u=r.split("."),a=o,o=u[1]),this.addNamespaces(o),CEe(this.data,u,a),l.silent||this.emit("added",r,o,s,a)}},{key:"addResources",value:function(r,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(r,o,l,s[l],{silent:!0});a.silent||this.emit("added",r,o,s)}},{key:"addResourceBundle",value:function(r,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[r,o];r.indexOf(".")>-1&&(u=r.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var d=YV(this.data,u)||{};a?X6e(d,s,l):d=d8(d8({},d),s),CEe(this.data,u,d),c.silent||this.emit("added",r,o,s)}},{key:"removeResourceBundle",value:function(r,o){this.hasResourceBundle(r,o)&&delete this.data[r][o],this.removeNamespaces(o),this.emit("removed",r,o)}},{key:"hasResourceBundle",value:function(r,o){return this.getResource(r,o)!==void 0}},{key:"getResourceBundle",value:function(r,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?d8(d8({},{}),this.getResource(r,o)):this.getResource(r,o)}},{key:"getDataByLanguage",value:function(r){return this.data[r]}},{key:"hasLanguageSomeTranslations",value:function(r){var o=this.getDataByLanguage(r),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(Jw),Z6e={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,i,r,o){var s=this;return e.forEach(function(a){s.processors[a]&&(t=s.processors[a].process(t,i,r,o))}),t}};function SEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Kd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?SEe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):SEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function pmt(n){var e=gmt();return function(){var i=Om(n),r;if(e){var o=Om(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return fN(this,r)}}function gmt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var EEe={},xEe=function(n){xv(t,n);var e=pmt(t);function t(i){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return El(this,t),r=e.call(this),Ej&&Jw.call(Yr(r)),rmt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,Yr(r)),r.options=o,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.logger=xb.create("translator"),r}return xl(t,[{key:"changeLanguage",value:function(r){r&&(this.language=r)}},{key:"exists",value:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(r==null)return!1;var s=this.resolve(r,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(r,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&r.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!umt(r,s,a);if(c&&!u){var d=r.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:r,namespaces:l};var h=r.split(s);(s!==a||s===a&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),r=h.join(a)}return typeof l=="string"&&(l=[l]),{key:r,namespaces:l}}},{key:"translate",value:function(r,o,s){var a=this;if(Qr(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),Qr(o)==="object"&&(o=Kd({},o)),o||(o={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(r[r.length-1],o),d=u.key,h=u.namespaces,f=h[h.length-1],g=o.lng||this.language,m=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(m){var v=o.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(f).concat(v).concat(d),usedKey:d,exactUsedKey:d,usedLng:g,usedNS:f}:"".concat(f).concat(v).concat(d)}return l?{res:d,usedKey:d,exactUsedKey:d,usedLng:g,usedNS:f}:d}var _=this.resolve(r,o),b=_&&_.res,y=_&&_.usedKey||d,C=_&&_.exactUsedKey||d,x=Object.prototype.toString.apply(b),E=["[object Number]","[object Function]","[object RegExp]"],k=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,D=typeof b!="string"&&typeof b!="boolean"&&typeof b!="number";if(L&&b&&D&&E.indexOf(x)<0&&!(typeof k=="string"&&x==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,b,Kd(Kd({},o),{},{ns:h})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(_.res=A,_):A}if(c){var O=x==="[object Array]",P=O?[]:{},F=O?C:y;for(var B in b)if(Object.prototype.hasOwnProperty.call(b,B)){var M="".concat(F).concat(c).concat(B);P[B]=this.translate(M,Kd(Kd({},o),{joinArrays:!1,ns:h})),P[B]===M&&(P[B]=b[B])}b=P}}else if(L&&typeof k=="string"&&x==="[object Array]")b=b.join(k),b&&(b=this.extendTranslation(b,r,o,s));else{var V=!1,U=!1,W=o.count!==void 0&&typeof o.count!="string",q=t.hasDefaultValue(o),H=W?this.pluralResolver.getSuffix(g,o.count,o):"",ie=o["defaultValue".concat(H)]||o.defaultValue;!this.isValidLookup(b)&&q&&(V=!0,b=ie),this.isValidLookup(b)||(U=!0,b=d);var se=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Q=se&&U?void 0:b,Ee=q&&ie!==b&&this.options.updateMissing;if(U||V||Ee){if(this.logger.log(Ee?"updateKey":"missingKey",g,f,d,Ee?ie:b),c){var Fe=this.resolve(d,Kd(Kd({},o),{},{keySeparator:!1}));Fe&&Fe.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var He=[],ke=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ke&&ke[0])for(var Me=0;Me<ke.length;Me++)He.push(ke[Me]);else this.options.saveMissingTo==="all"?He=this.languageUtils.toResolveHierarchy(o.lng||this.language):He.push(o.lng||this.language);var je=function(Be,_t,Wt){var Tt=q&&Wt!==b?Wt:Q;a.options.missingKeyHandler?a.options.missingKeyHandler(Be,f,_t,Tt,Ee,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Be,f,_t,Tt,Ee,o),a.emit("missingKey",Be,f,_t,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&W?He.forEach(function(qe){a.pluralResolver.getSuffixes(qe,o).forEach(function(Be){je([qe],d+Be,o["defaultValue".concat(Be)]||ie)})}):je(He,d,ie))}b=this.extendTranslation(b,r,o,_,s),U&&b===d&&this.options.appendNamespaceToMissingKey&&(b="".concat(f,":").concat(d)),(U||V)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(f,":").concat(d):d,V?b:void 0):b=this.options.parseMissingKeyHandler(b))}return l?(_.res=b,_):b}},{key:"extendTranslation",value:function(r,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)r=this.i18nFormat.parse(r,Kd(Kd({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Kd(Kd({},s),{interpolation:Kd(Kd({},this.options.interpolation),s.interpolation)}));var u=typeof r=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(u){var h=r.match(this.interpolator.nestingRegexp);d=h&&h.length}var f=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(f=Kd(Kd({},this.options.interpolation.defaultVariables),f)),r=this.interpolator.interpolate(r,f,s.lng||this.language,s),u){var g=r.match(this.interpolator.nestingRegexp),m=g&&g.length;d<m&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&a&&a.res&&(s.lng=a.usedLng),s.nest!==!1&&(r=this.interpolator.nest(r,function(){for(var b=arguments.length,y=new Array(b),C=0;C<b;C++)y[C]=arguments[C];return l&&l[0]===y[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(o[0])),null):c.translate.apply(c,y.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var v=s.postProcess||this.options.postProcess,_=typeof v=="string"?[v]:v;return r!=null&&_&&_.length&&s.applyPostProcessor!==!1&&(r=Z6e.handle(_,r,o,this.options&&this.options.postProcessPassResolved?Kd({i18nResolved:a},s):s,this)),r}},{key:"resolve",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,d;return typeof r=="string"&&(r=[r]),r.forEach(function(h){if(!o.isValidLookup(a)){var f=o.extractFromKey(h,s),g=f.key;l=g;var m=f.namespaces;o.options.fallbackNS&&(m=m.concat(o.options.fallbackNS));var v=s.count!==void 0&&typeof s.count!="string",_=v&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),b=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);m.forEach(function(C){o.isValidLookup(a)||(d=C,!EEe["".concat(y[0],"-").concat(C)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(d)&&(EEe["".concat(y[0],"-").concat(C)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(x){if(!o.isValidLookup(a)){u=x;var E=[g];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(E,g,x,C,s);else{var k;v&&(k=o.pluralResolver.getSuffix(x,s.count,s));var L="".concat(o.options.pluralSeparator,"zero");if(v&&(E.push(g+k),_&&E.push(g+L)),b){var D="".concat(g).concat(o.options.contextSeparator).concat(s.context);E.push(D),v&&(E.push(D+k),_&&E.push(D+L))}}for(var A;A=E.pop();)o.isValidLookup(a)||(c=A,a=o.getResource(x,C,A,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:d}}},{key:"isValidLookup",value:function(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}},{key:"getResource",value:function(r,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(r,o,s,a):this.resourceStore.getResource(r,o,s,a)}}],[{key:"hasDefaultValue",value:function(r){var o="defaultValue";for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&o===s.substring(0,o.length)&&r[s]!==void 0)return!0;return!1}}]),t}(Jw);function HX(n){return n.charAt(0).toUpperCase()+n.slice(1)}var TEe=function(){function n(e){El(this,n),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xb.create("languageUtils")}return xl(n,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var i=t.split("-");return this.formatLanguageCode(i[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],r=t.split("-");return this.options.lowerCaseLng?r=r.map(function(o){return o.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),i.indexOf(r[1].toLowerCase())>-1&&(r[1]=HX(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),i.indexOf(r[1].toLowerCase())>-1&&(r[1]=HX(r[1].toLowerCase())),i.indexOf(r[2].toLowerCase())>-1&&(r[2]=HX(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var i=this;if(!t)return null;var r;return t.forEach(function(o){if(!r){var s=i.formatLanguageCode(o);(!i.options.supportedLngs||i.isSupportedCode(s))&&(r=s)}}),!r&&this.options.supportedLngs&&t.forEach(function(o){if(!r){var s=i.getLanguagePartFromCode(o);if(i.isSupportedCode(s))return r=s;r=i.options.supportedLngs.find(function(a){if(a===s)return a;if(!(a.indexOf("-")<0&&s.indexOf("-")<0)&&a.indexOf(s)===0)return a})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];var r=t[i];return r||(r=t[this.getScriptPartFromCode(i)]),r||(r=t[this.formatLanguageCode(i)]),r||(r=t[this.getLanguagePartFromCode(i)]),r||(r=t.default),r||[]}},{key:"toResolveHierarchy",value:function(t,i){var r=this,o=this.getFallbackCodes(i||this.options.fallbackLng||[],t),s=[],a=function(c){c&&(r.isSupportedCode(c)?s.push(c):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),o.forEach(function(l){s.indexOf(l)<0&&a(r.formatLanguageCode(l))}),s}}]),n}(),mmt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_mt={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}},vmt=["v1","v2","v3"],kEe={zero:0,one:1,two:2,few:3,many:4,other:5};function bmt(){var n={};return mmt.forEach(function(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:_mt[e.fc]}})}),n}var ymt=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};El(this,n),this.languageUtils=e,this.options=t,this.logger=xb.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=bmt()}return xl(n,[{key:"addRule",value:function(t,i){this.rules[t]=i}},{key:"getRule",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,i);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(function(o){return"".concat(i).concat(o)})}},{key:"getSuffixes",value:function(t){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(t,r);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return kEe[s]-kEe[a]}).map(function(s){return"".concat(i.options.prepend).concat(s)}):o.numbers.map(function(s){return i.getSuffix(t,s,r)}):[]}},{key:"getSuffix",value:function(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(t,r);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(i)):this.getSuffixRetroCompatible(o,i):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,i){var r=this,o=t.noAbs?t.plurals(i):t.plurals(Math.abs(i)),s=t.numbers[o];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!vmt.includes(this.options.compatibilityJSON)}}]),n}();function IEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function d_(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?IEe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):IEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function LEe(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=smt(n,e,t);return!o&&r&&typeof t=="string"&&(o=QV(n,t,i),o===void 0&&(o=QV(e,t,i))),o}var Cmt=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(this,n),this.logger=xb.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return xl(n,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var i=t.interpolation;this.escape=i.escape!==void 0?i.escape:lmt,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?RI(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?RI(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?RI(i.nestingPrefix):i.nestingPrefixEscaped||RI("$t("),this.nestingSuffix=i.nestingSuffix?RI(i.nestingSuffix):i.nestingSuffixEscaped||RI(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var i="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(i,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(t,i,r,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(v){return v.replace(/\$/g,"$$$$")}var h=function(_){if(_.indexOf(s.formatSeparator)<0){var b=LEe(i,u,_,s.options.keySeparator,s.options.ignoreJSONStructure);return s.alwaysFormat?s.format(b,void 0,r,d_(d_(d_({},o),i),{},{interpolationkey:_})):b}var y=_.split(s.formatSeparator),C=y.shift().trim(),x=y.join(s.formatSeparator).trim();return s.format(LEe(i,u,C,s.options.keySeparator,s.options.ignoreJSONStructure),x,r,d_(d_(d_({},o),i),{},{interpolationkey:C}))};this.resetRegExp();var f=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(_){return d(_)}},{regex:this.regexp,safeValue:function(_){return s.escapeValue?d(s.escape(_)):d(_)}}];return m.forEach(function(v){for(c=0;a=v.regex.exec(t);){var _=a[1].trim();if(l=h(_),l===void 0)if(typeof f=="function"){var b=f(t,a,o);l=typeof b=="string"?b:""}else if(o&&Object.prototype.hasOwnProperty.call(o,_))l="";else if(g){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(_," for interpolating ").concat(t)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=yEe(l));var y=v.safeValue(l);if(t=t.replace(a[0],y),g?(v.regex.lastIndex+=l.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),t}},{key:"nest",value:function(t,i){var r=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l;function c(f,g){var m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;var v=f.split(new RegExp("".concat(m,"[ ]*{"))),_="{".concat(v[1]);f=v[0],_=this.interpolate(_,l);var b=_.match(/'/g),y=_.match(/"/g);(b&&b.length%2===0&&!y||y.length%2!==0)&&(_=_.replace(/'/g,'"'));try{l=JSON.parse(_),g&&(l=d_(d_({},g),l))}catch(C){return this.logger.warn("failed parsing options string in nesting for key ".concat(f),C),"".concat(f).concat(m).concat(_)}return delete l.defaultValue,f}for(;s=this.nestingRegexp.exec(t);){var u=[];l=d_({},o),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map(function(f){return f.trim()});s[1]=h.shift(),u=h,d=!0}if(a=i(c.call(this,s[1].trim(),l),l),a&&s[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=yEe(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(t)),a=""),d&&(a=u.reduce(function(f,g){return r.format(f,g,o.lng,d_(d_({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),t=t.replace(s[0],a),this.regexp.lastIndex=0}return t}}]),n}();function DEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function U0(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?DEe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):DEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function wmt(n){var e=n.toLowerCase().trim(),t={};if(n.indexOf("(")>-1){var i=n.split("(");e=i[0].toLowerCase().trim();var r=i[1].substring(0,i[1].length-1);if(e==="currency"&&r.indexOf(":")<0)t.currency||(t.currency=r.trim());else if(e==="relativetime"&&r.indexOf(":")<0)t.range||(t.range=r.trim());else{var o=r.split(";");o.forEach(function(s){if(s){var a=s.split(":"),l=Q6e(a),c=l[0],u=l.slice(1),d=u.join(":").trim().replace(/^'+|'+$/g,"");t[c.trim()]||(t[c.trim()]=d),d==="false"&&(t[c.trim()]=!1),d==="true"&&(t[c.trim()]=!0),isNaN(d)||(t[c.trim()]=parseInt(d,10))}})}}return{formatName:e,formatOptions:t}}function OI(n){var e={};return function(i,r,o){var s=r+JSON.stringify(o),a=e[s];return a||(a=n(r,o),e[s]=a),a(i)}}var Smt=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(this,n),this.logger=xb.create("formatter"),this.options=e,this.formats={number:OI(function(t,i){var r=new Intl.NumberFormat(t,U0({},i));return function(o){return r.format(o)}}),currency:OI(function(t,i){var r=new Intl.NumberFormat(t,U0(U0({},i),{},{style:"currency"}));return function(o){return r.format(o)}}),datetime:OI(function(t,i){var r=new Intl.DateTimeFormat(t,U0({},i));return function(o){return r.format(o)}}),relativetime:OI(function(t,i){var r=new Intl.RelativeTimeFormat(t,U0({},i));return function(o){return r.format(o,i.range||"day")}}),list:OI(function(t,i){var r=new Intl.ListFormat(t,U0({},i));return function(o){return r.format(o)}})},this.init(e)}return xl(n,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},r=i.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(t,i){this.formats[t.toLowerCase().trim()]=i}},{key:"addCached",value:function(t,i){this.formats[t.toLowerCase().trim()]=OI(i)}},{key:"format",value:function(t,i,r){var o=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=i.split(this.formatSeparator),l=a.reduce(function(c,u){var d=wmt(u),h=d.formatName,f=d.formatOptions;if(o.formats[h]){var g=c;try{var m=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},v=m.locale||m.lng||s.locale||s.lng||r;g=o.formats[h](c,v,U0(U0(U0({},f),s),m))}catch(_){o.logger.warn(_)}return g}else o.logger.warn("there was no format function for ".concat(h));return c},t);return l}}]),n}();function AEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function NEe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?AEe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):AEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Emt(n){var e=xmt();return function(){var i=Om(n),r;if(e){var o=Om(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return fN(this,r)}}function xmt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Tmt(n,e){n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)}var kmt=function(n){xv(t,n);var e=Emt(t);function t(i,r,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return El(this,t),s=e.call(this),Ej&&Jw.call(Yr(s)),s.backend=i,s.store=r,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=xb.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return xl(t,[{key:"queueLoad",value:function(r,o,s,a){var l=this,c={},u={},d={},h={};return r.forEach(function(f){var g=!0;o.forEach(function(m){var v="".concat(f,"|").concat(m);!s.reload&&l.store.hasResourceBundle(f,m)?l.state[v]=2:l.state[v]<0||(l.state[v]===1?u[v]===void 0&&(u[v]=!0):(l.state[v]=1,g=!1,u[v]===void 0&&(u[v]=!0),c[v]===void 0&&(c[v]=!0),h[m]===void 0&&(h[m]=!0)))}),g||(d[f]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(h)}}},{key:"loaded",value:function(r,o,s){var a=r.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[r]=o?-1:2;var u={};this.queue.forEach(function(d){omt(d.loaded,[l],c),Tmt(d,r),o&&d.errors.push(o),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(h){u[h]||(u[h]={});var f=d.loaded[h];f.length&&f.forEach(function(g){u[h][g]===void 0&&(u[h][g]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(r,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!r.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:o,fcName:s,tried:l,wait:c,callback:u});return}this.readingCalls++;var d=function(m,v){if(a.readingCalls--,a.waitingReads.length>0){var _=a.waitingReads.shift();a.read(_.lng,_.ns,_.fcName,_.tried,_.wait,_.callback)}if(m&&v&&l<a.maxRetries){setTimeout(function(){a.read.call(a,r,o,s,l+1,c*2,u)},c);return}u(m,v)},h=this.backend[s].bind(this.backend);if(h.length===2){try{var f=h(r,o);f&&typeof f.then=="function"?f.then(function(g){return d(null,g)}).catch(d):d(null,f)}catch(g){d(g)}return}return h(r,o,d)}},{key:"prepareLoading",value:function(r,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof r=="string"&&(r=this.languageUtils.toResolveHierarchy(r)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(r,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(r,o,s){this.prepareLoading(r,o,{},s)}},{key:"reload",value:function(r,o,s){this.prepareLoading(r,o,{reload:!0},s)}},{key:"loadOne",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=r.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,d){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&d&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),d),o.loaded(r,u,d)})}},{key:"saveMissing",value:function(r,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var d=NEe(NEe({},c),{},{isUpdate:l}),h=this.backend.create.bind(this.backend);if(h.length<6)try{var f;h.length===5?f=h(r,o,s,a,d):f=h(r,o,s,a),f&&typeof f.then=="function"?f.then(function(g){return u(null,g)}).catch(u):u(null,f)}catch(g){u(g)}else h(r,o,s,a,u,d)}!r||!r[0]||this.store.addResource(r[0],o,s,a)}}}]),t}(Jw);function REe(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(Qr(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),Qr(e[2])==="object"||Qr(e[3])==="object"){var i=e[3]||e[2];Object.keys(i).forEach(function(r){t[r]=i[r]})}return t},interpolation:{escapeValue:!0,format:function(e,t,i,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function OEe(n){return typeof n.ns=="string"&&(n.ns=[n.ns]),typeof n.fallbackLng=="string"&&(n.fallbackLng=[n.fallbackLng]),typeof n.fallbackNS=="string"&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs&&n.supportedLngs.indexOf("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),n}function PEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function $v(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?PEe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):PEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Imt(n){var e=Lmt();return function(){var i=Om(n),r;if(e){var o=Om(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return fN(this,r)}}function Lmt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h8(){}function Dmt(n){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(n));e.forEach(function(t){typeof n[t]=="function"&&(n[t]=n[t].bind(n))})}var XV=function(n){xv(t,n);var e=Imt(t);function t(){var i,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(El(this,t),i=e.call(this),Ej&&Jw.call(Yr(i)),i.options=OEe(r),i.services={},i.logger=xb,i.modules={external:[]},Dmt(Yr(i)),o&&!i.isInitialized&&!r.isClone){if(!i.options.initImmediate)return i.init(r,o),fN(i,Yr(i));setTimeout(function(){i.init(r,o)},0)}return i}return xl(t,[{key:"init",value:function(){var r=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=REe();this.options=$v($v($v({},a),this.options),OEe(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=$v($v({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(_){return _?typeof _=="function"?new _:_:null}if(!this.options.isClone){this.modules.logger?xb.init(l(this.modules.logger),this.options):xb.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Smt);var u=new TEe(this.options);this.store=new fmt(this.options.resources,this.options);var d=this.services;d.logger=xb,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new ymt(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=l(c),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new Cmt(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new kmt(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(_){for(var b=arguments.length,y=new Array(b>1?b-1:0),C=1;C<b;C++)y[C-1]=arguments[C];r.emit.apply(r,[_].concat(y))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new xEe(this.services,this.options),this.translator.on("*",function(_){for(var b=arguments.length,y=new Array(b>1?b-1:0),C=1;C<b;C++)y[C-1]=arguments[C];r.emit.apply(r,[_].concat(y))}),this.modules.external.forEach(function(_){_.init&&_.init(r)})}if(this.format=this.options.interpolation.format,s||(s=h8),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var f=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];f.forEach(function(_){r[_]=function(){var b;return(b=r.store)[_].apply(b,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(_){r[_]=function(){var b;return(b=r.store)[_].apply(b,arguments),r}});var m=QR(),v=function(){var b=function(C,x){r.isInitialized&&!r.initializedStoreOnce&&r.logger.warn("init: i18next is already initialized. You should call init just once!"),r.isInitialized=!0,r.options.isClone||r.logger.log("initialized",r.options),r.emit("initialized",r.options),m.resolve(x),s(C,x)};if(r.languages&&r.options.compatibilityAPI!=="v1"&&!r.isInitialized)return b(null,r.t.bind(r));r.changeLanguage(r.options.lng,b)};return this.options.resources||!this.options.initImmediate?v():setTimeout(v,0),m}},{key:"loadResources",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h8,a=s,l=typeof r=="string"?r:this.language;if(typeof r=="function"&&(a=r),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(f){if(f){var g=o.services.languageUtils.toResolveHierarchy(f);g.forEach(function(m){c.indexOf(m)<0&&c.push(m)})}};if(l)u(l);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(h){return u(h)})}this.options.preload&&this.options.preload.forEach(function(h){return u(h)}),this.services.backendConnector.load(c,this.options.ns,function(h){!h&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(h)})}else a(null)}},{key:"reloadResources",value:function(r,o,s){var a=QR();return r||(r=this.languages),o||(o=this.options.ns),s||(s=h8),this.services.backendConnector.reload(r,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&Z6e.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}},{key:"setResolvedLanguage",value:function(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(r,o){var s=this;this.isLanguageChangingTo=r;var a=QR();this.emit("languageChanging",r);var l=function(h){s.language=h,s.languages=s.services.languageUtils.toResolveHierarchy(h),s.resolvedLanguage=void 0,s.setResolvedLanguage(h)},c=function(h,f){f?(l(f),s.translator.changeLanguage(f),s.isLanguageChangingTo=void 0,s.emit("languageChanged",f),s.logger.log("languageChanged",f)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(h,function(){return s.t.apply(s,arguments)})},u=function(h){!r&&!h&&s.services.languageDetector&&(h=[]);var f=typeof h=="string"?h:s.services.languageUtils.getBestMatchFromCodes(h);f&&(s.language||l(f),s.translator.language||s.translator.changeLanguage(f),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(f)),s.loadResources(f,function(g){c(g,f)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(r),a}},{key:"getFixedT",value:function(r,o,s){var a=this,l=function c(u,d){var h;if(Qr(d)!=="object"){for(var f=arguments.length,g=new Array(f>2?f-2:0),m=2;m<f;m++)g[m-2]=arguments[m];h=a.options.overloadTranslationOptionHandler([u,d].concat(g))}else h=$v({},d);h.lng=h.lng||c.lng,h.lngs=h.lngs||c.lngs,h.ns=h.ns||c.ns,h.keyPrefix=h.keyPrefix||s||c.keyPrefix;var v=a.options.keySeparator||".",_;return h.keyPrefix&&Array.isArray(u)?_=u.map(function(b){return"".concat(h.keyPrefix).concat(v).concat(b)}):_=h.keyPrefix?"".concat(h.keyPrefix).concat(v).concat(u):u,a.t(_,h)};return typeof r=="string"?l.lng=r:l.lngs=r,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var r;return this.translator&&(r=this.translator).translate.apply(r,arguments)}},{key:"exists",value:function(){var r;return this.translator&&(r=this.translator).exists.apply(r,arguments)}},{key:"setDefaultNamespace",value:function(r){this.options.defaultNS=r}},{key:"hasLoadedNamespace",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=s.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(f,g){var m=o.services.backendConnector.state["".concat(f,"|").concat(g)];return m===-1||m===2};if(s.precheck){var d=s.precheck(this,u);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,r)&&(!l||u(c,r)))}},{key:"loadNamespaces",value:function(r,o){var s=this,a=QR();return this.options.ns?(typeof r=="string"&&(r=[r]),r.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(r,o){var s=QR();typeof r=="string"&&(r=[r]);var a=this.options.preload||[],l=r.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(r){if(r||(r=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!r)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new TEe(REe());return o.indexOf(s.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var r=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h8,a=$v($v($v({},this.options),o),{isClone:!0}),l=new t(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var c=["store","services","language"];return c.forEach(function(u){l[u]=r[u]}),l.services=$v({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new xEe(l.services,l.options),l.translator.on("*",function(u){for(var d=arguments.length,h=new Array(d>1?d-1:0),f=1;f<d;f++)h[f-1]=arguments[f];l.emit.apply(l,[u].concat(h))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}(Jw);Ze(XV,"createInstance",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new XV(n,e)});var gh=XV.createInstance();gh.createInstance=XV.createInstance;gh.createInstance;gh.dir;gh.init;gh.loadResources;gh.reloadResources;gh.use;gh.changeLanguage;gh.getFixedT;var Iie=gh.t;gh.exists;gh.setDefaultNamespace;gh.hasLoadedNamespace;gh.loadNamespaces;gh.loadLanguages;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function bt(n,e={}){let t=n;for(const i in e)t=t.replace(`:${i}`,e[i]);return t}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var Zi=(n=>(n.Active="active",n.Archived="archived",n.Deleted="deleted",n))(Zi||{});/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const WX={[Zi.Active]:"active",[Zi.Archived]:"archived",[Zi.Deleted]:"deleted"};var ype={exports:{}},J6e=function(e,t){return function(){for(var r=new Array(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];return e.apply(t,r)}},Amt=J6e,Cpe=Object.prototype.toString,wpe=function(n){return function(e){var t=Cpe.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function Dk(n){return n=n.toLowerCase(),function(t){return wpe(t)===n}}function Spe(n){return Array.isArray(n)}function ZV(n){return typeof n>"u"}function Nmt(n){return n!==null&&!ZV(n)&&n.constructor!==null&&!ZV(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}var eBe=Dk("ArrayBuffer");function Rmt(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&eBe(n.buffer),e}function Omt(n){return typeof n=="string"}function Pmt(n){return typeof n=="number"}function tBe(n){return n!==null&&typeof n=="object"}function t$(n){if(wpe(n)!=="object")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}var Mmt=Dk("Date"),Fmt=Dk("File"),Bmt=Dk("Blob"),$mt=Dk("FileList");function Epe(n){return Cpe.call(n)==="[object Function]"}function Vmt(n){return tBe(n)&&Epe(n.pipe)}function Hmt(n){var e="[object FormData]";return n&&(typeof FormData=="function"&&n instanceof FormData||Cpe.call(n)===e||Epe(n.toString)&&n.toString()===e)}var Wmt=Dk("URLSearchParams");function zmt(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Umt(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function xpe(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),Spe(n))for(var t=0,i=n.length;t<i;t++)e.call(null,n[t],t,n);else for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.call(null,n[r],r,n)}function Lie(){var n={};function e(r,o){t$(n[o])&&t$(r)?n[o]=Lie(n[o],r):t$(r)?n[o]=Lie({},r):Spe(r)?n[o]=r.slice():n[o]=r}for(var t=0,i=arguments.length;t<i;t++)xpe(arguments[t],e);return n}function jmt(n,e,t){return xpe(e,function(r,o){t&&typeof r=="function"?n[o]=Amt(r,t):n[o]=r}),n}function qmt(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}function Kmt(n,e,t,i){n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,t&&Object.assign(n.prototype,t)}function Gmt(n,e,t){var i,r,o,s={};e=e||{};do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)o=i[r],s[o]||(e[o]=n[o],s[o]=!0);n=Object.getPrototypeOf(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e}function Ymt(n,e,t){n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;var i=n.indexOf(e,t);return i!==-1&&i===t}function Qmt(n){if(!n)return null;var e=n.length;if(ZV(e))return null;for(var t=new Array(e);e-- >0;)t[e]=n[e];return t}var Xmt=function(n){return function(e){return n&&e instanceof n}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),$d={isArray:Spe,isArrayBuffer:eBe,isBuffer:Nmt,isFormData:Hmt,isArrayBufferView:Rmt,isString:Omt,isNumber:Pmt,isObject:tBe,isPlainObject:t$,isUndefined:ZV,isDate:Mmt,isFile:Fmt,isBlob:Bmt,isFunction:Epe,isStream:Vmt,isURLSearchParams:Wmt,isStandardBrowserEnv:Umt,forEach:xpe,merge:Lie,extend:jmt,trim:zmt,stripBOM:qmt,inherits:Kmt,toFlatObject:Gmt,kindOf:wpe,kindOfTest:Dk,endsWith:Ymt,toArray:Qmt,isTypedArray:Xmt,isFileList:$mt},PI=$d;function MEe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var nBe=function(e,t,i){if(!t)return e;var r;if(i)r=i(t);else if(PI.isURLSearchParams(t))r=t.toString();else{var o=[];PI.forEach(t,function(l,c){l===null||typeof l>"u"||(PI.isArray(l)?c=c+"[]":l=[l],PI.forEach(l,function(d){PI.isDate(d)?d=d.toISOString():PI.isObject(d)&&(d=JSON.stringify(d)),o.push(MEe(c)+"="+MEe(d))}))}),r=o.join("&")}if(r){var s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e},Zmt=$d;function xj(){this.handlers=[]}xj.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1};xj.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};xj.prototype.forEach=function(e){Zmt.forEach(this.handlers,function(i){i!==null&&e(i)})};var Jmt=xj,e_t=$d,t_t=function(e,t){e_t.forEach(e,function(r,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[o])})},iBe=$d;function ND(n,e,t,i,r){Error.call(this),this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r)}iBe.inherits(ND,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var rBe=ND.prototype,oBe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(n){oBe[n]={value:n}});Object.defineProperties(ND,oBe);Object.defineProperty(rBe,"isAxiosError",{value:!0});ND.from=function(n,e,t,i,r,o){var s=Object.create(rBe);return iBe.toFlatObject(n,s,function(l){return l!==Error.prototype}),ND.call(s,n.message,e,t,i,r),s.name=n.name,o&&Object.assign(s,o),s};var pN=ND,sBe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},h_=$d;function n_t(n,e){e=e||new FormData;var t=[];function i(o){return o===null?"":h_.isDate(o)?o.toISOString():h_.isArrayBuffer(o)||h_.isTypedArray(o)?typeof Blob=="function"?new Blob([o]):Buffer.from(o):o}function r(o,s){if(h_.isPlainObject(o)||h_.isArray(o)){if(t.indexOf(o)!==-1)throw Error("Circular reference detected in "+s);t.push(o),h_.forEach(o,function(l,c){if(!h_.isUndefined(l)){var u=s?s+"."+c:c,d;if(l&&!s&&typeof l=="object"){if(h_.endsWith(c,"{}"))l=JSON.stringify(l);else if(h_.endsWith(c,"[]")&&(d=h_.toArray(l))){d.forEach(function(h){!h_.isUndefined(h)&&e.append(u,i(h))});return}}r(l,u)}}),t.pop()}else e.append(s,i(o))}return r(n),e}var aBe=n_t,zX,FEe;function i_t(){if(FEe)return zX;FEe=1;var n=pN;return zX=function(t,i,r){var o=r.config.validateStatus;!r.status||!o||o(r.status)?t(r):i(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))},zX}var UX,BEe;function r_t(){if(BEe)return UX;BEe=1;var n=$d;return UX=n.isStandardBrowserEnv()?function(){return{write:function(i,r,o,s,a,l){var c=[];c.push(i+"="+encodeURIComponent(r)),n.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),n.isString(s)&&c.push("path="+s),n.isString(a)&&c.push("domain="+a),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(i){var r=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(i){this.write(i,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),UX}var o_t=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},s_t=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},a_t=o_t,l_t=s_t,lBe=function(e,t){return e&&!a_t(t)?l_t(e,t):t},jX,$Ee;function c_t(){if($Ee)return jX;$Ee=1;var n=$d,e=["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"];return jX=function(i){var r={},o,s,a;return i&&n.forEach(i.split(` `),function(c){if(a=c.indexOf(":"),o=n.trim(c.substr(0,a)).toLowerCase(),s=n.trim(c.substr(a+1)),o){if(r[o]&&e.indexOf(o)>=0)return;o==="set-cookie"?r[o]=(r[o]?r[o]:[]).concat([s]):r[o]=r[o]?r[o]+", "+s:s}}),r},jX}var qX,VEe;function u_t(){if(VEe)return qX;VEe=1;var n=$d;return qX=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),r;function o(s){var a=s;return t&&(i.setAttribute("href",a),a=i.href),i.setAttribute("href",a),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=o(window.location.href),function(a){var l=n.isString(a)?o(a):a;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),qX}var KX,HEe;function Tj(){if(HEe)return KX;HEe=1;var n=pN,e=$d;function t(i){n.call(this,i??"canceled",n.ERR_CANCELED),this.name="CanceledError"}return e.inherits(t,n,{__CANCEL__:!0}),KX=t,KX}var GX,WEe;function d_t(){return WEe||(WEe=1,GX=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),GX}var YX,zEe;function UEe(){if(zEe)return YX;zEe=1;var n=$d,e=i_t(),t=r_t(),i=nBe,r=lBe,o=c_t(),s=u_t(),a=sBe,l=pN,c=Tj(),u=d_t();return YX=function(h){return new Promise(function(g,m){var v=h.data,_=h.headers,b=h.responseType,y;function C(){h.cancelToken&&h.cancelToken.unsubscribe(y),h.signal&&h.signal.removeEventListener("abort",y)}n.isFormData(v)&&n.isStandardBrowserEnv()&&delete _["Content-Type"];var x=new XMLHttpRequest;if(h.auth){var E=h.auth.username||"",k=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"";_.Authorization="Basic "+btoa(E+":"+k)}var L=r(h.baseURL,h.url);x.open(h.method.toUpperCase(),i(L,h.params,h.paramsSerializer),!0),x.timeout=h.timeout;function D(){if(x){var P="getAllResponseHeaders"in x?o(x.getAllResponseHeaders()):null,F=!b||b==="text"||b==="json"?x.responseText:x.response,B={data:F,status:x.status,statusText:x.statusText,headers:P,config:h,request:x};e(function(V){g(V),C()},function(V){m(V),C()},B),x=null}}if("onloadend"in x?x.onloadend=D:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(D)},x.onabort=function(){x&&(m(new l("Request aborted",l.ECONNABORTED,h,x)),x=null)},x.onerror=function(){m(new l("Network Error",l.ERR_NETWORK,h,x,x)),x=null},x.ontimeout=function(){var F=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",B=h.transitional||a;h.timeoutErrorMessage&&(F=h.timeoutErrorMessage),m(new l(F,B.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,h,x)),x=null},n.isStandardBrowserEnv()){var A=(h.withCredentials||s(L))&&h.xsrfCookieName?t.read(h.xsrfCookieName):void 0;A&&(_[h.xsrfHeaderName]=A)}"setRequestHeader"in x&&n.forEach(_,function(F,B){typeof v>"u"&&B.toLowerCase()==="content-type"?delete _[B]:x.setRequestHeader(B,F)}),n.isUndefined(h.withCredentials)||(x.withCredentials=!!h.withCredentials),b&&b!=="json"&&(x.responseType=h.responseType),typeof h.onDownloadProgress=="function"&&x.addEventListener("progress",h.onDownloadProgress),typeof h.onUploadProgress=="function"&&x.upload&&x.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(y=function(P){x&&(m(!P||P&&P.type?new c:P),x.abort(),x=null)},h.cancelToken&&h.cancelToken.subscribe(y),h.signal&&(h.signal.aborted?y():h.signal.addEventListener("abort",y))),v||(v=null);var O=u(L);if(O&&["http","https","file"].indexOf(O)===-1){m(new l("Unsupported protocol "+O+":",l.ERR_BAD_REQUEST,h));return}x.send(v)})},YX}var QX,jEe;function h_t(){return jEe||(jEe=1,QX=null),QX}var Mu=$d,qEe=t_t,KEe=pN,f_t=sBe,p_t=aBe,g_t={"Content-Type":"application/x-www-form-urlencoded"};function GEe(n,e){!Mu.isUndefined(n)&&Mu.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function m_t(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=UEe()),n}function __t(n,e,t){if(Mu.isString(n))try{return(e||JSON.parse)(n),Mu.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}var kj={transitional:f_t,adapter:m_t(),transformRequest:[function(e,t){if(qEe(t,"Accept"),qEe(t,"Content-Type"),Mu.isFormData(e)||Mu.isArrayBuffer(e)||Mu.isBuffer(e)||Mu.isStream(e)||Mu.isFile(e)||Mu.isBlob(e))return e;if(Mu.isArrayBufferView(e))return e.buffer;if(Mu.isURLSearchParams(e))return GEe(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i=Mu.isObject(e),r=t&&t["Content-Type"],o;if((o=Mu.isFileList(e))||i&&r==="multipart/form-data"){var s=this.env&&this.env.FormData;return p_t(o?{"files[]":e}:e,s&&new s)}else if(i||r==="application/json")return GEe(t,"application/json"),__t(e);return e}],transformResponse:[function(e){var t=this.transitional||kj.transitional,i=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!i&&this.responseType==="json";if(o||r&&Mu.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?KEe.from(s,KEe.ERR_BAD_RESPONSE,this,null,this.response):s}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:h_t()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Mu.forEach(["delete","get","head"],function(e){kj.headers[e]={}});Mu.forEach(["post","put","patch"],function(e){kj.headers[e]=Mu.merge(g_t)});var Tpe=kj,v_t=$d,b_t=Tpe,y_t=function(e,t,i){var r=this||b_t;return v_t.forEach(i,function(s){e=s.call(r,e,t)}),e},XX,YEe;function cBe(){return YEe||(YEe=1,XX=function(e){return!!(e&&e.__CANCEL__)}),XX}var QEe=$d,ZX=y_t,C_t=cBe(),w_t=Tpe,S_t=Tj();function JX(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new S_t}var E_t=function(e){JX(e),e.headers=e.headers||{},e.data=ZX.call(e,e.data,e.headers,e.transformRequest),e.headers=QEe.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),QEe.forEach(["delete","get","head","post","put","patch","common"],function(r){delete e.headers[r]});var t=e.adapter||w_t.adapter;return t(e).then(function(r){return JX(e),r.data=ZX.call(e,r.data,r.headers,e.transformResponse),r},function(r){return C_t(r)||(JX(e),r&&r.response&&(r.response.data=ZX.call(e,r.response.data,r.response.headers,e.transformResponse))),Promise.reject(r)})},yp=$d,uBe=function(e,t){t=t||{};var i={};function r(u,d){return yp.isPlainObject(u)&&yp.isPlainObject(d)?yp.merge(u,d):yp.isPlainObject(d)?yp.merge({},d):yp.isArray(d)?d.slice():d}function o(u){if(yp.isUndefined(t[u])){if(!yp.isUndefined(e[u]))return r(void 0,e[u])}else return r(e[u],t[u])}function s(u){if(!yp.isUndefined(t[u]))return r(void 0,t[u])}function a(u){if(yp.isUndefined(t[u])){if(!yp.isUndefined(e[u]))return r(void 0,e[u])}else return r(void 0,t[u])}function l(u){if(u in t)return r(e[u],t[u]);if(u in e)return r(void 0,e[u])}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l};return yp.forEach(Object.keys(e).concat(Object.keys(t)),function(d){var h=c[d]||o,f=h(d);yp.isUndefined(f)&&h!==l||(i[d]=f)}),i},eZ,XEe;function dBe(){return XEe||(XEe=1,eZ={version:"0.27.2"}),eZ}var x_t=dBe().version,EC=pN,kpe={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){kpe[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});var ZEe={};kpe.transitional=function(e,t,i){function r(o,s){return"[Axios v"+x_t+"] Transitional option '"+o+"'"+s+(i?". "+i:"")}return function(o,s,a){if(e===!1)throw new EC(r(s," has been removed"+(t?" in "+t:"")),EC.ERR_DEPRECATED);return t&&!ZEe[s]&&(ZEe[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,s,a):!0}};function T_t(n,e,t){if(typeof n!="object")throw new EC("options must be an object",EC.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(n),r=i.length;r-- >0;){var o=i[r],s=e[o];if(s){var a=n[o],l=a===void 0||s(a,o,n);if(l!==!0)throw new EC("option "+o+" must be "+l,EC.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new EC("Unknown option "+o,EC.ERR_BAD_OPTION)}}var k_t={assertOptions:T_t,validators:kpe},hBe=$d,I_t=nBe,JEe=Jmt,exe=E_t,Ij=uBe,L_t=lBe,fBe=k_t,MI=fBe.validators;function RD(n){this.defaults=n,this.interceptors={request:new JEe,response:new JEe}}RD.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Ij(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var i=t.transitional;i!==void 0&&fBe.assertOptions(i,{silentJSONParsing:MI.transitional(MI.boolean),forcedJSONParsing:MI.transitional(MI.boolean),clarifyTimeoutError:MI.transitional(MI.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(o=o&&f.synchronous,r.unshift(f.fulfilled,f.rejected))});var s=[];this.interceptors.response.forEach(function(f){s.push(f.fulfilled,f.rejected)});var a;if(!o){var l=[exe,void 0];for(Array.prototype.unshift.apply(l,r),l=l.concat(s),a=Promise.resolve(t);l.length;)a=a.then(l.shift(),l.shift());return a}for(var c=t;r.length;){var u=r.shift(),d=r.shift();try{c=u(c)}catch(h){d(h);break}}try{a=exe(c)}catch(h){return Promise.reject(h)}for(;s.length;)a=a.then(s.shift(),s.shift());return a};RD.prototype.getUri=function(e){e=Ij(this.defaults,e);var t=L_t(e.baseURL,e.url);return I_t(t,e.params,e.paramsSerializer)};hBe.forEach(["delete","get","head","options"],function(e){RD.prototype[e]=function(t,i){return this.request(Ij(i||{},{method:e,url:t,data:(i||{}).data}))}});hBe.forEach(["post","put","patch"],function(e){function t(i){return function(o,s,a){return this.request(Ij(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}RD.prototype[e]=t(),RD.prototype[e+"Form"]=t(!0)});var D_t=RD,tZ,txe;function A_t(){if(txe)return tZ;txe=1;var n=Tj();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(s){i=s});var r=this;this.promise.then(function(o){if(r._listeners){var s,a=r._listeners.length;for(s=0;s<a;s++)r._listeners[s](o);r._listeners=null}}),this.promise.then=function(o){var s,a=new Promise(function(l){r.subscribe(l),s=l}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s){r.reason||(r.reason=new n(s),i(r.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]},e.prototype.unsubscribe=function(i){if(this._listeners){var r=this._listeners.indexOf(i);r!==-1&&this._listeners.splice(r,1)}},e.source=function(){var i,r=new e(function(s){i=s});return{token:r,cancel:i}},tZ=e,tZ}var nZ,nxe;function N_t(){return nxe||(nxe=1,nZ=function(e){return function(i){return e.apply(null,i)}}),nZ}var iZ,ixe;function R_t(){if(ixe)return iZ;ixe=1;var n=$d;return iZ=function(t){return n.isObject(t)&&t.isAxiosError===!0},iZ}var rxe=$d,O_t=J6e,n$=D_t,P_t=uBe,M_t=Tpe;function pBe(n){var e=new n$(n),t=O_t(n$.prototype.request,e);return rxe.extend(t,n$.prototype,e),rxe.extend(t,e),t.create=function(r){return pBe(P_t(n,r))},t}var Kf=pBe(M_t);Kf.Axios=n$;Kf.CanceledError=Tj();Kf.CancelToken=A_t();Kf.isCancel=cBe();Kf.VERSION=dBe().version;Kf.toFormData=aBe;Kf.AxiosError=pN;Kf.Cancel=Kf.CanceledError;Kf.all=function(e){return Promise.all(e)};Kf.spread=N_t();Kf.isAxiosError=R_t();ype.exports=Kf;ype.exports.default=Kf;var F_t=ype.exports,B_t=F_t;const Ipe=nl(B_t);let $_t=0;function Oo(n,e){const t=`atom${++$_t}`,i={toString:()=>t};return typeof n=="function"?i.read=n:(i.init=n,i.read=function(r){return r(this)},i.write=function(r,o,s){return o(this,typeof s=="function"?s(r(this)):s)}),e&&(i.write=e),i}const oxe=n=>"init"in n,sxe=n=>!!n.write,JV=new WeakMap,V_t=(n,e)=>{JV.set(n,e),n.catch(()=>{}).finally(()=>JV.delete(n))},axe=(n,e)=>{const t=JV.get(n);t&&(JV.delete(n),t(e))},lxe=(n,e)=>{n.status="fulfilled",n.value=e},cxe=(n,e)=>{n.status="rejected",n.reason=e},H_t=n=>typeof(n==null?void 0:n.then)=="function",XR=(n,e)=>!!n&&"v"in n&&"v"in e&&Object.is(n.v,e.v),uxe=(n,e)=>!!n&&"e"in n&&"e"in e&&Object.is(n.e,e.e),FI=n=>!!n&&"v"in n&&n.v instanceof Promise,W_t=(n,e)=>"v"in n&&"v"in e&&n.v.orig&&n.v.orig===e.v.orig,f8=n=>{if("e"in n)throw n.e;return n.v},z_t=()=>{const n=new WeakMap,e=new WeakMap,t=new Map;let i,r;const o=L=>n.get(L),s=(L,D)=>{const A=n.get(L);if(n.set(L,D),t.has(L)||t.set(L,A),FI(A)){const O="v"in D?D.v instanceof Promise?D.v:Promise.resolve(D.v):Promise.reject(D.e);A.v!==O&&axe(A.v,O)}},a=(L,D,A)=>{const O=new Map;let P=!1;A.forEach((F,B)=>{!F&&B===L&&(F=D),F&&(O.set(B,F),D.d.get(B)!==F&&(P=!0))}),(P||D.d.size!==O.size)&&(D.d=O)},l=(L,D,A)=>{const O=o(L),P={d:(O==null?void 0:O.d)||new Map,v:D};if(A&&a(L,P,A),XR(O,P)&&O.d===P.d)return O;if(FI(O)&&FI(P)&&W_t(O,P)){if(O.d===P.d)return O;P.v=O.v}return s(L,P),P},c=(L,D,A,O)=>{if(H_t(D)){let P;const F=()=>{const M=o(L);if(!FI(M)||M.v!==B)return;const V=l(L,B,A);e.has(L)&&M.d!==V.d&&x(L,V,M.d)},B=new Promise((M,V)=>{let U=!1;D.then(W=>{U||(U=!0,lxe(B,W),M(W),F())},W=>{U||(U=!0,cxe(B,W),V(W),F())}),P=W=>{U||(U=!0,W.then(q=>lxe(B,q),q=>cxe(B,q)),M(W))}});return B.orig=D,B.status="pending",V_t(B,M=>{M&&P(M),O==null||O()}),l(L,B,A)}return l(L,D,A)},u=(L,D,A)=>{const O=o(L),P={d:(O==null?void 0:O.d)||new Map,e:D};return A&&a(L,P,A),uxe(O,P)&&O.d===P.d?O:(s(L,P),P)},d=(L,D)=>{const A=o(L);if(!D&&A&&(e.has(L)||Array.from(A.d).every(([U,W])=>{if(U===L)return!0;const q=d(U);return q===W||XR(q,W)})))return A;const O=new Map;let P=!0;const F=U=>{if(U===L){const q=o(U);if(q)return O.set(U,q),f8(q);if(oxe(U))return O.set(U,void 0),U.init;throw new Error("no atom init")}const W=d(U);return O.set(U,W),f8(W)};let B,M;const V={get signal(){return B||(B=new AbortController),B.signal},get setSelf(){return!M&&sxe(L)&&(M=(...U)=>{if(!P)return b(L,...U)}),M}};try{const U=L.read(F,V);return c(L,U,O,()=>B==null?void 0:B.abort())}catch(U){return u(L,U,O)}finally{P=!1}},h=L=>f8(d(L)),f=L=>{let D=e.get(L);return D||(D=y(L)),D},g=(L,D)=>!D.l.size&&(!D.t.size||D.t.size===1&&D.t.has(L)),m=L=>{const D=e.get(L);D&&g(L,D)&&C(L)},v=L=>{const D=new Map,A=new WeakMap,O=B=>{var M;const V=new Set((M=e.get(B))==null?void 0:M.t);return t.forEach((U,W)=>{var q;(q=o(W))!=null&&q.d.has(B)&&V.add(W)}),V},P=B=>{O(B).forEach(M=>{M!==B&&(D.set(M,(D.get(M)||new Set).add(B)),A.set(M,(A.get(M)||0)+1),P(M))})};P(L);const F=B=>{O(B).forEach(M=>{var V;if(M!==B){let U=A.get(M);if(U&&A.set(M,--U),!U){let W=!!((V=D.get(M))!=null&&V.size);if(W){const q=o(M),H=d(M,!0);W=!XR(q,H)}W||D.forEach(q=>q.delete(M))}F(M)}})};F(L)},_=(L,...D)=>{let A=!0;const O=B=>f8(d(B)),P=(B,...M)=>{let V;if(B===L){if(!oxe(B))throw new Error("atom not writable");const U=o(B),W=c(B,M[0]);XR(U,W)||v(B)}else V=_(B,...M);if(!A){const U=E()}return V},F=L.write(O,P,...D);return A=!1,F},b=(L,...D)=>{const A=_(L,...D),O=E();return A},y=(L,D,A)=>{var O;const P=A||[];(O=o(L))==null||O.d.forEach((B,M)=>{const V=e.get(M);V?V.t.add(L):M!==L&&y(M,L,P)}),d(L);const F={t:new Set(D&&[D]),l:new Set};if(e.set(L,F),sxe(L)&&L.onMount){const{onMount:B}=L;P.push(()=>{const M=B((...V)=>b(L,...V));M&&(F.u=M)})}return A||P.forEach(B=>B()),F},C=L=>{var D;const A=(D=e.get(L))==null?void 0:D.u;A&&A(),e.delete(L);const O=o(L);O&&(FI(O)&&axe(O.v),O.d.forEach((P,F)=>{if(F!==L){const B=e.get(F);B&&(B.t.delete(L),g(F,B)&&C(F))}}))},x=(L,D,A)=>{const O=new Set(D.d.keys());A==null||A.forEach((P,F)=>{if(O.has(F)){O.delete(F);return}const B=e.get(F);B&&(B.t.delete(L),g(F,B)&&C(F))}),O.forEach(P=>{const F=e.get(P);F?F.t.add(L):e.has(L)&&y(P,L)})},E=()=>{let L;for(;t.size;){const D=Array.from(t);t.clear(),D.forEach(([A,O])=>{const P=o(A);if(P){const F=e.get(A);F&&P.d!==(O==null?void 0:O.d)&&x(A,P,O==null?void 0:O.d),F&&!(!FI(O)&&(XR(O,P)||uxe(O,P)))&&F.l.forEach(B=>B())}})}};return{get:h,set:b,sub:(L,D)=>{const A=f(L),O=E(),P=A.l;return P.add(D),()=>{P.delete(D),m(L)}}}};let rZ;const U_t=()=>(rZ||(rZ=z_t()),rZ),j_t=w.createContext(void 0),gBe=n=>{const e=w.useContext(j_t);return(n==null?void 0:n.store)||e||U_t()},q_t=n=>typeof(n==null?void 0:n.then)=="function",K_t=ae.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}),n)});function Fi(n,e){const t=gBe(e),[[i,r,o],s]=w.useReducer(c=>{const u=t.get(n);return Object.is(c[0],u)&&c[1]===t&&c[2]===n?c:[u,t,n]},void 0,()=>[t.get(n),t,n]);let a=i;(r!==t||o!==n)&&(s(),a=t.get(n));const l=e==null?void 0:e.delay;return w.useEffect(()=>{const c=t.sub(n,()=>{if(typeof l=="number"){setTimeout(s,l);return}s()});return s(),c},[t,n,l]),w.useDebugValue(a),q_t(a)?K_t(a):a}function Ar(n,e){const t=gBe(e);return w.useCallback((...r)=>t.set(n,...r),[t,n])}function Yo(n,e){return[Fi(n,e),Ar(n,e)]}var mBe={exports:{}};/*! * Pusher JavaScript Library v8.4.0-rc2 * https://pusher.com/ * * Copyright 2020, Pusher * Released under the MIT licence. */(function(n,e){(function(i,r){n.exports=r()})(window,function(){return function(t){var i={};function r(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=t,r.c=i,r.d=function(o,s,a){r.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:a})},r.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},r.t=function(o,s){if(s&1&&(o=r(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var l in o)r.d(a,l,(function(c){return o[c]}).bind(null,l));return a},r.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return r.d(s,"a",s),s},r.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},r.p="",r(r.s=2)}([function(t,i,r){var o=this&&this.__extends||function(){var m=function(v,_){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,y){b.__proto__=y}||function(b,y){for(var C in y)y.hasOwnProperty(C)&&(b[C]=y[C])},m(v,_)};return function(v,_){m(v,_);function b(){this.constructor=v}v.prototype=_===null?Object.create(_):(b.prototype=_.prototype,new b)}}();Object.defineProperty(i,"__esModule",{value:!0});var s=256,a=function(){function m(v){v===void 0&&(v="="),this._paddingCharacter=v}return m.prototype.encodedLength=function(v){return this._paddingCharacter?(v+2)/3*4|0:(v*8+5)/6|0},m.prototype.encode=function(v){for(var _="",b=0;b<v.length-2;b+=3){var y=v[b]<<16|v[b+1]<<8|v[b+2];_+=this._encodeByte(y>>>3*6&63),_+=this._encodeByte(y>>>2*6&63),_+=this._encodeByte(y>>>1*6&63),_+=this._encodeByte(y>>>0*6&63)}var C=v.length-b;if(C>0){var y=v[b]<<16|(C===2?v[b+1]<<8:0);_+=this._encodeByte(y>>>3*6&63),_+=this._encodeByte(y>>>2*6&63),C===2?_+=this._encodeByte(y>>>1*6&63):_+=this._paddingCharacter||"",_+=this._paddingCharacter||""}return _},m.prototype.maxDecodedLength=function(v){return this._paddingCharacter?v/4*3|0:(v*6+7)/8|0},m.prototype.decodedLength=function(v){return this.maxDecodedLength(v.length-this._getPaddingLength(v))},m.prototype.decode=function(v){if(v.length===0)return new Uint8Array(0);for(var _=this._getPaddingLength(v),b=v.length-_,y=new Uint8Array(this.maxDecodedLength(b)),C=0,x=0,E=0,k=0,L=0,D=0,A=0;x<b-4;x+=4)k=this._decodeChar(v.charCodeAt(x+0)),L=this._decodeChar(v.charCodeAt(x+1)),D=this._decodeChar(v.charCodeAt(x+2)),A=this._decodeChar(v.charCodeAt(x+3)),y[C++]=k<<2|L>>>4,y[C++]=L<<4|D>>>2,y[C++]=D<<6|A,E|=k&s,E|=L&s,E|=D&s,E|=A&s;if(x<b-1&&(k=this._decodeChar(v.charCodeAt(x)),L=this._decodeChar(v.charCodeAt(x+1)),y[C++]=k<<2|L>>>4,E|=k&s,E|=L&s),x<b-2&&(D=this._decodeChar(v.charCodeAt(x+2)),y[C++]=L<<4|D>>>2,E|=D&s),x<b-3&&(A=this._decodeChar(v.charCodeAt(x+3)),y[C++]=D<<6|A,E|=A&s),E!==0)throw new Error("Base64Coder: incorrect characters for decoding");return y},m.prototype._encodeByte=function(v){var _=v;return _+=65,_+=25-v>>>8&0-65-26+97,_+=51-v>>>8&26-97-52+48,_+=61-v>>>8&52-48-62+43,_+=62-v>>>8&62-43-63+47,String.fromCharCode(_)},m.prototype._decodeChar=function(v){var _=s;return _+=(42-v&v-44)>>>8&-s+v-43+62,_+=(46-v&v-48)>>>8&-s+v-47+63,_+=(47-v&v-58)>>>8&-s+v-48+52,_+=(64-v&v-91)>>>8&-s+v-65+0,_+=(96-v&v-123)>>>8&-s+v-97+26,_},m.prototype._getPaddingLength=function(v){var _=0;if(this._paddingCharacter){for(var b=v.length-1;b>=0&&v[b]===this._paddingCharacter;b--)_++;if(v.length<4||_>2)throw new Error("Base64Coder: incorrect padding")}return _},m}();i.Coder=a;var l=new a;function c(m){return l.encode(m)}i.encode=c;function u(m){return l.decode(m)}i.decode=u;var d=function(m){o(v,m);function v(){return m!==null&&m.apply(this,arguments)||this}return v.prototype._encodeByte=function(_){var b=_;return b+=65,b+=25-_>>>8&0-65-26+97,b+=51-_>>>8&26-97-52+48,b+=61-_>>>8&52-48-62+45,b+=62-_>>>8&62-45-63+95,String.fromCharCode(b)},v.prototype._decodeChar=function(_){var b=s;return b+=(44-_&_-46)>>>8&-s+_-45+62,b+=(94-_&_-96)>>>8&-s+_-95+63,b+=(47-_&_-58)>>>8&-s+_-48+52,b+=(64-_&_-91)>>>8&-s+_-65+0,b+=(96-_&_-123)>>>8&-s+_-97+26,b},v}(a);i.URLSafeCoder=d;var h=new d;function f(m){return h.encode(m)}i.encodeURLSafe=f;function g(m){return h.decode(m)}i.decodeURLSafe=g,i.encodedLength=function(m){return l.encodedLength(m)},i.maxDecodedLength=function(m){return l.maxDecodedLength(m)},i.decodedLength=function(m){return l.decodedLength(m)}},function(t,i,r){Object.defineProperty(i,"__esModule",{value:!0});var o="utf8: invalid string",s="utf8: invalid source encoding";function a(u){for(var d=new Uint8Array(l(u)),h=0,f=0;f<u.length;f++){var g=u.charCodeAt(f);g<128?d[h++]=g:g<2048?(d[h++]=192|g>>6,d[h++]=128|g&63):g<55296?(d[h++]=224|g>>12,d[h++]=128|g>>6&63,d[h++]=128|g&63):(f++,g=(g&1023)<<10,g|=u.charCodeAt(f)&1023,g+=65536,d[h++]=240|g>>18,d[h++]=128|g>>12&63,d[h++]=128|g>>6&63,d[h++]=128|g&63)}return d}i.encode=a;function l(u){for(var d=0,h=0;h<u.length;h++){var f=u.charCodeAt(h);if(f<128)d+=1;else if(f<2048)d+=2;else if(f<55296)d+=3;else if(f<=57343){if(h>=u.length-1)throw new Error(o);h++,d+=4}else throw new Error(o)}return d}i.encodedLength=l;function c(u){for(var d=[],h=0;h<u.length;h++){var f=u[h];if(f&128){var g=void 0;if(f<224){if(h>=u.length)throw new Error(s);var m=u[++h];if((m&192)!==128)throw new Error(s);f=(f&31)<<6|m&63,g=128}else if(f<240){if(h>=u.length-1)throw new Error(s);var m=u[++h],v=u[++h];if((m&192)!==128||(v&192)!==128)throw new Error(s);f=(f&15)<<12|(m&63)<<6|v&63,g=2048}else if(f<248){if(h>=u.length-2)throw new Error(s);var m=u[++h],v=u[++h],_=u[++h];if((m&192)!==128||(v&192)!==128||(_&192)!==128)throw new Error(s);f=(f&15)<<18|(m&63)<<12|(v&63)<<6|_&63,g=65536}else throw new Error(s);if(f<g||f>=55296&&f<=57343)throw new Error(s);if(f>=65536){if(f>1114111)throw new Error(s);f-=65536,d.push(String.fromCharCode(55296|f>>10)),f=56320|f&1023}}d.push(String.fromCharCode(f))}return d.join("")}i.decode=c},function(t,i,r){t.exports=r(3).default},function(t,i,r){r.r(i);class o{constructor(z,X){this.lastId=0,this.prefix=z,this.name=X}create(z){this.lastId++;var X=this.lastId,Ce=this.prefix+X,Ne=this.name+"["+X+"]",Kt=!1,Fn=function(){Kt||(z.apply(null,arguments),Kt=!0)};return this[X]=Fn,{number:X,id:Ce,name:Ne,callback:Fn}}remove(z){delete this[z.number]}}var s=new o("_pusher_script_","Pusher.ScriptReceivers"),a={VERSION:"8.4.0-rc2",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},l=a;class c{constructor(z){this.options=z,this.receivers=z.receivers||s,this.loading={}}load(z,X,Ce){var Ne=this;if(Ne.loading[z]&&Ne.loading[z].length>0)Ne.loading[z].push(Ce);else{Ne.loading[z]=[Ce];var Kt=Dn.createScriptRequest(Ne.getPath(z,X)),Fn=Ne.receivers.create(function(ki){if(Ne.receivers.remove(Fn),Ne.loading[z]){var $r=Ne.loading[z];delete Ne.loading[z];for(var Fo=function(An){An||Kt.cleanup()},yi=0;yi<$r.length;yi++)$r[yi](ki,Fo)}});Kt.send(Fn)}}getRoot(z){var X,Ce=Dn.getDocument().location.protocol;return z&&z.useTLS||Ce==="https:"?X=this.options.cdn_https:X=this.options.cdn_http,X.replace(/\/*$/,"")+"/"+this.options.version}getPath(z,X){return this.getRoot(X)+"/"+z+this.options.suffix+".js"}}var u=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),d=new c({cdn_http:l.cdn_http,cdn_https:l.cdn_https,version:l.VERSION,suffix:l.dependency_suffix,receivers:u});const h={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var g={buildLogSuffix:function(ee){const z="See:",X=h.urls[ee];if(!X)return"";let Ce;return X.fullUrl?Ce=X.fullUrl:X.path&&(Ce=h.baseUrl+X.path),Ce?`${z} ${Ce}`:""}},m;(function(ee){ee.UserAuthentication="user-authentication",ee.ChannelAuthorization="channel-authorization"})(m||(m={}));class v extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class b extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class y extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class k extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(z,X){super(X),this.status=z,Object.setPrototypeOf(this,new.target.prototype)}}var A=function(ee,z,X,Ce,Ne){const Kt=Dn.createXHR();Kt.open("POST",X.endpoint,!0),Kt.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var Fn in X.headers)Kt.setRequestHeader(Fn,X.headers[Fn]);if(X.headersProvider!=null){let ki=X.headersProvider();for(var Fn in ki)Kt.setRequestHeader(Fn,ki[Fn])}return Kt.onreadystatechange=function(){if(Kt.readyState===4)if(Kt.status===200){let ki,$r=!1;try{ki=JSON.parse(Kt.responseText),$r=!0}catch{Ne(new L(200,`JSON returned from ${Ce.toString()} endpoint was invalid, yet status code was 200. Data was: ${Kt.responseText}`),null)}$r&&Ne(null,ki)}else{let ki="";switch(Ce){case m.UserAuthentication:ki=g.buildLogSuffix("authenticationEndpoint");break;case m.ChannelAuthorization:ki=`Clients must be authorized to join private or presence channels. ${g.buildLogSuffix("authorizationEndpoint")}`;break}Ne(new L(Kt.status,`Unable to retrieve auth string from ${Ce.toString()} endpoint - received status: ${Kt.status} from ${X.endpoint}. ${ki}`),null)}},Kt.send(z),Kt};function O(ee){return U(M(ee))}var P=String.fromCharCode,F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=function(ee){var z=ee.charCodeAt(0);return z<128?ee:z<2048?P(192|z>>>6)+P(128|z&63):P(224|z>>>12&15)+P(128|z>>>6&63)+P(128|z&63)},M=function(ee){return ee.replace(/[^\x00-\x7F]/g,B)},V=function(ee){var z=[0,2,1][ee.length%3],X=ee.charCodeAt(0)<<16|(ee.length>1?ee.charCodeAt(1):0)<<8|(ee.length>2?ee.charCodeAt(2):0),Ce=[F.charAt(X>>>18),F.charAt(X>>>12&63),z>=2?"=":F.charAt(X>>>6&63),z>=1?"=":F.charAt(X&63)];return Ce.join("")},U=window.btoa||function(ee){return ee.replace(/[\s\S]{1,3}/g,V)};class W{constructor(z,X,Ce,Ne){this.clear=X,this.timer=z(()=>{this.timer&&(this.timer=Ne(this.timer))},Ce)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var q=W;function H(ee){window.clearTimeout(ee)}function ie(ee){window.clearInterval(ee)}class se extends q{constructor(z,X){super(setTimeout,H,z,function(Ce){return X(),null})}}class Q extends q{constructor(z,X){super(setInterval,ie,z,function(Ce){return X(),Ce})}}var Ee={now(){return Date.now?Date.now():new Date().valueOf()},defer(ee){return new se(0,ee)},method(ee,...z){var X=Array.prototype.slice.call(arguments,1);return function(Ce){return Ce[ee].apply(Ce,X.concat(arguments))}}},Fe=Ee;function He(ee,...z){for(var X=0;X<z.length;X++){var Ce=z[X];for(var Ne in Ce)Ce[Ne]&&Ce[Ne].constructor&&Ce[Ne].constructor===Object?ee[Ne]=He(ee[Ne]||{},Ce[Ne]):ee[Ne]=Ce[Ne]}return ee}function ke(){for(var ee=["Pusher"],z=0;z<arguments.length;z++)typeof arguments[z]=="string"?ee.push(arguments[z]):ee.push(Y(arguments[z]));return ee.join(" : ")}function Me(ee,z){var X=Array.prototype.indexOf;if(ee===null)return-1;if(X&&ee.indexOf===X)return ee.indexOf(z);for(var Ce=0,Ne=ee.length;Ce<Ne;Ce++)if(ee[Ce]===z)return Ce;return-1}function je(ee,z){for(var X in ee)Object.prototype.hasOwnProperty.call(ee,X)&&z(ee[X],X,ee)}function qe(ee){var z=[];return je(ee,function(X,Ce){z.push(Ce)}),z}function Be(ee){var z=[];return je(ee,function(X){z.push(X)}),z}function _t(ee,z,X){for(var Ce=0;Ce<ee.length;Ce++)z.call(X||window,ee[Ce],Ce,ee)}function Wt(ee,z){for(var X=[],Ce=0;Ce<ee.length;Ce++)X.push(z(ee[Ce],Ce,ee,X));return X}function Tt(ee,z){var X={};return je(ee,function(Ce,Ne){X[Ne]=z(Ce)}),X}function rn(ee,z){z=z||function(Ne){return!!Ne};for(var X=[],Ce=0;Ce<ee.length;Ce++)z(ee[Ce],Ce,ee,X)&&X.push(ee[Ce]);return X}function _n(ee,z){var X={};return je(ee,function(Ce,Ne){(z&&z(Ce,Ne,ee,X)||Ce)&&(X[Ne]=Ce)}),X}function wt(ee){var z=[];return je(ee,function(X,Ce){z.push([Ce,X])}),z}function pt(ee,z){for(var X=0;X<ee.length;X++)if(z(ee[X],X,ee))return!0;return!1}function ot(ee,z){for(var X=0;X<ee.length;X++)if(!z(ee[X],X,ee))return!1;return!0}function we(ee){return Tt(ee,function(z){return typeof z=="object"&&(z=Y(z)),encodeURIComponent(O(z.toString()))})}function Se(ee){var z=_n(ee,function(Ce){return Ce!==void 0}),X=Wt(wt(we(z)),Fe.method("join","=")).join("&");return X}function re(ee){var z=[],X=[];return function Ce(Ne,Kt){var Fn,ki,$r;switch(typeof Ne){case"object":if(!Ne)return null;for(Fn=0;Fn<z.length;Fn+=1)if(z[Fn]===Ne)return{$ref:X[Fn]};if(z.push(Ne),X.push(Kt),Object.prototype.toString.apply(Ne)==="[object Array]")for($r=[],Fn=0;Fn<Ne.length;Fn+=1)$r[Fn]=Ce(Ne[Fn],Kt+"["+Fn+"]");else{$r={};for(ki in Ne)Object.prototype.hasOwnProperty.call(Ne,ki)&&($r[ki]=Ce(Ne[ki],Kt+"["+JSON.stringify(ki)+"]"))}return $r;case"number":case"string":case"boolean":return Ne}}(ee,"$")}function Y(ee){try{return JSON.stringify(ee)}catch{return JSON.stringify(re(ee))}}class Z{constructor(){this.globalLog=z=>{window.console&&window.console.log&&window.console.log(z)}}debug(...z){this.log(this.globalLog,z)}warn(...z){this.log(this.globalLogWarn,z)}error(...z){this.log(this.globalLogError,z)}globalLogWarn(z){window.console&&window.console.warn?window.console.warn(z):this.globalLog(z)}globalLogError(z){window.console&&window.console.error?window.console.error(z):this.globalLogWarn(z)}log(z,...X){var Ce=ke.apply(this,arguments);wE.log?wE.log(Ce):wE.logToConsole&&z.bind(this)(Ce)}}var le=new Z,te=function(ee,z,X,Ce,Ne){(X.headers!==void 0||X.headersProvider!=null)&&le.warn(`To send headers with the ${Ce.toString()} request, you must use AJAX, rather than JSONP.`);var Kt=ee.nextAuthCallbackID.toString();ee.nextAuthCallbackID++;var Fn=ee.getDocument(),ki=Fn.createElement("script");ee.auth_callbacks[Kt]=function(yi){Ne(null,yi)};var $r="Pusher.auth_callbacks['"+Kt+"']";ki.src=X.endpoint+"?callback="+encodeURIComponent($r)+"&"+z;var Fo=Fn.getElementsByTagName("head")[0]||Fn.documentElement;Fo.insertBefore(ki,Fo.firstChild)},me=te;class Oe{constructor(z){this.src=z}send(z){var X=this,Ce="Error loading "+X.src;X.script=document.createElement("script"),X.script.id=z.id,X.script.src=X.src,X.script.type="text/javascript",X.script.charset="UTF-8",X.script.addEventListener?(X.script.onerror=function(){z.callback(Ce)},X.script.onload=function(){z.callback(null)}):X.script.onreadystatechange=function(){(X.script.readyState==="loaded"||X.script.readyState==="complete")&&z.callback(null)},X.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(X.errorScript=document.createElement("script"),X.errorScript.id=z.id+"_error",X.errorScript.text=z.name+"('"+Ce+"');",X.script.async=X.errorScript.async=!1):X.script.async=!0;var Ne=document.getElementsByTagName("head")[0];Ne.insertBefore(X.script,Ne.firstChild),X.errorScript&&Ne.insertBefore(X.errorScript,X.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class et{constructor(z,X){this.url=z,this.data=X}send(z){if(!this.request){var X=Se(this.data),Ce=this.url+"/"+z.number+"?"+X;this.request=Dn.createScriptRequest(Ce),this.request.send(z)}}cleanup(){this.request&&this.request.cleanup()}}var Et=function(ee,z){return function(X,Ce){var Ne="http"+(z?"s":"")+"://",Kt=Ne+(ee.host||ee.options.host)+ee.options.path,Fn=Dn.createJSONPRequest(Kt,X),ki=Dn.ScriptReceivers.create(function($r,Fo){s.remove(ki),Fn.cleanup(),Fo&&Fo.host&&(ee.host=Fo.host),Ce&&Ce($r,Fo)});Fn.send(ki)}},Qe={name:"jsonp",getAgent:Et},At=Qe;function Ut(ee,z,X){var Ce=ee+(z.useTLS?"s":""),Ne=z.useTLS?z.hostTLS:z.hostNonTLS;return Ce+"://"+Ne+X}function fe(ee,z){var X="/app/"+ee,Ce="?protocol="+l.PROTOCOL+"&client=js&version="+l.VERSION+(z?"&"+z:"");return X+Ce}var Re={getInitial:function(ee,z){var X=(z.httpPath||"")+fe(ee,"flash=false");return Ut("ws",z,X)}},Je={getInitial:function(ee,z){var X=(z.httpPath||"/pusher")+fe(ee);return Ut("http",z,X)}},Ot={getInitial:function(ee,z){return Ut("http",z,z.httpPath||"/pusher")},getPath:function(ee,z){return fe(ee)}};class Ft{constructor(){this._callbacks={}}get(z){return this._callbacks[jt(z)]}add(z,X,Ce){var Ne=jt(z);this._callbacks[Ne]=this._callbacks[Ne]||[],this._callbacks[Ne].push({fn:X,context:Ce})}remove(z,X,Ce){if(!z&&!X&&!Ce){this._callbacks={};return}var Ne=z?[jt(z)]:qe(this._callbacks);X||Ce?this.removeCallback(Ne,X,Ce):this.removeAllCallbacks(Ne)}removeCallback(z,X,Ce){_t(z,function(Ne){this._callbacks[Ne]=rn(this._callbacks[Ne]||[],function(Kt){return X&&X!==Kt.fn||Ce&&Ce!==Kt.context}),this._callbacks[Ne].length===0&&delete this._callbacks[Ne]},this)}removeAllCallbacks(z){_t(z,function(X){delete this._callbacks[X]},this)}}function jt(ee){return"_"+ee}class Jt{constructor(z){this.callbacks=new Ft,this.global_callbacks=[],this.failThrough=z}bind(z,X,Ce){return this.callbacks.add(z,X,Ce),this}bind_global(z){return this.global_callbacks.push(z),this}unbind(z,X,Ce){return this.callbacks.remove(z,X,Ce),this}unbind_global(z){return z?(this.global_callbacks=rn(this.global_callbacks||[],X=>X!==z),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(z,X,Ce){for(var Ne=0;Ne<this.global_callbacks.length;Ne++)this.global_callbacks[Ne](z,X);var Kt=this.callbacks.get(z),Fn=[];if(Ce?Fn.push(X,Ce):X&&Fn.push(X),Kt&&Kt.length>0)for(var Ne=0;Ne<Kt.length;Ne++)Kt[Ne].fn.apply(Kt[Ne].context||window,Fn);else this.failThrough&&this.failThrough(z,X);return this}}class ei extends Jt{constructor(z,X,Ce,Ne,Kt){super(),this.initialize=Dn.transportConnectionInitializer,this.hooks=z,this.name=X,this.priority=Ce,this.key=Ne,this.options=Kt,this.state="new",this.timeline=Kt.timeline,this.activityTimeout=Kt.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var z=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(z,this.options)}catch(X){return Fe.defer(()=>{this.onError(X),this.changeState("closed")}),!1}return this.bindListeners(),le.debug("Connecting",{transport:this.name,url:z}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(z){return this.state==="open"?(Fe.defer(()=>{this.socket&&this.socket.send(z)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(z){this.emit("error",{type:"WebSocketError",error:z}),this.timeline.error(this.buildTimelineMessage({error:z.toString()}))}onClose(z){z?this.changeState("closed",{code:z.code,reason:z.reason,wasClean:z.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(z){this.emit("message",z)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=z=>{this.onError(z)},this.socket.onclose=z=>{this.onClose(z)},this.socket.onmessage=z=>{this.onMessage(z)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(z,X){this.state=z,this.timeline.info(this.buildTimelineMessage({state:z,params:X})),this.emit(z,X)}buildTimelineMessage(z){return He({cid:this.id},z)}}class sr{constructor(z){this.hooks=z}isSupported(z){return this.hooks.isSupported(z)}createConnection(z,X,Ce,Ne){return new ei(this.hooks,z,X,Ce,Ne)}}var zn=new sr({urls:Re,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Dn.getWebSocketAPI()},isSupported:function(){return!!Dn.getWebSocketAPI()},getSocket:function(ee){return Dn.createWebSocket(ee)}}),Tn={urls:Je,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},pi=He({getSocket:function(ee){return Dn.HTTPFactory.createStreamingSocket(ee)}},Tn),Ei=He({getSocket:function(ee){return Dn.HTTPFactory.createPollingSocket(ee)}},Tn),$i={isSupported:function(){return Dn.isXHRSupported()}},Pr=new sr(He({},pi,$i)),ro=new sr(He({},Ei,$i)),Vo={ws:zn,xhr_streaming:Pr,xhr_polling:ro},oo=Vo,ta=new sr({file:"sockjs",urls:Ot,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(ee,z){return new window.SockJS(ee,null,{js_path:d.getPath("sockjs",{useTLS:z.useTLS}),ignore_null_origin:z.ignoreNullOrigin})},beforeOpen:function(ee,z){ee.send(JSON.stringify({path:z}))}}),Mr={isSupported:function(ee){var z=Dn.isXDRSupported(ee.useTLS);return z}},er=new sr(He({},pi,Mr)),on=new sr(He({},Ei,Mr));oo.xdr_streaming=er,oo.xdr_polling=on,oo.sockjs=ta;var hi=oo;class to extends Jt{constructor(){super();var z=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){z.emit("online")},!1),window.addEventListener("offline",function(){z.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Ge=new to;class xt{constructor(z,X,Ce){this.manager=z,this.transport=X,this.minPingDelay=Ce.minPingDelay,this.maxPingDelay=Ce.maxPingDelay,this.pingDelay=void 0}createConnection(z,X,Ce,Ne){Ne=He({},Ne,{activityTimeout:this.pingDelay});var Kt=this.transport.createConnection(z,X,Ce,Ne),Fn=null,ki=function(){Kt.unbind("open",ki),Kt.bind("closed",$r),Fn=Fe.now()},$r=Fo=>{if(Kt.unbind("closed",$r),Fo.code===1002||Fo.code===1003)this.manager.reportDeath();else if(!Fo.wasClean&&Fn){var yi=Fe.now()-Fn;yi<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(yi/2,this.minPingDelay))}};return Kt.bind("open",ki),Kt}isSupported(z){return this.manager.isAlive()&&this.transport.isSupported(z)}}const qt={decodeMessage:function(ee){try{var z=JSON.parse(ee.data),X=z.data;if(typeof X=="string")try{X=JSON.parse(z.data)}catch{}var Ce={event:z.event,channel:z.channel,data:X};return z.user_id&&(Ce.user_id=z.user_id),Ce}catch(Ne){throw{type:"MessageParseError",error:Ne,data:ee.data}}},encodeMessage:function(ee){return JSON.stringify(ee)},processHandshake:function(ee){var z=qt.decodeMessage(ee);if(z.event==="pusher:connection_established"){if(!z.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:z.data.socket_id,activityTimeout:z.data.activity_timeout*1e3}}else{if(z.event==="pusher:error")return{action:this.getCloseAction(z.data),error:this.getCloseError(z.data)};throw"Invalid handshake"}},getCloseAction:function(ee){return ee.code<4e3?ee.code>=1002&&ee.code<=1004?"backoff":null:ee.code===4e3?"tls_only":ee.code<4100?"refused":ee.code<4200?"backoff":ee.code<4300?"retry":"refused"},getCloseError:function(ee){return ee.code!==1e3&&ee.code!==1001?{type:"PusherError",data:{code:ee.code,message:ee.reason||ee.message}}:null}};var hn=qt;class ut extends Jt{constructor(z,X){super(),this.id=z,this.transport=X,this.activityTimeout=X.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(z){return this.transport.send(z)}send_event(z,X,Ce){var Ne={event:z,data:X};return Ce&&(Ne.channel=Ce),le.debug("Event sent",Ne),this.send(hn.encodeMessage(Ne))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var z={message:Ce=>{var Ne;try{Ne=hn.decodeMessage(Ce)}catch(Kt){this.emit("error",{type:"MessageParseError",error:Kt,data:Ce.data})}if(Ne!==void 0){switch(le.debug("Event recd",Ne),Ne.event){case"pusher:error":this.emit("error",{type:"PusherError",data:Ne.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",Ne)}},activity:()=>{this.emit("activity")},error:Ce=>{this.emit("error",Ce)},closed:Ce=>{X(),Ce&&Ce.code&&this.handleCloseEvent(Ce),this.transport=null,this.emit("closed")}},X=()=>{je(z,(Ce,Ne)=>{this.transport.unbind(Ne,Ce)})};je(z,(Ce,Ne)=>{this.transport.bind(Ne,Ce)})}handleCloseEvent(z){var X=hn.getCloseAction(z),Ce=hn.getCloseError(z);Ce&&this.emit("error",Ce),X&&this.emit(X,{action:X,error:Ce})}}class Ie{constructor(z,X){this.transport=z,this.callback=X,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=z=>{this.unbindListeners();var X;try{X=hn.processHandshake(z)}catch(Ce){this.finish("error",{error:Ce}),this.transport.close();return}X.action==="connected"?this.finish("connected",{connection:new ut(X.id,this.transport),activityTimeout:X.activityTimeout}):(this.finish(X.action,{error:X.error}),this.transport.close())},this.onClosed=z=>{this.unbindListeners();var X=hn.getCloseAction(z)||"backoff",Ce=hn.getCloseError(z);this.finish(X,{error:Ce})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(z,X){this.callback(He({transport:this.transport,action:z},X))}}class nt{constructor(z,X){this.timeline=z,this.options=X||{}}send(z,X){this.timeline.isEmpty()||this.timeline.send(Dn.TimelineTransport.getAgent(this,z),X)}}class Ve extends Jt{constructor(z,X){super(function(Ce,Ne){le.debug("No callbacks on "+z+" for "+Ce)}),this.name=z,this.pusher=X,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(z,X){return X(null,{auth:""})}trigger(z,X){if(z.indexOf("client-")!==0)throw new v("Event '"+z+"' does not start with 'client-'");if(!this.subscribed){var Ce=g.buildLogSuffix("triggeringClientEvents");le.warn(`Client event triggered before channel 'subscription_succeeded' event . ${Ce}`)}return this.pusher.send_event(z,X,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(z){var X=z.event,Ce=z.data;if(X==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(z);else if(X==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(z);else if(X.indexOf("pusher_internal:")!==0){var Ne={};this.emit(X,Ce,Ne)}}handleSubscriptionSucceededEvent(z){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",z.data)}handleSubscriptionCountEvent(z){z.data.subscription_count&&(this.subscriptionCount=z.data.subscription_count),this.emit("pusher:subscription_count",z.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(z,X)=>{z?(this.subscriptionPending=!1,le.error(z.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:z.message},z instanceof L?{status:z.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:X.auth,channel_data:X.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class ye extends Ve{authorize(z,X){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:z},X)}}class Xe{constructor(){this.reset()}get(z){return Object.prototype.hasOwnProperty.call(this.members,z)?{id:z,info:this.members[z]}:null}each(z){je(this.members,(X,Ce)=>{z(this.get(Ce))})}setMyID(z){this.myID=z}onSubscription(z){this.members=z.presence.hash,this.count=z.presence.count,this.me=this.get(this.myID)}addMember(z){return this.get(z.user_id)===null&&this.count++,this.members[z.user_id]=z.user_info,this.get(z.user_id)}removeMember(z){var X=this.get(z.user_id);return X&&(delete this.members[z.user_id],this.count--),X}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var yt=function(ee,z,X,Ce){function Ne(Kt){return Kt instanceof X?Kt:new X(function(Fn){Fn(Kt)})}return new(X||(X=Promise))(function(Kt,Fn){function ki(yi){try{Fo(Ce.next(yi))}catch(An){Fn(An)}}function $r(yi){try{Fo(Ce.throw(yi))}catch(An){Fn(An)}}function Fo(yi){yi.done?Kt(yi.value):Ne(yi.value).then(ki,$r)}Fo((Ce=Ce.apply(ee,z||[])).next())})};class it extends ye{constructor(z,X){super(z,X),this.members=new Xe}authorize(z,X){super.authorize(z,(Ce,Ne)=>yt(this,void 0,void 0,function*(){if(!Ce)if(Ne=Ne,Ne.channel_data!=null){var Kt=JSON.parse(Ne.channel_data);this.members.setMyID(Kt.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let Fn=g.buildLogSuffix("authorizationEndpoint");le.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${Fn}, or the user should be signed in.`),X("Invalid auth response");return}X(Ce,Ne)}))}handleEvent(z){var X=z.event;if(X.indexOf("pusher_internal:")===0)this.handleInternalEvent(z);else{var Ce=z.data,Ne={};z.user_id&&(Ne.user_id=z.user_id),this.emit(X,Ce,Ne)}}handleInternalEvent(z){var X=z.event,Ce=z.data;switch(X){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(z);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(z);break;case"pusher_internal:member_added":var Ne=this.members.addMember(Ce);this.emit("pusher:member_added",Ne);break;case"pusher_internal:member_removed":var Kt=this.members.removeMember(Ce);Kt&&this.emit("pusher:member_removed",Kt);break}}handleSubscriptionSucceededEvent(z){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(z.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var fn=r(1),In=r(0);class ti extends ye{constructor(z,X,Ce){super(z,X),this.key=null,this.nacl=Ce}authorize(z,X){super.authorize(z,(Ce,Ne)=>{if(Ce){X(Ce,Ne);return}let Kt=Ne.shared_secret;if(!Kt){X(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(In.decode)(Kt),delete Ne.shared_secret,X(null,Ne)})}trigger(z,X){throw new x("Client events are not currently supported for encrypted channels")}handleEvent(z){var X=z.event,Ce=z.data;if(X.indexOf("pusher_internal:")===0||X.indexOf("pusher:")===0){super.handleEvent(z);return}this.handleEncryptedEvent(X,Ce)}handleEncryptedEvent(z,X){if(!this.key){le.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!X.ciphertext||!X.nonce){le.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+X);return}let Ce=Object(In.decode)(X.ciphertext);if(Ce.length<this.nacl.secretbox.overheadLength){le.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${Ce.length}`);return}let Ne=Object(In.decode)(X.nonce);if(Ne.length<this.nacl.secretbox.nonceLength){le.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${Ne.length}`);return}let Kt=this.nacl.secretbox.open(Ce,Ne,this.key);if(Kt===null){le.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(Fn,ki)=>{if(Fn){le.error(`Failed to make a request to the authEndpoint: ${ki}. Unable to fetch new key, so dropping encrypted event`);return}if(Kt=this.nacl.secretbox.open(Ce,Ne,this.key),Kt===null){le.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(z,this.getDataToEmit(Kt))});return}this.emit(z,this.getDataToEmit(Kt))}getDataToEmit(z){let X=Object(fn.decode)(z);try{return JSON.parse(X)}catch{return X}}}class gi extends Jt{constructor(z,X){super(),this.state="initialized",this.connection=null,this.key=z,this.options=X,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var Ce=Dn.getNetwork();Ce.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),Ce.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(z){this.key=z,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(z){return this.connection?this.connection.send(z):!1}send_event(z,X,Ce){return this.connection?this.connection.send_event(z,X,Ce):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var z=(X,Ce)=>{X?this.runner=this.strategy.connect(0,z):Ce.action==="error"?(this.emit("error",{type:"HandshakeError",error:Ce.error}),this.timeline.error({handshakeError:Ce.error})):(this.abortConnecting(),this.handshakeCallbacks[Ce.action](Ce))};this.runner=this.strategy.connect(0,z)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var z=this.abandonConnection();z.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(z){this.timeline.info({action:"retry",delay:z}),z>0&&this.emit("connecting_in",Math.round(z/1e3)),this.retryTimer=new se(z||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new se(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new se(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new se(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(z){return He({},z,{message:X=>{this.resetActivityCheck(),this.emit("message",X)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:X=>{this.emit("error",X)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(z){return He({},z,{connected:X=>{this.activityTimeout=Math.min(this.options.activityTimeout,X.activityTimeout,X.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(X.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let z=X=>Ce=>{Ce.error&&this.emit("error",{type:"WebSocketError",error:Ce.error}),X(Ce)};return{tls_only:z(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:z(()=>{this.disconnect()}),backoff:z(()=>{this.retryIn(1e3)}),retry:z(()=>{this.retryIn(0)})}}setConnection(z){this.connection=z;for(var X in this.connectionCallbacks)this.connection.bind(X,this.connectionCallbacks[X]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var z in this.connectionCallbacks)this.connection.unbind(z,this.connectionCallbacks[z]);var X=this.connection;return this.connection=null,X}}updateState(z,X){var Ce=this.state;if(this.state=z,Ce!==z){var Ne=z;Ne==="connected"&&(Ne+=" with new socket ID "+X.socket_id),le.debug("State changed",Ce+" -> "+Ne),this.timeline.info({state:z,params:X}),this.emit("state_change",{previous:Ce,current:z}),this.emit(z,X)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Vi{constructor(){this.channels={}}add(z,X){return this.channels[z]||(this.channels[z]=Hn(z,X)),this.channels[z]}all(){return Be(this.channels)}find(z){return this.channels[z]}remove(z){var X=this.channels[z];return delete this.channels[z],X}disconnect(){je(this.channels,function(z){z.disconnect()})}}function Hn(ee,z){if(ee.indexOf("private-encrypted-")===0){if(z.config.nacl)return ii.createEncryptedChannel(ee,z,z.config.nacl);let X="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",Ce=g.buildLogSuffix("encryptedChannelSupport");throw new x(`${X}. ${Ce}`)}else{if(ee.indexOf("private-")===0)return ii.createPrivateChannel(ee,z);if(ee.indexOf("presence-")===0)return ii.createPresenceChannel(ee,z);if(ee.indexOf("#")===0)throw new _('Cannot create a channel with name "'+ee+'".');return ii.createChannel(ee,z)}}var pn={createChannels(){return new Vi},createConnectionManager(ee,z){return new gi(ee,z)},createChannel(ee,z){return new Ve(ee,z)},createPrivateChannel(ee,z){return new ye(ee,z)},createPresenceChannel(ee,z){return new it(ee,z)},createEncryptedChannel(ee,z,X){return new ti(ee,z,X)},createTimelineSender(ee,z){return new nt(ee,z)},createHandshake(ee,z){return new Ie(ee,z)},createAssistantToTheTransportManager(ee,z,X){return new xt(ee,z,X)}},ii=pn;class lr{constructor(z){this.options=z||{},this.livesLeft=this.options.lives||1/0}getAssistant(z){return ii.createAssistantToTheTransportManager(this,z,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class hr{constructor(z,X){this.strategies=z,this.loop=!!X.loop,this.failFast=!!X.failFast,this.timeout=X.timeout,this.timeoutLimit=X.timeoutLimit}isSupported(){return pt(this.strategies,Fe.method("isSupported"))}connect(z,X){var Ce=this.strategies,Ne=0,Kt=this.timeout,Fn=null,ki=($r,Fo)=>{Fo?X(null,Fo):(Ne=Ne+1,this.loop&&(Ne=Ne%Ce.length),Ne<Ce.length?(Kt&&(Kt=Kt*2,this.timeoutLimit&&(Kt=Math.min(Kt,this.timeoutLimit))),Fn=this.tryStrategy(Ce[Ne],z,{timeout:Kt,failFast:this.failFast},ki)):X(!0))};return Fn=this.tryStrategy(Ce[Ne],z,{timeout:Kt,failFast:this.failFast},ki),{abort:function(){Fn.abort()},forceMinPriority:function($r){z=$r,Fn&&Fn.forceMinPriority($r)}}}tryStrategy(z,X,Ce,Ne){var Kt=null,Fn=null;return Ce.timeout>0&&(Kt=new se(Ce.timeout,function(){Fn.abort(),Ne(!0)})),Fn=z.connect(X,function(ki,$r){ki&&Kt&&Kt.isRunning()&&!Ce.failFast||(Kt&&Kt.ensureAborted(),Ne(ki,$r))}),{abort:function(){Kt&&Kt.ensureAborted(),Fn.abort()},forceMinPriority:function(ki){Fn.forceMinPriority(ki)}}}}class na{constructor(z){this.strategies=z}isSupported(){return pt(this.strategies,Fe.method("isSupported"))}connect(z,X){return va(this.strategies,z,function(Ce,Ne){return function(Kt,Fn){if(Ne[Ce].error=Kt,Kt){Ua(Ne)&&X(!0);return}_t(Ne,function(ki){ki.forceMinPriority(Fn.transport.priority)}),X(null,Fn)}})}}function va(ee,z,X){var Ce=Wt(ee,function(Ne,Kt,Fn,ki){return Ne.connect(z,X(Kt,ki))});return{abort:function(){_t(Ce,os)},forceMinPriority:function(Ne){_t(Ce,function(Kt){Kt.forceMinPriority(Ne)})}}}function Ua(ee){return ot(ee,function(z){return!!z.error})}function os(ee){!ee.error&&!ee.aborted&&(ee.abort(),ee.aborted=!0)}class gs{constructor(z,X,Ce){this.strategy=z,this.transports=X,this.ttl=Ce.ttl||1800*1e3,this.usingTLS=Ce.useTLS,this.timeline=Ce.timeline}isSupported(){return this.strategy.isSupported()}connect(z,X){var Ce=this.usingTLS,Ne=kl(Ce),Kt=Ne&&Ne.cacheSkipCount?Ne.cacheSkipCount:0,Fn=[this.strategy];if(Ne&&Ne.timestamp+this.ttl>=Fe.now()){var ki=this.transports[Ne.transport];ki&&(["ws","wss"].includes(Ne.transport)||Kt>3?(this.timeline.info({cached:!0,transport:Ne.transport,latency:Ne.latency}),Fn.push(new hr([ki],{timeout:Ne.latency*2+1e3,failFast:!0}))):Kt++)}var $r=Fe.now(),Fo=Fn.pop().connect(z,function yi(An,Rr){An?(xi(Ce),Fn.length>0?($r=Fe.now(),Fo=Fn.pop().connect(z,yi)):X(An)):(cc(Ce,Rr.transport.name,Fe.now()-$r,Kt),X(null,Rr))});return{abort:function(){Fo.abort()},forceMinPriority:function(yi){z=yi,Fo&&Fo.forceMinPriority(yi)}}}}function Ho(ee){return"pusherTransport"+(ee?"TLS":"NonTLS")}function kl(ee){var z=Dn.getLocalStorage();if(z)try{var X=z[Ho(ee)];if(X)return JSON.parse(X)}catch{xi(ee)}return null}function cc(ee,z,X,Ce){var Ne=Dn.getLocalStorage();if(Ne)try{Ne[Ho(ee)]=Y({timestamp:Fe.now(),transport:z,latency:X,cacheSkipCount:Ce})}catch{}}function xi(ee){var z=Dn.getLocalStorage();if(z)try{delete z[Ho(ee)]}catch{}}class co{constructor(z,{delay:X}){this.strategy=z,this.options={delay:X}}isSupported(){return this.strategy.isSupported()}connect(z,X){var Ce=this.strategy,Ne,Kt=new se(this.options.delay,function(){Ne=Ce.connect(z,X)});return{abort:function(){Kt.ensureAborted(),Ne&&Ne.abort()},forceMinPriority:function(Fn){z=Fn,Ne&&Ne.forceMinPriority(Fn)}}}}class bo{constructor(z,X,Ce){this.test=z,this.trueBranch=X,this.falseBranch=Ce}isSupported(){var z=this.test()?this.trueBranch:this.falseBranch;return z.isSupported()}connect(z,X){var Ce=this.test()?this.trueBranch:this.falseBranch;return Ce.connect(z,X)}}class Ws{constructor(z){this.strategy=z}isSupported(){return this.strategy.isSupported()}connect(z,X){var Ce=this.strategy.connect(z,function(Ne,Kt){Kt&&Ce.abort(),X(Ne,Kt)});return Ce}}function Wo(ee){return function(){return ee.isSupported()}}var zs=function(ee,z,X){var Ce={};function Ne(uB,H1,_Q,vQ,TR){var kR=X(ee,uB,H1,_Q,vQ,TR);return Ce[uB]=kR,kR}var Kt=Object.assign({},z,{hostNonTLS:ee.wsHost+":"+ee.wsPort,hostTLS:ee.wsHost+":"+ee.wssPort,httpPath:ee.wsPath}),Fn=Object.assign({},Kt,{useTLS:!0}),ki=Object.assign({},z,{hostNonTLS:ee.httpHost+":"+ee.httpPort,hostTLS:ee.httpHost+":"+ee.httpsPort,httpPath:ee.httpPath}),$r={loop:!0,timeout:15e3,timeoutLimit:6e4},Fo=new lr({minPingDelay:1e4,maxPingDelay:ee.activityTimeout}),yi=new lr({lives:2,minPingDelay:1e4,maxPingDelay:ee.activityTimeout}),An=Ne("ws","ws",3,Kt,Fo),Rr=Ne("wss","ws",3,Fn,Fo),Hr=Ne("sockjs","sockjs",1,ki),_s=Ne("xhr_streaming","xhr_streaming",1,ki,yi),Mc=Ne("xdr_streaming","xdr_streaming",1,ki,yi),rd=Ne("xhr_polling","xhr_polling",1,ki),ol=Ne("xdr_polling","xdr_polling",1,ki),wh=new hr([An],$r),gp=new hr([Rr],$r),Hg=new hr([Hr],$r),ou=new hr([new bo(Wo(_s),_s,Mc)],$r),lB=new hr([new bo(Wo(rd),rd,ol)],$r),cB=new hr([new bo(Wo(ou),new na([ou,new co(lB,{delay:4e3})]),lB)],$r),ER=new bo(Wo(cB),cB,Hg),xR;return z.useTLS?xR=new na([wh,new co(ER,{delay:2e3})]):xR=new na([wh,new co(gp,{delay:2e3}),new co(ER,{delay:5e3})]),new gs(new Ws(new bo(Wo(An),xR,ER)),Ce,{ttl:18e5,timeline:z.timeline,useTLS:z.useTLS})},Mo=zs,Kr=function(){var ee=this;ee.timeline.info(ee.buildTimelineMessage({transport:ee.name+(ee.options.useTLS?"s":"")})),ee.hooks.isInitialized()?ee.changeState("initialized"):ee.hooks.file?(ee.changeState("initializing"),d.load(ee.hooks.file,{useTLS:ee.options.useTLS},function(z,X){ee.hooks.isInitialized()?(ee.changeState("initialized"),X(!0)):(z&&ee.onError(z),ee.onClose(),X(!1))})):ee.onClose()},uo={getRequest:function(ee){var z=new window.XDomainRequest;return z.ontimeout=function(){ee.emit("error",new b),ee.close()},z.onerror=function(X){ee.emit("error",X),ee.close()},z.onprogress=function(){z.responseText&&z.responseText.length>0&&ee.onChunk(200,z.responseText)},z.onload=function(){z.responseText&&z.responseText.length>0&&ee.onChunk(200,z.responseText),ee.emit("finished",200),ee.close()},z},abortRequest:function(ee){ee.ontimeout=ee.onerror=ee.onprogress=ee.onload=null,ee.abort()}},Tr=uo;const Fr=256*1024;class so extends Jt{constructor(z,X,Ce){super(),this.hooks=z,this.method=X,this.url=Ce}start(z){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Dn.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(z)}close(){this.unloader&&(Dn.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(z,X){for(;;){var Ce=this.advanceBuffer(X);if(Ce)this.emit("chunk",{status:z,data:Ce});else break}this.isBufferTooLong(X)&&this.emit("buffer_too_long")}advanceBuffer(z){var X=z.slice(this.position),Ce=X.indexOf(` `);return Ce!==-1?(this.position+=Ce+1,X.slice(0,Ce)):null}isBufferTooLong(z){return this.position===z.length&&z.length>Fr}}var qi;(function(ee){ee[ee.CONNECTING=0]="CONNECTING",ee[ee.OPEN=1]="OPEN",ee[ee.CLOSED=3]="CLOSED"})(qi||(qi={}));var Xn=qi,bi=1;class qn{constructor(z,X){this.hooks=z,this.session=wn(1e3)+"/"+Kn(8),this.location=oi(X),this.readyState=Xn.CONNECTING,this.openStream()}send(z){return this.sendRaw(JSON.stringify([z]))}ping(){this.hooks.sendHeartbeat(this)}close(z,X){this.onClose(z,X,!0)}sendRaw(z){if(this.readyState===Xn.OPEN)try{return Dn.createSocketRequest("POST",Ki(Si(this.location,this.session))).start(z),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(z,X,Ce){this.closeStream(),this.readyState=Xn.CLOSED,this.onclose&&this.onclose({code:z,reason:X,wasClean:Ce})}onChunk(z){if(z.status===200){this.readyState===Xn.OPEN&&this.onActivity();var X,Ce=z.data.slice(0,1);switch(Ce){case"o":X=JSON.parse(z.data.slice(1)||"{}"),this.onOpen(X);break;case"a":X=JSON.parse(z.data.slice(1)||"[]");for(var Ne=0;Ne<X.length;Ne++)this.onEvent(X[Ne]);break;case"m":X=JSON.parse(z.data.slice(1)||"null"),this.onEvent(X);break;case"h":this.hooks.onHeartbeat(this);break;case"c":X=JSON.parse(z.data.slice(1)||"[]"),this.onClose(X[0],X[1],!0);break}}}onOpen(z){this.readyState===Xn.CONNECTING?(z&&z.hostname&&(this.location.base=Sn(this.location.base,z.hostname)),this.readyState=Xn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(z){this.readyState===Xn.OPEN&&this.onmessage&&this.onmessage({data:z})}onActivity(){this.onactivity&&this.onactivity()}onError(z){this.onerror&&this.onerror(z)}openStream(){this.stream=Dn.createSocketRequest("POST",Ki(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",z=>{this.onChunk(z)}),this.stream.bind("finished",z=>{this.hooks.onFinished(this,z)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(z){Fe.defer(()=>{this.onError(z),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function oi(ee){var z=/([^\?]*)\/*(\??.*)/.exec(ee);return{base:z[1],queryString:z[2]}}function Si(ee,z){return ee.base+"/"+z+"/xhr_send"}function Ki(ee){var z=ee.indexOf("?")===-1?"?":"&";return ee+z+"t="+ +new Date+"&n="+bi++}function Sn(ee,z){var X=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(ee);return X[1]+z+X[3]}function wn(ee){return Dn.randomInt(ee)}function Kn(ee){for(var z=[],X=0;X<ee;X++)z.push(wn(32).toString(32));return z.join("")}var gt=qn,Pt={getReceiveURL:function(ee,z){return ee.base+"/"+z+"/xhr_streaming"+ee.queryString},onHeartbeat:function(ee){ee.sendRaw("[]")},sendHeartbeat:function(ee){ee.sendRaw("[]")},onFinished:function(ee,z){ee.onClose(1006,"Connection interrupted ("+z+")",!1)}},vn=Pt,Zn={getReceiveURL:function(ee,z){return ee.base+"/"+z+"/xhr"+ee.queryString},onHeartbeat:function(){},sendHeartbeat:function(ee){ee.sendRaw("[]")},onFinished:function(ee,z){z===200?ee.reconnect():ee.onClose(1006,"Connection interrupted ("+z+")",!1)}},Wn=Zn,ui={getRequest:function(ee){var z=Dn.getXHRAPI(),X=new z;return X.onreadystatechange=X.onprogress=function(){switch(X.readyState){case 3:X.responseText&&X.responseText.length>0&&ee.onChunk(X.status,X.responseText);break;case 4:X.responseText&&X.responseText.length>0&&ee.onChunk(X.status,X.responseText),ee.emit("finished",X.status),ee.close();break}},X},abortRequest:function(ee){ee.onreadystatechange=null,ee.abort()}},Br=ui,ho={createStreamingSocket(ee){return this.createSocket(vn,ee)},createPollingSocket(ee){return this.createSocket(Wn,ee)},createSocket(ee,z){return new gt(ee,z)},createXHR(ee,z){return this.createRequest(Br,ee,z)},createRequest(ee,z,X){return new so(ee,z,X)}},Xr=ho;Xr.createXDR=function(ee,z){return this.createRequest(Tr,ee,z)};var ja=Xr,kr={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:s,DependenciesReceivers:u,getDefaultStrategy:Mo,Transports:hi,transportConnectionInitializer:Kr,HTTPFactory:ja,TimelineTransport:At,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(ee){window.Pusher=ee;var z=()=>{this.onDocumentBody(ee.ready)};window.JSON?z():d.load("json2",{},z)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:A,jsonp:me}},onDocumentBody(ee){document.body?ee():setTimeout(()=>{this.onDocumentBody(ee)},0)},createJSONPRequest(ee,z){return new et(ee,z)},createScriptRequest(ee){return new Oe(ee)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var ee=this.getXHRAPI();return new ee},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Ge},createWebSocket(ee){var z=this.getWebSocketAPI();return new z(ee)},createSocketRequest(ee,z){if(this.isXHRSupported())return this.HTTPFactory.createXHR(ee,z);if(this.isXDRSupported(z.indexOf("https:")===0))return this.HTTPFactory.createXDR(ee,z);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var ee=this.getXHRAPI();return!!ee&&new ee().withCredentials!==void 0},isXDRSupported(ee){var z=ee?"https:":"http:",X=this.getProtocol();return!!window.XDomainRequest&&X===z},addUnloadListener(ee){window.addEventListener!==void 0?window.addEventListener("unload",ee,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",ee)},removeUnloadListener(ee){window.addEventListener!==void 0?window.removeEventListener("unload",ee,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",ee)},randomInt(ee){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*ee)}},Dn=kr,Ts;(function(ee){ee[ee.ERROR=3]="ERROR",ee[ee.INFO=6]="INFO",ee[ee.DEBUG=7]="DEBUG"})(Ts||(Ts={}));var Il=Ts;class nu{constructor(z,X,Ce){this.key=z,this.session=X,this.events=[],this.options=Ce||{},this.sent=0,this.uniqueID=0}log(z,X){z<=this.options.level&&(this.events.push(He({},X,{timestamp:Fe.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(z){this.log(Il.ERROR,z)}info(z){this.log(Il.INFO,z)}debug(z){this.log(Il.DEBUG,z)}isEmpty(){return this.events.length===0}send(z,X){var Ce=He({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],z(Ce,(Ne,Kt)=>{Ne||this.sent++,X&&X(Ne,Kt)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class ms{constructor(z,X,Ce,Ne){this.name=z,this.priority=X,this.transport=Ce,this.options=Ne||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(z,X){if(this.isSupported()){if(this.priority<z)return Wl(new y,X)}else return Wl(new k,X);var Ce=!1,Ne=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),Kt=null,Fn=function(){Ne.unbind("initialized",Fn),Ne.connect()},ki=function(){Kt=ii.createHandshake(Ne,function(An){Ce=!0,yi(),X(null,An)})},$r=function(An){yi(),X(An)},Fo=function(){yi();var An;An=Y(Ne),X(new C(An))},yi=function(){Ne.unbind("initialized",Fn),Ne.unbind("open",ki),Ne.unbind("error",$r),Ne.unbind("closed",Fo)};return Ne.bind("initialized",Fn),Ne.bind("open",ki),Ne.bind("error",$r),Ne.bind("closed",Fo),Ne.initialize(),{abort:()=>{Ce||(yi(),Kt?Kt.close():Ne.close())},forceMinPriority:An=>{Ce||this.priority<An&&(Kt?Kt.close():Ne.close())}}}}function Wl(ee,z){return Fe.defer(function(){z(ee)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:zl}=Dn;var Fg=function(ee,z,X,Ce,Ne,Kt){var Fn=zl[X];if(!Fn)throw new E(X);var ki=(!ee.enabledTransports||Me(ee.enabledTransports,z)!==-1)&&(!ee.disabledTransports||Me(ee.disabledTransports,z)===-1),$r;return ki?(Ne=Object.assign({ignoreNullOrigin:ee.ignoreNullOrigin},Ne),$r=new ms(z,Ce,Kt?Kt.getAssistant(Fn):Fn,Ne)):$r=R0,$r},R0={isSupported:function(){return!1},connect:function(ee,z){var X=Fe.defer(function(){z(new k)});return{abort:function(){X.ensureAborted()},forceMinPriority:function(){}}}};function _l(ee){if(ee==null)throw"You must pass an options object";if(ee.cluster==null)throw"Options object must provide a cluster";"disableStats"in ee&&le.warn("The disableStats option is deprecated in favor of enableStats")}const o_=(ee,z)=>{var X="socket_id="+encodeURIComponent(ee.socketId);for(var Ce in z.params)X+="&"+encodeURIComponent(Ce)+"="+encodeURIComponent(z.params[Ce]);if(z.paramsProvider!=null){let Ne=z.paramsProvider();for(var Ce in Ne)X+="&"+encodeURIComponent(Ce)+"="+encodeURIComponent(Ne[Ce])}return X};var Bg=ee=>{if(typeof Dn.getAuthorizers()[ee.transport]>"u")throw`'${ee.transport}' is not a recognized auth transport`;return(z,X)=>{const Ce=o_(z,ee);Dn.getAuthorizers()[ee.transport](Dn,Ce,ee,m.UserAuthentication,X)}};const Iu=(ee,z)=>{var X="socket_id="+encodeURIComponent(ee.socketId);X+="&channel_name="+encodeURIComponent(ee.channelName);for(var Ce in z.params)X+="&"+encodeURIComponent(Ce)+"="+encodeURIComponent(z.params[Ce]);if(z.paramsProvider!=null){let Ne=z.paramsProvider();for(var Ce in Ne)X+="&"+encodeURIComponent(Ce)+"="+encodeURIComponent(Ne[Ce])}return X};var O0=ee=>{if(typeof Dn.getAuthorizers()[ee.transport]>"u")throw`'${ee.transport}' is not a recognized auth transport`;return(z,X)=>{const Ce=Iu(z,ee);Dn.getAuthorizers()[ee.transport](Dn,Ce,ee,m.ChannelAuthorization,X)}};const $g=(ee,z,X)=>{const Ce={authTransport:z.transport,authEndpoint:z.endpoint,auth:{params:z.params,headers:z.headers}};return(Ne,Kt)=>{const Fn=ee.channel(Ne.channelName);X(Fn,Ce).authorize(Ne.socketId,Kt)}};function Vg(ee,z){let X={activityTimeout:ee.activityTimeout||l.activityTimeout,cluster:ee.cluster,httpPath:ee.httpPath||l.httpPath,httpPort:ee.httpPort||l.httpPort,httpsPort:ee.httpsPort||l.httpsPort,pongTimeout:ee.pongTimeout||l.pongTimeout,statsHost:ee.statsHost||l.stats_host,unavailableTimeout:ee.unavailableTimeout||l.unavailableTimeout,wsPath:ee.wsPath||l.wsPath,wsPort:ee.wsPort||l.wsPort,wssPort:ee.wssPort||l.wssPort,enableStats:wR(ee),httpHost:of(ee),useTLS:id(ee),wsHost:vI(ee),userAuthenticator:SR(ee),channelAuthorizer:sf(ee,z)};return"disabledTransports"in ee&&(X.disabledTransports=ee.disabledTransports),"enabledTransports"in ee&&(X.enabledTransports=ee.enabledTransports),"ignoreNullOrigin"in ee&&(X.ignoreNullOrigin=ee.ignoreNullOrigin),"timelineParams"in ee&&(X.timelineParams=ee.timelineParams),"nacl"in ee&&(X.nacl=ee.nacl),X}function of(ee){return ee.httpHost?ee.httpHost:ee.cluster?`sockjs-${ee.cluster}.pusher.com`:l.httpHost}function vI(ee){return ee.wsHost?ee.wsHost:bI(ee.cluster)}function bI(ee){return`ws-${ee}.pusher.com`}function id(ee){return Dn.getProtocol()==="https:"?!0:ee.forceTLS!==!1}function wR(ee){return"enableStats"in ee?ee.enableStats:"disableStats"in ee?!ee.disableStats:!1}const ru=ee=>"customHandler"in ee&&ee.customHandler!=null;function SR(ee){const z=Object.assign(Object.assign({},l.userAuthentication),ee.userAuthentication);return ru(z)?z.customHandler:Bg(z)}function yI(ee,z){let X;if("channelAuthorization"in ee)X=Object.assign(Object.assign({},l.channelAuthorization),ee.channelAuthorization);else if(X={transport:ee.authTransport||l.authTransport,endpoint:ee.authEndpoint||l.authEndpoint},"auth"in ee&&("params"in ee.auth&&(X.params=ee.auth.params),"headers"in ee.auth&&(X.headers=ee.auth.headers)),"authorizer"in ee)return{customHandler:$g(z,X,ee.authorizer)};return X}function sf(ee,z){const X=yI(ee,z);return ru(X)?X.customHandler:O0(X)}class Ch extends Jt{constructor(z){super(function(X,Ce){le.debug(`No callbacks on watchlist events for ${X}`)}),this.pusher=z,this.bindWatchlistInternalEvent()}handleEvent(z){z.data.events.forEach(X=>{this.emit(X.name,X)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",z=>{var X=z.event;X==="pusher_internal:watchlist_events"&&this.handleEvent(z)})}}function V1(){let ee,z;return{promise:new Promise((Ce,Ne)=>{ee=Ce,z=Ne}),resolve:ee,reject:z}}var ba=V1;class pp extends Jt{constructor(z){super(function(X,Ce){le.debug("No callbacks on user for "+X)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(X,Ce)=>{if(X){le.warn(`Error during signin: ${X}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:Ce.auth,user_data:Ce.user_data})},this.pusher=z,this.pusher.connection.bind("state_change",({previous:X,current:Ce})=>{X!=="connected"&&Ce==="connected"&&this._signin(),X==="connected"&&Ce!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Ch(z),this.pusher.connection.bind("message",X=>{var Ce=X.event;Ce==="pusher:signin_success"&&this._onSigninSuccess(X.data),this.serverToUserChannel&&this.serverToUserChannel.name===X.channel&&this.serverToUserChannel.handleEvent(X)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(z){try{this.user_data=JSON.parse(z.user_data)}catch{le.error(`Failed parsing user data after signin: ${z.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){le.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const z=X=>{X.subscriptionPending&&X.subscriptionCancelled?X.reinstateSubscription():!X.subscriptionPending&&this.pusher.connection.state==="connected"&&X.subscribe()};this.serverToUserChannel=new Ve(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((X,Ce)=>{X.indexOf("pusher_internal:")===0||X.indexOf("pusher:")===0||this.emit(X,Ce)}),z(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:z,resolve:X,reject:Ce}=ba();z.done=!1;const Ne=()=>{z.done=!0};z.then(Ne).catch(Ne),this.signinDonePromise=z,this._signinDoneResolve=X}}class vl{static ready(){vl.isReady=!0;for(var z=0,X=vl.instances.length;z<X;z++)vl.instances[z].connect()}static getClientFeatures(){return qe(_n({ws:Dn.Transports.ws},function(z){return z.isSupported({})}))}constructor(z,X){SE(z),_l(X),this.key=z,this.options=X,this.config=Vg(this.options,this),this.channels=ii.createChannels(),this.global_emitter=new Jt,this.sessionID=Dn.randomInt(1e9),this.timeline=new nu(this.key,this.sessionID,{cluster:this.config.cluster,features:vl.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Il.INFO,version:l.VERSION}),this.config.enableStats&&(this.timelineSender=ii.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Dn.TimelineTransport.name}));var Ce=Ne=>Dn.getDefaultStrategy(this.config,Ne,Fg);this.connection=ii.createConnectionManager(this.key,{getStrategy:Ce,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",Ne=>{var Kt=Ne.event,Fn=Kt.indexOf("pusher_internal:")===0;if(Ne.channel){var ki=this.channel(Ne.channel);ki&&ki.handleEvent(Ne)}Fn||this.global_emitter.emit(Ne.event,Ne.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",Ne=>{le.warn(Ne)}),vl.instances.push(this),this.timeline.info({instances:vl.instances.length}),this.user=new pp(this),vl.isReady&&this.connect()}switchCluster(z){const{appKey:X,cluster:Ce}=z;this.key=X,this.options=Object.assign(Object.assign({},this.options),{cluster:Ce}),this.config=Vg(this.options,this),this.connection.switchCluster(this.key)}channel(z){return this.channels.find(z)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var z=this.connection.isUsingTLS(),X=this.timelineSender;this.timelineSenderTimer=new Q(6e4,function(){X.send(z)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(z,X,Ce){return this.global_emitter.bind(z,X,Ce),this}unbind(z,X,Ce){return this.global_emitter.unbind(z,X,Ce),this}bind_global(z){return this.global_emitter.bind_global(z),this}unbind_global(z){return this.global_emitter.unbind_global(z),this}unbind_all(z){return this.global_emitter.unbind_all(),this}subscribeAll(){var z;for(z in this.channels.channels)this.channels.channels.hasOwnProperty(z)&&this.subscribe(z)}subscribe(z){var X=this.channels.add(z,this);return X.subscriptionPending&&X.subscriptionCancelled?X.reinstateSubscription():!X.subscriptionPending&&this.connection.state==="connected"&&X.subscribe(),X}unsubscribe(z){var X=this.channels.find(z);X&&X.subscriptionPending?X.cancelSubscription():(X=this.channels.remove(z),X&&X.subscribed&&X.unsubscribe())}send_event(z,X,Ce){return this.connection.send_event(z,X,Ce)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}vl.instances=[],vl.isReady=!1,vl.logToConsole=!1,vl.Runtime=Dn,vl.ScriptReceivers=Dn.ScriptReceivers,vl.DependenciesReceivers=Dn.DependenciesReceivers,vl.auth_callbacks=Dn.auth_callbacks;var wE=i.default=vl;function SE(ee){if(ee==null)throw"You must pass your app key when you instantiate Pusher."}Dn.setup(vl)}])})})(mBe);var G_t=mBe.exports;const Y_t=nl(G_t);function Uu(n){for(var e=arguments.length,t=Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map(function(r){return"'"+r+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Gf(n){return!!n&&!!n[po]}function dg(n){var e;return!!n&&(function(t){if(!t||typeof t!="object")return!1;var i=Object.getPrototypeOf(t);if(i===null)return!0;var r=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return r===Object||typeof r=="function"&&Function.toString.call(r)===ivt}(n)||Array.isArray(n)||!!n[PL]||!!(!((e=n.constructor)===null||e===void 0)&&e[PL])||Lj(n)||Dj(n))}function _Be(n){return Gf(n)||Uu(23,n),n[po].t}function d1(n,e,t){t===void 0&&(t=!1),eS(n)===0?(t?Object.keys:ML)(n).forEach(function(i){t&&typeof i=="symbol"||e(i,n[i],n)}):n.forEach(function(i,r){return e(r,i,n)})}function eS(n){var e=n[po];return e?e.i>3?e.i-4:e.i:Array.isArray(n)?1:Lj(n)?2:Dj(n)?3:0}function Cw(n,e){return eS(n)===2?n.has(e):Object.prototype.hasOwnProperty.call(n,e)}function i$(n,e){return eS(n)===2?n.get(e):n[e]}function vBe(n,e,t){var i=eS(n);i===2?n.set(e,t):i===3?n.add(t):n[e]=t}function bBe(n,e){return n===e?n!==0||1/n==1/e:n!=n&&e!=e}function Lj(n){return tvt&&n instanceof Map}function Dj(n){return nvt&&n instanceof Set}function Fu(n){return n.o||n.t}function Lpe(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var e=wBe(n);delete e[po];for(var t=ML(e),i=0;i<t.length;i++){var r=t[i],o=e[r];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[r]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[r]})}return Object.create(Object.getPrototypeOf(n),e)}function Z5(n,e){return e===void 0&&(e=!1),Dpe(n)||Gf(n)||!dg(n)||(eS(n)>1&&(n.set=n.add=n.clear=n.delete=Q_t),Object.freeze(n),e&&d1(n,function(t,i){return Z5(i,!0)},!0)),n}function Q_t(){Uu(2)}function Dpe(n){return n==null||typeof n!="object"||Object.isFrozen(n)}function zb(n){var e=Aie[n];return e||Uu(18,n),e}function Ape(n,e){Aie[n]||(Aie[n]=e)}function S4(){return x4}function oZ(n,e){e&&(zb("Patches"),n.u=[],n.s=[],n.v=e)}function eH(n){Die(n),n.p.forEach(X_t),n.p=null}function Die(n){n===x4&&(x4=n.l)}function dxe(n){return x4={p:[],l:x4,h:n,m:!0,_:0}}function X_t(n){var e=n[po];e.i===0||e.i===1?e.j():e.g=!0}function sZ(n,e){e._=e.p.length;var t=e.p[0],i=n!==void 0&&n!==t;return e.h.O||zb("ES5").S(e,n,i),i?(t[po].P&&(eH(e),Uu(4)),dg(n)&&(n=tH(e,n),e.l||nH(e,n)),e.u&&zb("Patches").M(t[po].t,n,e.u,e.s)):n=tH(e,t,[]),eH(e),e.u&&e.v(e.u,e.s),n!==Nj?n:void 0}function tH(n,e,t){if(Dpe(e))return e;var i=e[po];if(!i)return d1(e,function(a,l){return hxe(n,i,e,a,l,t)},!0),e;if(i.A!==n)return e;if(!i.P)return nH(n,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var r=i.i===4||i.i===5?i.o=Lpe(i.k):i.o,o=r,s=!1;i.i===3&&(o=new Set(r),r.clear(),s=!0),d1(o,function(a,l){return hxe(n,i,r,a,l,t,s)}),nH(n,r,!1),t&&n.u&&zb("Patches").N(i,t,n.u,n.s)}return i.o}function hxe(n,e,t,i,r,o,s){if(Gf(r)){var a=tH(n,r,o&&e&&e.i!==3&&!Cw(e.R,i)?o.concat(i):void 0);if(vBe(t,i,a),!Gf(a))return;n.m=!1}else s&&t.add(r);if(dg(r)&&!Dpe(r)){if(!n.h.D&&n._<1)return;tH(n,r),e&&e.A.l||nH(n,r)}}function nH(n,e,t){t===void 0&&(t=!1),!n.l&&n.h.D&&n.m&&Z5(e,t)}function aZ(n,e){var t=n[po];return(t?Fu(t):n)[e]}function fxe(n,e){if(e in n)for(var t=Object.getPrototypeOf(n);t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}}function wf(n){n.P||(n.P=!0,n.l&&wf(n.l))}function lZ(n){n.o||(n.o=Lpe(n.t))}function E4(n,e,t){var i=Lj(e)?zb("MapSet").F(e,t):Dj(e)?zb("MapSet").T(e,t):n.O?function(r,o){var s=Array.isArray(r),a={i:s?1:0,A:o?o.A:S4(),P:!1,I:!1,R:{},l:o,t:r,k:null,o:null,j:null,C:!1},l=a,c=T4;s&&(l=[a],c=iP);var u=Proxy.revocable(l,c),d=u.revoke,h=u.proxy;return a.k=h,a.j=d,h}(e,t):zb("ES5").J(e,t);return(t?t.A:S4()).p.push(i),i}function Aj(n){return Gf(n)||Uu(22,n),function e(t){if(!dg(t))return t;var i,r=t[po],o=eS(t);if(r){if(!r.P&&(r.i<4||!zb("ES5").K(r)))return r.t;r.I=!0,i=pxe(t,o),r.I=!1}else i=pxe(t,o);return d1(i,function(s,a){r&&i$(r.t,s)===a||vBe(i,s,e(a))}),o===3?new Set(i):i}(n)}function pxe(n,e){switch(e){case 2:return new Map(n);case 3:return Array.from(n)}return Lpe(n)}function Npe(){function n(o,s){var a=r[o];return a?a.enumerable=s:r[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[po];return T4.get(l,o)},set:function(l){var c=this[po];T4.set(c,o,l)}},a}function e(o){for(var s=o.length-1;s>=0;s--){var a=o[s][po];if(!a.P)switch(a.i){case 5:i(a)&&wf(a);break;case 4:t(a)&&wf(a)}}}function t(o){for(var s=o.t,a=o.k,l=ML(a),c=l.length-1;c>=0;c--){var u=l[c];if(u!==po){var d=s[u];if(d===void 0&&!Cw(s,u))return!0;var h=a[u],f=h&&h[po];if(f?f.t!==d:!bBe(h,d))return!0}}var g=!!s[po];return l.length!==ML(s).length+(g?0:1)}function i(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l<s.length;l++)if(!s.hasOwnProperty(l))return!0;return!1}var r={};Ape("ES5",{J:function(o,s){var a=Array.isArray(o),l=function(u,d){if(u){for(var h=Array(d.length),f=0;f<d.length;f++)Object.defineProperty(h,""+f,n(f,!0));return h}var g=wBe(d);delete g[po];for(var m=ML(g),v=0;v<m.length;v++){var _=m[v];g[_]=n(_,u||!!g[_].enumerable)}return Object.create(Object.getPrototypeOf(d),g)}(a,o),c={i:a?5:4,A:s?s.A:S4(),P:!1,I:!1,R:{},l:s,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,po,{value:c,writable:!0}),l},S:function(o,s,a){a?Gf(s)&&s[po].A===o&&e(o.p):(o.u&&function l(c){if(c&&typeof c=="object"){var u=c[po];if(u){var d=u.t,h=u.k,f=u.R,g=u.i;if(g===4)d1(h,function(y){y!==po&&(d[y]!==void 0||Cw(d,y)?f[y]||l(h[y]):(f[y]=!0,wf(u)))}),d1(d,function(y){h[y]!==void 0||Cw(h,y)||(f[y]=!1,wf(u))});else if(g===5){if(i(u)&&(wf(u),f.length=!0),h.length<d.length)for(var m=h.length;m<d.length;m++)f[m]=!1;else for(var v=d.length;v<h.length;v++)f[v]=!0;for(var _=Math.min(h.length,d.length),b=0;b<_;b++)h.hasOwnProperty(b)||(f[b]=!0),f[b]===void 0&&l(h[b])}}}}(o.p[0]),e(o.p))},K:function(o){return o.i===4?t(o):i(o)}})}function yBe(){function n(i){if(!dg(i))return i;if(Array.isArray(i))return i.map(n);if(Lj(i))return new Map(Array.from(i.entries()).map(function(s){return[s[0],n(s[1])]}));if(Dj(i))return new Set(Array.from(i).map(n));var r=Object.create(Object.getPrototypeOf(i));for(var o in i)r[o]=n(i[o]);return Cw(i,PL)&&(r[PL]=i[PL]),r}function e(i){return Gf(i)?n(i):i}var t="add";Ape("Patches",{$:function(i,r){return r.forEach(function(o){for(var s=o.path,a=o.op,l=i,c=0;c<s.length-1;c++){var u=eS(l),d=s[c];typeof d!="string"&&typeof d!="number"&&(d=""+d),u!==0&&u!==1||d!=="__proto__"&&d!=="constructor"||Uu(24),typeof l=="function"&&d==="prototype"&&Uu(24),typeof(l=i$(l,d))!="object"&&Uu(15,s.join("/"))}var h=eS(l),f=n(o.value),g=s[s.length-1];switch(a){case"replace":switch(h){case 2:return l.set(g,f);case 3:Uu(16);default:return l[g]=f}case t:switch(h){case 1:return g==="-"?l.push(f):l.splice(g,0,f);case 2:return l.set(g,f);case 3:return l.add(f);default:return l[g]=f}case"remove":switch(h){case 1:return l.splice(g,1);case 2:return l.delete(g);case 3:return l.delete(o.value);default:return delete l[g]}default:Uu(17,a)}}),i},N:function(i,r,o,s){switch(i.i){case 0:case 4:case 2:return function(a,l,c,u){var d=a.t,h=a.o;d1(a.R,function(f,g){var m=i$(d,f),v=i$(h,f),_=g?Cw(d,f)?"replace":t:"remove";if(m!==v||_!=="replace"){var b=l.concat(f);c.push(_==="remove"?{op:_,path:b}:{op:_,path:b,value:v}),u.push(_===t?{op:"remove",path:b}:_==="remove"?{op:t,path:b,value:e(m)}:{op:"replace",path:b,value:e(m)})}})}(i,r,o,s);case 5:case 1:return function(a,l,c,u){var d=a.t,h=a.R,f=a.o;if(f.length<d.length){var g=[f,d];d=g[0],f=g[1];var m=[u,c];c=m[0],u=m[1]}for(var v=0;v<d.length;v++)if(h[v]&&f[v]!==d[v]){var _=l.concat([v]);c.push({op:"replace",path:_,value:e(f[v])}),u.push({op:"replace",path:_,value:e(d[v])})}for(var b=d.length;b<f.length;b++){var y=l.concat([b]);c.push({op:t,path:y,value:e(f[b])})}d.length<f.length&&u.push({op:"replace",path:l.concat(["length"]),value:d.length})}(i,r,o,s);case 3:return function(a,l,c,u){var d=a.t,h=a.o,f=0;d.forEach(function(g){if(!h.has(g)){var m=l.concat([f]);c.push({op:"remove",path:m,value:g}),u.unshift({op:t,path:m,value:g})}f++}),f=0,h.forEach(function(g){if(!d.has(g)){var m=l.concat([f]);c.push({op:t,path:m,value:g}),u.unshift({op:"remove",path:m,value:g})}f++})}(i,r,o,s)}},M:function(i,r,o,s){o.push({op:"replace",path:[],value:r===Nj?void 0:r}),s.push({op:"replace",path:[],value:i})}})}function CBe(){function n(a,l){function c(){this.constructor=a}r(a,l),a.prototype=(c.prototype=l.prototype,new c)}function e(a){a.o||(a.R=new Map,a.o=new Map(a.t))}function t(a){a.o||(a.o=new Set,a.t.forEach(function(l){if(dg(l)){var c=E4(a.A.h,l,a);a.p.set(l,c),a.o.add(c)}else a.o.add(l)}))}function i(a){a.g&&Uu(3,JSON.stringify(Fu(a)))}var r=function(a,l){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,u){c.__proto__=u}||function(c,u){for(var d in u)u.hasOwnProperty(d)&&(c[d]=u[d])})(a,l)},o=function(){function a(c,u){return this[po]={i:2,l:u,A:u?u.A:S4(),P:!1,I:!1,o:void 0,R:void 0,t:c,k:this,C:!1,g:!1},this}n(a,Map);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return Fu(this[po]).size}}),l.has=function(c){return Fu(this[po]).has(c)},l.set=function(c,u){var d=this[po];return i(d),Fu(d).has(c)&&Fu(d).get(c)===u||(e(d),wf(d),d.R.set(c,!0),d.o.set(c,u),d.R.set(c,!0)),this},l.delete=function(c){if(!this.has(c))return!1;var u=this[po];return i(u),e(u),wf(u),u.t.has(c)?u.R.set(c,!1):u.R.delete(c),u.o.delete(c),!0},l.clear=function(){var c=this[po];i(c),Fu(c).size&&(e(c),wf(c),c.R=new Map,d1(c.t,function(u){c.R.set(u,!1)}),c.o.clear())},l.forEach=function(c,u){var d=this;Fu(this[po]).forEach(function(h,f){c.call(u,d.get(f),f,d)})},l.get=function(c){var u=this[po];i(u);var d=Fu(u).get(c);if(u.I||!dg(d)||d!==u.t.get(c))return d;var h=E4(u.A.h,d,u);return e(u),u.o.set(c,h),h},l.keys=function(){return Fu(this[po]).keys()},l.values=function(){var c,u=this,d=this.keys();return(c={})[p8]=function(){return u.values()},c.next=function(){var h=d.next();return h.done?h:{done:!1,value:u.get(h.value)}},c},l.entries=function(){var c,u=this,d=this.keys();return(c={})[p8]=function(){return u.entries()},c.next=function(){var h=d.next();if(h.done)return h;var f=u.get(h.value);return{done:!1,value:[h.value,f]}},c},l[p8]=function(){return this.entries()},a}(),s=function(){function a(c,u){return this[po]={i:3,l:u,A:u?u.A:S4(),P:!1,I:!1,o:void 0,t:c,k:this,p:new Map,g:!1,C:!1},this}n(a,Set);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return Fu(this[po]).size}}),l.has=function(c){var u=this[po];return i(u),u.o?!!u.o.has(c)||!(!u.p.has(c)||!u.o.has(u.p.get(c))):u.t.has(c)},l.add=function(c){var u=this[po];return i(u),this.has(c)||(t(u),wf(u),u.o.add(c)),this},l.delete=function(c){if(!this.has(c))return!1;var u=this[po];return i(u),t(u),wf(u),u.o.delete(c)||!!u.p.has(c)&&u.o.delete(u.p.get(c))},l.clear=function(){var c=this[po];i(c),Fu(c).size&&(t(c),wf(c),c.o.clear())},l.values=function(){var c=this[po];return i(c),t(c),c.o.values()},l.entries=function(){var c=this[po];return i(c),t(c),c.o.entries()},l.keys=function(){return this.values()},l[p8]=function(){return this.values()},l.forEach=function(c,u){for(var d=this.values(),h=d.next();!h.done;)c.call(u,h.value,h.value,this),h=d.next()},a}();Ape("MapSet",{F:function(a,l){return new o(a,l)},T:function(a,l){return new s(a,l)}})}function Z_t(){Npe(),CBe(),yBe()}function J_t(n){return n}function evt(n){return n}var gxe,x4,Rpe=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",tvt=typeof Map<"u",nvt=typeof Set<"u",mxe=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Nj=Rpe?Symbol.for("immer-nothing"):((gxe={})["immer-nothing"]=!0,gxe),PL=Rpe?Symbol.for("immer-draftable"):"__$immer_draftable",po=Rpe?Symbol.for("immer-state"):"__$immer_state",p8=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",ivt=""+Object.prototype.constructor,ML=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,wBe=Object.getOwnPropertyDescriptors||function(n){var e={};return ML(n).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(n,t)}),e},Aie={},T4={get:function(n,e){if(e===po)return n;var t=Fu(n);if(!Cw(t,e))return function(r,o,s){var a,l=fxe(o,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(r.k):void 0}(n,t,e);var i=t[e];return n.I||!dg(i)?i:i===aZ(n.t,e)?(lZ(n),n.o[e]=E4(n.A.h,i,n)):i},has:function(n,e){return e in Fu(n)},ownKeys:function(n){return Reflect.ownKeys(Fu(n))},set:function(n,e,t){var i=fxe(Fu(n),e);if(i!=null&&i.set)return i.set.call(n.k,t),!0;if(!n.P){var r=aZ(Fu(n),e),o=r==null?void 0:r[po];if(o&&o.t===t)return n.o[e]=t,n.R[e]=!1,!0;if(bBe(t,r)&&(t!==void 0||Cw(n.t,e)))return!0;lZ(n),wf(n)}return n.o[e]===t&&(t!==void 0||e in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[e])||(n.o[e]=t,n.R[e]=!0),!0},deleteProperty:function(n,e){return aZ(n.t,e)!==void 0||e in n.t?(n.R[e]=!1,lZ(n),wf(n)):delete n.R[e],n.o&&delete n.o[e],!0},getOwnPropertyDescriptor:function(n,e){var t=Fu(n),i=Reflect.getOwnPropertyDescriptor(t,e);return i&&{writable:!0,configurable:n.i!==1||e!=="length",enumerable:i.enumerable,value:t[e]}},defineProperty:function(){Uu(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){Uu(12)}},iP={};d1(T4,function(n,e){iP[n]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),iP.deleteProperty=function(n,e){return iP.set.call(this,n,e,void 0)},iP.set=function(n,e,t){return T4.set.call(this,n[0],e,t,n[0])};var SBe=function(){function n(t){var i=this;this.O=mxe,this.D=!0,this.produce=function(r,o,s){if(typeof r=="function"&&typeof o!="function"){var a=o;o=r;var l=i;return function(m){var v=this;m===void 0&&(m=a);for(var _=arguments.length,b=Array(_>1?_-1:0),y=1;y<_;y++)b[y-1]=arguments[y];return l.produce(m,function(C){var x;return(x=o).call.apply(x,[v,C].concat(b))})}}var c;if(typeof o!="function"&&Uu(6),s!==void 0&&typeof s!="function"&&Uu(7),dg(r)){var u=dxe(i),d=E4(i,r,void 0),h=!0;try{c=o(d),h=!1}finally{h?eH(u):Die(u)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return oZ(u,s),sZ(m,u)},function(m){throw eH(u),m}):(oZ(u,s),sZ(c,u))}if(!r||typeof r!="object"){if((c=o(r))===void 0&&(c=r),c===Nj&&(c=void 0),i.D&&Z5(c,!0),s){var f=[],g=[];zb("Patches").M(r,c,f,g),s(f,g)}return c}Uu(21,r)},this.produceWithPatches=function(r,o){if(typeof r=="function")return function(c){for(var u=arguments.length,d=Array(u>1?u-1:0),h=1;h<u;h++)d[h-1]=arguments[h];return i.produceWithPatches(c,function(f){return r.apply(void 0,[f].concat(d))})};var s,a,l=i.produce(r,o,function(c,u){s=c,a=u});return typeof Promise<"u"&&l instanceof Promise?l.then(function(c){return[c,s,a]}):[l,s,a]},typeof(t==null?void 0:t.useProxies)=="boolean"&&this.setUseProxies(t.useProxies),typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=n.prototype;return e.createDraft=function(t){dg(t)||Uu(8),Gf(t)&&(t=Aj(t));var i=dxe(this),r=E4(this,t,void 0);return r[po].C=!0,Die(i),r},e.finishDraft=function(t,i){var r=t&&t[po],o=r.A;return oZ(o,i),sZ(void 0,o)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!mxe&&Uu(20),this.O=t},e.applyPatches=function(t,i){var r;for(r=i.length-1;r>=0;r--){var o=i[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(i=i.slice(r+1));var s=zb("Patches").$;return Gf(t)?s(t,i):this.produce(t,function(a){return s(a,i)})},n}(),hg=new SBe,OD=hg.produce,rvt=hg.produceWithPatches.bind(hg),ovt=hg.setAutoFreeze.bind(hg),svt=hg.setUseProxies.bind(hg),avt=hg.applyPatches.bind(hg),lvt=hg.createDraft.bind(hg),cvt=hg.finishDraft.bind(hg);const uvt=Object.freeze(Object.defineProperty({__proto__:null,Immer:SBe,applyPatches:avt,castDraft:J_t,castImmutable:evt,createDraft:lvt,current:Aj,default:OD,enableAllPlugins:Z_t,enableES5:Npe,enableMapSet:CBe,enablePatches:yBe,finishDraft:cvt,freeze:Z5,immerable:PL,isDraft:Gf,isDraftable:dg,nothing:Nj,original:_Be,produce:OD,produceWithPatches:rvt,setAutoFreeze:ovt,setUseProxies:svt},Symbol.toStringTag,{value:"Module"}));function _xe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ct(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_xe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_xe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function dd(n){return"Minified Redux error #"+n+"; visit https://redux.js.org/Errors?code="+n+" for the full message or use the non-minified dev environment for full errors. "}var vxe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),cZ=function(){return Math.random().toString(36).substring(7).split("").join(".")},k4={INIT:"@@redux/INIT"+cZ(),REPLACE:"@@redux/REPLACE"+cZ(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+cZ()}};function dvt(n){if(typeof n!="object"||n===null)return!1;for(var e=n;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e}function J5(n,e,t){var i;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(dd(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(dd(1));return t(J5)(n,e)}if(typeof n!="function")throw new Error(dd(2));var r=n,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(dd(3));return o}function d(m){if(typeof m!="function")throw new Error(dd(4));if(l)throw new Error(dd(5));var v=!0;return c(),a.push(m),function(){if(v){if(l)throw new Error(dd(6));v=!1,c();var b=a.indexOf(m);a.splice(b,1),s=null}}}function h(m){if(!dvt(m))throw new Error(dd(7));if(typeof m.type>"u")throw new Error(dd(8));if(l)throw new Error(dd(9));try{l=!0,o=r(o,m)}finally{l=!1}for(var v=s=a,_=0;_<v.length;_++){var b=v[_];b()}return m}function f(m){if(typeof m!="function")throw new Error(dd(10));r=m,h({type:k4.REPLACE})}function g(){var m,v=d;return m={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(dd(11));function y(){b.next&&b.next(u())}y();var C=v(y);return{unsubscribe:C}}},m[vxe]=function(){return this},m}return h({type:k4.INIT}),i={dispatch:h,subscribe:d,getState:u,replaceReducer:f},i[vxe]=g,i}var hvt=J5;function fvt(n){Object.keys(n).forEach(function(e){var t=n[e],i=t(void 0,{type:k4.INIT});if(typeof i>"u")throw new Error(dd(12));if(typeof t(void 0,{type:k4.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(dd(13))})}function EBe(n){for(var e=Object.keys(n),t={},i=0;i<e.length;i++){var r=e[i];typeof n[r]=="function"&&(t[r]=n[r])}var o=Object.keys(t),s;try{fvt(t)}catch(a){s=a}return function(l,c){if(l===void 0&&(l={}),s)throw s;for(var u=!1,d={},h=0;h<o.length;h++){var f=o[h],g=t[f],m=l[f],v=g(m,c);if(typeof v>"u")throw c&&c.type,new Error(dd(14));d[f]=v,u=u||v!==m}return u=u||o.length!==Object.keys(l).length,u?d:l}}function bxe(n,e){return function(){return e(n.apply(this,arguments))}}function Nie(n,e){if(typeof n=="function")return bxe(n,e);if(typeof n!="object"||n===null)throw new Error(dd(16));var t={};for(var i in n){var r=n[i];typeof r=="function"&&(t[i]=bxe(r,e))}return t}function PD(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===0?function(i){return i}:e.length===1?e[0]:e.reduce(function(i,r){return function(){return i(r.apply(void 0,arguments))}})}function Ope(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(i){return function(){var r=i.apply(void 0,arguments),o=function(){throw new Error(dd(15))},s={getState:r.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(l){return l(s)});return o=PD.apply(void 0,a)(r.dispatch),ct(ct({},r),{},{dispatch:o})}}}var iH="NOT_FOUND";function pvt(n){var e;return{get:function(i){return e&&n(e.key,i)?e.value:iH},put:function(i,r){e={key:i,value:r}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function gvt(n,e){var t=[];function i(a){var l=t.findIndex(function(u){return e(a,u.key)});if(l>-1){var c=t[l];return l>0&&(t.splice(l,1),t.unshift(c)),c.value}return iH}function r(a,l){i(a)===iH&&(t.unshift({key:a,value:l}),t.length>n&&t.pop())}function o(){return t}function s(){t=[]}return{get:i,put:r,getEntries:o,clear:s}}var xBe=function(e,t){return e===t};function mvt(n){return function(t,i){if(t===null||i===null||t.length!==i.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!n(t[o],i[o]))return!1;return!0}}function TBe(n,e){var t=typeof e=="object"?e:{equalityCheck:e},i=t.equalityCheck,r=i===void 0?xBe:i,o=t.maxSize,s=o===void 0?1:o,a=t.resultEqualityCheck,l=mvt(r),c=s===1?pvt(l):gvt(s,l);function u(){var d=c.get(arguments);if(d===iH){if(d=n.apply(null,arguments),a){var h=c.getEntries(),f=h.find(function(g){return a(g.value,d)});f&&(d=f.value)}c.put(arguments,d)}return d}return u.clearCache=function(){return c.clear()},u}function _vt(n){var e=Array.isArray(n[0])?n[0]:n;if(!e.every(function(i){return typeof i=="function"})){var t=e.map(function(i){return typeof i=="function"?"function "+(i.name||"unnamed")+"()":typeof i}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+t+"]")}return e}function kBe(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var r=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];var c=0,u,d={memoizeOptions:void 0},h=a.pop();if(typeof h=="object"&&(d=h,h=a.pop()),typeof h!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof h+"]");var f=d,g=f.memoizeOptions,m=g===void 0?t:g,v=Array.isArray(m)?m:[m],_=_vt(a),b=n.apply(void 0,[function(){return c++,h.apply(null,arguments)}].concat(v)),y=n(function(){for(var x=[],E=_.length,k=0;k<E;k++)x.push(_[k].apply(null,arguments));return u=b.apply(null,x),u});return Object.assign(y,{resultFunc:h,memoizedResultFunc:b,dependencies:_,lastResult:function(){return u},recomputations:function(){return c},resetRecomputations:function(){return c=0}}),y};return r}var Rj=kBe(TBe),vvt=function(e,t){if(t===void 0&&(t=Rj),typeof e!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof e));var i=Object.keys(e),r=t(i.map(function(o){return e[o]}),function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return s.reduce(function(l,c,u){return l[i[u]]=c,l},{})});return r};const bvt=Object.freeze(Object.defineProperty({__proto__:null,createSelector:Rj,createSelectorCreator:kBe,createStructuredSelector:vvt,defaultEqualityCheck:xBe,defaultMemoize:TBe},Symbol.toStringTag,{value:"Module"}));function IBe(n){var e=function(i){var r=i.dispatch,o=i.getState;return function(s){return function(a){return typeof a=="function"?a(r,o,n):s(a)}}};return e}var LBe=IBe();LBe.withExtraArgument=IBe;const yxe=LBe;var DBe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),eF=globalThis&&globalThis.__generator||function(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=c[0]&2?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){t.label=c[1];break}if(c[0]===6&&t.label<o[1]){t.label=o[1],o=c;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(c);break}o[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],r=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},tS=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},yvt=Object.defineProperty,Cvt=Object.defineProperties,wvt=Object.getOwnPropertyDescriptors,Cxe=Object.getOwnPropertySymbols,Svt=Object.prototype.hasOwnProperty,Evt=Object.prototype.propertyIsEnumerable,wxe=function(n,e,t){return e in n?yvt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Af=function(n,e){for(var t in e||(e={}))Svt.call(e,t)&&wxe(n,t,e[t]);if(Cxe)for(var i=0,r=Cxe(e);i<r.length;i++){var t=r[i];Evt.call(e,t)&&wxe(n,t,e[t])}return n},uZ=function(n,e){return Cvt(n,wvt(e))},tF=function(n,e,t){return new Promise(function(i,r){var o=function(l){try{a(t.next(l))}catch(c){r(c)}},s=function(l){try{a(t.throw(l))}catch(c){r(c)}},a=function(l){return l.done?i(l.value):Promise.resolve(l.value).then(o,s)};a((t=t.apply(n,e)).next())})},sy=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=Rj.apply(void 0,n),i=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return t.apply(void 0,tS([Gf(r)?Aj(r):r],o))};return i},xvt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?PD:PD.apply(null,arguments)};function Oj(n){if(typeof n!="object"||n===null)return!1;var e=Object.getPrototypeOf(n);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}var ABe=function(n){return n&&typeof n.match=="function"};function Ub(n,e){function t(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(e){var o=e.apply(void 0,i);if(!o)throw new Error("prepareAction did not return an object");return Af(Af({type:n,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:n,payload:i[0]}}return t.toString=function(){return""+n},t.type=n,t.match=function(i){return i.type===n},t}function Ppe(n){return Oj(n)&&"type"in n}function Tvt(n){return typeof n=="function"&&"type"in n&&ABe(n)}function NBe(n){return Ppe(n)&&typeof n.type=="string"&&Object.keys(n).every(kvt)}function kvt(n){return["type","payload","error","meta"].indexOf(n)>-1}function Ivt(n){return""+n}function Lvt(n){return function(){return function(e){return function(t){return e(t)}}}}var RBe=function(n){DBe(e,n);function e(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=n.apply(this,t)||this;return Object.setPrototypeOf(r,e.prototype),r}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,tS([void 0],t[0].concat(this)))):new(e.bind.apply(e,tS([void 0],t.concat(this))))},e}(Array),OBe=function(n){DBe(e,n);function e(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=n.apply(this,t)||this;return Object.setPrototypeOf(r,e.prototype),r}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,tS([void 0],t[0].concat(this)))):new(e.bind.apply(e,tS([void 0],t.concat(this))))},e}(Array);function Rie(n){return dg(n)?OD(n,function(){}):n}function Dvt(n){return typeof n!="object"||n==null||Object.isFrozen(n)}function Avt(n){return function(){return function(e){return function(t){return e(t)}}}}function PBe(n){var e=typeof n;return n==null||e==="string"||e==="boolean"||e==="number"||Array.isArray(n)||Oj(n)}function MBe(n,e,t,i,r,o){e===void 0&&(e=""),t===void 0&&(t=PBe),r===void 0&&(r=[]);var s;if(!t(n))return{keyPath:e||"<root>",value:n};if(typeof n!="object"||n===null||o!=null&&o.has(n))return!1;for(var a=i!=null?i(n):Object.entries(n),l=r.length>0,c=function(v,_){var b=e?e+"."+v:v;if(l){var y=r.some(function(C){return C instanceof RegExp?C.test(b):b===C});if(y)return"continue"}if(!t(_))return{value:{keyPath:b,value:_}};if(typeof _=="object"&&(s=MBe(_,b,t,i,r,o),s))return{value:s}},u=0,d=a;u<d.length;u++){var h=d[u],f=h[0],g=h[1],m=c(f,g);if(typeof m=="object")return m.value}return o&&FBe(n)&&o.add(n),!1}function FBe(n){if(!Object.isFrozen(n))return!1;for(var e=0,t=Object.values(n);e<t.length;e++){var i=t[e];if(!(typeof i!="object"||i===null)&&!FBe(i))return!1}return!0}function Nvt(n){return function(){return function(e){return function(t){return e(t)}}}}function Rvt(n){return typeof n=="boolean"}function Ovt(){return function(e){return BBe(e)}}function BBe(n){n===void 0&&(n={});var e=n.thunk,t=e===void 0?!0:e;n.immutableCheck,n.serializableCheck,n.actionCreatorCheck;var i=new RBe;return t&&(Rvt(t)?i.push(yxe):i.push(yxe.withExtraArgument(t.extraArgument))),i}var Pvt=!0;function $Be(n){var e=Ovt(),t=n||{},i=t.reducer,r=i===void 0?void 0:i,o=t.middleware,s=o===void 0?e():o,a=t.devTools,l=a===void 0?!0:a,c=t.preloadedState,u=c===void 0?void 0:c,d=t.enhancers,h=d===void 0?void 0:d,f;if(typeof r=="function")f=r;else if(Oj(r))f=EBe(r);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var g=s;typeof g=="function"&&(g=g(e));var m=Ope.apply(void 0,g),v=PD;l&&(v=xvt(Af({trace:!Pvt},typeof l=="object"&&l)));var _=new OBe(m),b=_;Array.isArray(h)?b=tS([m],h):typeof h=="function"&&(b=h(_));var y=v.apply(void 0,b);return J5(f,u,y)}function VBe(n){var e={},t=[],i,r={addCase:function(o,s){var a=typeof o=="string"?o:o.type;if(!a)throw new Error("`builder.addCase` cannot be called with an empty action type");if(a in e)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return e[a]=s,r},addMatcher:function(o,s){return t.push({matcher:o,reducer:s}),r},addDefaultCase:function(o){return i=o,r}};return n(r),[e,t,i]}function Mvt(n){return typeof n=="function"}function HBe(n,e,t,i){t===void 0&&(t=[]);var r=typeof e=="function"?VBe(e):[e,t,i],o=r[0],s=r[1],a=r[2],l;if(Mvt(n))l=function(){return Rie(n())};else{var c=Rie(n);l=function(){return c}}function u(d,h){d===void 0&&(d=l());var f=tS([o[h.type]],s.filter(function(g){var m=g.matcher;return m(h)}).map(function(g){var m=g.reducer;return m}));return f.filter(function(g){return!!g}).length===0&&(f=[a]),f.reduce(function(g,m){if(m)if(Gf(g)){var v=g,_=m(v,h);return _===void 0?g:_}else{if(dg(g))return OD(g,function(b){return m(b,h)});var _=m(g,h);if(_===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return g},d)}return u.getInitialState=l,u}function Fvt(n,e){return n+"/"+e}function gN(n){var e=n.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var t=typeof n.initialState=="function"?n.initialState:Rie(n.initialState),i=n.reducers||{},r=Object.keys(i),o={},s={},a={};r.forEach(function(u){var d=i[u],h=Fvt(e,u),f,g;"reducer"in d?(f=d.reducer,g=d.prepare):f=d,o[u]=f,s[h]=f,a[u]=g?Ub(h,g):Ub(h)});function l(){var u=typeof n.extraReducers=="function"?VBe(n.extraReducers):[n.extraReducers],d=u[0],h=d===void 0?{}:d,f=u[1],g=f===void 0?[]:f,m=u[2],v=m===void 0?void 0:m,_=Af(Af({},h),s);return HBe(t,function(b){for(var y in _)b.addCase(y,_[y]);for(var C=0,x=g;C<x.length;C++){var E=x[C];b.addMatcher(E.matcher,E.reducer)}v&&b.addDefaultCase(v)})}var c;return{name:e,reducer:function(u,d){return c||(c=l()),c(u,d)},actions:a,caseReducers:o,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}function Bvt(){return{ids:[],entities:{}}}function $vt(){function n(e){return e===void 0&&(e={}),Object.assign(Bvt(),e)}return{getInitialState:n}}function Vvt(){function n(e){var t=function(c){return c.ids},i=function(c){return c.entities},r=sy(t,i,function(c,u){return c.map(function(d){return u[d]})}),o=function(c,u){return u},s=function(c,u){return c[u]},a=sy(t,function(c){return c.length});if(!e)return{selectIds:t,selectEntities:i,selectAll:r,selectTotal:a,selectById:sy(i,o,s)};var l=sy(e,i);return{selectIds:sy(e,t),selectEntities:l,selectAll:sy(e,r),selectTotal:sy(e,a),selectById:sy(l,o,s)}}return{getSelectors:n}}function Hvt(n){var e=gc(function(t,i){return n(i)});return function(i){return e(i,void 0)}}function gc(n){return function(t,i){function r(s){return NBe(s)}var o=function(s){r(i)?n(i.payload,s):n(i,s)};return Gf(t)?(o(t),t):OD(t,o)}}function jP(n,e){var t=e(n);return t}function nT(n){return Array.isArray(n)||(n=Object.values(n)),n}function WBe(n,e,t){n=nT(n);for(var i=[],r=[],o=0,s=n;o<s.length;o++){var a=s[o],l=jP(a,e);l in t.entities?r.push({id:l,changes:a}):i.push(a)}return[i,r]}function zBe(n){function e(g,m){var v=jP(g,n);v in m.entities||(m.ids.push(v),m.entities[v]=g)}function t(g,m){g=nT(g);for(var v=0,_=g;v<_.length;v++){var b=_[v];e(b,m)}}function i(g,m){var v=jP(g,n);v in m.entities||m.ids.push(v),m.entities[v]=g}function r(g,m){g=nT(g);for(var v=0,_=g;v<_.length;v++){var b=_[v];i(b,m)}}function o(g,m){g=nT(g),m.ids=[],m.entities={},t(g,m)}function s(g,m){return a([g],m)}function a(g,m){var v=!1;g.forEach(function(_){_ in m.entities&&(delete m.entities[_],v=!0)}),v&&(m.ids=m.ids.filter(function(_){return _ in m.entities}))}function l(g){Object.assign(g,{ids:[],entities:{}})}function c(g,m,v){var _=v.entities[m.id],b=Object.assign({},_,m.changes),y=jP(b,n),C=y!==m.id;return C&&(g[m.id]=y,delete v.entities[m.id]),v.entities[y]=b,C}function u(g,m){return d([g],m)}function d(g,m){var v={},_={};g.forEach(function(C){C.id in m.entities&&(_[C.id]={id:C.id,changes:Af(Af({},_[C.id]?_[C.id].changes:null),C.changes)})}),g=Object.values(_);var b=g.length>0;if(b){var y=g.filter(function(C){return c(v,C,m)}).length>0;y&&(m.ids=Object.keys(m.entities))}}function h(g,m){return f([g],m)}function f(g,m){var v=WBe(g,n,m),_=v[0],b=v[1];d(b,m),t(_,m)}return{removeAll:Hvt(l),addOne:gc(e),addMany:gc(t),setOne:gc(i),setMany:gc(r),setAll:gc(o),updateOne:gc(u),updateMany:gc(d),upsertOne:gc(h),upsertMany:gc(f),removeOne:gc(s),removeMany:gc(a)}}function Wvt(n,e){var t=zBe(n),i=t.removeOne,r=t.removeMany,o=t.removeAll;function s(b,y){return a([b],y)}function a(b,y){b=nT(b);var C=b.filter(function(x){return!(jP(x,n)in y.entities)});C.length!==0&&v(C,y)}function l(b,y){return c([b],y)}function c(b,y){b=nT(b),b.length!==0&&v(b,y)}function u(b,y){b=nT(b),y.entities={},y.ids=[],a(b,y)}function d(b,y){return h([b],y)}function h(b,y){for(var C=!1,x=0,E=b;x<E.length;x++){var k=E[x],L=y.entities[k.id];if(L){C=!0,Object.assign(L,k.changes);var D=n(L);k.id!==D&&(delete y.entities[k.id],y.entities[D]=L)}}C&&_(y)}function f(b,y){return g([b],y)}function g(b,y){var C=WBe(b,n,y),x=C[0],E=C[1];h(E,y),a(x,y)}function m(b,y){if(b.length!==y.length)return!1;for(var C=0;C<b.length&&C<y.length;C++)if(b[C]!==y[C])return!1;return!0}function v(b,y){b.forEach(function(C){y.entities[n(C)]=C}),_(y)}function _(b){var y=Object.values(b.entities);y.sort(e);var C=y.map(n),x=b.ids;m(x,C)||(b.ids=C)}return{removeOne:i,removeMany:r,removeAll:o,addOne:gc(s),updateOne:gc(d),upsertOne:gc(f),setOne:gc(l),setMany:gc(c),setAll:gc(u),addMany:gc(a),updateMany:gc(h),upsertMany:gc(g)}}function zvt(n){n===void 0&&(n={});var e=Af({sortComparer:!1,selectId:function(a){return a.id}},n),t=e.selectId,i=e.sortComparer,r=$vt(),o=Vvt(),s=i?Wvt(t,i):zBe(t);return Af(Af(Af({selectId:t,sortComparer:i},r),o),s)}var Uvt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Mpe=function(n){n===void 0&&(n=21);for(var e="",t=n;t--;)e+=Uvt[Math.random()*64|0];return e},jvt=["name","message","stack","code"],dZ=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),Sxe=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),UBe=function(n){if(typeof n=="object"&&n!==null){for(var e={},t=0,i=jvt;t<i.length;t++){var r=i[t];typeof n[r]=="string"&&(e[r]=n[r])}return e}return{message:String(n)}},qvt=function(){function n(e,t,i){var r=Ub(e+"/fulfilled",function(c,u,d,h){return{payload:c,meta:uZ(Af({},h||{}),{arg:d,requestId:u,requestStatus:"fulfilled"})}}),o=Ub(e+"/pending",function(c,u,d){return{payload:void 0,meta:uZ(Af({},d||{}),{arg:u,requestId:c,requestStatus:"pending"})}}),s=Ub(e+"/rejected",function(c,u,d,h,f){return{payload:h,error:(i&&i.serializeError||UBe)(c||"Rejected"),meta:uZ(Af({},f||{}),{arg:d,requestId:u,rejectedWithValue:!!h,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"})}}),a=typeof AbortController<"u"?AbortController:function(){function c(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return c.prototype.abort=function(){},c}();function l(c){return function(u,d,h){var f=i!=null&&i.idGenerator?i.idGenerator(c):Mpe(),g=new a,m;function v(b){m=b,g.abort()}var _=function(){return tF(this,null,function(){var b,y,C,x,E,k,L;return eF(this,function(D){switch(D.label){case 0:return D.trys.push([0,4,,5]),x=(b=i==null?void 0:i.condition)==null?void 0:b.call(i,c,{getState:d,extra:h}),Kvt(x)?[4,x]:[3,2];case 1:x=D.sent(),D.label=2;case 2:if(x===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return E=new Promise(function(A,O){return g.signal.addEventListener("abort",function(){return O({name:"AbortError",message:m||"Aborted"})})}),u(o(f,c,(y=i==null?void 0:i.getPendingMeta)==null?void 0:y.call(i,{requestId:f,arg:c},{getState:d,extra:h}))),[4,Promise.race([E,Promise.resolve(t(c,{dispatch:u,getState:d,extra:h,requestId:f,signal:g.signal,abort:v,rejectWithValue:function(A,O){return new dZ(A,O)},fulfillWithValue:function(A,O){return new Sxe(A,O)}})).then(function(A){if(A instanceof dZ)throw A;return A instanceof Sxe?r(A.payload,f,c,A.meta):r(A,f,c)})])];case 3:return C=D.sent(),[3,5];case 4:return k=D.sent(),C=k instanceof dZ?s(null,f,c,k.payload,k.meta):s(k,f,c),[3,5];case 5:return L=i&&!i.dispatchConditionRejection&&s.match(C)&&C.meta.condition,L||u(C),[2,C]}})})}();return Object.assign(_,{abort:v,requestId:f,arg:c,unwrap:function(){return _.then(jBe)}})}}return Object.assign(l,{pending:o,rejected:s,fulfilled:r,typePrefix:e})}return n.withTypes=function(){return n},n}();function jBe(n){if(n.meta&&n.meta.rejectedWithValue)throw n.payload;if(n.error)throw n.error;return n.payload}function Kvt(n){return n!==null&&typeof n=="object"&&typeof n.then=="function"}var qBe=function(n,e){return ABe(n)?n.match(e):n(e)};function nF(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.some(function(i){return qBe(i,t)})}}function Oie(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.every(function(i){return qBe(i,t)})}}function Pj(n,e){if(!n||!n.meta)return!1;var t=typeof n.meta.requestId=="string",i=e.indexOf(n.meta.requestStatus)>-1;return t&&i}function iF(n){return typeof n[0]=="function"&&"pending"in n[0]&&"fulfilled"in n[0]&&"rejected"in n[0]}function KBe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Pj(t,["pending"])}:iF(n)?function(t){var i=n.map(function(o){return o.pending}),r=nF.apply(void 0,i);return r(t)}:KBe()(n[0])}function rH(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Pj(t,["rejected"])}:iF(n)?function(t){var i=n.map(function(o){return o.rejected}),r=nF.apply(void 0,i);return r(t)}:rH()(n[0])}function GBe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=function(i){return i&&i.meta&&i.meta.rejectedWithValue};return n.length===0?function(i){var r=Oie(rH.apply(void 0,n),t);return r(i)}:iF(n)?function(i){var r=Oie(rH.apply(void 0,n),t);return r(i)}:GBe()(n[0])}function YBe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Pj(t,["fulfilled"])}:iF(n)?function(t){var i=n.map(function(o){return o.fulfilled}),r=nF.apply(void 0,i);return r(t)}:YBe()(n[0])}function QBe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Pj(t,["pending","fulfilled","rejected"])}:iF(n)?function(t){for(var i=[],r=0,o=n;r<o.length;r++){var s=o[r];i.push(s.pending,s.rejected,s.fulfilled)}var a=nF.apply(void 0,i);return a(t)}:QBe()(n[0])}var Fpe=function(n,e){if(typeof n!="function")throw new TypeError(e+" is not a function")},Pie=function(){},XBe=function(n,e){return e===void 0&&(e=Pie),n.catch(e),n},ZBe=function(n,e){return n.addEventListener("abort",e,{once:!0}),function(){return n.removeEventListener("abort",e)}},FL=function(n,e){var t=n.signal;t.aborted||("reason"in t||Object.defineProperty(t,"reason",{enumerable:!0,value:e,configurable:!0,writable:!0}),n.abort(e))},Gvt="task",JBe="listener",e8e="completed",Bpe="cancelled",Yvt="task-"+Bpe,Qvt="task-"+e8e,t8e=JBe+"-"+Bpe,Xvt=JBe+"-"+e8e,rF=function(){function n(e){this.code=e,this.name="TaskAbortError",this.message=Gvt+" "+Bpe+" (reason: "+e+")"}return n}(),BL=function(n){if(n.aborted)throw new rF(n.reason)};function n8e(n,e){var t=Pie;return new Promise(function(i,r){var o=function(){return r(new rF(n.reason))};if(n.aborted){o();return}t=ZBe(n,o),e.finally(function(){return t()}).then(i,r)}).finally(function(){t=Pie})}var Zvt=function(n,e){return tF(void 0,null,function(){var t,i;return eF(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return r.sent(),[4,n()];case 2:return t=r.sent(),[2,{status:"ok",value:t}];case 3:return i=r.sent(),[2,{status:i instanceof rF?"cancelled":"rejected",error:i}];case 4:return e==null||e(),[7];case 5:return[2]}})})},oH=function(n){return function(e){return XBe(n8e(n,e).then(function(t){return BL(n),t}))}},i8e=function(n){var e=oH(n);return function(t){return e(new Promise(function(i){return setTimeout(i,t)}))}},Jvt=Object.assign,Exe={},oF="listenerMiddleware",ebt=function(n,e){var t=function(i){return ZBe(n,function(){return FL(i,n.reason)})};return function(i,r){Fpe(i,"taskExecutor");var o=new AbortController;t(o);var s=Zvt(function(){return tF(void 0,null,function(){var a;return eF(this,function(l){switch(l.label){case 0:return BL(n),BL(o.signal),[4,i({pause:oH(o.signal),delay:i8e(o.signal),signal:o.signal})];case 1:return a=l.sent(),BL(o.signal),[2,a]}})})},function(){return FL(o,Qvt)});return r!=null&&r.autoJoin&&e.push(s),{result:oH(n)(s),cancel:function(){FL(o,Yvt)}}}},tbt=function(n,e){var t=function(i,r){return tF(void 0,null,function(){var o,s,a,l;return eF(this,function(c){switch(c.label){case 0:BL(e),o=function(){},s=new Promise(function(u,d){var h=n({predicate:i,effect:function(f,g){g.unsubscribe(),u([f,g.getState(),g.getOriginalState()])}});o=function(){h(),d()}}),a=[s],r!=null&&a.push(new Promise(function(u){return setTimeout(u,r,null)})),c.label=1;case 1:return c.trys.push([1,,3,4]),[4,n8e(e,Promise.race(a))];case 2:return l=c.sent(),BL(e),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(i,r){return XBe(t(i,r))}},r8e=function(n){var e=n.type,t=n.actionCreator,i=n.matcher,r=n.predicate,o=n.effect;if(e)r=Ub(e).match;else if(t)e=t.type,r=t.match;else if(i)r=i;else if(!r)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Fpe(o,"options.listener"),{predicate:r,type:e,effect:o}},nbt=function(n){var e=r8e(n),t=e.type,i=e.predicate,r=e.effect,o=Mpe(),s={id:o,effect:r,type:t,predicate:i,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return s},Mie=function(n){n.pending.forEach(function(e){FL(e,t8e)})},ibt=function(n){return function(){n.forEach(Mie),n.clear()}},xxe=function(n,e,t){try{n(e,t)}catch(i){setTimeout(function(){throw i},0)}},o8e=Ub(oF+"/add"),s8e=Ub(oF+"/removeAll"),a8e=Ub(oF+"/remove"),rbt=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,tS([oF+"/error"],n))};function obt(n){var e=this;n===void 0&&(n={});var t=new Map,i=n.extra,r=n.onError,o=r===void 0?rbt:r;Fpe(o,"onError");var s=function(f){return f.unsubscribe=function(){return t.delete(f.id)},t.set(f.id,f),function(g){f.unsubscribe(),g!=null&&g.cancelActive&&Mie(f)}},a=function(f){for(var g=0,m=Array.from(t.values());g<m.length;g++){var v=m[g];if(f(v))return v}},l=function(f){var g=a(function(m){return m.effect===f.effect});return g||(g=nbt(f)),s(g)},c=function(f){var g=r8e(f),m=g.type,v=g.effect,_=g.predicate,b=a(function(y){var C=typeof m=="string"?y.type===m:y.predicate===_;return C&&y.effect===v});return b&&(b.unsubscribe(),f.cancelActive&&Mie(b)),!!b},u=function(f,g,m,v){return tF(e,null,function(){var _,b,y,C;return eF(this,function(x){switch(x.label){case 0:_=new AbortController,b=tbt(l,_.signal),y=[],x.label=1;case 1:return x.trys.push([1,3,4,6]),f.pending.add(_),[4,Promise.resolve(f.effect(g,Jvt({},m,{getOriginalState:v,condition:function(E,k){return b(E,k).then(Boolean)},take:b,delay:i8e(_.signal),pause:oH(_.signal),extra:i,signal:_.signal,fork:ebt(_.signal,y),unsubscribe:f.unsubscribe,subscribe:function(){t.set(f.id,f)},cancelActiveListeners:function(){f.pending.forEach(function(E,k,L){E!==_&&(FL(E,t8e),L.delete(E))})}})))];case 2:return x.sent(),[3,6];case 3:return C=x.sent(),C instanceof rF||xxe(o,C,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(y)];case 5:return x.sent(),FL(_,Xvt),f.pending.delete(_),[7];case 6:return[2]}})})},d=ibt(t),h=function(f){return function(g){return function(m){if(!Ppe(m))return g(m);if(o8e.match(m))return l(m.payload);if(s8e.match(m)){d();return}if(a8e.match(m))return c(m.payload);var v=f.getState(),_=function(){if(v===Exe)throw new Error(oF+": getOriginalState can only be called synchronously");return v},b;try{if(b=g(m),t.size>0)for(var y=f.getState(),C=Array.from(t.values()),x=0,E=C;x<E.length;x++){var k=E[x],L=!1;try{L=k.predicate(m,y,v)}catch(D){L=!1,xxe(o,D,{raisedBy:"predicate"})}L&&u(k,m,f,_)}}finally{v=Exe}return b}}};return{middleware:h,startListening:l,stopListening:c,clearListeners:d}}var $pe="RTK_autoBatch",sbt=function(){return function(n){var e;return{payload:n,meta:(e={},e[$pe]=!0,e)}}},Txe,abt=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(n){return(Txe||(Txe=Promise.resolve())).then(n).catch(function(e){return setTimeout(function(){throw e},0)})},l8e=function(n){return function(e){setTimeout(e,n)}},lbt=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:l8e(10),cbt=function(n){return n===void 0&&(n={type:"raf"}),function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=e.apply(void 0,t),o=!0,s=!1,a=!1,l=new Set,c=n.type==="tick"?abt:n.type==="raf"?lbt:n.type==="callback"?n.queueNotification:l8e(n.timeout),u=function(){a=!1,s&&(s=!1,l.forEach(function(d){return d()}))};return Object.assign({},r,{subscribe:function(d){var h=function(){return o&&d()},f=r.subscribe(h);return l.add(d),function(){f(),l.delete(d)}},dispatch:function(d){var h;try{return o=!((h=d==null?void 0:d.meta)!=null&&h[$pe]),s=!o,s&&(a||(a=!0,c(u))),r.dispatch(d)}finally{o=!0}}})}}};Npe();const ubt=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:OBe,MiddlewareArray:RBe,SHOULD_AUTOBATCH:$pe,TaskAbortError:rF,__DO_NOT_USE__ActionTypes:k4,addListener:o8e,applyMiddleware:Ope,autoBatchEnhancer:cbt,bindActionCreators:Nie,clearAllListeners:s8e,combineReducers:EBe,compose:PD,configureStore:$Be,createAction:Ub,createActionCreatorInvariantMiddleware:Lvt,createAsyncThunk:qvt,createDraftSafeSelector:sy,createEntityAdapter:zvt,createImmutableStateInvariantMiddleware:Avt,createListenerMiddleware:obt,createNextState:OD,createReducer:HBe,createSelector:Rj,createSerializableStateInvariantMiddleware:Nvt,createSlice:gN,createStore:J5,current:Aj,findNonSerializableValue:MBe,freeze:Z5,getDefaultMiddleware:BBe,getType:Ivt,isAction:Ppe,isActionCreator:Tvt,isAllOf:Oie,isAnyOf:nF,isAsyncThunkAction:QBe,isDraft:Gf,isFluxStandardAction:NBe,isFulfilled:YBe,isImmutableDefault:Dvt,isPending:KBe,isPlain:PBe,isPlainObject:Oj,isRejected:rH,isRejectedWithValue:GBe,legacy_createStore:hvt,miniSerializeError:UBe,nanoid:Mpe,original:_Be,prepareAutoBatched:sbt,removeListener:a8e,unwrapResult:jBe},Symbol.toStringTag,{value:"Module"}));/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const dbt={authenticated:!1,user:{},changes:{}},c8e=gN({name:"user",initialState:dbt,reducers:{updateUser:(n,e)=>{n.user=e.payload},injectInChanges:n=>{n.changes=n.user},injectInChangesWithData:(n,e)=>{n.changes=e.payload},resetChanges:n=>{n.changes=n.user},authenticate:(n,e)=>{n.authenticated=!0,n.user=e.payload.user,localStorage.setItem("X-NINJA-TOKEN",e.payload.token)},register:(n,e)=>{n.authenticated=!0,n.user=e.payload.user,localStorage.setItem("X-NINJA-TOKEN",e.payload.token)},updateChanges:(n,e)=>{un.set(n.changes,e.payload.property,e.payload.value)},deletePassword:n=>{delete n.changes.password,delete n.user.password}}}),{updateUser:qy,injectInChanges:Vpe,injectInChangesWithData:hZ,resetChanges:hbt,authenticate:sF,register:fbt,updateChanges:Ak,deletePassword:pbt}=c8e.actions;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function pa(){return Oc(n=>n.user.user)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function aF(){return Oc(n=>n.user.changes)}function T1(n){const e=pa(),t=Qi(),i=aF();return w.useEffect(()=>{i&&(n==null?void 0:n.overwrite)===!1||t(Vpe())},[e]),i}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const sH={dashboard_charts:{default_view:"month",currency:1,range:"this_month"},datatables:{clients:{sort:"id|desc"}},reports:{columns:{}},auto_expand_product_table_notes:!1,enable_public_notifications:null,use_system_fonts:!1};function Ha(n){var o,s;const e=T1({overwrite:n==null?void 0:n.overwrite}),t=Oc(a=>{var l,c;return(c=(l=a.user.changes)==null?void 0:l.company_user)==null?void 0:c.react_settings})||{},r={show_pdf_preview:!0,react_notification_link:!0,react_table_columns:{...(s=(o=e==null?void 0:e.company_user)==null?void 0:o.settings)==null?void 0:s.react_table_columns,...t.react_table_columns},preferences:un.cloneDeep(sH)};return un.merge({...r},{...t})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const gbt=Oo(null);function Hpe(){const[n,e]=Yo(gbt),t=ci(),i=Ha();return w.useEffect(()=>{if(!t||!i.preferences.enable_public_notifications)return;const r=new Y_t("f0111a02782708da651f",{cluster:"eu",authEndpoint:mN()+"/broadcasting/auth",forceTLS:!1,enableStats:!0,wsHost:"socket.invoicing.co",wsPort:6002,enabledTransports:["ws","wss"],auth:{headers:nS()}});return e(r),r.connection.bind("connected",()=>{localStorage.setItem("X-SOCKET-ID",r.connection.socket_id)}),()=>{r.disconnect()}},[t,i.preferences.enable_public_notifications]),n}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function mbt(){const n=Hpe(),e=ci(),t={"App\\Events\\Invoice\\InvoiceWasPaid":()=>{},"App\\Events\\Invoice\\InvoiceWasViewed":()=>{},"App\\Events\\Payment\\PaymentWasUpdated":()=>{},"App\\Events\\Credit\\CreditWasCreated":()=>{},"App\\Events\\Credit\\CreditWasUpdated":()=>{}};return w.useEffect(()=>{if(!n||!e||!Ro())return;console.log(`Subscribing to private-company-${e.company_key}`),n.subscribe(`private-company-${e.company_key}`).bind_global((r,o)=>{console.log(`channel: ${r}`);const s=t[r];s&&(s(o),window.dispatchEvent(new CustomEvent(`pusher::${r}`,{detail:{event:r,data:o}})))})},[n,e]),null}function u8e({on:n,callback:e}){w.useEffect(()=>{},[n,e])}function kxe(){return localStorage.getItem("X-SOCKET-ID")?parseFloat(localStorage.getItem("X-SOCKET-ID")):null}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function nS(){const n={"X-Api-Token":localStorage.getItem("X-NINJA-TOKEN"),"X-Requested-With":"XMLHttpRequest","X-React":"true"};return kxe()&&Ro()&&(n["X-Socket-ID"]=kxe()),n}let _bt={data:""},vbt=n=>typeof window=="object"?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||_bt,bbt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ybt=/\/\*[^]*?\*\/| +/g,Ixe=/\n+/g,OC=(n,e)=>{let t="",i="",r="";for(let o in n){let s=n[o];o[0]=="@"?o[1]=="i"?t=o+" "+s+";":i+=o[1]=="f"?OC(s,o):o+"{"+OC(s,o[1]=="k"?"":e)+"}":typeof s=="object"?i+=OC(s,e?e.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=OC.p?OC.p(o,s):o+":"+s+";")}return t+(e&&r?e+"{"+r+"}":r)+i},j0={},d8e=n=>{if(typeof n=="object"){let e="";for(let t in n)e+=t+d8e(n[t]);return e}return n},Cbt=(n,e,t,i,r)=>{let o=d8e(n),s=j0[o]||(j0[o]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(o));if(!j0[s]){let l=o!==n?n:(c=>{let u,d,h=[{}];for(;u=bbt.exec(c.replace(ybt,""));)u[4]?h.shift():u[3]?(d=u[3].replace(Ixe," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(Ixe," ").trim();return h[0]})(n);j0[s]=OC(r?{["@keyframes "+s]:l}:l,t?"":"."+s)}let a=t&&j0.g?j0.g:null;return t&&(j0.g=j0[s]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(j0[s],e,i,a),s},wbt=(n,e,t)=>n.reduce((i,r,o)=>{let s=e[o];if(s&&s.call){let a=s(t),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=l?"."+l:a&&typeof a=="object"?a.props?"":OC(a,""):a===!1?"":a}return i+r+(s??"")},"");function Mj(n){let e=this||{},t=n.call?n(e.p):n;return Cbt(t.unshift?t.raw?wbt(t,[].slice.call(arguments,1),e.p):t.reduce((i,r)=>Object.assign(i,r&&r.call?r(e.p):r),{}):t,vbt(e.target),e.g,e.o,e.k)}let h8e,Fie,Bie;Mj.bind({g:1});let h1=Mj.bind({k:1});function Sbt(n,e,t,i){OC.p=e,h8e=n,Fie=t,Bie=i}function zS(n,e){let t=this||{};return function(){let i=arguments;function r(o,s){let a=Object.assign({},o),l=a.className||r.className;t.p=Object.assign({theme:Fie&&Fie()},a),t.o=/ *go\d+/.test(l),a.className=Mj.apply(t,i)+(l?" "+l:""),e&&(a.ref=s);let c=n;return n[0]&&(c=a.as||n,delete a.as),Bie&&c[0]&&Bie(a),h8e(c,a)}return e?e(r):r}}var Ebt=n=>typeof n=="function",aH=(n,e)=>Ebt(n)?n(e):n,xbt=(()=>{let n=0;return()=>(++n).toString()})(),f8e=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");n=!e||e.matches}return n}})(),Tbt=20,r$=new Map,kbt=1e3,Lxe=n=>{if(r$.has(n))return;let e=setTimeout(()=>{r$.delete(n),Nk({type:4,toastId:n})},kbt);r$.set(n,e)},Ibt=n=>{let e=r$.get(n);e&&clearTimeout(e)},$ie=(n,e)=>{switch(e.type){case 0:return{...n,toasts:[e.toast,...n.toasts].slice(0,Tbt)};case 1:return e.toast.id&&Ibt(e.toast.id),{...n,toasts:n.toasts.map(o=>o.id===e.toast.id?{...o,...e.toast}:o)};case 2:let{toast:t}=e;return n.toasts.find(o=>o.id===t.id)?$ie(n,{type:1,toast:t}):$ie(n,{type:0,toast:t});case 3:let{toastId:i}=e;return i?Lxe(i):n.toasts.forEach(o=>{Lxe(o.id)}),{...n,toasts:n.toasts.map(o=>o.id===i||i===void 0?{...o,visible:!1}:o)};case 4:return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(o=>o.id!==e.toastId)};case 5:return{...n,pausedAt:e.time};case 6:let r=e.time-(n.pausedAt||0);return{...n,pausedAt:void 0,toasts:n.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+r}))}}},o$=[],s$={toasts:[],pausedAt:void 0},Nk=n=>{s$=$ie(s$,n),o$.forEach(e=>{e(s$)})},Lbt={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Dbt=(n={})=>{let[e,t]=w.useState(s$);w.useEffect(()=>(o$.push(t),()=>{let r=o$.indexOf(t);r>-1&&o$.splice(r,1)}),[e]);let i=e.toasts.map(r=>{var o,s;return{...n,...n[r.type],...r,duration:r.duration||((o=n[r.type])==null?void 0:o.duration)||(n==null?void 0:n.duration)||Lbt[r.type],style:{...n.style,...(s=n[r.type])==null?void 0:s.style,...r.style}}});return{...e,toasts:i}},Abt=(n,e="blank",t)=>({createdAt:Date.now(),visible:!0,type:e,ariaProps:{role:"status","aria-live":"polite"},message:n,pauseDuration:0,...t,id:(t==null?void 0:t.id)||xbt()}),lF=n=>(e,t)=>{let i=Abt(e,n,t);return Nk({type:2,toast:i}),i.id},Ku=(n,e)=>lF("blank")(n,e);Ku.error=lF("error");Ku.success=lF("success");Ku.loading=lF("loading");Ku.custom=lF("custom");Ku.dismiss=n=>{Nk({type:3,toastId:n})};Ku.remove=n=>Nk({type:4,toastId:n});Ku.promise=(n,e,t)=>{let i=Ku.loading(e.loading,{...t,...t==null?void 0:t.loading});return n.then(r=>(Ku.success(aH(e.success,r),{id:i,...t,...t==null?void 0:t.success}),r)).catch(r=>{Ku.error(aH(e.error,r),{id:i,...t,...t==null?void 0:t.error})}),n};var Nbt=(n,e)=>{Nk({type:1,toast:{id:n,height:e}})},Rbt=()=>{Nk({type:5,time:Date.now()})},Obt=n=>{let{toasts:e,pausedAt:t}=Dbt(n);w.useEffect(()=>{if(t)return;let o=Date.now(),s=e.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(l<0){a.visible&&Ku.dismiss(a.id);return}return setTimeout(()=>Ku.dismiss(a.id),l)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[e,t]);let i=w.useCallback(()=>{t&&Nk({type:6,time:Date.now()})},[t]),r=w.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=s||{},u=e.filter(f=>(f.position||c)===(o.position||c)&&f.height),d=u.findIndex(f=>f.id===o.id),h=u.filter((f,g)=>g<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,g)=>f+(g.height||0)+l,0)},[e]);return{toasts:e,handlers:{updateHeight:Nbt,startPause:Rbt,endPause:i,calculateOffset:r}}},Pbt=h1` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Mbt=h1` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,Fbt=h1` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,Bbt=zS("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${Pbt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${Mbt} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${n=>n.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${Fbt} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,$bt=h1` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,Vbt=zS("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${n=>n.secondary||"#e0e0e0"}; border-right-color: ${n=>n.primary||"#616161"}; animation: ${$bt} 1s linear infinite; `,Hbt=h1` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Wbt=h1` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,zbt=zS("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${Hbt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${Wbt} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${n=>n.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,Ubt=zS("div")` position: absolute; `,jbt=zS("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,qbt=h1` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,Kbt=zS("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${qbt} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,Gbt=({toast:n})=>{let{icon:e,type:t,iconTheme:i}=n;return e!==void 0?typeof e=="string"?w.createElement(Kbt,null,e):e:t==="blank"?null:w.createElement(jbt,null,w.createElement(Vbt,{...i}),t!=="loading"&&w.createElement(Ubt,null,t==="error"?w.createElement(Bbt,{...i}):w.createElement(zbt,{...i})))},Ybt=n=>` 0% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,Qbt=n=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;} `,Xbt="0%{opacity:0;} 100%{opacity:1;}",Zbt="0%{opacity:1;} 100%{opacity:0;}",Jbt=zS("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,e0t=zS("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,t0t=(n,e)=>{let t=n.includes("top")?1:-1,[i,r]=f8e()?[Xbt,Zbt]:[Ybt(t),Qbt(t)];return{animation:e?`${h1(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${h1(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},n0t=w.memo(({toast:n,position:e,style:t,children:i})=>{let r=n.height?t0t(n.position||e||"top-center",n.visible):{opacity:0},o=w.createElement(Gbt,{toast:n}),s=w.createElement(e0t,{...n.ariaProps},aH(n.message,n));return w.createElement(Jbt,{className:n.className,style:{...r,...t,...n.style}},typeof i=="function"?i({icon:o,message:s}):w.createElement(w.Fragment,null,o,s))});Sbt(w.createElement);var i0t=({id:n,className:e,style:t,onHeightUpdate:i,children:r})=>{let o=w.useCallback(s=>{if(s){let a=()=>{let l=s.getBoundingClientRect().height;i(n,l)};a(),new MutationObserver(a).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[n,i]);return w.createElement("div",{ref:o,className:e,style:t},r)},r0t=(n,e)=>{let t=n.includes("top"),i=t?{top:0}:{bottom:0},r=n.includes("center")?{justifyContent:"center"}:n.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:f8e()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(t?1:-1)}px)`,...i,...r}},o0t=Mj` z-index: 9999; > * { pointer-events: auto; } `,g8=16,s0t=({reverseOrder:n,position:e="top-center",toastOptions:t,gutter:i,children:r,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:l}=Obt(t);return w.createElement("div",{style:{position:"fixed",zIndex:9999,top:g8,left:g8,right:g8,bottom:g8,pointerEvents:"none",...o},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||e,d=l.calculateOffset(c,{reverseOrder:n,gutter:i,defaultPosition:e}),h=r0t(u,d);return w.createElement(i0t,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?o0t:"",style:h},c.type==="custom"?aH(c.message,c):r?r(c):w.createElement(n0t,{toast:c,position:u}))}))},p8e=Ku;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */class a0t{processing(){return this.currentId=Ku.loading(Iie("processing",{}),{id:this.currentId}),this}success(e="success",t={}){return this.currentId=Ku.success(Ms(e,t),{id:this.currentId}),this}error(e="error_title"){return this.currentId=Ku.error(Iie(e),{id:this.currentId}),this}dismiss(){return Ku.dismiss(this.currentId),this}}const ce=new a0t;function cF(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,GV(n,e)}var uF=function(){function n(){this.listeners=[]}var e=n.prototype;return e.subscribe=function(i){var r=this,o=i||function(){};return this.listeners.push(o),this.onSubscribe(),function(){r.listeners=r.listeners.filter(function(s){return s!==o}),r.onUnsubscribe()}},e.hasListeners=function(){return this.listeners.length>0},e.onSubscribe=function(){},e.onUnsubscribe=function(){},n}(),lH=typeof window>"u";function Jd(){}function l0t(n,e){return typeof n=="function"?n(e):n}function Vie(n){return typeof n=="number"&&n>=0&&n!==1/0}function cH(n){return Array.isArray(n)?n:[n]}function g8e(n,e){return Math.max(n+(e||0)-Date.now(),0)}function a$(n,e,t){return Fj(n)?typeof e=="function"?Ct({},t,{queryKey:n,queryFn:e}):Ct({},e,{queryKey:n}):n}function xC(n,e,t){return Fj(n)?[Ct({},e,{queryKey:n}),t]:[n||{},e]}function c0t(n,e){if(n===!0&&e===!0||n==null&&e==null)return"all";if(n===!1&&e===!1)return"none";var t=n??!e;return t?"active":"inactive"}function Dxe(n,e){var t=n.active,i=n.exact,r=n.fetching,o=n.inactive,s=n.predicate,a=n.queryKey,l=n.stale;if(Fj(a)){if(i){if(e.queryHash!==Wpe(a,e.options))return!1}else if(!uH(e.queryKey,a))return!1}var c=c0t(t,o);if(c==="none")return!1;if(c!=="all"){var u=e.isActive();if(c==="active"&&!u||c==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||typeof r=="boolean"&&e.isFetching()!==r||s&&!s(e))}function Axe(n,e){var t=n.exact,i=n.fetching,r=n.predicate,o=n.mutationKey;if(Fj(o)){if(!e.options.mutationKey)return!1;if(t){if(Px(e.options.mutationKey)!==Px(o))return!1}else if(!uH(e.options.mutationKey,o))return!1}return!(typeof i=="boolean"&&e.state.status==="loading"!==i||r&&!r(e))}function Wpe(n,e){var t=(e==null?void 0:e.queryKeyHashFn)||Px;return t(n)}function Px(n){var e=cH(n);return u0t(e)}function u0t(n){return JSON.stringify(n,function(e,t){return Hie(t)?Object.keys(t).sort().reduce(function(i,r){return i[r]=t[r],i},{}):t})}function uH(n,e){return m8e(cH(n),cH(e))}function m8e(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?!Object.keys(e).some(function(t){return!m8e(n[t],e[t])}):!1}function dH(n,e){if(n===e)return n;var t=Array.isArray(n)&&Array.isArray(e);if(t||Hie(n)&&Hie(e)){for(var i=t?n.length:Object.keys(n).length,r=t?e:Object.keys(e),o=r.length,s=t?[]:{},a=0,l=0;l<o;l++){var c=t?l:r[l];s[c]=dH(n[c],e[c]),s[c]===n[c]&&a++}return i===o&&a===i?n:s}return e}function d0t(n,e){if(n&&!e||e&&!n)return!1;for(var t in n)if(n[t]!==e[t])return!1;return!0}function Hie(n){if(!Nxe(n))return!1;var e=n.constructor;if(typeof e>"u")return!0;var t=e.prototype;return!(!Nxe(t)||!t.hasOwnProperty("isPrototypeOf"))}function Nxe(n){return Object.prototype.toString.call(n)==="[object Object]"}function Fj(n){return typeof n=="string"||Array.isArray(n)}function h0t(n){return new Promise(function(e){setTimeout(e,n)})}function Rxe(n){Promise.resolve().then(n).catch(function(e){return setTimeout(function(){throw e})})}function _8e(){if(typeof AbortController=="function")return new AbortController}var f0t=function(n){cF(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var o;if(!lH&&((o=window)!=null&&o.addEventListener)){var s=function(){return r()};return window.addEventListener("visibilitychange",s,!1),window.addEventListener("focus",s,!1),function(){window.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}}},i}var t=e.prototype;return t.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},t.onUnsubscribe=function(){if(!this.hasListeners()){var r;(r=this.cleanup)==null||r.call(this),this.cleanup=void 0}},t.setEventListener=function(r){var o,s=this;this.setup=r,(o=this.cleanup)==null||o.call(this),this.cleanup=r(function(a){typeof a=="boolean"?s.setFocused(a):s.onFocus()})},t.setFocused=function(r){this.focused=r,r&&this.onFocus()},t.onFocus=function(){this.listeners.forEach(function(r){r()})},t.isFocused=function(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)},e}(uF),qP=new f0t,p0t=function(n){cF(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var o;if(!lH&&((o=window)!=null&&o.addEventListener)){var s=function(){return r()};return window.addEventListener("online",s,!1),window.addEventListener("offline",s,!1),function(){window.removeEventListener("online",s),window.removeEventListener("offline",s)}}},i}var t=e.prototype;return t.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},t.onUnsubscribe=function(){if(!this.hasListeners()){var r;(r=this.cleanup)==null||r.call(this),this.cleanup=void 0}},t.setEventListener=function(r){var o,s=this;this.setup=r,(o=this.cleanup)==null||o.call(this),this.cleanup=r(function(a){typeof a=="boolean"?s.setOnline(a):s.onOnline()})},t.setOnline=function(r){this.online=r,r&&this.onOnline()},t.onOnline=function(){this.listeners.forEach(function(r){r()})},t.isOnline=function(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine},e}(uF),l$=new p0t;function g0t(n){return Math.min(1e3*Math.pow(2,n),3e4)}function hH(n){return typeof(n==null?void 0:n.cancel)=="function"}var v8e=function(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent};function c$(n){return n instanceof v8e}var b8e=function(e){var t=this,i=!1,r,o,s,a;this.abort=e.abort,this.cancel=function(h){return r==null?void 0:r(h)},this.cancelRetry=function(){i=!0},this.continueRetry=function(){i=!1},this.continue=function(){return o==null?void 0:o()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise(function(h,f){s=h,a=f});var l=function(f){t.isResolved||(t.isResolved=!0,e.onSuccess==null||e.onSuccess(f),o==null||o(),s(f))},c=function(f){t.isResolved||(t.isResolved=!0,e.onError==null||e.onError(f),o==null||o(),a(f))},u=function(){return new Promise(function(f){o=f,t.isPaused=!0,e.onPause==null||e.onPause()}).then(function(){o=void 0,t.isPaused=!1,e.onContinue==null||e.onContinue()})},d=function h(){if(!t.isResolved){var f;try{f=e.fn()}catch(g){f=Promise.reject(g)}r=function(m){if(!t.isResolved&&(c(new v8e(m)),t.abort==null||t.abort(),hH(f)))try{f.cancel()}catch{}},t.isTransportCancelable=hH(f),Promise.resolve(f).then(l).catch(function(g){var m,v;if(!t.isResolved){var _=(m=e.retry)!=null?m:3,b=(v=e.retryDelay)!=null?v:g0t,y=typeof b=="function"?b(t.failureCount,g):b,C=_===!0||typeof _=="number"&&t.failureCount<_||typeof _=="function"&&_(t.failureCount,g);if(i||!C){c(g);return}t.failureCount++,e.onFail==null||e.onFail(t.failureCount,g),h0t(y).then(function(){if(!qP.isFocused()||!l$.isOnline())return u()}).then(function(){i?c(g):h()})}})}};d()},m0t=function(){function n(){this.queue=[],this.transactions=0,this.notifyFn=function(t){t()},this.batchNotifyFn=function(t){t()}}var e=n.prototype;return e.batch=function(i){var r;this.transactions++;try{r=i()}finally{this.transactions--,this.transactions||this.flush()}return r},e.schedule=function(i){var r=this;this.transactions?this.queue.push(i):Rxe(function(){r.notifyFn(i)})},e.batchCalls=function(i){var r=this;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];r.schedule(function(){i.apply(void 0,s)})}},e.flush=function(){var i=this,r=this.queue;this.queue=[],r.length&&Rxe(function(){i.batchNotifyFn(function(){r.forEach(function(o){i.notifyFn(o)})})})},e.setNotifyFunction=function(i){this.notifyFn=i},e.setBatchNotifyFunction=function(i){this.batchNotifyFn=i},n}(),Zl=new m0t,y8e=console;function fH(){return y8e}function _0t(n){y8e=n}var v0t=function(){function n(t){this.abortSignalConsumed=!1,this.hadObservers=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||this.getDefaultState(this.options),this.state=this.initialState,this.meta=t.meta,this.scheduleGc()}var e=n.prototype;return e.setOptions=function(i){var r;this.options=Ct({},this.defaultOptions,i),this.meta=i==null?void 0:i.meta,this.cacheTime=Math.max(this.cacheTime||0,(r=this.options.cacheTime)!=null?r:5*60*1e3)},e.setDefaultOptions=function(i){this.defaultOptions=i},e.scheduleGc=function(){var i=this;this.clearGcTimeout(),Vie(this.cacheTime)&&(this.gcTimeout=setTimeout(function(){i.optionalRemove()},this.cacheTime))},e.clearGcTimeout=function(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)},e.optionalRemove=function(){this.observers.length||(this.state.isFetching?this.hadObservers&&this.scheduleGc():this.cache.remove(this))},e.setData=function(i,r){var o,s,a=this.state.data,l=l0t(i,a);return(o=(s=this.options).isDataEqual)!=null&&o.call(s,a,l)?l=a:this.options.structuralSharing!==!1&&(l=dH(a,l)),this.dispatch({data:l,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt}),l},e.setState=function(i,r){this.dispatch({type:"setState",state:i,setStateOptions:r})},e.cancel=function(i){var r,o=this.promise;return(r=this.retryer)==null||r.cancel(i),o?o.then(Jd).catch(Jd):Promise.resolve()},e.destroy=function(){this.clearGcTimeout(),this.cancel({silent:!0})},e.reset=function(){this.destroy(),this.setState(this.initialState)},e.isActive=function(){return this.observers.some(function(i){return i.options.enabled!==!1})},e.isFetching=function(){return this.state.isFetching},e.isStale=function(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(function(i){return i.getCurrentResult().isStale})},e.isStaleByTime=function(i){return i===void 0&&(i=0),this.state.isInvalidated||!this.state.dataUpdatedAt||!g8e(this.state.dataUpdatedAt,i)},e.onFocus=function(){var i,r=this.observers.find(function(o){return o.shouldFetchOnWindowFocus()});r&&r.refetch(),(i=this.retryer)==null||i.continue()},e.onOnline=function(){var i,r=this.observers.find(function(o){return o.shouldFetchOnReconnect()});r&&r.refetch(),(i=this.retryer)==null||i.continue()},e.addObserver=function(i){this.observers.indexOf(i)===-1&&(this.observers.push(i),this.hadObservers=!0,this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:i}))},e.removeObserver=function(i){this.observers.indexOf(i)!==-1&&(this.observers=this.observers.filter(function(r){return r!==i}),this.observers.length||(this.retryer&&(this.retryer.isTransportCancelable||this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.cacheTime?this.scheduleGc():this.cache.remove(this)),this.cache.notify({type:"observerRemoved",query:this,observer:i}))},e.getObserversCount=function(){return this.observers.length},e.invalidate=function(){this.state.isInvalidated||this.dispatch({type:"invalidate"})},e.fetch=function(i,r){var o=this,s,a,l;if(this.state.isFetching){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(this.promise){var c;return(c=this.retryer)==null||c.continueRetry(),this.promise}}if(i&&this.setOptions(i),!this.options.queryFn){var u=this.observers.find(function(b){return b.options.queryFn});u&&this.setOptions(u.options)}var d=cH(this.queryKey),h=_8e(),f={queryKey:d,pageParam:void 0,meta:this.meta};Object.defineProperty(f,"signal",{enumerable:!0,get:function(){if(h)return o.abortSignalConsumed=!0,h.signal}});var g=function(){return o.options.queryFn?(o.abortSignalConsumed=!1,o.options.queryFn(f)):Promise.reject("Missing queryFn")},m={fetchOptions:r,options:this.options,queryKey:d,state:this.state,fetchFn:g,meta:this.meta};if((s=this.options.behavior)!=null&&s.onFetch){var v;(v=this.options.behavior)==null||v.onFetch(m)}if(this.revertState=this.state,!this.state.isFetching||this.state.fetchMeta!==((a=m.fetchOptions)==null?void 0:a.meta)){var _;this.dispatch({type:"fetch",meta:(_=m.fetchOptions)==null?void 0:_.meta})}return this.retryer=new b8e({fn:m.fetchFn,abort:h==null||(l=h.abort)==null?void 0:l.bind(h),onSuccess:function(y){o.setData(y),o.cache.config.onSuccess==null||o.cache.config.onSuccess(y,o),o.cacheTime===0&&o.optionalRemove()},onError:function(y){c$(y)&&y.silent||o.dispatch({type:"error",error:y}),c$(y)||(o.cache.config.onError==null||o.cache.config.onError(y,o),fH().error(y)),o.cacheTime===0&&o.optionalRemove()},onFail:function(){o.dispatch({type:"failed"})},onPause:function(){o.dispatch({type:"pause"})},onContinue:function(){o.dispatch({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay}),this.promise=this.retryer.promise,this.promise},e.dispatch=function(i){var r=this;this.state=this.reducer(this.state,i),Zl.batch(function(){r.observers.forEach(function(o){o.onQueryUpdate(i)}),r.cache.notify({query:r,type:"queryUpdated",action:i})})},e.getDefaultState=function(i){var r=typeof i.initialData=="function"?i.initialData():i.initialData,o=typeof i.initialData<"u",s=o?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0,a=typeof r<"u";return{data:r,dataUpdateCount:0,dataUpdatedAt:a?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isFetching:!1,isInvalidated:!1,isPaused:!1,status:a?"success":"idle"}},e.reducer=function(i,r){var o,s;switch(r.type){case"failed":return Ct({},i,{fetchFailureCount:i.fetchFailureCount+1});case"pause":return Ct({},i,{isPaused:!0});case"continue":return Ct({},i,{isPaused:!1});case"fetch":return Ct({},i,{fetchFailureCount:0,fetchMeta:(o=r.meta)!=null?o:null,isFetching:!0,isPaused:!1},!i.dataUpdatedAt&&{error:null,status:"loading"});case"success":return Ct({},i,{data:r.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:(s=r.dataUpdatedAt)!=null?s:Date.now(),error:null,fetchFailureCount:0,isFetching:!1,isInvalidated:!1,isPaused:!1,status:"success"});case"error":var a=r.error;return c$(a)&&a.revert&&this.revertState?Ct({},this.revertState):Ct({},i,{error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,isFetching:!1,isPaused:!1,status:"error"});case"invalidate":return Ct({},i,{isInvalidated:!0});case"setState":return Ct({},i,r.state);default:return i}},n}(),b0t=function(n){cF(e,n);function e(i){var r;return r=n.call(this)||this,r.config=i||{},r.queries=[],r.queriesMap={},r}var t=e.prototype;return t.build=function(r,o,s){var a,l=o.queryKey,c=(a=o.queryHash)!=null?a:Wpe(l,o),u=this.get(c);return u||(u=new v0t({cache:this,queryKey:l,queryHash:c,options:r.defaultQueryOptions(o),state:s,defaultOptions:r.getQueryDefaults(l),meta:o.meta}),this.add(u)),u},t.add=function(r){this.queriesMap[r.queryHash]||(this.queriesMap[r.queryHash]=r,this.queries.push(r),this.notify({type:"queryAdded",query:r}))},t.remove=function(r){var o=this.queriesMap[r.queryHash];o&&(r.destroy(),this.queries=this.queries.filter(function(s){return s!==r}),o===r&&delete this.queriesMap[r.queryHash],this.notify({type:"queryRemoved",query:r}))},t.clear=function(){var r=this;Zl.batch(function(){r.queries.forEach(function(o){r.remove(o)})})},t.get=function(r){return this.queriesMap[r]},t.getAll=function(){return this.queries},t.find=function(r,o){var s=xC(r,o),a=s[0];return typeof a.exact>"u"&&(a.exact=!0),this.queries.find(function(l){return Dxe(a,l)})},t.findAll=function(r,o){var s=xC(r,o),a=s[0];return Object.keys(a).length>0?this.queries.filter(function(l){return Dxe(a,l)}):this.queries},t.notify=function(r){var o=this;Zl.batch(function(){o.listeners.forEach(function(s){s(r)})})},t.onFocus=function(){var r=this;Zl.batch(function(){r.queries.forEach(function(o){o.onFocus()})})},t.onOnline=function(){var r=this;Zl.batch(function(){r.queries.forEach(function(o){o.onOnline()})})},e}(uF),y0t=function(){function n(t){this.options=Ct({},t.defaultOptions,t.options),this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.observers=[],this.state=t.state||C0t(),this.meta=t.meta}var e=n.prototype;return e.setState=function(i){this.dispatch({type:"setState",state:i})},e.addObserver=function(i){this.observers.indexOf(i)===-1&&this.observers.push(i)},e.removeObserver=function(i){this.observers=this.observers.filter(function(r){return r!==i})},e.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(Jd).catch(Jd)):Promise.resolve()},e.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},e.execute=function(){var i=this,r,o=this.state.status==="loading",s=Promise.resolve();return o||(this.dispatch({type:"loading",variables:this.options.variables}),s=s.then(function(){i.mutationCache.config.onMutate==null||i.mutationCache.config.onMutate(i.state.variables,i)}).then(function(){return i.options.onMutate==null?void 0:i.options.onMutate(i.state.variables)}).then(function(a){a!==i.state.context&&i.dispatch({type:"loading",context:a,variables:i.state.variables})})),s.then(function(){return i.executeMutation()}).then(function(a){r=a,i.mutationCache.config.onSuccess==null||i.mutationCache.config.onSuccess(r,i.state.variables,i.state.context,i)}).then(function(){return i.options.onSuccess==null?void 0:i.options.onSuccess(r,i.state.variables,i.state.context)}).then(function(){return i.options.onSettled==null?void 0:i.options.onSettled(r,null,i.state.variables,i.state.context)}).then(function(){return i.dispatch({type:"success",data:r}),r}).catch(function(a){return i.mutationCache.config.onError==null||i.mutationCache.config.onError(a,i.state.variables,i.state.context,i),fH().error(a),Promise.resolve().then(function(){return i.options.onError==null?void 0:i.options.onError(a,i.state.variables,i.state.context)}).then(function(){return i.options.onSettled==null?void 0:i.options.onSettled(void 0,a,i.state.variables,i.state.context)}).then(function(){throw i.dispatch({type:"error",error:a}),a})})},e.executeMutation=function(){var i=this,r;return this.retryer=new b8e({fn:function(){return i.options.mutationFn?i.options.mutationFn(i.state.variables):Promise.reject("No mutationFn found")},onFail:function(){i.dispatch({type:"failed"})},onPause:function(){i.dispatch({type:"pause"})},onContinue:function(){i.dispatch({type:"continue"})},retry:(r=this.options.retry)!=null?r:0,retryDelay:this.options.retryDelay}),this.retryer.promise},e.dispatch=function(i){var r=this;this.state=w0t(this.state,i),Zl.batch(function(){r.observers.forEach(function(o){o.onMutationUpdate(i)}),r.mutationCache.notify(r)})},n}();function C0t(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function w0t(n,e){switch(e.type){case"failed":return Ct({},n,{failureCount:n.failureCount+1});case"pause":return Ct({},n,{isPaused:!0});case"continue":return Ct({},n,{isPaused:!1});case"loading":return Ct({},n,{context:e.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:e.variables});case"success":return Ct({},n,{data:e.data,error:null,status:"success",isPaused:!1});case"error":return Ct({},n,{data:void 0,error:e.error,failureCount:n.failureCount+1,isPaused:!1,status:"error"});case"setState":return Ct({},n,e.state);default:return n}}var S0t=function(n){cF(e,n);function e(i){var r;return r=n.call(this)||this,r.config=i||{},r.mutations=[],r.mutationId=0,r}var t=e.prototype;return t.build=function(r,o,s){var a=new y0t({mutationCache:this,mutationId:++this.mutationId,options:r.defaultMutationOptions(o),state:s,defaultOptions:o.mutationKey?r.getMutationDefaults(o.mutationKey):void 0,meta:o.meta});return this.add(a),a},t.add=function(r){this.mutations.push(r),this.notify(r)},t.remove=function(r){this.mutations=this.mutations.filter(function(o){return o!==r}),r.cancel(),this.notify(r)},t.clear=function(){var r=this;Zl.batch(function(){r.mutations.forEach(function(o){r.remove(o)})})},t.getAll=function(){return this.mutations},t.find=function(r){return typeof r.exact>"u"&&(r.exact=!0),this.mutations.find(function(o){return Axe(r,o)})},t.findAll=function(r){return this.mutations.filter(function(o){return Axe(r,o)})},t.notify=function(r){var o=this;Zl.batch(function(){o.listeners.forEach(function(s){s(r)})})},t.onFocus=function(){this.resumePausedMutations()},t.onOnline=function(){this.resumePausedMutations()},t.resumePausedMutations=function(){var r=this.mutations.filter(function(o){return o.state.isPaused});return Zl.batch(function(){return r.reduce(function(o,s){return o.then(function(){return s.continue().catch(Jd)})},Promise.resolve())})},e}(uF);function E0t(){return{onFetch:function(e){e.fetchFn=function(){var t,i,r,o,s,a,l=(t=e.fetchOptions)==null||(i=t.meta)==null?void 0:i.refetchPage,c=(r=e.fetchOptions)==null||(o=r.meta)==null?void 0:o.fetchMore,u=c==null?void 0:c.pageParam,d=(c==null?void 0:c.direction)==="forward",h=(c==null?void 0:c.direction)==="backward",f=((s=e.state.data)==null?void 0:s.pages)||[],g=((a=e.state.data)==null?void 0:a.pageParams)||[],m=_8e(),v=m==null?void 0:m.signal,_=g,b=!1,y=e.options.queryFn||function(){return Promise.reject("Missing queryFn")},C=function(B,M,V,U){return _=U?[M].concat(_):[].concat(_,[M]),U?[V].concat(B):[].concat(B,[V])},x=function(B,M,V,U){if(b)return Promise.reject("Cancelled");if(typeof V>"u"&&!M&&B.length)return Promise.resolve(B);var W={queryKey:e.queryKey,signal:v,pageParam:V,meta:e.meta},q=y(W),H=Promise.resolve(q).then(function(se){return C(B,V,se,U)});if(hH(q)){var ie=H;ie.cancel=q.cancel}return H},E;if(!f.length)E=x([]);else if(d){var k=typeof u<"u",L=k?u:Oxe(e.options,f);E=x(f,k,L)}else if(h){var D=typeof u<"u",A=D?u:x0t(e.options,f);E=x(f,D,A,!0)}else(function(){_=[];var F=typeof e.options.getNextPageParam>"u",B=l&&f[0]?l(f[0],0,f):!0;E=B?x([],F,g[0]):Promise.resolve(C([],g[0],f[0]));for(var M=function(W){E=E.then(function(q){var H=l&&f[W]?l(f[W],W,f):!0;if(H){var ie=F?g[W]:Oxe(e.options,q);return x(q,F,ie)}return Promise.resolve(C(q,g[W],f[W]))})},V=1;V<f.length;V++)M(V)})();var O=E.then(function(F){return{pages:F,pageParams:_}}),P=O;return P.cancel=function(){b=!0,m==null||m.abort(),hH(E)&&E.cancel()},O}}}}function Oxe(n,e){return n.getNextPageParam==null?void 0:n.getNextPageParam(e[e.length-1],e)}function x0t(n,e){return n.getPreviousPageParam==null?void 0:n.getPreviousPageParam(e[0],e)}var T0t=function(){function n(t){t===void 0&&(t={}),this.queryCache=t.queryCache||new b0t,this.mutationCache=t.mutationCache||new S0t,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}var e=n.prototype;return e.mount=function(){var i=this;this.unsubscribeFocus=qP.subscribe(function(){qP.isFocused()&&l$.isOnline()&&(i.mutationCache.onFocus(),i.queryCache.onFocus())}),this.unsubscribeOnline=l$.subscribe(function(){qP.isFocused()&&l$.isOnline()&&(i.mutationCache.onOnline(),i.queryCache.onOnline())})},e.unmount=function(){var i,r;(i=this.unsubscribeFocus)==null||i.call(this),(r=this.unsubscribeOnline)==null||r.call(this)},e.isFetching=function(i,r){var o=xC(i,r),s=o[0];return s.fetching=!0,this.queryCache.findAll(s).length},e.isMutating=function(i){return this.mutationCache.findAll(Ct({},i,{fetching:!0})).length},e.getQueryData=function(i,r){var o;return(o=this.queryCache.find(i,r))==null?void 0:o.state.data},e.getQueriesData=function(i){return this.getQueryCache().findAll(i).map(function(r){var o=r.queryKey,s=r.state,a=s.data;return[o,a]})},e.setQueryData=function(i,r,o){var s=a$(i),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(r,o)},e.setQueriesData=function(i,r,o){var s=this;return Zl.batch(function(){return s.getQueryCache().findAll(i).map(function(a){var l=a.queryKey;return[l,s.setQueryData(l,r,o)]})})},e.getQueryState=function(i,r){var o;return(o=this.queryCache.find(i,r))==null?void 0:o.state},e.removeQueries=function(i,r){var o=xC(i,r),s=o[0],a=this.queryCache;Zl.batch(function(){a.findAll(s).forEach(function(l){a.remove(l)})})},e.resetQueries=function(i,r,o){var s=this,a=xC(i,r,o),l=a[0],c=a[1],u=this.queryCache,d=Ct({},l,{active:!0});return Zl.batch(function(){return u.findAll(l).forEach(function(h){h.reset()}),s.refetchQueries(d,c)})},e.cancelQueries=function(i,r,o){var s=this,a=xC(i,r,o),l=a[0],c=a[1],u=c===void 0?{}:c;typeof u.revert>"u"&&(u.revert=!0);var d=Zl.batch(function(){return s.queryCache.findAll(l).map(function(h){return h.cancel(u)})});return Promise.all(d).then(Jd).catch(Jd)},e.invalidateQueries=function(i,r,o){var s,a,l,c=this,u=xC(i,r,o),d=u[0],h=u[1],f=Ct({},d,{active:(s=(a=d.refetchActive)!=null?a:d.active)!=null?s:!0,inactive:(l=d.refetchInactive)!=null?l:!1});return Zl.batch(function(){return c.queryCache.findAll(d).forEach(function(g){g.invalidate()}),c.refetchQueries(f,h)})},e.refetchQueries=function(i,r,o){var s=this,a=xC(i,r,o),l=a[0],c=a[1],u=Zl.batch(function(){return s.queryCache.findAll(l).map(function(h){return h.fetch(void 0,Ct({},c,{meta:{refetchPage:l==null?void 0:l.refetchPage}}))})}),d=Promise.all(u).then(Jd);return c!=null&&c.throwOnError||(d=d.catch(Jd)),d},e.fetchQuery=function(i,r,o){var s=a$(i,r,o),a=this.defaultQueryOptions(s);typeof a.retry>"u"&&(a.retry=!1);var l=this.queryCache.build(this,a);return l.isStaleByTime(a.staleTime)?l.fetch(a):Promise.resolve(l.state.data)},e.prefetchQuery=function(i,r,o){return this.fetchQuery(i,r,o).then(Jd).catch(Jd)},e.fetchInfiniteQuery=function(i,r,o){var s=a$(i,r,o);return s.behavior=E0t(),this.fetchQuery(s)},e.prefetchInfiniteQuery=function(i,r,o){return this.fetchInfiniteQuery(i,r,o).then(Jd).catch(Jd)},e.cancelMutations=function(){var i=this,r=Zl.batch(function(){return i.mutationCache.getAll().map(function(o){return o.cancel()})});return Promise.all(r).then(Jd).catch(Jd)},e.resumePausedMutations=function(){return this.getMutationCache().resumePausedMutations()},e.executeMutation=function(i){return this.mutationCache.build(this,i).execute()},e.getQueryCache=function(){return this.queryCache},e.getMutationCache=function(){return this.mutationCache},e.getDefaultOptions=function(){return this.defaultOptions},e.setDefaultOptions=function(i){this.defaultOptions=i},e.setQueryDefaults=function(i,r){var o=this.queryDefaults.find(function(s){return Px(i)===Px(s.queryKey)});o?o.defaultOptions=r:this.queryDefaults.push({queryKey:i,defaultOptions:r})},e.getQueryDefaults=function(i){var r;return i?(r=this.queryDefaults.find(function(o){return uH(i,o.queryKey)}))==null?void 0:r.defaultOptions:void 0},e.setMutationDefaults=function(i,r){var o=this.mutationDefaults.find(function(s){return Px(i)===Px(s.mutationKey)});o?o.defaultOptions=r:this.mutationDefaults.push({mutationKey:i,defaultOptions:r})},e.getMutationDefaults=function(i){var r;return i?(r=this.mutationDefaults.find(function(o){return uH(i,o.mutationKey)}))==null?void 0:r.defaultOptions:void 0},e.defaultQueryOptions=function(i){if(i!=null&&i._defaulted)return i;var r=Ct({},this.defaultOptions.queries,this.getQueryDefaults(i==null?void 0:i.queryKey),i,{_defaulted:!0});return!r.queryHash&&r.queryKey&&(r.queryHash=Wpe(r.queryKey,r)),r},e.defaultQueryObserverOptions=function(i){return this.defaultQueryOptions(i)},e.defaultMutationOptions=function(i){return i!=null&&i._defaulted?i:Ct({},this.defaultOptions.mutations,this.getMutationDefaults(i==null?void 0:i.mutationKey),i,{_defaulted:!0})},e.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},n}(),k0t=function(n){cF(e,n);function e(i,r){var o;return o=n.call(this)||this,o.client=i,o.options=r,o.trackedProps=[],o.selectError=null,o.bindMethods(),o.setOptions(r),o}var t=e.prototype;return t.bindMethods=function(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)},t.onSubscribe=function(){this.listeners.length===1&&(this.currentQuery.addObserver(this),Pxe(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},t.onUnsubscribe=function(){this.listeners.length||this.destroy()},t.shouldFetchOnReconnect=function(){return Wie(this.currentQuery,this.options,this.options.refetchOnReconnect)},t.shouldFetchOnWindowFocus=function(){return Wie(this.currentQuery,this.options,this.options.refetchOnWindowFocus)},t.destroy=function(){this.listeners=[],this.clearTimers(),this.currentQuery.removeObserver(this)},t.setOptions=function(r,o){var s=this.options,a=this.currentQuery;if(this.options=this.client.defaultQueryObserverOptions(r),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();var l=this.hasListeners();l&&Mxe(this.currentQuery,a,this.options,s)&&this.executeFetch(),this.updateResult(o),l&&(this.currentQuery!==a||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();var c=this.computeRefetchInterval();l&&(this.currentQuery!==a||this.options.enabled!==s.enabled||c!==this.currentRefetchInterval)&&this.updateRefetchInterval(c)},t.getOptimisticResult=function(r){var o=this.client.defaultQueryObserverOptions(r),s=this.client.getQueryCache().build(this.client,o);return this.createResult(s,o)},t.getCurrentResult=function(){return this.currentResult},t.trackResult=function(r,o){var s=this,a={},l=function(u){s.trackedProps.includes(u)||s.trackedProps.push(u)};return Object.keys(r).forEach(function(c){Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:function(){return l(c),r[c]}})}),(o.useErrorBoundary||o.suspense)&&l("error"),a},t.getNextResult=function(r){var o=this;return new Promise(function(s,a){var l=o.subscribe(function(c){c.isFetching||(l(),c.isError&&(r!=null&&r.throwOnError)?a(c.error):s(c))})})},t.getCurrentQuery=function(){return this.currentQuery},t.remove=function(){this.client.getQueryCache().remove(this.currentQuery)},t.refetch=function(r){return this.fetch(Ct({},r,{meta:{refetchPage:r==null?void 0:r.refetchPage}}))},t.fetchOptimistic=function(r){var o=this,s=this.client.defaultQueryObserverOptions(r),a=this.client.getQueryCache().build(this.client,s);return a.fetch().then(function(){return o.createResult(a,s)})},t.fetch=function(r){var o=this;return this.executeFetch(r).then(function(){return o.updateResult(),o.currentResult})},t.executeFetch=function(r){this.updateQuery();var o=this.currentQuery.fetch(this.options,r);return r!=null&&r.throwOnError||(o=o.catch(Jd)),o},t.updateStaleTimeout=function(){var r=this;if(this.clearStaleTimeout(),!(lH||this.currentResult.isStale||!Vie(this.options.staleTime))){var o=g8e(this.currentResult.dataUpdatedAt,this.options.staleTime),s=o+1;this.staleTimeoutId=setTimeout(function(){r.currentResult.isStale||r.updateResult()},s)}},t.computeRefetchInterval=function(){var r;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(r=this.options.refetchInterval)!=null?r:!1},t.updateRefetchInterval=function(r){var o=this;this.clearRefetchInterval(),this.currentRefetchInterval=r,!(lH||this.options.enabled===!1||!Vie(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(function(){(o.options.refetchIntervalInBackground||qP.isFocused())&&o.executeFetch()},this.currentRefetchInterval))},t.updateTimers=function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())},t.clearTimers=function(){this.clearStaleTimeout(),this.clearRefetchInterval()},t.clearStaleTimeout=function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)},t.clearRefetchInterval=function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)},t.createResult=function(r,o){var s=this.currentQuery,a=this.options,l=this.currentResult,c=this.currentResultState,u=this.currentResultOptions,d=r!==s,h=d?r.state:this.currentQueryInitialState,f=d?this.currentResult:this.previousQueryResult,g=r.state,m=g.dataUpdatedAt,v=g.error,_=g.errorUpdatedAt,b=g.isFetching,y=g.status,C=!1,x=!1,E;if(o.optimisticResults){var k=this.hasListeners(),L=!k&&Pxe(r,o),D=k&&Mxe(r,s,o,a);(L||D)&&(b=!0,m||(y="loading"))}if(o.keepPreviousData&&!g.dataUpdateCount&&(f!=null&&f.isSuccess)&&y!=="error")E=f.data,m=f.dataUpdatedAt,y=f.status,C=!0;else if(o.select&&typeof g.data<"u")if(l&&g.data===(c==null?void 0:c.data)&&o.select===this.selectFn)E=this.selectResult;else try{this.selectFn=o.select,E=o.select(g.data),o.structuralSharing!==!1&&(E=dH(l==null?void 0:l.data,E)),this.selectResult=E,this.selectError=null}catch(P){fH().error(P),this.selectError=P}else E=g.data;if(typeof o.placeholderData<"u"&&typeof E>"u"&&(y==="loading"||y==="idle")){var A;if(l!=null&&l.isPlaceholderData&&o.placeholderData===(u==null?void 0:u.placeholderData))A=l.data;else if(A=typeof o.placeholderData=="function"?o.placeholderData():o.placeholderData,o.select&&typeof A<"u")try{A=o.select(A),o.structuralSharing!==!1&&(A=dH(l==null?void 0:l.data,A)),this.selectError=null}catch(P){fH().error(P),this.selectError=P}typeof A<"u"&&(y="success",E=A,x=!0)}this.selectError&&(v=this.selectError,E=this.selectResult,_=Date.now(),y="error");var O={status:y,isLoading:y==="loading",isSuccess:y==="success",isError:y==="error",isIdle:y==="idle",data:E,dataUpdatedAt:m,error:v,errorUpdatedAt:_,failureCount:g.fetchFailureCount,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:b,isRefetching:b&&y!=="loading",isLoadingError:y==="error"&&g.dataUpdatedAt===0,isPlaceholderData:x,isPreviousData:C,isRefetchError:y==="error"&&g.dataUpdatedAt!==0,isStale:zpe(r,o),refetch:this.refetch,remove:this.remove};return O},t.shouldNotifyListeners=function(r,o){if(!o)return!0;var s=this.options,a=s.notifyOnChangeProps,l=s.notifyOnChangePropsExclusions;if(!a&&!l||a==="tracked"&&!this.trackedProps.length)return!0;var c=a==="tracked"?this.trackedProps:a;return Object.keys(r).some(function(u){var d=u,h=r[d]!==o[d],f=c==null?void 0:c.some(function(m){return m===u}),g=l==null?void 0:l.some(function(m){return m===u});return h&&!g&&(!c||f)})},t.updateResult=function(r){var o=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!d0t(this.currentResult,o)){var s={cache:!0};(r==null?void 0:r.listeners)!==!1&&this.shouldNotifyListeners(this.currentResult,o)&&(s.listeners=!0),this.notify(Ct({},s,r))}},t.updateQuery=function(){var r=this.client.getQueryCache().build(this.client,this.options);if(r!==this.currentQuery){var o=this.currentQuery;this.currentQuery=r,this.currentQueryInitialState=r.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(o==null||o.removeObserver(this),r.addObserver(this))}},t.onQueryUpdate=function(r){var o={};r.type==="success"?o.onSuccess=!0:r.type==="error"&&!c$(r.error)&&(o.onError=!0),this.updateResult(o),this.hasListeners()&&this.updateTimers()},t.notify=function(r){var o=this;Zl.batch(function(){r.onSuccess?(o.options.onSuccess==null||o.options.onSuccess(o.currentResult.data),o.options.onSettled==null||o.options.onSettled(o.currentResult.data,null)):r.onError&&(o.options.onError==null||o.options.onError(o.currentResult.error),o.options.onSettled==null||o.options.onSettled(void 0,o.currentResult.error)),r.listeners&&o.listeners.forEach(function(s){s(o.currentResult)}),r.cache&&o.client.getQueryCache().notify({query:o.currentQuery,type:"observerResultsUpdated"})})},e}(uF);function I0t(n,e){return e.enabled!==!1&&!n.state.dataUpdatedAt&&!(n.state.status==="error"&&e.retryOnMount===!1)}function Pxe(n,e){return I0t(n,e)||n.state.dataUpdatedAt>0&&Wie(n,e,e.refetchOnMount)}function Wie(n,e,t){if(e.enabled!==!1){var i=typeof t=="function"?t(n):t;return i==="always"||i!==!1&&zpe(n,e)}return!1}function Mxe(n,e,t,i){return t.enabled!==!1&&(n!==e||i.enabled===!1)&&(!t.suspense||n.state.status!=="error")&&zpe(n,t)}function zpe(n,e){return n.isStaleByTime(e.staleTime)}var L0t=ij.unstable_batchedUpdates;Zl.setBatchNotifyFunction(L0t);var D0t=console;_0t(D0t);var Fxe=ae.createContext(void 0),C8e=ae.createContext(!1);function w8e(n){return n&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Fxe),window.ReactQueryClientContext):Fxe}var _o=function(){var e=ae.useContext(w8e(ae.useContext(C8e)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},A0t=function(e){var t=e.client,i=e.contextSharing,r=i===void 0?!1:i,o=e.children;ae.useEffect(function(){return t.mount(),function(){t.unmount()}},[t]);var s=w8e(r);return ae.createElement(C8e.Provider,{value:r},ae.createElement(s.Provider,{value:t},o))};function N0t(){var n=!1;return{clearReset:function(){n=!1},reset:function(){n=!0},isReset:function(){return n}}}var R0t=ae.createContext(N0t()),O0t=function(){return ae.useContext(R0t)};function P0t(n,e,t){return typeof e=="function"?e.apply(void 0,t):typeof e=="boolean"?e:!!n}function M0t(n,e){var t=ae.useRef(!1),i=ae.useState(0),r=i[1],o=_o(),s=O0t(),a=o.defaultQueryObserverOptions(n);a.optimisticResults=!0,a.onError&&(a.onError=Zl.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=Zl.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=Zl.batchCalls(a.onSettled)),a.suspense&&(typeof a.staleTime!="number"&&(a.staleTime=1e3),a.cacheTime===0&&(a.cacheTime=1)),(a.suspense||a.useErrorBoundary)&&(s.isReset()||(a.retryOnMount=!1));var l=ae.useState(function(){return new e(o,a)}),c=l[0],u=c.getOptimisticResult(a);if(ae.useEffect(function(){t.current=!0,s.clearReset();var d=c.subscribe(Zl.batchCalls(function(){t.current&&r(function(h){return h+1})}));return c.updateResult(),function(){t.current=!1,d()}},[s,c]),ae.useEffect(function(){c.setOptions(a,{listeners:!1})},[a,c]),a.suspense&&u.isLoading)throw c.fetchOptimistic(a).then(function(d){var h=d.data;a.onSuccess==null||a.onSuccess(h),a.onSettled==null||a.onSettled(h,null)}).catch(function(d){s.clearReset(),a.onError==null||a.onError(d),a.onSettled==null||a.onSettled(void 0,d)});if(u.isError&&!s.isReset()&&!u.isFetching&&P0t(a.suspense,a.useErrorBoundary,[u.error,c.getCurrentQuery()]))throw u.error;return a.notifyOnChangeProps==="tracked"&&(u=c.trackResult(u,a)),u}function Ti(n,e,t){var i=a$(n,e,t);return M0t(i,k0t)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const $L={invoices:{path:"/api/v1/invoices",dependencies:["/api/v1/clients","/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/activities/entity","/api/v1/activities","/api/v1/documents"]},designs:{path:"/api/v1/designs",dependencies:["/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/purchase_orders"]},tokens:{path:"/api/v1/tokens",dependencies:[]},webhooks:{path:"/api/v1/webhooks",dependencies:[]},company_gateways:{path:"/api/v1/company_gateways",dependencies:[]},credits:{path:"/api/v1/credits",dependencies:["/api/v1/clients","/api/v1/documents"]},expense_categories:{path:"/api/v1/expense_categories",dependencies:["/api/v1/expenses","/api/v1/recurring_expenses","/api/v1/bank_transaction_rules","/api/v1/vendors","/api/v1/bank_transactions"]},expenses:{path:"/api/v1/expenses",dependencies:["/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/documents"]},group_settings:{path:"/api/v1/group_settings",dependencies:["/api/v1/clients"]},payments:{path:"/api/v1/payments",dependencies:["/api/v1/expenses","/api/v1/invoices","/api/v1/clients","/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/activities","/api/v1/documents"]},purchase_orders:{path:"/api/v1/purchase_orders",dependencies:["/api/v1/vendors"]},recurring_expenses:{path:"/api/v1/recurring_expenses",dependencies:["/api/v1/vendors","/api/v1/documents"]},task_statuses:{path:"/api/v1/task_statuses",dependencies:["/api/v1/tasks"]},tasks:{path:"/api/v1/tasks",dependencies:["/api/v1/projects","/api/v1/documents"]},tax_rates:{path:"/api/v1/tax_rates",dependencies:["/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/purchase_orders"]},bank_transactions:{path:"/api/v1/bank_transactions",dependencies:["/api/v1/payments","/api/v1/invoices","/api/v1/vendors","/api/v1/expenses","/api/v1/expense_categories"]},bank_transaction_rules:{path:"/api/v1/bank_transaction_rules",dependencies:["/api/v1/bank_transactions"]},vendors:{path:"/api/v1/vendors",dependencies:["/api/v1/expenses","/api/v1/recurring_expenses","/api/v1/purchase_orders","/api/v1/activities/entity"]},users:{path:"/api/v1/users",dependencies:["/api/v1/tasks","/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/projects","/api/v1/payments","/api/v1/expenses","/api/v1/tasks"]},company_users:{path:"/api/v1/company_users",dependencies:[]},clients:{path:"/api/v1/clients",dependencies:["/api/v1/tasks","/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/projects","/api/v1/payments","/api/v1/expenses","/api/v1/recurring_expenses","/api/v1/tasks","/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/documents"]},products:{path:"/api/v1/products",dependencies:["/api/v1/subscriptions","/api/v1/invoices"]},projects:{path:"/api/v1/projects",dependencies:["/api/v1/tasks","/api/v1/documents"]},quotes:{path:"/api/v1/quotes",dependencies:["/api/v1/clients","/api/v1/activities","/api/v1/documents"]},recurring_invoices:{path:"/api/v1/recurring_invoices",dependencies:["/api/v1/clients","/api/v1/activities/entity","/api/v1/documents"]},bank_integrations:{path:"/api/v1/bank_integrations",dependencies:["/api/v1/bank_transactions"]},documents:{path:"/api/v1/documents",dependencies:[]},payment_terms:{path:"/api/v1/payment_terms",dependencies:[]},statics:{path:"/api/v1/statics",dependencies:[]},task_schedulers:{path:"/api/v1/task_schedulers",dependencies:[]},subscriptions:{path:"/api/v1/subscriptions",dependencies:[]},activities:{path:"/api/v1/activities",dependencies:["/api/v1/activities/entity"]},entity_validations:{path:"/api/v1/einvoice/validateEntity",dependencies:[]}};function S8e(){const n=_o();return e=>{e.map(t=>{$L[t]&&(n.invalidateQueries($L[t].path),$L[t].dependencies.map(i=>{n.invalidateQueries(i)}))})}}function En(n){window.dispatchEvent(new CustomEvent("refetch",{detail:{property:n}}))}function F0t(n){return Object.keys($L).find(t=>$L[t].path.startsWith(n)||n.startsWith($L[t].path))}function B0t(n){n.map(e=>{const t=F0t(e);t&&En([t])})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Upe(){const n=localStorage.getItem("displayChromeExtensionBanner");localStorage.clear(),n&&localStorage.setItem("displayChromeExtensionBanner",n)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const E8e=Ipe.create();E8e.interceptors.response.use(n=>{var i,r;const e=$0t(n.config.data),t=n.config.method;return((r=(i=n.config)==null?void 0:i.headers)==null?void 0:r["X-Api-Password"])!==void 0&&window.dispatchEvent(new CustomEvent("reset.password.required")),(t==="put"||t==="post"&&(e==null?void 0:e.action)==="delete"||t==="delete")&&En(["activities"]),n},n=>{var t,i,r,o,s,a,l,c,u,d,h;const e=(t=n.response)==null?void 0:t.config.url;return e!=null&&e.includes("einvoice")&&(((i=n.response)==null?void 0:i.status)===401||((r=n.response)==null?void 0:r.status)===403)?(console.error(n),e.includes("quota")||Ku.error(Ms("einvoice_something_went_wrong",{}),{duration:1e4}),Promise.reject(n)):((((o=n.response)==null?void 0:o.status)===429||((s=n.response)==null?void 0:s.status)===403)&&(window.location.reload(),Upe()),((a=n.response)==null?void 0:a.status)===404&&window.dispatchEvent(new CustomEvent("navigate.invalid.page")),(l=n.response)!=null&&l.status&&n.response.status!==412&&n.response.status!==422&&n.response.status>399&&n.response.status<500&&ce.error(((c=n.response)==null?void 0:c.data.message)||"error_title"),(u=n.response)!=null&&u.status&&n.response.status===500&&ce.error("error_title"),((d=n.response)==null?void 0:d.status)===409&&ce.processing(),((h=n.response)==null?void 0:h.status)===422&&window.dispatchEvent(new CustomEvent("display.error.toaster",{detail:{error:n}})),console.error(n),Promise.reject(n))});function Ae(n,e,t,i){return E8e({method:n,url:e,data:t,...i,headers:{...nS(),...i==null?void 0:i.headers},signal:i==null?void 0:i.signal})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function lc(){const n=ci(),{data:e}=ed(),[t,i]=w.useState("0"),[r,o]=w.useState("DD/MMM/YYYY");return w.useEffect(()=>{if(e!=null&&e.date_formats){const s=e.date_formats.find(a=>{var l;return a.id===((l=n==null?void 0:n.settings)==null?void 0:l.date_format_id)});s&&(o(s.format_moment),i(s.id))}},[n,e]),{dateFormatId:t,dateFormat:r}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ro(){return!1}function Rk(){return!Ro()}function mN(){return window.location.origin||"https://invoicing.co"}function Te(n,e={}){return mN()+bt(n,e)}function fZ(...n){return n.filter(Boolean).join(" ")}function go(n,e){return n===0||n===""||n===void 0?"":typeof n=="number"?Un.unix(n).format(e):Un(n).format(e)}function C2r(){const{dateFormat:n}=lc(),e=["DD. MMM. YYYY","ddd MMM D, YYYY"];return t=>Un(t,e.includes(n)?void 0:n)}function Sr(n){if(!n.is_deleted&&!n.archived_at)return WX.active;if(n.archived_at&&!n.is_deleted)return WX.archived;if(n.is_deleted)return WX.deleted}function Ms(n,e){let t=Iie(n);for(const i in e)t=t.replace(`:${i}`,e[i]);return t}function w2r(n,e={}){return mN()+bt(n,e)}function f1(){return"https://demo.invoiceninja.com"===mN()}function $0t(n){try{return n&&JSON.parse(n)}catch{return!1}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ed(){return Ti(["/api/v1/statics"],()=>Ae("GET",Te("/api/v1/statics")).then(n=>n.data),{enabled:!!localStorage.getItem("X-NINJA-TOKEN"),staleTime:1/0})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Bj(){const{data:n}=ed(),[e,t]=w.useState([]);return w.useEffect(()=>{n!=null&&n.languages&&t(n.languages)},[n]),e}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function x8e(){const n=Bj();return e=>n.find(t=>t.id.toString()===e.toString())}function Qu(n,e){if(n==null)return{};var t=cpe(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function V0t(){if(console&&console.warn){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];typeof t[0]=="string"&&(t[0]="react-i18next:: ".concat(t[0])),(n=console).warn.apply(n,t)}}var Bxe={};function zie(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];typeof e[0]=="string"&&Bxe[e[0]]||(typeof e[0]=="string"&&(Bxe[e[0]]=new Date),V0t.apply(void 0,e))}var T8e=function(e,t){return function(){if(e.isInitialized)t();else{var i=function r(){setTimeout(function(){e.off("initialized",r)},0),t()};e.on("initialized",i)}}};function $xe(n,e,t){n.loadNamespaces(e,T8e(n,t))}function Vxe(n,e,t,i){typeof t=="string"&&(t=[t]),t.forEach(function(r){n.options.ns.indexOf(r)<0&&n.options.ns.push(r)}),n.loadLanguages(e,T8e(n,i))}function H0t(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=e.languages[0],r=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(i,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(i,n)&&(!r||s(o,n)))}function W0t(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return zie("i18n.languages were undefined or empty",e.languages),!0;var i=e.options.ignoreJSONStructure!==void 0;return i?e.hasLoadedNamespace(n,{lng:t.lng,precheck:function(o,s){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,n))return!1}}):H0t(n,e,t)}var z0t=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,U0t={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},j0t=function(e){return U0t[e]},q0t=function(e){return e.replace(z0t,j0t)};function Hxe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Wxe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hxe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hxe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var Uie={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:q0t};function K0t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Uie=Wxe(Wxe({},Uie),n)}function G0t(){return Uie}var k8e;function Y0t(n){k8e=n}function Q0t(){return k8e}var X0t={type:"3rdParty",init:function(e){K0t(e.options.react),Y0t(e)}},Z0t=w.createContext(),J0t=function(){function n(){El(this,n),this.usedNamespaces={}}return xl(n,[{key:"addUsedNamespaces",value:function(t){var i=this;t.forEach(function(r){i.usedNamespaces[r]||(i.usedNamespaces[r]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),n}();function eyt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(i=o.call(t)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}function ln(n,e){return K6e(n)||eyt(n,e)||vpe(n,e)||Y6e()}function zxe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function pZ(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zxe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zxe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var tyt=function(e,t){var i=w.useRef();return w.useEffect(function(){i.current=t?i.current:e},[e,t]),i.current};function pe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.i18n,i=w.useContext(Z0t)||{},r=i.i18n,o=i.defaultNS,s=t||r||Q0t();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new J0t),!s){zie("You will need to pass in an i18next instance by using initReactI18next");var a=function(D,A){return typeof A=="string"?A:A&&Qr(A)==="object"&&typeof A.defaultValue=="string"?A.defaultValue:Array.isArray(D)?D[D.length-1]:D},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&zie("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=pZ(pZ(pZ({},G0t()),s.options.react),e),u=c.useSuspense,d=c.keyPrefix,h=n||o||s.options&&s.options.defaultNS;h=typeof h=="string"?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var f=(s.isInitialized||s.initializedStoreOnce)&&h.every(function(L){return W0t(L,s,c)});function g(){return s.getFixedT(e.lng||null,c.nsMode==="fallback"?h:h[0],d)}var m=w.useState(g),v=ln(m,2),_=v[0],b=v[1],y=h.join();e.lng&&(y="".concat(e.lng).concat(y));var C=tyt(y),x=w.useRef(!0);w.useEffect(function(){var L=c.bindI18n,D=c.bindI18nStore;x.current=!0,!f&&!u&&(e.lng?Vxe(s,e.lng,h,function(){x.current&&b(g)}):$xe(s,h,function(){x.current&&b(g)})),f&&C&&C!==y&&x.current&&b(g);function A(){x.current&&b(g)}return L&&s&&s.on(L,A),D&&s&&s.store.on(D,A),function(){x.current=!1,L&&s&&L.split(" ").forEach(function(O){return s.off(O,A)}),D&&s&&D.split(" ").forEach(function(O){return s.store.off(O,A)})}},[s,y]);var E=w.useRef(!0);w.useEffect(function(){x.current&&!E.current&&b(g),E.current=!1},[s,d]);var k=[_,s,f];if(k.t=_,k.i18n=s,k.ready=f,f||!f&&!u)return k;throw new Promise(function(L){e.lng?Vxe(s,e.lng,h,function(){return L()}):$xe(s,h,function(){return L()})})}const nyt="modulepreload",iyt=function(n){return"/"+n},Uxe={},ne=function(e,t,i){if(!t||t.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=iyt(o),o in Uxe)return;Uxe[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!i)for(let u=r.length-1;u>=0;u--){const d=r[u];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":nyt,s||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};/** * @remix-run/router v1.10.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function I4(){return I4=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},I4.apply(this,arguments)}var jC;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(jC||(jC={}));const jxe="popstate";function ryt(n){n===void 0&&(n={});function e(i,r){let{pathname:o,search:s,hash:a}=i.location;return jie("",{pathname:o,search:s,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(i,r){return typeof r=="string"?r:pH(r)}return syt(e,t,null,n)}function tc(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function $j(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function oyt(){return Math.random().toString(36).substr(2,8)}function qxe(n,e){return{usr:n.state,key:n.key,idx:e}}function jie(n,e,t,i){return t===void 0&&(t=null),I4({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?_N(e):e,{state:t,key:e&&e.key||i||oyt()})}function pH(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function _N(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function syt(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:o=!1}=i,s=r.history,a=jC.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(I4({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=jC.Pop;let v=u(),_=v==null?null:v-c;c=v,l&&l({action:a,location:m.location,delta:_})}function h(v,_){a=jC.Push;let b=jie(m.location,v,_);t&&t(b,v),c=u()+1;let y=qxe(b,c),C=m.createHref(b);try{s.pushState(y,"",C)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;r.location.assign(C)}o&&l&&l({action:a,location:m.location,delta:1})}function f(v,_){a=jC.Replace;let b=jie(m.location,v,_);t&&t(b,v),c=u();let y=qxe(b,c),C=m.createHref(b);s.replaceState(y,"",C),o&&l&&l({action:a,location:m.location,delta:0})}function g(v){let _=r.location.origin!=="null"?r.location.origin:r.location.href,b=typeof v=="string"?v:pH(v);return tc(_,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,_)}let m={get action(){return a},get location(){return n(r,s)},listen(v){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(jxe,d),l=v,()=>{r.removeEventListener(jxe,d),l=null}},createHref(v){return e(r,v)},createURL:g,encodeLocation(v){let _=g(v);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:h,replace:f,go(v){return s.go(v)}};return m}var Kxe;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Kxe||(Kxe={}));function ayt(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?_N(e):e,r=jpe(i.pathname||"/",t);if(r==null)return null;let o=I8e(n);lyt(o);let s=null;for(let a=0;s==null&&a<o.length;++a)s=_yt(o[a],yyt(r));return s}function I8e(n,e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i="");let r=(o,s,a)=>{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(tc(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let c=ww([i,l.relativePath]),u=t.concat(l);o.children&&o.children.length>0&&(tc(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),I8e(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:gyt(c,o.index),routesMeta:u})};return n.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))r(o,s);else for(let l of L8e(o.path))r(o,s,l)}),e}function L8e(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),o=t.replace(/\?$/,"");if(i.length===0)return r?[o,""]:[o];let s=L8e(i.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),r&&a.push(...s),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function lyt(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:myt(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const cyt=/^:\w+$/,uyt=3,dyt=2,hyt=1,fyt=10,pyt=-2,Gxe=n=>n==="*";function gyt(n,e){let t=n.split("/"),i=t.length;return t.some(Gxe)&&(i+=pyt),e&&(i+=dyt),t.filter(r=>!Gxe(r)).reduce((r,o)=>r+(cyt.test(o)?uyt:o===""?hyt:fyt),i)}function myt(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function _yt(n,e){let{routesMeta:t}=n,i={},r="/",o=[];for(let s=0;s<t.length;++s){let a=t[s],l=s===t.length-1,c=r==="/"?e:e.slice(r.length)||"/",u=vyt({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},c);if(!u)return null;Object.assign(i,u.params);let d=a.route;o.push({params:i,pathname:ww([r,u.pathname]),pathnameBase:Eyt(ww([r,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(r=ww([r,u.pathnameBase]))}return o}function S2r(n,e){e===void 0&&(e={});let t=n;t.endsWith("*")&&t!=="*"&&!t.endsWith("/*")&&($j(!1,'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".')),t=t.replace(/\*$/,"/*"));const i=t.startsWith("/")?"/":"",r=s=>s==null?"":typeof s=="string"?s:String(s),o=t.split(/\/+/).map((s,a,l)=>{if(a===l.length-1&&s==="*")return r(e["*"]);const u=s.match(/^:(\w+)(\??)$/);if(u){const[,d,h]=u;let f=e[d];return tc(h==="?"||f!=null,'Missing ":'+d+'" param'),r(f)}return s.replace(/\?$/g,"")}).filter(s=>!!s);return i+o.join("/")}function vyt(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=byt(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let o=r[0],s=o.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:i.reduce((c,u,d)=>{if(u==="*"){let h=a[d]||"";s=o.slice(0,o.length-h.length).replace(/(.)\/+$/,"$1")}return c[u]=Cyt(a[d]||"",u),c},{}),pathname:o,pathnameBase:s,pattern:n}}function byt(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),$j(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(i.push(a),"/([^\\/]+)"));return n.endsWith("*")?(i.push("*"),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function yyt(n){try{return decodeURI(n)}catch(e){return $j(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function Cyt(n,e){try{return decodeURIComponent(n)}catch(t){return $j(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function jpe(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function wyt(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?_N(n):n;return{pathname:t?t.startsWith("/")?t:Syt(t,e):e,search:xyt(i),hash:Tyt(r)}}function Syt(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function gZ(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function qpe(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Kpe(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=_N(n):(r=I4({},n),tc(!r.pathname||!r.pathname.includes("?"),gZ("?","pathname","search",r)),tc(!r.pathname||!r.pathname.includes("#"),gZ("#","pathname","hash",r)),tc(!r.search||!r.search.includes("#"),gZ("#","search","hash",r)));let o=n===""||r.pathname==="",s=o?"/":r.pathname,a;if(i||s==null)a=t;else{let d=e.length-1;if(s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;r.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=wyt(r,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const ww=n=>n.join("/").replace(/\/\/+/g,"/"),Eyt=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),xyt=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Tyt=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function kyt(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const D8e=["post","put","patch","delete"];new Set(D8e);const Iyt=["get",...D8e];new Set(Iyt);/** * React Router v6.17.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function gH(){return gH=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},gH.apply(this,arguments)}const Gpe=w.createContext(null),Lyt=w.createContext(null),vN=w.createContext(null),Vj=w.createContext(null),y0=w.createContext({outlet:null,matches:[],isDataRoute:!1}),A8e=w.createContext(null);function Dyt(n,e){let{relative:t}=e===void 0?{}:e;bN()||tc(!1);let{basename:i,navigator:r}=w.useContext(vN),{hash:o,pathname:s,search:a}=P8e(n,{relative:t}),l=s;return i!=="/"&&(l=s==="/"?i:ww([i,s])),r.createHref({pathname:l,search:a,hash:o})}function bN(){return w.useContext(Vj)!=null}function Tl(){return bN()||tc(!1),w.useContext(Vj).location}function N8e(n){w.useContext(vN).static||w.useLayoutEffect(n)}function wi(){let{isDataRoute:n}=w.useContext(y0);return n?Uyt():Ayt()}function Ayt(){bN()||tc(!1);let n=w.useContext(Gpe),{basename:e,navigator:t}=w.useContext(vN),{matches:i}=w.useContext(y0),{pathname:r}=Tl(),o=JSON.stringify(qpe(i).map(l=>l.pathnameBase)),s=w.useRef(!1);return N8e(()=>{s.current=!0}),w.useCallback(function(l,c){if(c===void 0&&(c={}),!s.current)return;if(typeof l=="number"){t.go(l);return}let u=Kpe(l,JSON.parse(o),r,c.relative==="path");n==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:ww([e,u.pathname])),(c.replace?t.replace:t.push)(u,c.state,c)},[e,t,o,r,n])}const R8e=w.createContext(null);function O8e(){return w.useContext(R8e)}function Nyt(n){let e=w.useContext(y0).outlet;return e&&w.createElement(R8e.Provider,{value:n},e)}function il(){let{matches:n}=w.useContext(y0),e=n[n.length-1];return e?e.params:{}}function P8e(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=w.useContext(y0),{pathname:r}=Tl(),o=JSON.stringify(qpe(i).map(s=>s.pathnameBase));return w.useMemo(()=>Kpe(n,JSON.parse(o),r,t==="path"),[n,o,r,t])}function Ryt(n,e){return Oyt(n,e)}function Oyt(n,e,t){bN()||tc(!1);let{navigator:i}=w.useContext(vN),{matches:r}=w.useContext(y0),o=r[r.length-1],s=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let l=Tl(),c;if(e){var u;let m=typeof e=="string"?_N(e):e;a==="/"||(u=m.pathname)!=null&&u.startsWith(a)||tc(!1),c=m}else c=l;let d=c.pathname||"/",h=a==="/"?d:d.slice(a.length)||"/",f=ayt(n,{pathname:h}),g=$yt(f&&f.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:ww([a,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:ww([a,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),r,t);return e&&g?w.createElement(Vj.Provider,{value:{location:gH({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:jC.Pop}},g):g}function Pyt(){let n=zyt(),e=kyt(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),t?w.createElement("pre",{style:r},t):null,o)}const Myt=w.createElement(Pyt,null);class Fyt extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?w.createElement(y0.Provider,{value:this.props.routeContext},w.createElement(A8e.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Byt(n){let{routeContext:e,match:t,children:i}=n,r=w.useContext(Gpe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(y0.Provider,{value:e},i)}function $yt(n,e,t){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n==null){var r;if((r=t)!=null&&r.errors)n=t.matches;else return null}let o=n,s=(i=t)==null?void 0:i.errors;if(s!=null){let a=o.findIndex(l=>l.route.id&&(s==null?void 0:s[l.route.id]));a>=0||tc(!1),o=o.slice(0,Math.min(o.length,a+1))}return o.reduceRight((a,l,c)=>{let u=l.route.id?s==null?void 0:s[l.route.id]:null,d=null;t&&(d=l.route.errorElement||Myt);let h=e.concat(o.slice(0,c+1)),f=()=>{let g;return u?g=d:l.route.Component?g=w.createElement(l.route.Component,null):l.route.element?g=l.route.element:g=a,w.createElement(Byt,{match:l,routeContext:{outlet:a,matches:h,isDataRoute:t!=null},children:g})};return t&&(l.route.ErrorBoundary||l.route.errorElement||c===0)?w.createElement(Fyt,{location:t.location,revalidation:t.revalidation,component:d,error:u,children:f(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):f()},null)}var M8e=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(M8e||{}),mH=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(mH||{});function Vyt(n){let e=w.useContext(Gpe);return e||tc(!1),e}function Hyt(n){let e=w.useContext(Lyt);return e||tc(!1),e}function Wyt(n){let e=w.useContext(y0);return e||tc(!1),e}function F8e(n){let e=Wyt(),t=e.matches[e.matches.length-1];return t.route.id||tc(!1),t.route.id}function zyt(){var n;let e=w.useContext(A8e),t=Hyt(mH.UseRouteError),i=F8e(mH.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function Uyt(){let{router:n}=Vyt(M8e.UseNavigateStable),e=F8e(mH.UseNavigateStable),t=w.useRef(!1);return N8e(()=>{t.current=!0}),w.useCallback(function(r,o){o===void 0&&(o={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,gH({fromRouteId:e},o)))},[n,e])}function iS(n){let{to:e,replace:t,state:i,relative:r}=n;bN()||tc(!1);let{matches:o}=w.useContext(y0),{pathname:s}=Tl(),a=wi(),l=Kpe(e,qpe(o).map(u=>u.pathnameBase),s,r==="path"),c=JSON.stringify(l);return w.useEffect(()=>a(JSON.parse(c),{replace:t,state:i,relative:r}),[a,c,r,t,i]),null}function Tg(n){return Nyt(n.context)}function _e(n){tc(!1)}function jyt(n){let{basename:e="/",children:t=null,location:i,navigationType:r=jC.Pop,navigator:o,static:s=!1}=n;bN()&&tc(!1);let a=e.replace(/^\/*/,"/"),l=w.useMemo(()=>({basename:a,navigator:o,static:s}),[a,o,s]);typeof i=="string"&&(i=_N(i));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=i,g=w.useMemo(()=>{let m=jpe(c,a);return m==null?null:{location:{pathname:m,search:u,hash:d,state:h,key:f},navigationType:r}},[a,c,u,d,h,f,r]);return g==null?null:w.createElement(vN.Provider,{value:l},w.createElement(Vj.Provider,{children:t,value:g}))}function qyt(n){let{children:e,location:t}=n;return Ryt(qie(e),t)}new Promise(()=>{});function qie(n,e){e===void 0&&(e=[]);let t=[];return w.Children.forEach(n,(i,r)=>{if(!w.isValidElement(i))return;let o=[...e,r];if(i.type===w.Fragment){t.push.apply(t,qie(i.props.children,o));return}i.type!==_e&&tc(!1),!i.props.index||!i.props.children||tc(!1);let s={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(s.children=qie(i.props.children,o)),t.push(s)}),t}/** * React Router DOM v6.17.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Kie(){return Kie=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Kie.apply(this,arguments)}function Kyt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function Gyt(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Yyt(n,e){return n.button===0&&(!e||e==="_self")&&!Gyt(n)}function Gie(n){return n===void 0&&(n=""),new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let i=n[t];return e.concat(Array.isArray(i)?i.map(r=>[t,r]):[[t,i]])},[]))}function Qyt(n,e){let t=Gie(n);return e&&e.forEach((i,r)=>{t.has(r)||e.getAll(r).forEach(o=>{t.append(r,o)})}),t}const Xyt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Zyt="startTransition",Yxe=Am[Zyt];function Jyt(n){let{basename:e,children:t,future:i,window:r}=n,o=w.useRef();o.current==null&&(o.current=ryt({window:r,v5Compat:!0}));let s=o.current,[a,l]=w.useState({action:s.action,location:s.location}),{v7_startTransition:c}=i||{},u=w.useCallback(d=>{c&&Yxe?Yxe(()=>l(d)):l(d)},[l,c]);return w.useLayoutEffect(()=>s.listen(u),[s,u]),w.createElement(jyt,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}const e1t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",t1t=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,C0=w.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,unstable_viewTransition:d}=e,h=Kyt(e,Xyt),{basename:f}=w.useContext(vN),g,m=!1;if(typeof c=="string"&&t1t.test(c)&&(g=c,e1t))try{let y=new URL(window.location.href),C=c.startsWith("//")?new URL(y.protocol+c):new URL(c),x=jpe(C.pathname,f);C.origin===y.origin&&x!=null?c=x+C.search+C.hash:m=!0}catch{}let v=Dyt(c,{relative:r}),_=n1t(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,unstable_viewTransition:d});function b(y){i&&i(y),y.defaultPrevented||_(y)}return w.createElement("a",Kie({},h,{href:g||v,onClick:m||o?i:b,ref:t,target:l}))});var Qxe;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Qxe||(Qxe={}));var Xxe;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(Xxe||(Xxe={}));function n1t(n,e){let{target:t,replace:i,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:a}=e===void 0?{}:e,l=wi(),c=Tl(),u=P8e(n,{relative:s});return w.useCallback(d=>{if(Yyt(d,t)){d.preventDefault();let h=i!==void 0?i:pH(c)===pH(u);l(n,{replace:h,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[c,l,u,i,r,t,n,o,s,a])}function dF(n){let e=w.useRef(Gie(n)),t=w.useRef(!1),i=Tl(),r=w.useMemo(()=>Qyt(i.search,t.current?null:e.current),[i.search]),o=wi(),s=w.useCallback((a,l)=>{const c=Gie(typeof a=="function"?a(r):a);t.current=!0,o("?"+c,l)},[o,r]);return[r,s]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const i1t={currentIndex:localStorage.getItem("X-CURRENT-INDEX")?parseInt(localStorage.getItem("X-CURRENT-INDEX")):0,api:{},changes:{company:void 0}},B8e=gN({name:"companyUser",initialState:i1t,reducers:{changeCurrentIndex:(n,e)=>{n.currentIndex=e.payload},updateCompanyUsers:(n,e)=>{n.api=e.payload},injectInChanges:(n,e)=>{n.changes[e.payload.object]=e.payload.data},updateChanges:(n,e)=>{n.changes[e.payload.object]=un.set(n.changes[e.payload.object],e.payload.property,e.payload.value)},resetChanges:(n,e)=>{n.changes[e.payload]=n.api[n.currentIndex][e.payload]},updateRecord:(n,e)=>{n.api[n.currentIndex][e.payload.object]=e.payload.data}}}),{changeCurrentIndex:Hj,updateCompanyUsers:w0,injectInChanges:rS,resetChanges:Ype,updateChanges:Go,updateRecord:US}=B8e.actions;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var yN=(n=>(n.TOKEN="invoiceninja_token",n.GOOGLE_SSO="google_sso",n))(yN||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Qpe(){const n=Oc(o=>o.user),e=localStorage.getItem("X-NINJA-TOKEN"),t=wi(),i=Qi(),r=_o();return e===null?!1:(n.authenticated||r.fetchQuery("/api/v1/refresh",()=>Ae("POST",Te("/api/v1/refresh")).then(o=>{let s=0;if(localStorage.getItem("X-CURRENT-INDEX"))s=parseInt(localStorage.getItem("X-CURRENT-INDEX")||"0");else{const a=o.data.data,l=a[0].account.default_company_id;s=a.findIndex(c=>c.company.id===l)||0}i(sF({type:yN.TOKEN,user:o.data.data[s].user,token:localStorage.getItem("X-NINJA-TOKEN")})),i(w0(o.data.data)),i(Hj(s))}).catch(()=>{localStorage.removeItem("X-NINJA-TOKEN"),t("/login")})),!0)}const r1t=Symbol(),o1t=n=>typeof(n==null?void 0:n.then)=="function";function $8e(n){let e,t;const i={getItem:(r,o)=>{var s,a;const l=u=>{if(u=u||"",e!==u){try{t=JSON.parse(u)}catch{return o}e=u}return t},c=(a=(s=n())==null?void 0:s.getItem(r))!=null?a:null;return o1t(c)?c.then(l):l(c)},setItem:(r,o)=>{var s;return(s=n())==null?void 0:s.setItem(r,JSON.stringify(o))},removeItem:r=>{var o;return(o=n())==null?void 0:o.removeItem(r)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(i.subscribe=(r,o,s)=>{if(!(n()instanceof window.Storage))return()=>{};const a=l=>{if(l.storageArea===n()&&l.key===r){let c;try{c=JSON.parse(l.newValue||"")}catch{c=s}o(c)}};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}}),i}const s1t=$8e(()=>typeof window<"u"?window.localStorage:void 0);function hF(n,e,t=s1t,i){const r=i==null?void 0:i.unstable_getOnInit,o=Oo(r?t.getItem(n,e):e);return o.onMount=a=>{r||a(t.getItem(n,e));let l;return t.subscribe&&(l=t.subscribe(n,a,e)),l},Oo(a=>a(o),(a,l,c)=>{const u=typeof c=="function"?c(a(o)):c;return u===r1t?(l(o,e),t.removeItem(n)):u instanceof Promise?u.then(d=>(l(o,d),t.setItem(n,d))):(l(o,u),t.setItem(n,u))})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const a1t={name:"invoiceninja.dark",$0:"dark",$1:"#121212",$2:"#121212",$3:"rgba(255, 255, 255, 0.87)",$4:"#1f2e41",$5:"#1f2e41",$6:"#121212",$7:"#151f2c",$8:"#1f2e41",$9:"#ffffff",$10:.87,$11:.6,$12:.38,$13:"#E5E7EB"},V8e={name:"invoiceninja.light",$0:"light",$1:"#ffffff",$2:"#f7f7f7",$3:"#2a303d",$4:"#f7f7f7",$5:"#d1d5db",$6:"#242930",$7:"#f7f7f7",$8:"#363D47",$9:"#ffffff",$10:1,$11:.8,$12:.5,$13:"#E5E7EB"},H8e=hF("colorScheme",V8e);function ni(){const n=Ha({overwrite:!1}),[e,t]=Yo(H8e);return w.useEffect(()=>{n&&(n.dark_mode?t(a1t):t(V8e))},[n==null?void 0:n.dark_mode]),e}function ns(n){const e=ni();return N("svg",{style:{color:e.$3},className:`animate-spin h-5 w-5 ${n.variant??"text-black"}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[p("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function l1t(){return p("div",{className:"flex items-center justify-center h-screen",children:p(ns,{variant:"dark"})})}var W8e={exports:{}},c1t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",u1t=c1t,d1t=u1t;function z8e(){}function U8e(){}U8e.resetWarningCache=z8e;var h1t=function(){function n(i,r,o,s,a,l){if(l!==d1t){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:U8e,resetWarningCache:z8e};return t.PropTypes=t,t};W8e.exports=h1t();var gn=W8e.exports;const Ke=nl(gn);function Yie(){return Yie=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Yie.apply(this,arguments)}function f1t(n,e){if(n==null)return{};var t=p1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function p1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Xpe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=f1t(n,["color","size"]);return ae.createElement("svg",Yie({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"}))});Xpe.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Xpe.displayName="Activity";const g1t=Xpe;function Qie(){return Qie=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Qie.apply(this,arguments)}function m1t(n,e){if(n==null)return{};var t=_1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function _1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Zpe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=m1t(n,["color","size"]);return ae.createElement("svg",Qie({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("circle",{cx:"12",cy:"12",r:"10"}),ae.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),ae.createElement("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))});Zpe.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Zpe.displayName="AlertCircle";const v1t=Zpe;function Xie(){return Xie=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Xie.apply(this,arguments)}function b1t(n,e){if(n==null)return{};var t=y1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function y1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Jpe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=b1t(n,["color","size"]);return ae.createElement("svg",Xie({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),ae.createElement("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),ae.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});Jpe.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Jpe.displayName="AlertTriangle";const j8e=Jpe;function Zie(){return Zie=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Zie.apply(this,arguments)}function C1t(n,e){if(n==null)return{};var t=w1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function w1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ege=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=C1t(n,["color","size"]);return ae.createElement("svg",Zie({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("line",{x1:"21",y1:"10",x2:"3",y2:"10"}),ae.createElement("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),ae.createElement("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),ae.createElement("line",{x1:"21",y1:"18",x2:"3",y2:"18"}))});ege.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};ege.displayName="AlignJustify";const S1t=ege;function Jie(){return Jie=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Jie.apply(this,arguments)}function E1t(n,e){if(n==null)return{};var t=x1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function x1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var tge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=E1t(n,["color","size"]);return ae.createElement("svg",Jie({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),ae.createElement("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"}))});tge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};tge.displayName="Bell";const T1t=tge;function ere(){return ere=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ere.apply(this,arguments)}function k1t(n,e){if(n==null)return{};var t=I1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function I1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var nge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=k1t(n,["color","size"]);return ae.createElement("svg",ere({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),ae.createElement("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}))});nge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};nge.displayName="Book";const L1t=nge;function tre(){return tre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},tre.apply(this,arguments)}function D1t(n,e){if(n==null)return{};var t=A1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function A1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ige=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=D1t(n,["color","size"]);return ae.createElement("svg",tre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),ae.createElement("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),ae.createElement("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"}))});ige.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};ige.displayName="Box";const N1t=ige;function nre(){return nre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},nre.apply(this,arguments)}function R1t(n,e){if(n==null)return{};var t=O1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function O1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var rge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=R1t(n,["color","size"]);return ae.createElement("svg",nre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"}),ae.createElement("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"}))});rge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};rge.displayName="Briefcase";const P1t=rge;function ire(){return ire=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ire.apply(this,arguments)}function M1t(n,e){if(n==null)return{};var t=F1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function F1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var oge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=M1t(n,["color","size"]);return ae.createElement("svg",ire({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),ae.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),ae.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),ae.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"}))});oge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};oge.displayName="Calendar";const q8e=oge;function rre(){return rre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},rre.apply(this,arguments)}function B1t(n,e){if(n==null)return{};var t=$1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function $1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var sge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=B1t(n,["color","size"]);return ae.createElement("svg",rre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),ae.createElement("polyline",{points:"22 4 12 14.01 9 11.01"}))});sge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};sge.displayName="CheckCircle";const mZ=sge;function ore(){return ore=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ore.apply(this,arguments)}function V1t(n,e){if(n==null)return{};var t=H1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function H1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var age=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=V1t(n,["color","size"]);return ae.createElement("svg",ore({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"20 6 9 17 4 12"}))});age.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};age.displayName="Check";const MD=age;function sre(){return sre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},sre.apply(this,arguments)}function W1t(n,e){if(n==null)return{};var t=z1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function z1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var lge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=W1t(n,["color","size"]);return ae.createElement("svg",sre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"6 9 12 15 18 9"}))});lge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};lge.displayName="ChevronDown";const fF=lge;function are(){return are=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},are.apply(this,arguments)}function U1t(n,e){if(n==null)return{};var t=j1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function j1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var cge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=U1t(n,["color","size"]);return ae.createElement("svg",are({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"15 18 9 12 15 6"}))});cge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};cge.displayName="ChevronLeft";const K8e=cge;function lre(){return lre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},lre.apply(this,arguments)}function q1t(n,e){if(n==null)return{};var t=K1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function K1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var uge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=q1t(n,["color","size"]);return ae.createElement("svg",lre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"9 18 15 12 9 6"}))});uge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};uge.displayName="ChevronRight";const dge=uge;function cre(){return cre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},cre.apply(this,arguments)}function G1t(n,e){if(n==null)return{};var t=Y1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Y1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var hge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=G1t(n,["color","size"]);return ae.createElement("svg",cre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"18 15 12 9 6 15"}))});hge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};hge.displayName="ChevronUp";const Q1t=hge;function ure(){return ure=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ure.apply(this,arguments)}function X1t(n,e){if(n==null)return{};var t=Z1t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Z1t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var fge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=X1t(n,["color","size"]);return ae.createElement("svg",ure({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"11 17 6 12 11 7"}),ae.createElement("polyline",{points:"18 17 13 12 18 7"}))});fge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};fge.displayName="ChevronsLeft";const J1t=fge;function dre(){return dre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},dre.apply(this,arguments)}function eCt(n,e){if(n==null)return{};var t=tCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function tCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var pge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=eCt(n,["color","size"]);return ae.createElement("svg",dre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"13 17 18 12 13 7"}),ae.createElement("polyline",{points:"6 17 11 12 6 7"}))});pge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};pge.displayName="ChevronsRight";const rm=pge;function hre(){return hre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},hre.apply(this,arguments)}function nCt(n,e){if(n==null)return{};var t=iCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function iCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var gge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=nCt(n,["color","size"]);return ae.createElement("svg",hre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("circle",{cx:"12",cy:"12",r:"10"}),ae.createElement("polyline",{points:"12 6 12 12 16 14"}))});gge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};gge.displayName="Clock";const rCt=gge;function fre(){return fre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},fre.apply(this,arguments)}function oCt(n,e){if(n==null)return{};var t=sCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function sCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var mge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=oCt(n,["color","size"]);return ae.createElement("svg",fre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),ae.createElement("line",{x1:"1",y1:"10",x2:"23",y2:"10"}))});mge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};mge.displayName="CreditCard";const aCt=mge;function pre(){return pre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},pre.apply(this,arguments)}function lCt(n,e){if(n==null)return{};var t=cCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function cCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var _ge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=lCt(n,["color","size"]);return ae.createElement("svg",pre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"8 17 12 21 16 17"}),ae.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),ae.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"}))});_ge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};_ge.displayName="DownloadCloud";const uCt=_ge;function gre(){return gre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},gre.apply(this,arguments)}function dCt(n,e){if(n==null)return{};var t=hCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function hCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var vge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=dCt(n,["color","size"]);return ae.createElement("svg",gre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ae.createElement("polyline",{points:"15 3 21 3 21 9"}),ae.createElement("line",{x1:"10",y1:"14",x2:"21",y2:"3"}))});vge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};vge.displayName="ExternalLink";const G8e=vge;function mre(){return mre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},mre.apply(this,arguments)}function fCt(n,e){if(n==null)return{};var t=pCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function pCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var bge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=fCt(n,["color","size"]);return ae.createElement("svg",mre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"}))});bge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};bge.displayName="Facebook";const gCt=bge;function _re(){return _re=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},_re.apply(this,arguments)}function mCt(n,e){if(n==null)return{};var t=_Ct(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function _Ct(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var yge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=mCt(n,["color","size"]);return ae.createElement("svg",_re({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),ae.createElement("polyline",{points:"14 2 14 8 20 8"}),ae.createElement("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),ae.createElement("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),ae.createElement("polyline",{points:"10 9 9 9 8 9"}))});yge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};yge.displayName="FileText";const oS=yge;function vre(){return vre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},vre.apply(this,arguments)}function vCt(n,e){if(n==null)return{};var t=bCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function bCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Cge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=vCt(n,["color","size"]);return ae.createElement("svg",vre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),ae.createElement("polyline",{points:"13 2 13 9 20 9"}))});Cge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Cge.displayName="File";const wge=Cge;function bre(){return bre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},bre.apply(this,arguments)}function yCt(n,e){if(n==null)return{};var t=CCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function CCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Sge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=yCt(n,["color","size"]);return ae.createElement("svg",bre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"}))});Sge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Sge.displayName="GitHub";const wCt=Sge;function yre(){return yre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},yre.apply(this,arguments)}function SCt(n,e){if(n==null)return{};var t=ECt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ECt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Ege=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=SCt(n,["color","size"]);return ae.createElement("svg",yre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("circle",{cx:"12",cy:"12",r:"10"}),ae.createElement("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),ae.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});Ege.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Ege.displayName="HelpCircle";const xge=Ege;function Cre(){return Cre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Cre.apply(this,arguments)}function xCt(n,e){if(n==null)return{};var t=TCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function TCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Tge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=xCt(n,["color","size"]);return ae.createElement("svg",Cre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),ae.createElement("polyline",{points:"9 22 9 12 15 12 15 22"}))});Tge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Tge.displayName="Home";const Y8e=Tge;function wre(){return wre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},wre.apply(this,arguments)}function kCt(n,e){if(n==null)return{};var t=ICt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ICt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var kge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=kCt(n,["color","size"]);return ae.createElement("svg",wre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),ae.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),ae.createElement("polyline",{points:"21 15 16 10 5 21"}))});kge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};kge.displayName="Image";const NT=kge;function Sre(){return Sre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Sre.apply(this,arguments)}function LCt(n,e){if(n==null)return{};var t=DCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function DCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Ige=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=LCt(n,["color","size"]);return ae.createElement("svg",Sre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("circle",{cx:"12",cy:"12",r:"10"}),ae.createElement("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),ae.createElement("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"}))});Ige.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Ige.displayName="Info";const Q8e=Ige;function Ere(){return Ere=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ere.apply(this,arguments)}function ACt(n,e){if(n==null)return{};var t=NCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function NCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Lge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=ACt(n,["color","size"]);return ae.createElement("svg",Ere({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polygon",{points:"12 2 2 7 12 12 22 7 12 2"}),ae.createElement("polyline",{points:"2 17 12 22 22 17"}),ae.createElement("polyline",{points:"2 12 12 17 22 12"}))});Lge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Lge.displayName="Layers";const RCt=Lge;function xre(){return xre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},xre.apply(this,arguments)}function OCt(n,e){if(n==null)return{};var t=PCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function PCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Dge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=OCt(n,["color","size"]);return ae.createElement("svg",xre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),ae.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}))});Dge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Dge.displayName="Lock";const MCt=Dge;function Tre(){return Tre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Tre.apply(this,arguments)}function FCt(n,e){if(n==null)return{};var t=BCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function BCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Age=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=FCt(n,["color","size"]);return ae.createElement("svg",Tre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),ae.createElement("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),ae.createElement("line",{x1:"3",y1:"18",x2:"21",y2:"18"}))});Age.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Age.displayName="Menu";const $Ct=Age;function kre(){return kre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},kre.apply(this,arguments)}function VCt(n,e){if(n==null)return{};var t=HCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function HCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Nge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=VCt(n,["color","size"]);return ae.createElement("svg",kre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}))});Nge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Nge.displayName="MessageSquare";const WCt=Nge;function Ire(){return Ire=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ire.apply(this,arguments)}function zCt(n,e){if(n==null)return{};var t=UCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function UCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Rge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=zCt(n,["color","size"]);return ae.createElement("svg",Ire({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83"}),ae.createElement("path",{d:"M22 12A10 10 0 0 0 12 2v10z"}))});Rge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Rge.displayName="PieChart";const jCt=Rge;function Lre(){return Lre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Lre.apply(this,arguments)}function qCt(n,e){if(n==null)return{};var t=KCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function KCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Oge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=qCt(n,["color","size"]);return ae.createElement("svg",Lre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("circle",{cx:"12",cy:"12",r:"10"}),ae.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),ae.createElement("line",{x1:"8",y1:"12",x2:"16",y2:"12"}))});Oge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Oge.displayName="PlusCircle";const Yd=Oge;function Dre(){return Dre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Dre.apply(this,arguments)}function GCt(n,e){if(n==null)return{};var t=YCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function YCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Pge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=GCt(n,["color","size"]);return ae.createElement("svg",Dre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),ae.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))});Pge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Pge.displayName="Plus";const QCt=Pge;function Are(){return Are=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Are.apply(this,arguments)}function XCt(n,e){if(n==null)return{};var t=ZCt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ZCt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Mge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=XCt(n,["color","size"]);return ae.createElement("svg",Are({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"17 1 21 5 17 9"}),ae.createElement("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),ae.createElement("polyline",{points:"7 23 3 19 7 15"}),ae.createElement("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}))});Mge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Mge.displayName="Repeat";const _H=Mge;function Nre(){return Nre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Nre.apply(this,arguments)}function JCt(n,e){if(n==null)return{};var t=ewt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ewt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Fge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=JCt(n,["color","size"]);return ae.createElement("svg",Nre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("circle",{cx:"12",cy:"12",r:"3"}),ae.createElement("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}))});Fge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Fge.displayName="Settings";const Bge=Fge;function Rre(){return Rre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Rre.apply(this,arguments)}function twt(n,e){if(n==null)return{};var t=nwt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function nwt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var $ge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=twt(n,["color","size"]);return ae.createElement("svg",Rre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M14.5 10c-.83 0-1.5-.67-1.5-1.5v-5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5z"}),ae.createElement("path",{d:"M20.5 10H19V8.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"}),ae.createElement("path",{d:"M9.5 14c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5S8 21.33 8 20.5v-5c0-.83.67-1.5 1.5-1.5z"}),ae.createElement("path",{d:"M3.5 14H5v1.5c0 .83-.67 1.5-1.5 1.5S2 16.33 2 15.5 2.67 14 3.5 14z"}),ae.createElement("path",{d:"M14 14.5c0-.83.67-1.5 1.5-1.5h5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-5c-.83 0-1.5-.67-1.5-1.5z"}),ae.createElement("path",{d:"M15.5 19H14v1.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"}),ae.createElement("path",{d:"M10 9.5C10 8.67 9.33 8 8.5 8h-5C2.67 8 2 8.67 2 9.5S2.67 11 3.5 11h5c.83 0 1.5-.67 1.5-1.5z"}),ae.createElement("path",{d:"M8.5 5H10V3.5C10 2.67 9.33 2 8.5 2S7 2.67 7 3.5 7.67 5 8.5 5z"}))});$ge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};$ge.displayName="Slack";const iwt=$ge;function Ore(){return Ore=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ore.apply(this,arguments)}function rwt(n,e){if(n==null)return{};var t=owt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function owt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Vge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=rwt(n,["color","size"]);return ae.createElement("svg",Ore({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),ae.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))});Vge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Vge.displayName="Smartphone";const swt=Vge;function Pre(){return Pre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Pre.apply(this,arguments)}function awt(n,e){if(n==null)return{};var t=lwt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function lwt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Hge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=awt(n,["color","size"]);return ae.createElement("svg",Pre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"3 6 5 6 21 6"}),ae.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),ae.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),ae.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}))});Hge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Hge.displayName="Trash2";const cwt=Hge;function Mre(){return Mre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Mre.apply(this,arguments)}function uwt(n,e){if(n==null)return{};var t=dwt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function dwt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Wge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=uwt(n,["color","size"]);return ae.createElement("svg",Mre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("polyline",{points:"3 6 5 6 21 6"}),ae.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});Wge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Wge.displayName="Trash";const hwt=Wge;function Fre(){return Fre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Fre.apply(this,arguments)}function fwt(n,e){if(n==null)return{};var t=pwt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function pwt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var zge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=fwt(n,["color","size"]);return ae.createElement("svg",Fre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"}))});zge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};zge.displayName="Twitter";const gwt=zge;function Bre(){return Bre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Bre.apply(this,arguments)}function mwt(n,e){if(n==null)return{};var t=_wt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function _wt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Uge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=mwt(n,["color","size"]);return ae.createElement("svg",Bre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),ae.createElement("circle",{cx:"9",cy:"7",r:"4"}),ae.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),ae.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}))});Uge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};Uge.displayName="Users";const vwt=Uge;function $re(){return $re=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},$re.apply(this,arguments)}function bwt(n,e){if(n==null)return{};var t=ywt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function ywt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var jge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=bwt(n,["color","size"]);return ae.createElement("svg",$re({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))});jge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};jge.displayName="X";const kg=jge;function Vre(){return Vre=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Vre.apply(this,arguments)}function Cwt(n,e){if(n==null)return{};var t=wwt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function wwt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var qge=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Cwt(n,["color","size"]);return ae.createElement("svg",Vre({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),ae.createElement("path",{d:"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"}),ae.createElement("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"}))});qge.propTypes={color:Ke.string,size:Ke.oneOfType([Ke.string,Ke.number])};qge.displayName="Youtube";const Swt=qge;var X8e={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var i=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")i.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&i.push(a)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){i.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&i.push(l)}}}return i.join(" ")}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(X8e);var Ewt=X8e.exports;const Nt=nl(Ewt);/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Z8e={accent:"#117DC0",primary:"#2F7DC3",secondary:"#7081e0"};/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function vo(){var t,i,r,o,s;const n=pa();return((r=(i=(t=Oc(a=>a.user).changes)==null?void 0:t.company_user)==null?void 0:i.settings)==null?void 0:r.accent_color)||((s=(o=n==null?void 0:n.company_user)==null?void 0:o.settings)==null?void 0:s.accent_color)||Z8e.accent}var Nf=function(){return Nf=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Nf.apply(this,arguments)};function CN(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function wN(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(o=c[0]&2?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){t.label=c[1];break}if(c[0]===6&&t.label<o[1]){t.label=o[1],o=c;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(c);break}o[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],r=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Zxe(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,o=[],s;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(s)throw s.error}}return o}function FD(n,e,t){if(t||arguments.length===2)for(var i=0,r=e.length,o;i<r;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return n.concat(o||Array.prototype.slice.call(e))}function xwt(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var al="-ms-",KP="-moz-",qs="-webkit-",J8e="comm",Wj="rule",Kge="decl",Twt="@import",e9e="@keyframes",kwt="@layer",Iwt=Math.abs,Gge=String.fromCharCode,Hre=Object.assign;function Lwt(n,e){return Hu(n,0)^45?(((e<<2^Hu(n,0))<<2^Hu(n,1))<<2^Hu(n,2))<<2^Hu(n,3):0}function t9e(n){return n.trim()}function cy(n,e){return(n=e.exec(n))?n[0]:n}function To(n,e,t){return n.replace(e,t)}function u$(n,e){return n.indexOf(e)}function Hu(n,e){return n.charCodeAt(e)|0}function BD(n,e,t){return n.slice(e,t)}function eb(n){return n.length}function n9e(n){return n.length}function rP(n,e){return e.push(n),n}function Dwt(n,e){return n.map(e).join("")}function Jxe(n,e){return n.filter(function(t){return!cy(t,e)})}var zj=1,$D=1,i9e=0,Pm=0,zc=0,SN="";function Uj(n,e,t,i,r,o,s,a){return{value:n,root:e,parent:t,type:i,props:r,children:o,line:zj,column:$D,length:s,return:"",siblings:a}}function dC(n,e){return Hre(Uj("",null,null,"",null,null,0,n.siblings),n,{length:-n.length},e)}function BI(n){for(;n.root;)n=dC(n.root,{children:[n]});rP(n,n.siblings)}function Awt(){return zc}function Nwt(){return zc=Pm>0?Hu(SN,--Pm):0,$D--,zc===10&&($D=1,zj--),zc}function ov(){return zc=Pm<i9e?Hu(SN,Pm++):0,$D++,zc===10&&($D=1,zj++),zc}function iT(){return Hu(SN,Pm)}function d$(){return Pm}function jj(n,e){return BD(SN,n,e)}function Wre(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Rwt(n){return zj=$D=1,i9e=eb(SN=n),Pm=0,[]}function Owt(n){return SN="",n}function _Z(n){return t9e(jj(Pm-1,zre(n===91?n+2:n===40?n+1:n)))}function Pwt(n){for(;(zc=iT())&&zc<33;)ov();return Wre(n)>2||Wre(zc)>3?"":" "}function Mwt(n,e){for(;--e&&ov()&&!(zc<48||zc>102||zc>57&&zc<65||zc>70&&zc<97););return jj(n,d$()+(e<6&&iT()==32&&ov()==32))}function zre(n){for(;ov();)switch(zc){case n:return Pm;case 34:case 39:n!==34&&n!==39&&zre(zc);break;case 40:n===41&&zre(n);break;case 92:ov();break}return Pm}function Fwt(n,e){for(;ov()&&n+zc!==47+10;)if(n+zc===42+42&&iT()===47)break;return"/*"+jj(e,Pm-1)+"*"+Gge(n===47?n:ov())}function Bwt(n){for(;!Wre(iT());)ov();return jj(n,Pm)}function $wt(n){return Owt(h$("",null,null,null,[""],n=Rwt(n),0,[0],n))}function h$(n,e,t,i,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,m=1,v=1,_=1,b=0,y="",C=r,x=o,E=i,k=y;v;)switch(g=b,b=ov()){case 40:if(g!=108&&Hu(k,d-1)==58){u$(k+=To(_Z(b),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:k+=_Z(b);break;case 9:case 10:case 13:case 32:k+=Pwt(g);break;case 92:k+=Mwt(d$()-1,7);continue;case 47:switch(iT()){case 42:case 47:rP(Vwt(Fwt(ov(),d$()),e,t,l),l);break;default:k+="/"}break;case 123*m:a[c++]=eb(k)*_;case 125*m:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+u:_==-1&&(k=To(k,/\f/g,"")),f>0&&eb(k)-d&&rP(f>32?tTe(k+";",i,t,d-1,l):tTe(To(k," ","")+";",i,t,d-2,l),l);break;case 59:k+=";";default:if(rP(E=eTe(k,e,t,c,u,r,a,y,C=[],x=[],d,o),o),b===123)if(u===0)h$(k,e,E,E,C,o,d,a,x);else switch(h===99&&Hu(k,3)===110?100:h){case 100:case 108:case 109:case 115:h$(n,E,E,i&&rP(eTe(n,E,E,0,0,r,a,y,r,C=[],d,x),x),r,x,d,a,i?C:x);break;default:h$(k,E,E,E,[""],x,0,a,x)}}c=u=f=0,m=_=1,y=k="",d=s;break;case 58:d=1+eb(k),f=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&Nwt()==125)continue}switch(k+=Gge(b),b*m){case 38:_=u>0?1:(k+="\f",-1);break;case 44:a[c++]=(eb(k)-1)*_,_=1;break;case 64:iT()===45&&(k+=_Z(ov())),h=iT(),u=d=eb(y=k+=Bwt(d$())),b++;break;case 45:g===45&&eb(k)==2&&(m=0)}}return o}function eTe(n,e,t,i,r,o,s,a,l,c,u,d){for(var h=r-1,f=r===0?o:[""],g=n9e(f),m=0,v=0,_=0;m<i;++m)for(var b=0,y=BD(n,h+1,h=Iwt(v=s[m])),C=n;b<g;++b)(C=t9e(v>0?f[b]+" "+y:To(y,/&\f/g,f[b])))&&(l[_++]=C);return Uj(n,e,t,r===0?Wj:a,l,c,u,d)}function Vwt(n,e,t,i){return Uj(n,e,t,J8e,Gge(Awt()),BD(n,2,-2),0,i)}function tTe(n,e,t,i,r){return Uj(n,e,t,Kge,BD(n,0,i),BD(n,i+1,-1),i,r)}function r9e(n,e,t){switch(Lwt(n,e)){case 5103:return qs+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return qs+n+n;case 4789:return KP+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return qs+n+KP+n+al+n+n;case 5936:switch(Hu(n,e+11)){case 114:return qs+n+al+To(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return qs+n+al+To(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return qs+n+al+To(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return qs+n+al+n+n;case 6165:return qs+n+al+"flex-"+n+n;case 5187:return qs+n+To(n,/(\w+).+(:[^]+)/,qs+"box-$1$2"+al+"flex-$1$2")+n;case 5443:return qs+n+al+"flex-item-"+To(n,/flex-|-self/g,"")+(cy(n,/flex-|baseline/)?"":al+"grid-row-"+To(n,/flex-|-self/g,""))+n;case 4675:return qs+n+al+"flex-line-pack"+To(n,/align-content|flex-|-self/g,"")+n;case 5548:return qs+n+al+To(n,"shrink","negative")+n;case 5292:return qs+n+al+To(n,"basis","preferred-size")+n;case 6060:return qs+"box-"+To(n,"-grow","")+qs+n+al+To(n,"grow","positive")+n;case 4554:return qs+To(n,/([^-])(transform)/g,"$1"+qs+"$2")+n;case 6187:return To(To(To(n,/(zoom-|grab)/,qs+"$1"),/(image-set)/,qs+"$1"),n,"")+n;case 5495:case 3959:return To(n,/(image-set\([^]*)/,qs+"$1$`$1");case 4968:return To(To(n,/(.+:)(flex-)?(.*)/,qs+"box-pack:$3"+al+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+qs+n+n;case 4200:if(!cy(n,/flex-|baseline/))return al+"grid-column-align"+BD(n,e)+n;break;case 2592:case 3360:return al+To(n,"template-","")+n;case 4384:case 3616:return t&&t.some(function(i,r){return e=r,cy(i.props,/grid-\w+-end/)})?~u$(n+(t=t[e].value),"span")?n:al+To(n,"-start","")+n+al+"grid-row-span:"+(~u$(t,"span")?cy(t,/\d+/):+cy(t,/\d+/)-+cy(n,/\d+/))+";":al+To(n,"-start","")+n;case 4896:case 4128:return t&&t.some(function(i){return cy(i.props,/grid-\w+-start/)})?n:al+To(To(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return To(n,/(.+)-inline(.+)/,qs+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(eb(n)-1-e>6)switch(Hu(n,e+1)){case 109:if(Hu(n,e+4)!==45)break;case 102:return To(n,/(.+:)(.+)-([^]+)/,"$1"+qs+"$2-$3$1"+KP+(Hu(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~u$(n,"stretch")?r9e(To(n,"stretch","fill-available"),e,t)+n:n}break;case 5152:case 5920:return To(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(i,r,o,s,a,l,c){return al+r+":"+o+c+(s?al+r+"-span:"+(a?l:+l-+o)+c:"")+n});case 4949:if(Hu(n,e+6)===121)return To(n,":",":"+qs)+n;break;case 6444:switch(Hu(n,Hu(n,14)===45?18:11)){case 120:return To(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+qs+(Hu(n,14)===45?"inline-":"")+"box$3$1"+qs+"$2$3$1"+al+"$2box$3")+n;case 100:return To(n,":",":"+al)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return To(n,"scroll-","scroll-snap-")+n}return n}function vH(n,e){for(var t="",i=0;i<n.length;i++)t+=e(n[i],i,n,e)||"";return t}function Hwt(n,e,t,i){switch(n.type){case kwt:if(n.children.length)break;case Twt:case Kge:return n.return=n.return||n.value;case J8e:return"";case e9e:return n.return=n.value+"{"+vH(n.children,i)+"}";case Wj:if(!eb(n.value=n.props.join(",")))return""}return eb(t=vH(n.children,i))?n.return=n.value+"{"+t+"}":""}function Wwt(n){var e=n9e(n);return function(t,i,r,o){for(var s="",a=0;a<e;a++)s+=n[a](t,i,r,o)||"";return s}}function zwt(n){return function(e){e.root||(e=e.return)&&n(e)}}function Uwt(n,e,t,i){if(n.length>-1&&!n.return)switch(n.type){case Kge:n.return=r9e(n.value,n.length,t);return;case e9e:return vH([dC(n,{value:To(n.value,"@","@"+qs)})],i);case Wj:if(n.length)return Dwt(t=n.props,function(r){switch(cy(r,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":BI(dC(n,{props:[To(r,/:(read-\w+)/,":"+KP+"$1")]})),BI(dC(n,{props:[r]})),Hre(n,{props:Jxe(t,i)});break;case"::placeholder":BI(dC(n,{props:[To(r,/:(plac\w+)/,":"+qs+"input-$1")]})),BI(dC(n,{props:[To(r,/:(plac\w+)/,":"+KP+"$1")]})),BI(dC(n,{props:[To(r,/:(plac\w+)/,al+"input-$1")]})),BI(dC(n,{props:[r]})),Hre(n,{props:Jxe(t,i)});break}return""})}}var o9e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},VD=typeof process<"u"&&process.env!==void 0&&({}.REACT_APP_SC_ATTR||{}.SC_ATTR)||"data-styled",Yge=typeof window<"u"&&"HTMLElement"in window,jwt=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==""?{}.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&{}.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.SC_DISABLE_SPEEDY!==void 0&&{}.SC_DISABLE_SPEEDY!==""&&{}.SC_DISABLE_SPEEDY!=="false"&&{}.SC_DISABLE_SPEEDY),qj=Object.freeze([]),HD=Object.freeze({});function qwt(n,e,t){return t===void 0&&(t=HD),n.theme!==t.theme&&n.theme||e||t.theme}var s9e=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Kwt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Gwt=/(^-|-$)/g;function nTe(n){return n.replace(Kwt,"-").replace(Gwt,"")}var Ywt=/(a)(d)/gi,iTe=function(n){return String.fromCharCode(n+(n>25?39:97))};function Ure(n){var e,t="";for(e=Math.abs(n);e>52;e=e/52|0)t=iTe(e%52)+t;return(iTe(e%52)+t).replace(Ywt,"$1-$2")}var vZ,U2=function(n,e){for(var t=e.length;t;)n=33*n^e.charCodeAt(--t);return n},a9e=function(n){return U2(5381,n)};function Qwt(n){return Ure(a9e(n)>>>0)}function Xwt(n){return n.displayName||n.name||"Component"}function bZ(n){return typeof n=="string"&&!0}var l9e=typeof Symbol=="function"&&Symbol.for,c9e=l9e?Symbol.for("react.memo"):60115,Zwt=l9e?Symbol.for("react.forward_ref"):60112,Jwt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},eSt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},u9e={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},tSt=((vZ={})[Zwt]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},vZ[c9e]=u9e,vZ);function rTe(n){return("type"in(e=n)&&e.type.$$typeof)===c9e?u9e:"$$typeof"in n?tSt[n.$$typeof]:Jwt;var e}var nSt=Object.defineProperty,iSt=Object.getOwnPropertyNames,oTe=Object.getOwnPropertySymbols,rSt=Object.getOwnPropertyDescriptor,oSt=Object.getPrototypeOf,sTe=Object.prototype;function d9e(n,e,t){if(typeof e!="string"){if(sTe){var i=oSt(e);i&&i!==sTe&&d9e(n,i,t)}var r=iSt(e);oTe&&(r=r.concat(oTe(e)));for(var o=rTe(n),s=rTe(e),a=0;a<r.length;++a){var l=r[a];if(!(l in eSt||t&&t[l]||s&&l in s||o&&l in o)){var c=rSt(e,l);try{nSt(n,l,c)}catch{}}}}return n}function WD(n){return typeof n=="function"}function Qge(n){return typeof n=="object"&&"styledComponentId"in n}function Mx(n,e){return n&&e?"".concat(n," ").concat(e):n||e||""}function aTe(n,e){if(n.length===0)return"";for(var t=n[0],i=1;i<n.length;i++)t+=e?e+n[i]:n[i];return t}function L4(n){return n!==null&&typeof n=="object"&&n.constructor.name===Object.name&&!("props"in n&&n.$$typeof)}function jre(n,e,t){if(t===void 0&&(t=!1),!t&&!L4(n)&&!Array.isArray(n))return e;if(Array.isArray(e))for(var i=0;i<e.length;i++)n[i]=jre(n[i],e[i]);else if(L4(e))for(var i in e)n[i]=jre(n[i],e[i]);return n}function Xge(n,e){Object.defineProperty(n,"toString",{value:e})}function pF(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(n," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var sSt=function(){function n(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return n.prototype.indexOfGroup=function(e){for(var t=0,i=0;i<e;i++)t+=this.groupSizes[i];return t},n.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var i=this.groupSizes,r=i.length,o=r;e>=o;)if((o<<=1)<0)throw pF(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),l=(s=0,t.length);s<l;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},n.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],i=this.indexOfGroup(e),r=i+t;this.groupSizes[e]=0;for(var o=i;o<r;o++)this.tag.deleteRule(i)}},n.prototype.getGroup=function(e){var t="";if(e>=this.length||this.groupSizes[e]===0)return t;for(var i=this.groupSizes[e],r=this.indexOfGroup(e),o=r+i,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat(`/*!sc*/ `);return t},n}(),f$=new Map,bH=new Map,yZ=1,m8=function(n){if(f$.has(n))return f$.get(n);for(;bH.has(yZ);)yZ++;var e=yZ++;return f$.set(n,e),bH.set(e,n),e},aSt=function(n,e){f$.set(n,e),bH.set(e,n)},lSt="style[".concat(VD,"][").concat("data-styled-version",'="').concat("6.1.0",'"]'),cSt=new RegExp("^".concat(VD,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),uSt=function(n,e,t){for(var i,r=t.split(","),o=0,s=r.length;o<s;o++)(i=r[o])&&n.registerName(e,i)},dSt=function(n,e){for(var t,i=((t=e.textContent)!==null&&t!==void 0?t:"").split(`/*!sc*/ `),r=[],o=0,s=i.length;o<s;o++){var a=i[o].trim();if(a){var l=a.match(cSt);if(l){var c=0|parseInt(l[1],10),u=l[2];c!==0&&(aSt(u,c),uSt(n,u,l[3]),n.getTag().insertRules(c,r)),r.length=0}else r.push(a)}}};function hSt(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var h9e=function(n){var e=document.head,t=n||e,i=document.createElement("style"),r=function(a){var l=Array.from(a.querySelectorAll("style[".concat(VD,"]")));return l[l.length-1]}(t),o=r!==void 0?r.nextSibling:null;i.setAttribute(VD,"active"),i.setAttribute("data-styled-version","6.1.0");var s=hSt();return s&&i.setAttribute("nonce",s),t.insertBefore(i,o),i},fSt=function(){function n(e){this.element=h9e(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var i=document.styleSheets,r=0,o=i.length;r<o;r++){var s=i[r];if(s.ownerNode===t)return s}throw pF(17)}(this.element),this.length=0}return n.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}},n.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},n.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},n}(),pSt=function(){function n(e){this.element=h9e(e),this.nodes=this.element.childNodes,this.length=0}return n.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var i=document.createTextNode(t);return this.element.insertBefore(i,this.nodes[e]||null),this.length++,!0}return!1},n.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},n.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},n}(),gSt=function(){function n(e){this.rules=[],this.length=0}return n.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},n.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},n.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},n}(),lTe=Yge,mSt={isServer:!Yge,useCSSOMInjection:!jwt},f9e=function(){function n(e,t,i){e===void 0&&(e=HD),t===void 0&&(t={});var r=this;this.options=Nf(Nf({},mSt),e),this.gs=t,this.names=new Map(i),this.server=!!e.isServer,!this.server&&Yge&&lTe&&(lTe=!1,function(o){for(var s=document.querySelectorAll(lSt),a=0,l=s.length;a<l;a++){var c=s[a];c&&c.getAttribute(VD)!=="active"&&(dSt(o,c),c.parentNode&&c.parentNode.removeChild(c))}}(this)),Xge(this,function(){return function(o){for(var s=o.getTag(),a=s.length,l="",c=function(d){var h=function(_){return bH.get(_)}(d);if(h===void 0)return"continue";var f=o.names.get(h),g=s.getGroup(d);if(f===void 0||g.length===0)return"continue";var m="".concat(VD,".g").concat(d,'[id="').concat(h,'"]'),v="";f!==void 0&&f.forEach(function(_){_.length>0&&(v+="".concat(_,","))}),l+="".concat(g).concat(m,'{content:"').concat(v,'"}').concat(`/*!sc*/ `)},u=0;u<a;u++)c(u);return l}(r)})}return n.registerId=function(e){return m8(e)},n.prototype.reconstructWithOptions=function(e,t){return t===void 0&&(t=!0),new n(Nf(Nf({},this.options),e),this.gs,t&&this.names||void 0)},n.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},n.prototype.getTag=function(){return this.tag||(this.tag=(e=function(t){var i=t.useCSSOMInjection,r=t.target;return t.isServer?new gSt(r):i?new fSt(r):new pSt(r)}(this.options),new sSt(e)));var e},n.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},n.prototype.registerName=function(e,t){if(m8(e),this.names.has(e))this.names.get(e).add(t);else{var i=new Set;i.add(t),this.names.set(e,i)}},n.prototype.insertRules=function(e,t,i){this.registerName(e,t),this.getTag().insertRules(m8(e),i)},n.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},n.prototype.clearRules=function(e){this.getTag().clearGroup(m8(e)),this.clearNames(e)},n.prototype.clearTag=function(){this.tag=void 0},n}(),_St=/&/g,vSt=/^\s*\/\/.*$/gm;function p9e(n,e){return n.map(function(t){return t.type==="rule"&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map(function(i){return"".concat(e," ").concat(i)})),Array.isArray(t.children)&&t.type!=="@keyframes"&&(t.children=p9e(t.children,e)),t})}function bSt(n){var e,t,i,r=n===void 0?HD:n,o=r.options,s=o===void 0?HD:o,a=r.plugins,l=a===void 0?qj:a,c=function(h,f,g){return g===t||g.startsWith(t)&&g.endsWith(t)&&g.replaceAll(t,"").length>0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===Wj&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(_St,t).replace(i,c))}),s.prefix&&u.push(Uwt),u.push(Hwt);var d=function(h,f,g,m){f===void 0&&(f=""),g===void 0&&(g=""),m===void 0&&(m="&"),e=m,t=f,i=new RegExp("\\".concat(t,"\\b"),"g");var v=h.replace(vSt,""),_=$wt(g||f?"".concat(g," ").concat(f," { ").concat(v," }"):v);s.namespace&&(_=p9e(_,s.namespace));var b=[];return vH(_,Wwt(u.concat(zwt(function(y){return b.push(y)})))),b};return d.hash=l.length?l.reduce(function(h,f){return f.name||pF(15),U2(h,f.name)},5381).toString():"",d}var ySt=new f9e,qre=bSt(),g9e=ae.createContext({shouldForwardProp:void 0,styleSheet:ySt,stylis:qre});g9e.Consumer;ae.createContext(void 0);function cTe(){return w.useContext(g9e)}var CSt=function(){function n(e,t){var i=this;this.inject=function(r,o){o===void 0&&(o=qre);var s=i.name+o.hash;r.hasNameForId(i.id,s)||r.insertRules(i.id,s,o(i.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Xge(this,function(){throw pF(12,String(i.name))})}return n.prototype.getName=function(e){return e===void 0&&(e=qre),this.name+e.hash},n}(),wSt=function(n){return n>="A"&&n<="Z"};function uTe(n){for(var e="",t=0;t<n.length;t++){var i=n[t];if(t===1&&i==="-"&&n[0]==="-")return n;wSt(i)?e+="-"+i.toLowerCase():e+=i}return e.startsWith("ms-")?"-"+e:e}var m9e=function(n){return n==null||n===!1||n===""},_9e=function(n){var e,t,i=[];for(var r in n){var o=n[r];n.hasOwnProperty(r)&&!m9e(o)&&(Array.isArray(o)&&o.isCss||WD(o)?i.push("".concat(uTe(r),":"),o,";"):L4(o)?i.push.apply(i,FD(FD(["".concat(r," {")],_9e(o),!1),["}"],!1)):i.push("".concat(uTe(r),": ").concat((e=r,(t=o)==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in o9e||e.startsWith("--")?String(t).trim():"".concat(t,"px")),";")))}return i};function rT(n,e,t,i){if(m9e(n))return[];if(Qge(n))return[".".concat(n.styledComponentId)];if(WD(n)){if(!WD(o=n)||o.prototype&&o.prototype.isReactComponent||!e)return[n];var r=n(e);return rT(r,e,t,i)}var o;return n instanceof CSt?t?(n.inject(t,i),[n.getName(i)]):[n]:L4(n)?_9e(n):Array.isArray(n)?Array.prototype.concat.apply(qj,n.map(function(s){return rT(s,e,t,i)})):[n.toString()]}function SSt(n){for(var e=0;e<n.length;e+=1){var t=n[e];if(WD(t)&&!Qge(t))return!1}return!0}var ESt=a9e("6.1.0"),xSt=function(){function n(e,t,i){this.rules=e,this.staticRulesId="",this.isStatic=(i===void 0||i.isStatic)&&SSt(e),this.componentId=t,this.baseHash=U2(ESt,t),this.baseStyle=i,f9e.registerId(t)}return n.prototype.generateAndInjectStyles=function(e,t,i){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,i):"";if(this.isStatic&&!i.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=Mx(r,this.staticRulesId);else{var o=aTe(rT(this.rules,e,t,i)),s=Ure(U2(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var a=i(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,a)}r=Mx(r,s),this.staticRulesId=s}else{for(var l=U2(this.baseHash,i.hash),c="",u=0;u<this.rules.length;u++){var d=this.rules[u];if(typeof d=="string")c+=d;else if(d){var h=aTe(rT(d,e,t,i));l=U2(l,h+u),c+=h}}if(c){var f=Ure(l>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,i(c,".".concat(f),void 0,this.componentId)),r=Mx(r,f)}}return r},n}(),v9e=ae.createContext(void 0);v9e.Consumer;var CZ={};function TSt(n,e,t){var i=Qge(n),r=n,o=!bZ(n),s=e.attrs,a=s===void 0?qj:s,l=e.componentId,c=l===void 0?function(y,C){var x=typeof y!="string"?"sc":nTe(y);CZ[x]=(CZ[x]||0)+1;var E="".concat(x,"-").concat(Qwt("6.1.0"+x+CZ[x]));return C?"".concat(C,"-").concat(E):E}(e.displayName,e.parentComponentId):l,u=e.displayName;u===void 0&&function(y){return bZ(y)?"styled.".concat(y):"Styled(".concat(Xwt(y),")")}(n);var d=e.displayName&&e.componentId?"".concat(nTe(e.displayName),"-").concat(e.componentId):e.componentId||c,h=i&&r.attrs?r.attrs.concat(a).filter(Boolean):a,f=e.shouldForwardProp;if(i&&r.shouldForwardProp){var g=r.shouldForwardProp;if(e.shouldForwardProp){var m=e.shouldForwardProp;f=function(y,C){return g(y,C)&&m(y,C)}}else f=g}var v=new xSt(t,d,i?r.componentStyle:void 0);function _(y,C){return function(x,E,k){var L=x.attrs,D=x.componentStyle,A=x.defaultProps,O=x.foldedComponentIds,P=x.styledComponentId,F=x.target,B=ae.useContext(v9e),M=cTe(),V=x.shouldForwardProp||M.shouldForwardProp,U=function(Q,Ee,Fe){for(var He,ke=Nf(Nf({},Ee),{className:void 0,theme:Fe}),Me=0;Me<Q.length;Me+=1){var je=WD(He=Q[Me])?He(ke):He;for(var qe in je)ke[qe]=qe==="className"?Mx(ke[qe],je[qe]):qe==="style"?Nf(Nf({},ke[qe]),je[qe]):je[qe]}return Ee.className&&(ke.className=Mx(ke.className,Ee.className)),ke}(L,E,qwt(E,B,A)||HD),W=U.as||F,q={};for(var H in U)U[H]===void 0||H[0]==="$"||H==="as"||H==="theme"||(H==="forwardedAs"?q.as=U.forwardedAs:V&&!V(H,W)||(q[H]=U[H]));var ie=function(Q,Ee){var Fe=cTe(),He=Q.generateAndInjectStyles(Ee,Fe.styleSheet,Fe.stylis);return He}(D,U),se=Mx(O,P);return ie&&(se+=" "+ie),U.className&&(se+=" "+U.className),q[bZ(W)&&!s9e.has(W)?"class":"className"]=se,q.ref=k,w.createElement(W,q)}(b,y,C)}var b=ae.forwardRef(_);return b.attrs=h,b.componentStyle=v,b.shouldForwardProp=f,b.foldedComponentIds=i?Mx(r.foldedComponentIds,r.styledComponentId):"",b.styledComponentId=d,b.target=i?r.target:n,Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(y){this._foldedDefaultProps=i?function(C){for(var x=[],E=1;E<arguments.length;E++)x[E-1]=arguments[E];for(var k=0,L=x;k<L.length;k++)jre(C,L[k],!0);return C}({},r.defaultProps,y):y}}),Xge(b,function(){return".".concat(b.styledComponentId)}),o&&d9e(b,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),b}function dTe(n,e){for(var t=[n[0]],i=0,r=e.length;i<r;i+=1)t.push(e[i],n[i+1]);return t}var hTe=function(n){return Object.assign(n,{isCss:!0})};function kSt(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(WD(n)||L4(n)){var i=n;return hTe(rT(dTe(qj,FD([i],e,!0))))}var r=n;return e.length===0&&r.length===1&&typeof r[0]=="string"?rT(r):hTe(rT(dTe(r,e)))}function Kre(n,e,t){if(t===void 0&&(t=HD),!e)throw pF(1,e);var i=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return n(e,t,kSt.apply(void 0,FD([r],o,!1)))};return i.attrs=function(r){return Kre(n,e,Nf(Nf({},t),{attrs:Array.prototype.concat(t.attrs,r).filter(Boolean)}))},i.withConfig=function(r){return Kre(n,e,Nf(Nf({},t),r))},i}var b9e=function(n){return Kre(TSt,n)},rl=b9e;s9e.forEach(function(n){rl[n]=b9e(n)});const ISt={type:"primary",behavior:"submit"},LSt=rl(C0)` color: ${n=>n.theme.color} !important; background-color: ${n=>n.theme.backgroundColor} !important; border-color: ${n=>n.theme.borderColor} !important; `,DSt=rl.button` color: ${n=>n.theme.color} !important; background-color: ${n=>n.theme.backgroundColor} !important; border-color: ${n=>n.theme.borderColor} !important; `;function Gt(n){n={...ISt,...n};const e=ni(),t=vo(),i={backgroundColor:n.type==="primary"?t:n.noBackgroundColor?"transparent":"white",color:n.type!=="primary"&&n.type!=="secondary"?t:""};return n.to?p(LSt,{to:n.to,theme:{backgroundColor:n.type==="primary"?t:e.$1,color:n.type==="primary"?e.$9:e.$3,borderColor:n.type==="primary"?"transparent":e.$5},className:Nt(`border inline-flex items-center space-x-2 px-4 justify-center rounded text-sm ${n.className} disabled:cursor-not-allowed disabled:opacity-75`,{"py-2 px-4":n.type!=="minimal","w-full":n.variant==="block","p-0 m-0":n.type==="minimal"}),style:i,children:n.disabled?p(ns,{variant:"light"}):n.children}):p(DSt,{type:n.behavior,disabled:n.disabled,theme:{backgroundColor:n.type==="primary"?t:e.$1,color:n.type==="primary"?e.$9:e.$3,borderColor:n.type==="primary"?"transparent":e.$5},className:Nt(`border inline-flex items-center space-x-2 px-4 justify-center rounded text-sm ${n.className} disabled:cursor-not-allowed disabled:opacity-75`,{"py-2 px-4":n.type!=="minimal","w-full":n.variant==="block","p-0 m-0":n.type==="minimal"}),style:i,onClick:n.onClick,form:n.form,children:n.disabled&&!n.disableWithoutIcon?p(ns,{variant:"light"}):n.children})}const ASt=rl.input` background-color: ${n=>n.theme.backgroundColor}; `;function Ph(n){const e=ni();return N("div",{className:"relative flex items-start",children:[p("div",{className:"flex items-center h-5",children:p(ASt,{theme:{backgroundColor:e.$2},ref:n.innerRef,value:n.value,id:n.id,"aria-describedby":"comments-description",type:"checkbox",className:Nt("h-4 w-4 rounded cursor-pointer disabled:opacity-50",n.className),style:{borderColor:e.$5},onChange:t=>{n.onChange&&n.onChange(t),n.onValueChange&&n.onValueChange(t.target.value,t.target.checked)},checked:n.checked,disabled:n.disabled,"data-cy":n.cypressRef})}),p("div",{className:"ml-3 text-sm",children:p("label",{htmlFor:n.id,className:"font-medium cursor-pointer",style:{color:e.$3},children:n.label})})]})}function NSt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ok(n){var e=NSt();return function(){var i=Om(n),r;if(e){var o=Om(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return fN(this,r)}}var Wf="top",Mm="bottom",Fm="right",zf="left",Zge="auto",gF=[Wf,Mm,Fm,zf],zD="start",D4="end",RSt="clippingParents",y9e="viewport",ZR="popper",OSt="reference",fTe=gF.reduce(function(n,e){return n.concat([e+"-"+zD,e+"-"+D4])},[]),C9e=[].concat(gF,[Zge]).reduce(function(n,e){return n.concat([e,e+"-"+zD,e+"-"+D4])},[]),PSt="beforeRead",MSt="read",FSt="afterRead",BSt="beforeMain",$St="main",VSt="afterMain",HSt="beforeWrite",WSt="write",zSt="afterWrite",USt=[PSt,MSt,FSt,BSt,$St,VSt,HSt,WSt,zSt];function Jb(n){return n?(n.nodeName||"").toLowerCase():null}function fg(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function RT(n){var e=fg(n).Element;return n instanceof e||n instanceof Element}function Sm(n){var e=fg(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Jge(n){if(typeof ShadowRoot>"u")return!1;var e=fg(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function jSt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];!Sm(o)||!Jb(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function qSt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],o=e.attributes[i]||{},s=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=s.reduce(function(l,c){return l[c]="",l},{});!Sm(r)||!Jb(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}const eme={name:"applyStyles",enabled:!0,phase:"write",fn:jSt,effect:qSt,requires:["computeStyles"]};function jb(n){return n.split("-")[0]}var oT=Math.max,yH=Math.min,UD=Math.round;function Gre(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function w9e(){return!/^((?!chrome|android).)*safari/i.test(Gre())}function jD(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),r=1,o=1;e&&Sm(n)&&(r=n.offsetWidth>0&&UD(i.width)/n.offsetWidth||1,o=n.offsetHeight>0&&UD(i.height)/n.offsetHeight||1);var s=RT(n)?fg(n):window,a=s.visualViewport,l=!w9e()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/r,u=(i.top+(l&&a?a.offsetTop:0))/o,d=i.width/r,h=i.height/o;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function tme(n){var e=jD(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function S9e(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Jge(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function p1(n){return fg(n).getComputedStyle(n)}function KSt(n){return["table","td","th"].indexOf(Jb(n))>=0}function jS(n){return((RT(n)?n.ownerDocument:n.document)||window.document).documentElement}function Kj(n){return Jb(n)==="html"?n:n.assignedSlot||n.parentNode||(Jge(n)?n.host:null)||jS(n)}function pTe(n){return!Sm(n)||p1(n).position==="fixed"?null:n.offsetParent}function GSt(n){var e=/firefox/i.test(Gre()),t=/Trident/i.test(Gre());if(t&&Sm(n)){var i=p1(n);if(i.position==="fixed")return null}var r=Kj(n);for(Jge(r)&&(r=r.host);Sm(r)&&["html","body"].indexOf(Jb(r))<0;){var o=p1(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function mF(n){for(var e=fg(n),t=pTe(n);t&&KSt(t)&&p1(t).position==="static";)t=pTe(t);return t&&(Jb(t)==="html"||Jb(t)==="body"&&p1(t).position==="static")?e:t||GSt(n)||e}function nme(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function GP(n,e,t){return oT(n,yH(e,t))}function YSt(n,e,t){var i=GP(n,e,t);return i>t?t:i}function E9e(){return{top:0,right:0,bottom:0,left:0}}function x9e(n){return Object.assign({},E9e(),n)}function T9e(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var QSt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,x9e(typeof e!="number"?e:T9e(e,gF))};function XSt(n){var e,t=n.state,i=n.name,r=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=jb(t.placement),l=nme(a),c=[zf,Fm].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=QSt(r.padding,t),h=tme(o),f=l==="y"?Wf:zf,g=l==="y"?Mm:Fm,m=t.rects.reference[u]+t.rects.reference[l]-s[l]-t.rects.popper[u],v=s[l]-t.rects.reference[l],_=mF(o),b=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,y=m/2-v/2,C=d[f],x=b-h[u]-d[g],E=b/2-h[u]/2+y,k=GP(C,E,x),L=l;t.modifiersData[i]=(e={},e[L]=k,e.centerOffset=k-E,e)}}function ZSt(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||S9e(e.elements.popper,r)&&(e.elements.arrow=r))}const JSt={name:"arrow",enabled:!0,phase:"main",fn:XSt,effect:ZSt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qD(n){return n.split("-")[1]}var eEt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tEt(n,e){var t=n.x,i=n.y,r=e.devicePixelRatio||1;return{x:UD(t*r)/r||0,y:UD(i*r)/r||0}}function gTe(n){var e,t=n.popper,i=n.popperRect,r=n.placement,o=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,h=s.x,f=h===void 0?0:h,g=s.y,m=g===void 0?0:g,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var _=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=zf,C=Wf,x=window;if(c){var E=mF(t),k="clientHeight",L="clientWidth";if(E===fg(t)&&(E=jS(t),p1(E).position!=="static"&&a==="absolute"&&(k="scrollHeight",L="scrollWidth")),E=E,r===Wf||(r===zf||r===Fm)&&o===D4){C=Mm;var D=d&&E===x&&x.visualViewport?x.visualViewport.height:E[k];m-=D-i.height,m*=l?1:-1}if(r===zf||(r===Wf||r===Mm)&&o===D4){y=Fm;var A=d&&E===x&&x.visualViewport?x.visualViewport.width:E[L];f-=A-i.width,f*=l?1:-1}}var O=Object.assign({position:a},c&&eEt),P=u===!0?tEt({x:f,y:m},fg(t)):{x:f,y:m};if(f=P.x,m=P.y,l){var F;return Object.assign({},O,(F={},F[C]=b?"0":"",F[y]=_?"0":"",F.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",F))}return Object.assign({},O,(e={},e[C]=b?m+"px":"",e[y]=_?f+"px":"",e.transform="",e))}function nEt(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,o=t.adaptive,s=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:jb(e.placement),variation:qD(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,gTe(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,gTe(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const iEt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:nEt,data:{}};var _8={passive:!0};function rEt(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=fg(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,_8)}),a&&l.addEventListener("resize",t.update,_8),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,_8)}),a&&l.removeEventListener("resize",t.update,_8)}}const oEt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rEt,data:{}};var sEt={left:"right",right:"left",bottom:"top",top:"bottom"};function p$(n){return n.replace(/left|right|bottom|top/g,function(e){return sEt[e]})}var aEt={start:"end",end:"start"};function mTe(n){return n.replace(/start|end/g,function(e){return aEt[e]})}function ime(n){var e=fg(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function rme(n){return jD(jS(n)).left+ime(n).scrollLeft}function lEt(n,e){var t=fg(n),i=jS(n),r=t.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=w9e();(c||!c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+rme(n),y:l}}function cEt(n){var e,t=jS(n),i=ime(n),r=(e=n.ownerDocument)==null?void 0:e.body,o=oT(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=oT(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+rme(n),l=-i.scrollTop;return p1(r||t).direction==="rtl"&&(a+=oT(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function ome(n){var e=p1(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function k9e(n){return["html","body","#document"].indexOf(Jb(n))>=0?n.ownerDocument.body:Sm(n)&&ome(n)?n:k9e(Kj(n))}function YP(n,e){var t;e===void 0&&(e=[]);var i=k9e(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),o=fg(i),s=r?[o].concat(o.visualViewport||[],ome(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(YP(Kj(s)))}function Yre(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function uEt(n,e){var t=jD(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function _Te(n,e,t){return e===y9e?Yre(lEt(n,t)):RT(e)?uEt(e,t):Yre(cEt(jS(n)))}function dEt(n){var e=YP(Kj(n)),t=["absolute","fixed"].indexOf(p1(n).position)>=0,i=t&&Sm(n)?mF(n):n;return RT(i)?e.filter(function(r){return RT(r)&&S9e(r,i)&&Jb(r)!=="body"}):[]}function hEt(n,e,t,i){var r=e==="clippingParents"?dEt(n):[].concat(e),o=[].concat(r,[t]),s=o[0],a=o.reduce(function(l,c){var u=_Te(n,c,i);return l.top=oT(u.top,l.top),l.right=yH(u.right,l.right),l.bottom=yH(u.bottom,l.bottom),l.left=oT(u.left,l.left),l},_Te(n,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function I9e(n){var e=n.reference,t=n.element,i=n.placement,r=i?jb(i):null,o=i?qD(i):null,s=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(r){case Wf:l={x:s,y:e.y-t.height};break;case Mm:l={x:s,y:e.y+e.height};break;case Fm:l={x:e.x+e.width,y:a};break;case zf:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=r?nme(r):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case zD:l[c]=l[c]-(e[u]/2-t[u]/2);break;case D4:l[c]=l[c]+(e[u]/2-t[u]/2);break}}return l}function A4(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,o=t.strategy,s=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?RSt:a,c=t.rootBoundary,u=c===void 0?y9e:c,d=t.elementContext,h=d===void 0?ZR:d,f=t.altBoundary,g=f===void 0?!1:f,m=t.padding,v=m===void 0?0:m,_=x9e(typeof v!="number"?v:T9e(v,gF)),b=h===ZR?OSt:ZR,y=n.rects.popper,C=n.elements[g?b:h],x=hEt(RT(C)?C:C.contextElement||jS(n.elements.popper),l,u,s),E=jD(n.elements.reference),k=I9e({reference:E,element:y,strategy:"absolute",placement:r}),L=Yre(Object.assign({},y,k)),D=h===ZR?L:E,A={top:x.top-D.top+_.top,bottom:D.bottom-x.bottom+_.bottom,left:x.left-D.left+_.left,right:D.right-x.right+_.right},O=n.modifiersData.offset;if(h===ZR&&O){var P=O[r];Object.keys(A).forEach(function(F){var B=[Fm,Mm].indexOf(F)>=0?1:-1,M=[Wf,Mm].indexOf(F)>=0?"y":"x";A[F]+=P[M]*B})}return A}function fEt(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,o=t.rootBoundary,s=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?C9e:l,u=qD(i),d=u?a?fTe:fTe.filter(function(g){return qD(g)===u}):gF,h=d.filter(function(g){return c.indexOf(g)>=0});h.length===0&&(h=d);var f=h.reduce(function(g,m){return g[m]=A4(n,{placement:m,boundary:r,rootBoundary:o,padding:s})[jb(m)],g},{});return Object.keys(f).sort(function(g,m){return f[g]-f[m]})}function pEt(n){if(jb(n)===Zge)return[];var e=p$(n);return[mTe(n),e,mTe(e)]}function gEt(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!0:s,l=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,h=t.altBoundary,f=t.flipVariations,g=f===void 0?!0:f,m=t.allowedAutoPlacements,v=e.options.placement,_=jb(v),b=_===v,y=l||(b||!g?[p$(v)]:pEt(v)),C=[v].concat(y).reduce(function(Ee,Fe){return Ee.concat(jb(Fe)===Zge?fEt(e,{placement:Fe,boundary:u,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:m}):Fe)},[]),x=e.rects.reference,E=e.rects.popper,k=new Map,L=!0,D=C[0],A=0;A<C.length;A++){var O=C[A],P=jb(O),F=qD(O)===zD,B=[Wf,Mm].indexOf(P)>=0,M=B?"width":"height",V=A4(e,{placement:O,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),U=B?F?Fm:zf:F?Mm:Wf;x[M]>E[M]&&(U=p$(U));var W=p$(U),q=[];if(o&&q.push(V[P]<=0),a&&q.push(V[U]<=0,V[W]<=0),q.every(function(Ee){return Ee})){D=O,L=!1;break}k.set(O,q)}if(L)for(var H=g?3:1,ie=function(Fe){var He=C.find(function(ke){var Me=k.get(ke);if(Me)return Me.slice(0,Fe).every(function(je){return je})});if(He)return D=He,"break"},se=H;se>0;se--){var Q=ie(se);if(Q==="break")break}e.placement!==D&&(e.modifiersData[i]._skip=!0,e.placement=D,e.reset=!0)}}const mEt={name:"flip",enabled:!0,phase:"main",fn:gEt,requiresIfExists:["offset"],data:{_skip:!1}};function vTe(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function bTe(n){return[Wf,Fm,Mm,zf].some(function(e){return n[e]>=0})}function _Et(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=A4(e,{elementContext:"reference"}),a=A4(e,{altBoundary:!0}),l=vTe(s,i),c=vTe(a,r,o),u=bTe(l),d=bTe(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const vEt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_Et};function bEt(n,e,t){var i=jb(n),r=[zf,Wf].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[zf,Fm].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function yEt(n){var e=n.state,t=n.options,i=n.name,r=t.offset,o=r===void 0?[0,0]:r,s=C9e.reduce(function(u,d){return u[d]=bEt(d,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}const CEt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:yEt};function wEt(n){var e=n.state,t=n.name;e.modifiersData[t]=I9e({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const SEt={name:"popperOffsets",enabled:!0,phase:"read",fn:wEt,data:{}};function EEt(n){return n==="x"?"y":"x"}function xEt(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!1:s,l=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,h=t.tether,f=h===void 0?!0:h,g=t.tetherOffset,m=g===void 0?0:g,v=A4(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),_=jb(e.placement),b=qD(e.placement),y=!b,C=nme(_),x=EEt(C),E=e.modifiersData.popperOffsets,k=e.rects.reference,L=e.rects.popper,D=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,A=typeof D=="number"?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(E){if(o){var F,B=C==="y"?Wf:zf,M=C==="y"?Mm:Fm,V=C==="y"?"height":"width",U=E[C],W=U+v[B],q=U-v[M],H=f?-L[V]/2:0,ie=b===zD?k[V]:L[V],se=b===zD?-L[V]:-k[V],Q=e.elements.arrow,Ee=f&&Q?tme(Q):{width:0,height:0},Fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:E9e(),He=Fe[B],ke=Fe[M],Me=GP(0,k[V],Ee[V]),je=y?k[V]/2-H-Me-He-A.mainAxis:ie-Me-He-A.mainAxis,qe=y?-k[V]/2+H+Me+ke+A.mainAxis:se+Me+ke+A.mainAxis,Be=e.elements.arrow&&mF(e.elements.arrow),_t=Be?C==="y"?Be.clientTop||0:Be.clientLeft||0:0,Wt=(F=O==null?void 0:O[C])!=null?F:0,Tt=U+je-Wt-_t,rn=U+qe-Wt,_n=GP(f?yH(W,Tt):W,U,f?oT(q,rn):q);E[C]=_n,P[C]=_n-U}if(a){var wt,pt=C==="x"?Wf:zf,ot=C==="x"?Mm:Fm,we=E[x],Se=x==="y"?"height":"width",re=we+v[pt],Y=we-v[ot],Z=[Wf,zf].indexOf(_)!==-1,le=(wt=O==null?void 0:O[x])!=null?wt:0,te=Z?re:we-k[Se]-L[Se]-le+A.altAxis,me=Z?we+k[Se]+L[Se]-le-A.altAxis:Y,Oe=f&&Z?YSt(te,we,me):GP(f?te:re,we,f?me:Y);E[x]=Oe,P[x]=Oe-we}e.modifiersData[i]=P}}const TEt={name:"preventOverflow",enabled:!0,phase:"main",fn:xEt,requiresIfExists:["offset"]};function kEt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function IEt(n){return n===fg(n)||!Sm(n)?ime(n):kEt(n)}function LEt(n){var e=n.getBoundingClientRect(),t=UD(e.width)/n.offsetWidth||1,i=UD(e.height)/n.offsetHeight||1;return t!==1||i!==1}function DEt(n,e,t){t===void 0&&(t=!1);var i=Sm(e),r=Sm(e)&&LEt(e),o=jS(e),s=jD(n,r,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((Jb(e)!=="body"||ome(o))&&(a=IEt(e)),Sm(e)?(l=jD(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=rme(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function AEt(n){var e=new Map,t=new Set,i=[];n.forEach(function(o){e.set(o.name,o)});function r(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&r(l)}}),i.push(o)}return n.forEach(function(o){t.has(o.name)||r(o)}),i}function NEt(n){var e=AEt(n);return USt.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function REt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function OEt(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var yTe={placement:"bottom",modifiers:[],strategy:"absolute"};function CTe(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function PEt(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,o=r===void 0?yTe:r;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},yTe,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],h=!1,f={state:u,setOptions:function(_){var b=typeof _=="function"?_(u.options):_;m(),u.options=Object.assign({},o,u.options,b),u.scrollParents={reference:RT(a)?YP(a):a.contextElement?YP(a.contextElement):[],popper:YP(l)};var y=NEt(OEt([].concat(i,u.options.modifiers)));return u.orderedModifiers=y.filter(function(C){return C.enabled}),g(),f.update()},forceUpdate:function(){if(!h){var _=u.elements,b=_.reference,y=_.popper;if(CTe(b,y)){u.rects={reference:DEt(b,mF(y),u.options.strategy==="fixed"),popper:tme(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(A){return u.modifiersData[A.name]=Object.assign({},A.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var x=u.orderedModifiers[C],E=x.fn,k=x.options,L=k===void 0?{}:k,D=x.name;typeof E=="function"&&(u=E({state:u,options:L,name:D,instance:f})||u)}}}},update:REt(function(){return new Promise(function(v){f.forceUpdate(),v(u)})}),destroy:function(){m(),h=!0}};if(!CTe(a,l))return f;f.setOptions(c).then(function(v){!h&&c.onFirstUpdate&&c.onFirstUpdate(v)});function g(){u.orderedModifiers.forEach(function(v){var _=v.name,b=v.options,y=b===void 0?{}:b,C=v.effect;if(typeof C=="function"){var x=C({state:u,name:_,instance:f,options:y}),E=function(){};d.push(x||E)}})}function m(){d.forEach(function(v){return v()}),d=[]}return f}}var MEt=[oEt,SEt,iEt,eme,CEt,mEt,TEt,JSt,vEt],L9e=PEt({defaultModifiers:MEt});function vt(n){const e=vo(),t=w.createElement(n.element);return w.isValidElement(t)?w.cloneElement(t,{fontSize:n.size||18,color:n.color||e,className:n.className,onClick:n.onClick,style:n.style}):p(dt,{})}var D9e={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},wTe=ae.createContext&&ae.createContext(D9e),Sw=globalThis&&globalThis.__assign||function(){return Sw=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},Sw.apply(this,arguments)},FEt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function A9e(n){return n&&n.map(function(e,t){return ae.createElement(e.tag,Sw({key:t},e.attr),A9e(e.child))})}function xn(n){return function(e){return ae.createElement(BEt,Sw({attr:Sw({},n.attr)},e),A9e(n.child))}}function BEt(n){var e=function(t){var i=n.attr,r=n.size,o=n.title,s=FEt(n,["attr","size","title"]),a=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),ae.createElement("svg",Sw({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,s,{className:l,style:Sw(Sw({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&ae.createElement("title",null,o),n.children)};return wTe!==void 0?ae.createElement(wTe.Consumer,null,function(t){return e(t)}):e(D9e)}function $Et(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 8l-4 4h3c0 3.31-2.69 6-6 6a5.87 5.87 0 01-2.8-.7l-1.46 1.46A7.93 7.93 0 0012 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46A7.93 7.93 0 0012 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}}]})(n)}function E2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}}]})(n)}function x2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-2 8c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm4 8H8v-.57c0-.81.48-1.53 1.22-1.85a6.95 6.95 0 015.56 0A2.01 2.01 0 0116 17.43V18z"}}]})(n)}function T2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}}]})(n)}function VEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}}]})(n)}function gl(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}}]})(n)}function sme(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}}]})(n)}function k2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24m0 24H0"}},{tag:"path",attr:{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}}]})(n)}function OT(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M11 7h2v2h-2V7zm0 4h2v6h-2v-6zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}}]})(n)}function STe(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}}]})(n)}function I2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 19H5V5h7V3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}}]})(n)}function CH(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6zM18 20H6V10h12v10z"}}]})(n)}function HEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"}}]})(n)}function WEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"circle",attr:{cx:"10",cy:"8",r:"4"}},{tag:"path",attr:{d:"M10.67 13.02c-.22-.01-.44-.02-.67-.02-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26a6.963 6.963 0 01-.59-6.98zM20.75 16c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}}]})(n)}function ame(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm1 0V8l5 4-5 4z"}}]})(n)}function lme(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.5 9a2.5 2.5 0 000 5 2.5 2.5 0 000-5zM20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3.21 14.21l-2.91-2.91c-.69.44-1.51.7-2.39.7C9.01 16 7 13.99 7 11.5S9.01 7 11.5 7 16 9.01 16 11.5c0 .88-.26 1.69-.7 2.39l2.91 2.9-1.42 1.42z"}}]})(n)}function L2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm.88 15.76V19h-1.75v-1.29c-.74-.18-2.39-.77-3.02-2.96l1.65-.67c.06.22.58 2.09 2.4 2.09.93 0 1.98-.48 1.98-1.61 0-.96-.7-1.46-2.28-2.03-1.1-.39-3.35-1.03-3.35-3.31 0-.1.01-2.4 2.62-2.96V5h1.75v1.24c1.84.32 2.51 1.79 2.66 2.23l-1.58.67c-.11-.35-.59-1.34-1.9-1.34-.7 0-1.81.37-1.81 1.39 0 .95.86 1.31 2.64 1.9 2.4.83 3.01 2.05 3.01 3.45 0 2.63-2.5 3.13-3.02 3.22z"}}]})(n)}function D2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}}]})(n)}function A2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V5a2 2 0 00-2-2zm0 16H5V7h14v12zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4zm0 6.5a2.5 2.5 0 010-5 2.5 2.5 0 010 5z"}}]})(n)}function N9e(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"}}]})(n)}function Dc(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3a9 9 0 00-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0013 21a9 9 0 000-18zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}}]})(n)}function cme(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}},{tag:"path",attr:{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"}}]})(n)}function N2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-2-9a9 9 0 00-9 9H0l4 4 4-4H5c0-3.87 3.13-7 7-7s7 3.13 7 7a6.995 6.995 0 01-11.06 5.7l-1.42 1.44A9 9 0 1012 3z"}}]})(n)}function zEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(n)}function Tb(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}}]})(n)}function UEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 5v14l11-7z"}}]})(n)}function ume(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 14H8V8h8v8z"}}]})(n)}function Gj(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM18 14H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"}}]})(n)}function R9e(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a6.995 6.995 0 0110-6.32V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1zM4 6l8 5 8-5v2l-8 5-8-5V6zm13.34 16l-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34 17.34 22z"}}]})(n)}function jEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}}]})(n)}function R2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"}}]})(n)}function qEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}}]})(n)}function Ac(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z"}}]})(n)}function O2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}}]})(n)}function KEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2zm-5 12H9v-2h6v2zm5-7H4V4l16-.02V7z"}}]})(n)}function P2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5zm-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11A4.991 4.991 0 002 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3 2 4.27z"}},{tag:"path",attr:{fill:"none",d:"M0 24V0"}}]})(n)}function GEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}}]})(n)}function YEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 13H5v-2h14v2z"}}]})(n)}function dme(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"}}]})(n)}function M2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h5v-2H4v-6h18V6c0-1.11-.89-2-2-2zm0 4H4V6h16v2zm-5.07 11.17l-2.83-2.83-1.41 1.41L14.93 22 22 14.93l-1.41-1.41-5.66 5.65z"}}]})(n)}function QEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 13v7h18v-1.5l-9-7L8 17l-5-4zm0-6l4 3 5-7 5 4h4v8.97l-9.4-7.31-3.98 5.48L3 10.44V7z"}}]})(n)}function O9e(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"}}]})(n)}function hme(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.5 14H8c-1.66 0-3-1.34-3-3s1.34-3 3-3l.14.01A3.98 3.98 0 0112 7c2.21 0 4 1.79 4 4h.5a2.5 2.5 0 010 5z"}}]})(n)}function sS(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}}]})(n)}function XEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"}}]})(n)}function ZEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM7.83 16L5 13.17l1.41-1.41 1.41 1.41 3.54-3.54 1.41 1.41L7.83 16zm9.58-3L19 14.59 17.59 16 16 14.41 14.41 16 13 14.59 14.59 13 13 11.41 14.41 10 16 11.59 17.59 10 19 11.41 17.41 13z"}}]})(n)}function Pk(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20.41 8.41l-4.83-4.83c-.37-.37-.88-.58-1.41-.58H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.42zM7 7h7v2H7V7zm10 10H7v-2h10v2zm0-4H7v-2h10v2z"}}]})(n)}function F2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}}]})(n)}function B2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}]})(n)}function e0(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 8h-2v3h-3v2h3v3h2v-3h3v-2h-3zM2 12c0-2.79 1.64-5.2 4.01-6.32V3.52C2.52 4.76 0 8.09 0 12s2.52 7.24 6.01 8.48v-2.16A6.99 6.99 0 012 12zm13-9c-4.96 0-9 4.04-9 9s4.04 9 9 9 9-4.04 9-9-4.04-9-9-9zm0 16c-3.86 0-7-3.14-7-7s3.14-7 7-7 7 3.14 7 7-3.14 7-7 7z"}}]})(n)}function _F(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 000-1.41l-2.34-2.34a.996.996 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}]})(n)}function $2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}}]})(n)}function V2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}}]})(n)}function Yj(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}}]})(n)}function H2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2l-5.5 9h11z"}},{tag:"circle",attr:{cx:"17.5",cy:"17.5",r:"4.5"}},{tag:"path",attr:{d:"M3 13.5h8v8H3z"}}]})(n)}function EN(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.24 11.51l1.57-1.57-3.75-3.75-1.57 1.57-4.14-4.13c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l4.13 4.13L3 17.25V21h3.75l4.76-4.76 4.13 4.13c.95.95 2.23.6 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83l-4.13-4.13zm-7.06-.44L5.04 6.94l1.89-1.9L8.2 6.31 7.02 7.5l1.41 1.41 1.19-1.19 1.45 1.45-1.89 1.9zm7.88 7.89l-4.13-4.13 1.9-1.9 1.45 1.45-1.19 1.19 1.41 1.41 1.19-1.19 1.27 1.27-1.9 1.9zM20.71 7.04a.996.996 0 000-1.41l-2.34-2.34c-.47-.47-1.12-.29-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}]})(n)}function JEt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 10l5 5 5-5z"}}]})(n)}function W2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(n)}function z2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}}]})(n)}function t0(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}]})(n)}function U2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}},{tag:"path",attr:{fill:"none",d:"M24 24H0V0h24v24z"}}]})(n)}function j2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}}]})(n)}function ext(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M24 24H0V0h24z"}},{tag:"path",attr:{d:"M15.5 15.38V8.62L18.88 12l-3.38 3.38M14 19l7-7-7-7v14zm-4 0V5l-7 7 7 7z"}}]})(n)}function txt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0020 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 004 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}}]})(n)}function P9e(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}}]})(n)}function nxt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M22.61 18.99l-9.08-9.08c.93-2.34.45-5.1-1.44-7C9.79.61 6.21.4 3.66 2.26L7.5 6.11 6.08 7.52 2.25 3.69C.39 6.23.6 9.82 2.9 12.11c1.86 1.86 4.57 2.35 6.89 1.48l9.11 9.11c.39.39 1.02.39 1.41 0l2.3-2.3c.4-.38.4-1.01 0-1.41zm-3 1.6l-9.46-9.46c-.61.45-1.29.72-2 .82-1.36.2-2.79-.21-3.83-1.25C3.37 9.76 2.93 8.5 3 7.26l3.09 3.09 4.24-4.24-3.09-3.09c1.24-.07 2.49.37 3.44 1.31a4.469 4.469 0 011.24 3.96 4.35 4.35 0 01-.88 1.96l9.45 9.45-.88.89z"}}]})(n)}function wH(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}}]})(n)}function ixt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V5a2 2 0 00-2-2zm0 16H5V7h14v12zm-7-8.5c1.84 0 3.48.96 4.34 2.5-.86 1.54-2.5 2.5-4.34 2.5s-3.48-.96-4.34-2.5c.86-1.54 2.5-2.5 4.34-2.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4zm0 5.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"}}]})(n)}function rxt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 6h-2c0-2.21-1.79-4-4-4S8 3.79 8 6H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-6-2c1.1 0 2 .9 2 2h-4c0-1.1.9-2 2-2zm6 16H6V8h2v2c0 .55.45 1 1 1s1-.45 1-1V8h4v2c0 .55.45 1 1 1s1-.45 1-1V8h2v12z"}}]})(n)}function oxt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}}]})(n)}function M9e(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}}]})(n)}function sxt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h2v-2h2v-2h-2v-2h-2v2h-2z"}}]})(n)}function Ls(n){const[e,t]=w.useState(!0),i=ni();return p("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1},className:Nt(`border-l-4 py-2 ${n.className}`,{"bg-red-50 border-red-500":n.type==="danger","bg-yellow-50 border-yellow-500":n.type==="warning","bg-green-50 border-green-500":n.type==="success",block:e,hidden:!e}),children:p("div",{className:"mx-4",children:p("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1,borderColor:i.$4},className:Nt("text-sm",{"text-red-700":n.type==="danger","text-yellow-700":n.type==="warning","text-green-700":n.type==="success"}),children:N("div",{className:"flex items-center justify-between space-x-2",style:{backgroundColor:i.$1,borderColor:i.$4},children:[p("div",{className:"w-full break-all",style:{backgroundColor:i.$1,borderColor:i.$4},children:n.children}),!n.disableClosing&&p("button",{type:"button",children:p(kg,{onClick:()=>t(!1)})})]})})})})}var axt=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function lxt(n){var e=n.defaultInputValue,t=e===void 0?"":e,i=n.defaultMenuIsOpen,r=i===void 0?!1:i,o=n.defaultValue,s=o===void 0?null:o,a=n.inputValue,l=n.menuIsOpen,c=n.onChange,u=n.onInputChange,d=n.onMenuClose,h=n.onMenuOpen,f=n.value,g=Qu(n,axt),m=w.useState(a!==void 0?a:t),v=ln(m,2),_=v[0],b=v[1],y=w.useState(l!==void 0?l:r),C=ln(y,2),x=C[0],E=C[1],k=w.useState(f!==void 0?f:s),L=ln(k,2),D=L[0],A=L[1],O=w.useCallback(function(W,q){typeof c=="function"&&c(W,q),A(W)},[c]),P=w.useCallback(function(W,q){var H;typeof u=="function"&&(H=u(W,q)),b(H!==void 0?H:W)},[u]),F=w.useCallback(function(){typeof h=="function"&&h(),E(!0)},[h]),B=w.useCallback(function(){typeof d=="function"&&d(),E(!1)},[d]),M=a!==void 0?a:_,V=l!==void 0?l:x,U=f!==void 0?f:D;return ct(ct({},g),{},{inputValue:M,menuIsOpen:V,onChange:O,onInputChange:P,onMenuClose:B,onMenuOpen:F,value:U})}function cxt(n){if(Array.isArray(n))return kie(n)}function uxt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jr(n){return cxt(n)||G6e(n)||vpe(n)||uxt()}function dxt(n){if(n.sheet)return n.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===n)return document.styleSheets[e]}function hxt(n){var e=document.createElement("style");return e.setAttribute("data-emotion",n.key),n.nonce!==void 0&&e.setAttribute("nonce",n.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var fxt=function(){function n(t){var i=this;this._insertTag=function(r){var o;i.tags.length===0?i.insertionPoint?o=i.insertionPoint.nextSibling:i.prepend?o=i.container.firstChild:o=i.before:o=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(r,o),i.tags.push(r)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=n.prototype;return e.hydrate=function(i){i.forEach(this._insertTag)},e.insert=function(i){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(hxt(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=dxt(r);try{o.insertRule(i,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(i));this.ctr++},e.flush=function(){this.tags.forEach(function(i){return i.parentNode&&i.parentNode.removeChild(i)}),this.tags=[],this.ctr=0},n}(),Gd="-ms-",SH="-moz-",Ns="-webkit-",F9e="comm",fme="rule",pme="decl",pxt="@import",B9e="@keyframes",gxt="@layer",mxt=Math.abs,Qj=String.fromCharCode,_xt=Object.assign;function vxt(n,e){return gd(n,0)^45?(((e<<2^gd(n,0))<<2^gd(n,1))<<2^gd(n,2))<<2^gd(n,3):0}function $9e(n){return n.trim()}function bxt(n,e){return(n=e.exec(n))?n[0]:n}function Rs(n,e,t){return n.replace(e,t)}function Qre(n,e){return n.indexOf(e)}function gd(n,e){return n.charCodeAt(e)|0}function N4(n,e,t){return n.slice(e,t)}function tb(n){return n.length}function gme(n){return n.length}function v8(n,e){return e.push(n),n}function yxt(n,e){return n.map(e).join("")}var Xj=1,KD=1,V9e=0,Yf=0,Uc=0,xN="";function Zj(n,e,t,i,r,o,s){return{value:n,root:e,parent:t,type:i,props:r,children:o,line:Xj,column:KD,length:s,return:""}}function JR(n,e){return _xt(Zj("",null,null,"",null,null,0),n,{length:-n.length},e)}function Cxt(){return Uc}function wxt(){return Uc=Yf>0?gd(xN,--Yf):0,KD--,Uc===10&&(KD=1,Xj--),Uc}function ng(){return Uc=Yf<V9e?gd(xN,Yf++):0,KD++,Uc===10&&(KD=1,Xj++),Uc}function qb(){return gd(xN,Yf)}function g$(){return Yf}function vF(n,e){return N4(xN,n,e)}function R4(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function H9e(n){return Xj=KD=1,V9e=tb(xN=n),Yf=0,[]}function W9e(n){return xN="",n}function m$(n){return $9e(vF(Yf-1,Xre(n===91?n+2:n===40?n+1:n)))}function Sxt(n){for(;(Uc=qb())&&Uc<33;)ng();return R4(n)>2||R4(Uc)>3?"":" "}function Ext(n,e){for(;--e&&ng()&&!(Uc<48||Uc>102||Uc>57&&Uc<65||Uc>70&&Uc<97););return vF(n,g$()+(e<6&&qb()==32&&ng()==32))}function Xre(n){for(;ng();)switch(Uc){case n:return Yf;case 34:case 39:n!==34&&n!==39&&Xre(Uc);break;case 40:n===41&&Xre(n);break;case 92:ng();break}return Yf}function xxt(n,e){for(;ng()&&n+Uc!==47+10;)if(n+Uc===42+42&&qb()===47)break;return"/*"+vF(e,Yf-1)+"*"+Qj(n===47?n:ng())}function Txt(n){for(;!R4(qb());)ng();return vF(n,Yf)}function z9e(n){return W9e(_$("",null,null,null,[""],n=H9e(n),0,[0],n))}function _$(n,e,t,i,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,m=1,v=1,_=1,b=0,y="",C=r,x=o,E=i,k=y;v;)switch(g=b,b=ng()){case 40:if(g!=108&&gd(k,d-1)==58){Qre(k+=Rs(m$(b),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:k+=m$(b);break;case 9:case 10:case 13:case 32:k+=Sxt(g);break;case 92:k+=Ext(g$()-1,7);continue;case 47:switch(qb()){case 42:case 47:v8(kxt(xxt(ng(),g$()),e,t),l);break;default:k+="/"}break;case 123*m:a[c++]=tb(k)*_;case 125*m:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+u:_==-1&&(k=Rs(k,/\f/g,"")),f>0&&tb(k)-d&&v8(f>32?xTe(k+";",i,t,d-1):xTe(Rs(k," ","")+";",i,t,d-2),l);break;case 59:k+=";";default:if(v8(E=ETe(k,e,t,c,u,r,a,y,C=[],x=[],d),o),b===123)if(u===0)_$(k,e,E,E,C,o,d,a,x);else switch(h===99&&gd(k,3)===110?100:h){case 100:case 108:case 109:case 115:_$(n,E,E,i&&v8(ETe(n,E,E,0,0,r,a,y,r,C=[],d),x),r,x,d,a,i?C:x);break;default:_$(k,E,E,E,[""],x,0,a,x)}}c=u=f=0,m=_=1,y=k="",d=s;break;case 58:d=1+tb(k),f=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&wxt()==125)continue}switch(k+=Qj(b),b*m){case 38:_=u>0?1:(k+="\f",-1);break;case 44:a[c++]=(tb(k)-1)*_,_=1;break;case 64:qb()===45&&(k+=m$(ng())),h=qb(),u=d=tb(y=k+=Txt(g$())),b++;break;case 45:g===45&&tb(k)==2&&(m=0)}}return o}function ETe(n,e,t,i,r,o,s,a,l,c,u){for(var d=r-1,h=r===0?o:[""],f=gme(h),g=0,m=0,v=0;g<i;++g)for(var _=0,b=N4(n,d+1,d=mxt(m=s[g])),y=n;_<f;++_)(y=$9e(m>0?h[_]+" "+b:Rs(b,/&\f/g,h[_])))&&(l[v++]=y);return Zj(n,e,t,r===0?fme:a,l,c,u)}function kxt(n,e,t){return Zj(n,e,t,F9e,Qj(Cxt()),N4(n,2,-2),0)}function xTe(n,e,t,i){return Zj(n,e,t,pme,N4(n,0,i),N4(n,i+1,-1),i)}function sT(n,e){for(var t="",i=gme(n),r=0;r<i;r++)t+=e(n[r],r,n,e)||"";return t}function U9e(n,e,t,i){switch(n.type){case gxt:if(n.children.length)break;case pxt:case pme:return n.return=n.return||n.value;case F9e:return"";case B9e:return n.return=n.value+"{"+sT(n.children,i)+"}";case fme:n.value=n.props.join(",")}return tb(t=sT(n.children,i))?n.return=n.value+"{"+t+"}":""}function Ixt(n){var e=gme(n);return function(t,i,r,o){for(var s="",a=0;a<e;a++)s+=n[a](t,i,r,o)||"";return s}}function Lxt(n){return function(e){e.root||(e=e.return)&&n(e)}}var Dxt=function(e,t,i){for(var r=0,o=0;r=o,o=qb(),r===38&&o===12&&(t[i]=1),!R4(o);)ng();return vF(e,Yf)},Axt=function(e,t){var i=-1,r=44;do switch(R4(r)){case 0:r===38&&qb()===12&&(t[i]=1),e[i]+=Dxt(Yf-1,t,i);break;case 2:e[i]+=m$(r);break;case 4:if(r===44){e[++i]=qb()===58?"&\f":"",t[i]=e[i].length;break}default:e[i]+=Qj(r)}while(r=ng());return e},Nxt=function(e,t){return W9e(Axt(H9e(e),t))},TTe=new WeakMap,Rxt=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,i=e.parent,r=e.column===i.column&&e.line===i.line;i.type!=="rule";)if(i=i.parent,!i)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!TTe.get(i))&&!r){TTe.set(e,!0);for(var o=[],s=Nxt(t,o),a=i.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},Oxt=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function j9e(n,e){switch(vxt(n,e)){case 5103:return Ns+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ns+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return Ns+n+SH+n+Gd+n+n;case 6828:case 4268:return Ns+n+Gd+n+n;case 6165:return Ns+n+Gd+"flex-"+n+n;case 5187:return Ns+n+Rs(n,/(\w+).+(:[^]+)/,Ns+"box-$1$2"+Gd+"flex-$1$2")+n;case 5443:return Ns+n+Gd+"flex-item-"+Rs(n,/flex-|-self/,"")+n;case 4675:return Ns+n+Gd+"flex-line-pack"+Rs(n,/align-content|flex-|-self/,"")+n;case 5548:return Ns+n+Gd+Rs(n,"shrink","negative")+n;case 5292:return Ns+n+Gd+Rs(n,"basis","preferred-size")+n;case 6060:return Ns+"box-"+Rs(n,"-grow","")+Ns+n+Gd+Rs(n,"grow","positive")+n;case 4554:return Ns+Rs(n,/([^-])(transform)/g,"$1"+Ns+"$2")+n;case 6187:return Rs(Rs(Rs(n,/(zoom-|grab)/,Ns+"$1"),/(image-set)/,Ns+"$1"),n,"")+n;case 5495:case 3959:return Rs(n,/(image-set\([^]*)/,Ns+"$1$`$1");case 4968:return Rs(Rs(n,/(.+:)(flex-)?(.*)/,Ns+"box-pack:$3"+Gd+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ns+n+n;case 4095:case 3583:case 4068:case 2532:return Rs(n,/(.+)-inline(.+)/,Ns+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(tb(n)-1-e>6)switch(gd(n,e+1)){case 109:if(gd(n,e+4)!==45)break;case 102:return Rs(n,/(.+:)(.+)-([^]+)/,"$1"+Ns+"$2-$3$1"+SH+(gd(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~Qre(n,"stretch")?j9e(Rs(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(gd(n,e+1)!==115)break;case 6444:switch(gd(n,tb(n)-3-(~Qre(n,"!important")&&10))){case 107:return Rs(n,":",":"+Ns)+n;case 101:return Rs(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ns+(gd(n,14)===45?"inline-":"")+"box$3$1"+Ns+"$2$3$1"+Gd+"$2box$3")+n}break;case 5936:switch(gd(n,e+11)){case 114:return Ns+n+Gd+Rs(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Ns+n+Gd+Rs(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Ns+n+Gd+Rs(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Ns+n+Gd+n+n}return n}var Pxt=function(e,t,i,r){if(e.length>-1&&!e.return)switch(e.type){case pme:e.return=j9e(e.value,e.length);break;case B9e:return sT([JR(e,{value:Rs(e.value,"@","@"+Ns)})],r);case fme:if(e.length)return yxt(e.props,function(o){switch(bxt(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return sT([JR(e,{props:[Rs(o,/:(read-\w+)/,":"+SH+"$1")]})],r);case"::placeholder":return sT([JR(e,{props:[Rs(o,/:(plac\w+)/,":"+Ns+"input-$1")]}),JR(e,{props:[Rs(o,/:(plac\w+)/,":"+SH+"$1")]}),JR(e,{props:[Rs(o,/:(plac\w+)/,Gd+"input-$1")]})],r)}return""})}},Mxt=[Pxt],Fxt=function(e){var t=e.key;if(t==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(m){var v=m.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var r=e.stylisPlugins||Mxt,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(m){for(var v=m.getAttribute("data-emotion").split(" "),_=1;_<v.length;_++)o[v[_]]=!0;a.push(m)});var l,c=[Rxt,Oxt];{var u,d=[U9e,Lxt(function(m){u.insert(m)})],h=Ixt(c.concat(r,d)),f=function(v){return sT(z9e(v),h)};l=function(v,_,b,y){u=b,f(v?v+"{"+_.styles+"}":_.styles),y&&(g.inserted[_.name]=!0)}}var g={key:t,sheet:new fxt({key:t,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return g.sheet.hydrate(a),g},Bxt=!0;function $xt(n,e,t){var i="";return t.split(" ").forEach(function(r){n[r]!==void 0?e.push(n[r]+";"):i+=r+" "}),i}var q9e=function(e,t,i){var r=e.key+"-"+t.name;(i===!1||Bxt===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},Vxt=function(e,t,i){q9e(e,t,i);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function Hxt(n){for(var e=0,t,i=0,r=n.length;r>=4;++i,r-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var Wxt=/[A-Z]|^ms/g,zxt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,K9e=function(e){return e.charCodeAt(1)===45},kTe=function(e){return e!=null&&typeof e!="boolean"},wZ=xwt(function(n){return K9e(n)?n:n.replace(Wxt,"-$&").toLowerCase()}),ITe=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(zxt,function(i,r,o){return nb={name:r,styles:o,next:nb},r})}return o9e[e]!==1&&!K9e(e)&&typeof t=="number"&&t!==0?t+"px":t};function O4(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return nb={name:t.name,styles:t.styles,next:nb},t.name;if(t.styles!==void 0){var i=t.next;if(i!==void 0)for(;i!==void 0;)nb={name:i.name,styles:i.styles,next:nb},i=i.next;var r=t.styles+";";return r}return Uxt(n,e,t)}case"function":{if(n!==void 0){var o=nb,s=t(n);return nb=o,O4(n,e,s)}break}}if(e==null)return t;var a=e[t];return a!==void 0?a:t}function Uxt(n,e,t){var i="";if(Array.isArray(t))for(var r=0;r<t.length;r++)i+=O4(n,e,t[r])+";";else for(var o in t){var s=t[o];if(typeof s!="object")e!=null&&e[s]!==void 0?i+=o+"{"+e[s]+"}":kTe(s)&&(i+=wZ(o)+":"+ITe(o,s)+";");else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var a=0;a<s.length;a++)kTe(s[a])&&(i+=wZ(o)+":"+ITe(o,s[a])+";");else{var l=O4(n,e,s);switch(o){case"animation":case"animationName":{i+=wZ(o)+":"+l+";";break}default:i+=o+"{"+l+"}"}}}return i}var LTe=/label:\s*([^\s;\n{]+)\s*(;|$)/g,nb,G9e=function(e,t,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";nb=void 0;var s=e[0];s==null||s.raw===void 0?(r=!1,o+=O4(i,t,s)):o+=s[0];for(var a=1;a<e.length;a++)o+=O4(i,t,e[a]),r&&(o+=s[a]);LTe.lastIndex=0;for(var l="",c;(c=LTe.exec(o))!==null;)l+="-"+c[1];var u=Hxt(o)+l;return{name:u,styles:o,next:nb}},jxt=function(e){return e()},qxt=Am["useInsertionEffect"]?Am["useInsertionEffect"]:!1,Kxt=qxt||jxt,mme={}.hasOwnProperty,Y9e=w.createContext(typeof HTMLElement<"u"?Fxt({key:"css"}):null);Y9e.Provider;var Gxt=function(e){return w.forwardRef(function(t,i){var r=w.useContext(Y9e);return e(t,r,i)})},Yxt=w.createContext({}),Zre="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Qxt=function(e,t){var i={};for(var r in t)mme.call(t,r)&&(i[r]=t[r]);return i[Zre]=e,i},Xxt=function(e){var t=e.cache,i=e.serialized,r=e.isStringTag;return q9e(t,i,r),Kxt(function(){return Vxt(t,i,r)}),null},Zxt=Gxt(function(n,e,t){var i=n.css;typeof i=="string"&&e.registered[i]!==void 0&&(i=e.registered[i]);var r=n[Zre],o=[i],s="";typeof n.className=="string"?s=$xt(e.registered,o,n.className):n.className!=null&&(s=n.className+" ");var a=G9e(o,void 0,w.useContext(Yxt));s+=e.key+"-"+a.name;var l={};for(var c in n)mme.call(n,c)&&c!=="css"&&c!==Zre&&(l[c]=n[c]);return l.ref=t,l.className=s,w.createElement(w.Fragment,null,w.createElement(Xxt,{cache:e,serialized:a,isStringTag:typeof r=="string"}),w.createElement(r,l))}),Jxt=Zxt,Er=function(e,t){var i=arguments;if(t==null||!mme.call(t,"css"))return w.createElement.apply(void 0,i);var r=i.length,o=new Array(r);o[0]=Jxt,o[1]=Qxt(e,t);for(var s=2;s<r;s++)o[s]=i[s];return w.createElement.apply(null,o)};function _me(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return G9e(e)}var eTt=function(){var e=_me.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function tTt(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}const nTt=Math.min,iTt=Math.max,EH=Math.round,b8=Math.floor,xH=n=>({x:n,y:n});function rTt(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function Q9e(n){return Z9e(n)?(n.nodeName||"").toLowerCase():"#document"}function sv(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function X9e(n){var e;return(e=(Z9e(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Z9e(n){return n instanceof Node||n instanceof sv(n).Node}function Jre(n){return n instanceof Element||n instanceof sv(n).Element}function vme(n){return n instanceof HTMLElement||n instanceof sv(n).HTMLElement}function DTe(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof sv(n).ShadowRoot}function J9e(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=bme(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function oTt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function sTt(n){return["html","body","#document"].includes(Q9e(n))}function bme(n){return sv(n).getComputedStyle(n)}function aTt(n){if(Q9e(n)==="html")return n;const e=n.assignedSlot||n.parentNode||DTe(n)&&n.host||X9e(n);return DTe(e)?e.host:e}function e7e(n){const e=aTt(n);return sTt(e)?n.ownerDocument?n.ownerDocument.body:n.body:vme(e)&&J9e(e)?e:e7e(e)}function TH(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=e7e(n),o=r===((i=n.ownerDocument)==null?void 0:i.body),s=sv(r);return o?e.concat(s,s.visualViewport||[],J9e(r)?r:[],s.frameElement&&t?TH(s.frameElement):[]):e.concat(r,TH(r,[],t))}function lTt(n){const e=bme(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=vme(n),o=r?n.offsetWidth:t,s=r?n.offsetHeight:i,a=EH(t)!==o||EH(i)!==s;return a&&(t=o,i=s),{width:t,height:i,$:a}}function yme(n){return Jre(n)?n:n.contextElement}function SZ(n){const e=yme(n);if(!vme(e))return xH(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:o}=lTt(e);let s=(o?EH(t.width):t.width)/i,a=(o?EH(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cTt=xH(0);function uTt(n){const e=sv(n);return!oTt()||!e.visualViewport?cTt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dTt(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==sv(n)?!1:e}function ATe(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=yme(n);let s=xH(1);e&&(i?Jre(i)&&(s=SZ(i)):s=SZ(n));const a=dTt(o,t,i)?uTt(o):xH(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(o){const h=sv(o),f=i&&Jre(i)?sv(i):i;let g=h.frameElement;for(;g&&i&&f!==h;){const m=SZ(g),v=g.getBoundingClientRect(),_=bme(g),b=v.left+(g.clientLeft+parseFloat(_.paddingLeft))*m.x,y=v.top+(g.clientTop+parseFloat(_.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=y,g=sv(g).frameElement}}return rTt({width:u,height:d,x:l,y:c})}function hTt(n,e){let t=null,i;const r=X9e(n);function o(){clearTimeout(i),t&&t.disconnect(),t=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:d,height:h}=n.getBoundingClientRect();if(a||e(),!d||!h)return;const f=b8(u),g=b8(r.clientWidth-(c+d)),m=b8(r.clientHeight-(u+h)),v=b8(c),b={rootMargin:-f+"px "+-g+"px "+-m+"px "+-v+"px",threshold:iTt(0,nTt(1,l))||1};let y=!0;function C(x){const E=x[0].intersectionRatio;if(E!==l){if(!y)return s();E?s(!1,E):i=setTimeout(()=>{s(!1,1e-7)},100)}y=!1}try{t=new IntersectionObserver(C,{...b,root:r.ownerDocument})}catch{t=new IntersectionObserver(C,b)}t.observe(n)}return s(!0),o}function fTt(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=yme(n),u=r||o?[...c?TH(c):[],...TH(e)]:[];u.forEach(_=>{r&&_.addEventListener("scroll",t,{passive:!0}),o&&_.addEventListener("resize",t)});const d=c&&a?hTt(c,t):null;let h=-1,f=null;s&&(f=new ResizeObserver(_=>{let[b]=_;b&&b.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(e)})),t()}),c&&!l&&f.observe(c),f.observe(e));let g,m=l?ATe(n):null;l&&v();function v(){const _=ATe(n);m&&(_.x!==m.x||_.y!==m.y||_.width!==m.width||_.height!==m.height)&&t(),m=_,g=requestAnimationFrame(v)}return t(),()=>{u.forEach(_=>{r&&_.removeEventListener("scroll",t),o&&_.removeEventListener("resize",t)}),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(g)}}var eoe=w.useLayoutEffect,pTt=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],kH=function(){};function gTt(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function mTt(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),r=2;r<t;r++)i[r-2]=arguments[r];var o=[].concat(i);if(e&&n)for(var s in e)e.hasOwnProperty(s)&&e[s]&&o.push("".concat(gTt(n,s)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var NTe=function(e){return xTt(e)?e.filter(Boolean):Qr(e)==="object"&&e!==null?[e]:[]},t7e=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=Qu(e,pTt);return ct({},t)},nc=function(e,t,i){var r=e.cx,o=e.getStyles,s=e.getClassNames,a=e.className;return{css:o(t,e),className:r(i??{},s(t,e),a)}};function Jj(n){return[document.documentElement,document.body,window].indexOf(n)>-1}function _Tt(n){return Jj(n)?window.innerHeight:n.clientHeight}function n7e(n){return Jj(n)?window.pageYOffset:n.scrollTop}function IH(n,e){if(Jj(n)){window.scrollTo(0,e);return}n.scrollTop=e}function vTt(n){var e=getComputedStyle(n),t=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=n;r=r.parentElement;)if(e=getComputedStyle(r),!(t&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function bTt(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}function y8(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:kH,r=n7e(n),o=e-r,s=10,a=0;function l(){a+=s;var c=bTt(a,r,o,t);IH(n,c),a<t?window.requestAnimationFrame(l):i(n)}l()}function RTe(n,e){var t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetHeight/3;i.bottom+r>t.bottom?IH(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+r,n.scrollHeight)):i.top-r<t.top&&IH(n,Math.max(e.offsetTop-r,0))}function yTt(n){var e=n.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function OTe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function CTt(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var i7e=!1,wTt={get passive(){return i7e=!0}},C8=typeof window<"u"?window:{};C8.addEventListener&&C8.removeEventListener&&(C8.addEventListener("p",kH,wTt),C8.removeEventListener("p",kH,!1));var STt=i7e;function ETt(n){return n!=null}function xTt(n){return Array.isArray(n)}function w8(n,e,t){return n?e:t}var TTt=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];var o=Object.entries(e).filter(function(s){var a=ln(s,1),l=a[0];return!i.includes(l)});return o.reduce(function(s,a){var l=ln(a,2),c=l[0],u=l[1];return s[c]=u,s},{})},kTt=["children","innerProps"],ITt=["children","innerProps"];function LTt(n){var e=n.maxHeight,t=n.menuEl,i=n.minHeight,r=n.placement,o=n.shouldScroll,s=n.isFixedPosition,a=n.controlHeight,l=vTt(t),c={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,h=t.getBoundingClientRect(),f=h.bottom,g=h.height,m=h.top,v=t.offsetParent.getBoundingClientRect(),_=v.top,b=s?window.innerHeight:_Tt(l),y=n7e(l),C=parseInt(getComputedStyle(t).marginBottom,10),x=parseInt(getComputedStyle(t).marginTop,10),E=_-x,k=b-m,L=E+y,D=d-y-m,A=f-b+y+C,O=y+m-x,P=160;switch(r){case"auto":case"bottom":if(k>=g)return{placement:"bottom",maxHeight:e};if(D>=g&&!s)return o&&y8(l,A,P),{placement:"bottom",maxHeight:e};if(!s&&D>=i||s&&k>=i){o&&y8(l,A,P);var F=s?k-C:D-C;return{placement:"bottom",maxHeight:F}}if(r==="auto"||s){var B=e,M=s?E:L;return M>=i&&(B=Math.min(M-C-a,e)),{placement:"top",maxHeight:B}}if(r==="bottom")return o&&IH(l,A),{placement:"bottom",maxHeight:e};break;case"top":if(E>=g)return{placement:"top",maxHeight:e};if(L>=g&&!s)return o&&y8(l,O,P),{placement:"top",maxHeight:e};if(!s&&L>=i||s&&E>=i){var V=e;return(!s&&L>=i||s&&E>=i)&&(V=s?E-x:L-x),o&&y8(l,O,P),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function DTt(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var r7e=function(e){return e==="auto"?"bottom":e},ATt=function(e,t){var i,r=e.placement,o=e.theme,s=o.borderRadius,a=o.spacing,l=o.colors;return ct((i={label:"menu"},Ze(i,DTt(r),"100%"),Ze(i,"position","absolute"),Ze(i,"width","100%"),Ze(i,"zIndex",1),i),t?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},o7e=w.createContext(null),NTt=function(e){var t=e.children,i=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,s=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=w.useContext(o7e)||{},u=c.setPortalPlacement,d=w.useRef(null),h=w.useState(r),f=ln(h,2),g=f[0],m=f[1],v=w.useState(null),_=ln(v,2),b=_[0],y=_[1],C=l.spacing.controlHeight;return eoe(function(){var x=d.current;if(x){var E=s==="fixed",k=a&&!E,L=LTt({maxHeight:r,menuEl:x,minHeight:i,placement:o,shouldScroll:k,isFixedPosition:E,controlHeight:C});m(L.maxHeight),y(L.placement),u==null||u(L.placement)}},[r,o,s,a,i,u,C]),t({ref:d,placerProps:ct(ct({},e),{},{placement:b||r7e(o),maxHeight:g})})},RTt=function(e){var t=e.children,i=e.innerRef,r=e.innerProps;return Er("div",Ct({},nc(e,"menu",{menu:!0}),{ref:i},r),t)},OTt=RTt,PTt=function(e,t){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return ct({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},MTt=function(e){var t=e.children,i=e.innerProps,r=e.innerRef,o=e.isMulti;return Er("div",Ct({},nc(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),t)},s7e=function(e,t){var i=e.theme,r=i.spacing.baseUnit,o=i.colors;return ct({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},FTt=s7e,BTt=s7e,$Tt=function(e){var t=e.children,i=t===void 0?"No options":t,r=e.innerProps,o=Qu(e,kTt);return Er("div",Ct({},nc(ct(ct({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},VTt=function(e){var t=e.children,i=t===void 0?"Loading...":t,r=e.innerProps,o=Qu(e,ITt);return Er("div",Ct({},nc(ct(ct({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},HTt=function(e){var t=e.rect,i=e.offset,r=e.position;return{left:t.left,position:r,top:i,width:t.width,zIndex:1}},WTt=function(e){var t=e.appendTo,i=e.children,r=e.controlElement,o=e.innerProps,s=e.menuPlacement,a=e.menuPosition,l=w.useRef(null),c=w.useRef(null),u=w.useState(r7e(s)),d=ln(u,2),h=d[0],f=d[1],g=w.useMemo(function(){return{setPortalPlacement:f}},[]),m=w.useState(null),v=ln(m,2),_=v[0],b=v[1],y=w.useCallback(function(){if(r){var k=yTt(r),L=a==="fixed"?0:window.pageYOffset,D=k[h]+L;(D!==(_==null?void 0:_.offset)||k.left!==(_==null?void 0:_.rect.left)||k.width!==(_==null?void 0:_.rect.width))&&b({offset:D,rect:k})}},[r,a,h,_==null?void 0:_.offset,_==null?void 0:_.rect.left,_==null?void 0:_.rect.width]);eoe(function(){y()},[y]);var C=w.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=fTt(r,l.current,y,{elementResize:"ResizeObserver"in window}))},[r,y]);eoe(function(){C()},[C]);var x=w.useCallback(function(k){l.current=k,C()},[C]);if(!t&&a!=="fixed"||!_)return null;var E=Er("div",Ct({ref:x},nc(ct(ct({},e),{},{offset:_.offset,position:a,rect:_.rect}),"menuPortal",{"menu-portal":!0}),o),i);return Er(o7e.Provider,{value:g},t?sp.createPortal(E,t):E)},zTt=function(e){var t=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},UTt=function(e){var t=e.children,i=e.innerProps,r=e.isDisabled,o=e.isRtl;return Er("div",Ct({},nc(e,"container",{"--is-disabled":r,"--is-rtl":o}),i),t)},jTt=function(e,t){var i=e.theme.spacing,r=e.isMulti,o=e.hasValue,s=e.selectProps.controlShouldRenderValue;return ct({alignItems:"center",display:r&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},qTt=function(e){var t=e.children,i=e.innerProps,r=e.isMulti,o=e.hasValue;return Er("div",Ct({},nc(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),t)},KTt=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},GTt=function(e){var t=e.children,i=e.innerProps;return Er("div",Ct({},nc(e,"indicatorsContainer",{indicators:!0}),i),t)},PTe,YTt=["size"],QTt=["innerProps","isRtl","size"],XTt={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},a7e=function(e){var t=e.size,i=Qu(e,YTt);return Er("svg",Ct({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:XTt},i))},Cme=function(e){return Er(a7e,Ct({size:20},e),Er("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},l7e=function(e){return Er(a7e,Ct({size:20},e),Er("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},c7e=function(e,t){var i=e.isFocused,r=e.theme,o=r.spacing.baseUnit,s=r.colors;return ct({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:i?s.neutral60:s.neutral20,padding:o*2,":hover":{color:i?s.neutral80:s.neutral40}})},ZTt=c7e,JTt=function(e){var t=e.children,i=e.innerProps;return Er("div",Ct({},nc(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),t||Er(l7e,null))},ekt=c7e,tkt=function(e){var t=e.children,i=e.innerProps;return Er("div",Ct({},nc(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),t||Er(Cme,null))},nkt=function(e,t){var i=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,s=r.colors;return ct({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:i?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},ikt=function(e){var t=e.innerProps;return Er("span",Ct({},t,nc(e,"indicatorSeparator",{"indicator-separator":!0})))},rkt=eTt(PTe||(PTe=tTt([` 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } `]))),okt=function(e,t){var i=e.isFocused,r=e.size,o=e.theme,s=o.colors,a=o.spacing.baseUnit;return ct({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:i?s.neutral60:s.neutral20,padding:a*2})},EZ=function(e){var t=e.delay,i=e.offset;return Er("span",{css:_me({animation:"".concat(rkt," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},skt=function(e){var t=e.innerProps,i=e.isRtl,r=e.size,o=r===void 0?4:r,s=Qu(e,QTt);return Er("div",Ct({},nc(ct(ct({},s),{},{innerProps:t,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Er(EZ,{delay:0,offset:i}),Er(EZ,{delay:160,offset:!0}),Er(EZ,{delay:320,offset:!i}))},akt=function(e,t){var i=e.isDisabled,r=e.isFocused,o=e.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return ct({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:i?s.neutral5:s.neutral0,borderColor:i?s.neutral10:r?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:r?s.primary:s.neutral30}})},lkt=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,o=e.innerRef,s=e.innerProps,a=e.menuIsOpen;return Er("div",Ct({ref:o},nc(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":a}),s,{"aria-disabled":i||void 0}),t)},ckt=lkt,ukt=["data"],dkt=function(e,t){var i=e.theme.spacing;return t?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},hkt=function(e){var t=e.children,i=e.cx,r=e.getStyles,o=e.getClassNames,s=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return Er("div",Ct({},nc(e,"group",{group:!0}),l),Er(s,Ct({},a,{selectProps:d,theme:u,getStyles:r,getClassNames:o,cx:i}),c),Er("div",null,t))},fkt=function(e,t){var i=e.theme,r=i.colors,o=i.spacing;return ct({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},pkt=function(e){var t=t7e(e);t.data;var i=Qu(t,ukt);return Er("div",Ct({},nc(e,"groupHeading",{"group-heading":!0}),i))},gkt=hkt,mkt=["innerRef","isDisabled","isHidden","inputClassName"],_kt=function(e,t){var i=e.isDisabled,r=e.value,o=e.theme,s=o.spacing,a=o.colors;return ct(ct({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},vkt),t?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},u7e={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},vkt={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ct({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},u7e)},bkt=function(e){return ct({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},u7e)},ykt=function(e){var t=e.cx,i=e.value,r=t7e(e),o=r.innerRef,s=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=Qu(r,mkt);return Er("div",Ct({},nc(e,"input",{"input-container":!0}),{"data-value":i||""}),Er("input",Ct({className:t({input:!0},l),ref:o,style:bkt(a),disabled:s},c)))},Ckt=ykt,wkt=function(e,t){var i=e.theme,r=i.spacing,o=i.borderRadius,s=i.colors;return ct({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},Skt=function(e,t){var i=e.theme,r=i.borderRadius,o=i.colors,s=e.cropWithEllipsis;return ct({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Ekt=function(e,t){var i=e.theme,r=i.spacing,o=i.borderRadius,s=i.colors,a=e.isFocused;return ct({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},d7e=function(e){var t=e.children,i=e.innerProps;return Er("div",i,t)},xkt=d7e,Tkt=d7e;function kkt(n){var e=n.children,t=n.innerProps;return Er("div",Ct({role:"button"},t),e||Er(Cme,{size:14}))}var Ikt=function(e){var t=e.children,i=e.components,r=e.data,o=e.innerProps,s=e.isDisabled,a=e.removeProps,l=e.selectProps,c=i.Container,u=i.Label,d=i.Remove;return Er(c,{data:r,innerProps:ct(ct({},nc(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Er(u,{data:r,innerProps:ct({},nc(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),Er(d,{data:r,innerProps:ct(ct({},nc(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},Lkt=Ikt,Dkt=function(e,t){var i=e.isDisabled,r=e.isFocused,o=e.isSelected,s=e.theme,a=s.spacing,l=s.colors;return ct({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?l.primary:l.primary50}})},Akt=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,o=e.isSelected,s=e.innerRef,a=e.innerProps;return Er("div",Ct({},nc(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:s,"aria-disabled":i},a),t)},Nkt=Akt,Rkt=function(e,t){var i=e.theme,r=i.spacing,o=i.colors;return ct({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Okt=function(e){var t=e.children,i=e.innerProps;return Er("div",Ct({},nc(e,"placeholder",{placeholder:!0}),i),t)},Pkt=Okt,Mkt=function(e,t){var i=e.isDisabled,r=e.theme,o=r.spacing,s=r.colors;return ct({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:i?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Fkt=function(e){var t=e.children,i=e.isDisabled,r=e.innerProps;return Er("div",Ct({},nc(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),t)},Bkt=Fkt,$kt={ClearIndicator:tkt,Control:ckt,DropdownIndicator:JTt,DownChevron:l7e,CrossIcon:Cme,Group:gkt,GroupHeading:pkt,IndicatorsContainer:GTt,IndicatorSeparator:ikt,Input:Ckt,LoadingIndicator:skt,Menu:OTt,MenuList:MTt,MenuPortal:WTt,LoadingMessage:VTt,NoOptionsMessage:$Tt,MultiValue:Lkt,MultiValueContainer:xkt,MultiValueLabel:Tkt,MultiValueRemove:kkt,Option:Nkt,Placeholder:Pkt,SelectContainer:UTt,SingleValue:Bkt,ValueContainer:qTt},Vkt=function(e){return ct(ct({},$kt),e.components)},MTe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Hkt(n,e){return!!(n===e||MTe(n)&&MTe(e))}function Wkt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!Hkt(n[t],e[t]))return!1;return!0}function yu(n,e){e===void 0&&(e=Wkt);var t=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var s=n.apply(this,r);return t={lastResult:s,lastArgs:r,lastThis:this},s}return i.clear=function(){t=null},i}var zkt={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Ukt=function(e){return Er("span",Ct({css:zkt},e))},FTe=Ukt,jkt={guidance:function(e){var t=e.isSearchable,i=e.isMulti,r=e.isDisabled,o=e.tabSelectsValue,s=e.context;switch(s){case"menu":return"Use Up and Down to choose options".concat(r?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(o?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,i=e.label,r=i===void 0?"":i,o=e.labels,s=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,i=e.focused,r=e.options,o=e.label,s=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,c=e.isSelected,u=function(g,m){return g&&g.length?"".concat(g.indexOf(m)+1," of ").concat(g.length):""};if(t==="value"&&a)return"value ".concat(s," focused, ").concat(u(a,i),".");if(t==="menu"){var d=l?" disabled":"",h="".concat(c?"selected":"focused").concat(d);return"option ".concat(s," ").concat(h,", ").concat(u(r,i),".")}return""},onFilter:function(e){var t=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(t?" for search term "+t:"",".")}},qkt=function(e){var t=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,s=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,u=l.ariaLiveMessages,d=l.getOptionLabel,h=l.inputValue,f=l.isMulti,g=l.isOptionDisabled,m=l.isSearchable,v=l.menuIsOpen,_=l.options,b=l.screenReaderStatus,y=l.tabSelectsValue,C=l["aria-label"],x=l["aria-live"],E=w.useMemo(function(){return ct(ct({},jkt),u||{})},[u]),k=w.useMemo(function(){var B="";if(t&&E.onChange){var M=t.option,V=t.options,U=t.removedValue,W=t.removedValues,q=t.value,H=function(ke){return Array.isArray(ke)?null:ke},ie=U||M||H(q),se=ie?d(ie):"",Q=V||W||void 0,Ee=Q?Q.map(d):[],Fe=ct({isDisabled:ie&&g(ie,a),label:se,labels:Ee},t);B=E.onChange(Fe)}return B},[t,E,g,a,d]),L=w.useMemo(function(){var B="",M=i||r,V=!!(i&&a&&a.includes(i));if(M&&E.onFocus){var U={focused:M,label:d(M),isDisabled:g(M,a),isSelected:V,options:o,context:M===i?"menu":"value",selectValue:a};B=E.onFocus(U)}return B},[i,r,d,g,E,o,a]),D=w.useMemo(function(){var B="";if(v&&_.length&&E.onFilter){var M=b({count:o.length});B=E.onFilter({inputValue:h,resultsMessage:M})}return B},[o,h,v,E,_,b]),A=w.useMemo(function(){var B="";if(E.guidance){var M=r?"value":v?"menu":"input";B=E.guidance({"aria-label":C,context:M,isDisabled:i&&g(i,a),isMulti:f,isSearchable:m,tabSelectsValue:y})}return B},[C,i,r,f,g,m,v,E,a,y]),O="".concat(L," ").concat(D," ").concat(A),P=Er(w.Fragment,null,Er("span",{id:"aria-selection"},k),Er("span",{id:"aria-context"},O)),F=(t==null?void 0:t.action)==="initial-input-focus";return Er(w.Fragment,null,Er(FTe,{id:c},F&&P),Er(FTe,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text"},s&&!F&&P))},Kkt=qkt,toe=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Gkt=new RegExp("["+toe.map(function(n){return n.letters}).join("")+"]","g"),h7e={};for(var xZ=0;xZ<toe.length;xZ++)for(var TZ=toe[xZ],kZ=0;kZ<TZ.letters.length;kZ++)h7e[TZ.letters[kZ]]=TZ.base;var f7e=function(e){return e.replace(Gkt,function(t){return h7e[t]})},Ykt=yu(f7e),BTe=function(e){return e.replace(/^\s+|\s+$/g,"")},Qkt=function(e){return"".concat(e.label," ").concat(e.value)},Xkt=function(e){return function(t,i){if(t.data.__isNew__)return!0;var r=ct({ignoreCase:!0,ignoreAccents:!0,stringify:Qkt,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,s=r.ignoreAccents,a=r.stringify,l=r.trim,c=r.matchFrom,u=l?BTe(i):i,d=l?BTe(a(t)):a(t);return o&&(u=u.toLowerCase(),d=d.toLowerCase()),s&&(u=Ykt(u),d=f7e(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},Zkt=["innerRef"];function Jkt(n){var e=n.innerRef,t=Qu(n,Zkt),i=TTt(t,"onExited","in","enter","exit","appear");return Er("input",Ct({ref:e},i,{css:_me({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var eIt=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function tIt(n){var e=n.isEnabled,t=n.onBottomArrive,i=n.onBottomLeave,r=n.onTopArrive,o=n.onTopLeave,s=w.useRef(!1),a=w.useRef(!1),l=w.useRef(0),c=w.useRef(null),u=w.useCallback(function(v,_){if(c.current!==null){var b=c.current,y=b.scrollTop,C=b.scrollHeight,x=b.clientHeight,E=c.current,k=_>0,L=C-x-y,D=!1;L>_&&s.current&&(i&&i(v),s.current=!1),k&&a.current&&(o&&o(v),a.current=!1),k&&_>L?(t&&!s.current&&t(v),E.scrollTop=C,D=!0,s.current=!0):!k&&-_>y&&(r&&!a.current&&r(v),E.scrollTop=0,D=!0,a.current=!0),D&&eIt(v)}},[t,i,r,o]),d=w.useCallback(function(v){u(v,v.deltaY)},[u]),h=w.useCallback(function(v){l.current=v.changedTouches[0].clientY},[]),f=w.useCallback(function(v){var _=l.current-v.changedTouches[0].clientY;u(v,_)},[u]),g=w.useCallback(function(v){if(v){var _=STt?{passive:!1}:!1;v.addEventListener("wheel",d,_),v.addEventListener("touchstart",h,_),v.addEventListener("touchmove",f,_)}},[f,h,d]),m=w.useCallback(function(v){v&&(v.removeEventListener("wheel",d,!1),v.removeEventListener("touchstart",h,!1),v.removeEventListener("touchmove",f,!1))},[f,h,d]);return w.useEffect(function(){if(e){var v=c.current;return g(v),function(){m(v)}}},[e,g,m]),function(v){c.current=v}}var $Te=["boxSizing","height","overflow","paddingRight","position"],VTe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function HTe(n){n.preventDefault()}function WTe(n){n.stopPropagation()}function zTe(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function UTe(){return"ontouchstart"in window||navigator.maxTouchPoints}var jTe=!!(typeof window<"u"&&window.document&&window.document.createElement),eO=0,$I={capture:!1,passive:!1};function nIt(n){var e=n.isEnabled,t=n.accountForScrollbars,i=t===void 0?!0:t,r=w.useRef({}),o=w.useRef(null),s=w.useCallback(function(l){if(jTe){var c=document.body,u=c&&c.style;if(i&&$Te.forEach(function(g){var m=u&&u[g];r.current[g]=m}),i&&eO<1){var d=parseInt(r.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,f=window.innerWidth-h+d||0;Object.keys(VTe).forEach(function(g){var m=VTe[g];u&&(u[g]=m)}),u&&(u.paddingRight="".concat(f,"px"))}c&&UTe()&&(c.addEventListener("touchmove",HTe,$I),l&&(l.addEventListener("touchstart",zTe,$I),l.addEventListener("touchmove",WTe,$I))),eO+=1}},[i]),a=w.useCallback(function(l){if(jTe){var c=document.body,u=c&&c.style;eO=Math.max(eO-1,0),i&&eO<1&&$Te.forEach(function(d){var h=r.current[d];u&&(u[d]=h)}),c&&UTe()&&(c.removeEventListener("touchmove",HTe,$I),l&&(l.removeEventListener("touchstart",zTe,$I),l.removeEventListener("touchmove",WTe,$I)))}},[i]);return w.useEffect(function(){if(e){var l=o.current;return s(l),function(){a(l)}}},[e,s,a]),function(l){o.current=l}}var iIt=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},rIt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oIt(n){var e=n.children,t=n.lockEnabled,i=n.captureEnabled,r=i===void 0?!0:i,o=n.onBottomArrive,s=n.onBottomLeave,a=n.onTopArrive,l=n.onTopLeave,c=tIt({isEnabled:r,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),u=nIt({isEnabled:t}),d=function(f){c(f),u(f)};return Er(w.Fragment,null,t&&Er("div",{onClick:iIt,css:rIt}),e(d))}var sIt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},aIt=function(e){var t=e.name,i=e.onFocus;return Er("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:sIt,value:"",onChange:function(){}})},lIt=aIt,cIt=function(e){return e.label},uIt=function(e){return e.label},dIt=function(e){return e.value},hIt=function(e){return!!e.isDisabled},fIt={clearIndicator:ekt,container:zTt,control:akt,dropdownIndicator:ZTt,group:dkt,groupHeading:fkt,indicatorsContainer:KTt,indicatorSeparator:nkt,input:_kt,loadingIndicator:okt,loadingMessage:BTt,menu:ATt,menuList:PTt,menuPortal:HTt,multiValue:wkt,multiValueLabel:Skt,multiValueRemove:Ekt,noOptionsMessage:FTt,option:Dkt,placeholder:Rkt,singleValue:Mkt,valueContainer:jTt},pIt={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},gIt=4,p7e=4,mIt=38,_It=p7e*2,vIt={baseUnit:p7e,controlHeight:mIt,menuGutter:_It},IZ={borderRadius:gIt,colors:pIt,spacing:vIt},bIt={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:OTe(),captureMenuScroll:!OTe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Xkt(),formatGroupLabel:cIt,getOptionLabel:uIt,getOptionValue:dIt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:hIt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!CTt(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function qTe(n,e,t,i){var r=v7e(n,e,t),o=b7e(n,e,t),s=_7e(n,e),a=LH(n,e);return{type:"option",data:e,isDisabled:r,isSelected:o,label:s,value:a,index:i}}function g7e(n,e){return n.options.map(function(t,i){if("options"in t){var r=t.options.map(function(s,a){return qTe(n,s,e,a)}).filter(function(s){return KTe(n,s)});return r.length>0?{type:"group",data:t,options:r,index:i}:void 0}var o=qTe(n,t,e,i);return KTe(n,o)?o:void 0}).filter(ETt)}function m7e(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,Jr(t.options.map(function(i){return i.data}))):e.push(t.data),e},[])}function yIt(n,e){return m7e(g7e(n,e))}function KTe(n,e){var t=n.inputValue,i=t===void 0?"":t,r=e.data,o=e.isSelected,s=e.label,a=e.value;return(!C7e(n)||!o)&&y7e(n,{label:s,value:a,data:r},i)}function CIt(n,e){var t=n.focusedValue,i=n.selectValue,r=i.indexOf(t);if(r>-1){var o=e.indexOf(t);if(o>-1)return t;if(r<e.length)return e[r]}return null}function wIt(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var _7e=function(e,t){return e.getOptionLabel(t)},LH=function(e,t){return e.getOptionValue(t)};function v7e(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function b7e(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var i=LH(n,e);return t.some(function(r){return LH(n,r)===i})}function y7e(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var C7e=function(e){var t=e.hideSelectedOptions,i=e.isMulti;return t===void 0?i:t},SIt=1,w7e=function(n){xv(t,n);var e=Ok(t);function t(i){var r;if(El(this,t),r=e.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,l){var c=r.props,u=c.onChange,d=c.name;l.name=d,r.ariaOnChange(a,l),u(a,l)},r.setValue=function(a,l,c){var u=r.props,d=u.closeMenuOnSelect,h=u.isMulti,f=u.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:f}),d&&(r.setState({inputIsHiddenAfterUpdate:!h}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(a,{action:l,option:c})},r.selectOption=function(a){var l=r.props,c=l.blurInputOnSelect,u=l.isMulti,d=l.name,h=r.state.selectValue,f=u&&r.isOptionSelected(a,h),g=r.isOptionDisabled(a,h);if(f){var m=r.getOptionValue(a);r.setValue(h.filter(function(v){return r.getOptionValue(v)!==m}),"deselect-option",a)}else if(!g)u?r.setValue([].concat(Jr(h),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:d});return}c&&r.blurInput()},r.removeValue=function(a){var l=r.props.isMulti,c=r.state.selectValue,u=r.getOptionValue(a),d=c.filter(function(f){return r.getOptionValue(f)!==u}),h=w8(l,d,d[0]||null);r.onChange(h,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(w8(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,l=r.state.selectValue,c=l[l.length-1],u=l.slice(0,l.length-1),d=w8(a,u,u[0]||null);r.onChange(d,{action:"pop-value",removedValue:c})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return mTt.apply(void 0,[r.props.classNamePrefix].concat(l))},r.getOptionLabel=function(a){return _7e(r.props,a)},r.getOptionValue=function(a){return LH(r.props,a)},r.getStyles=function(a,l){var c=r.props.unstyled,u=fIt[a](l,c);u.boxSizing="border-box";var d=r.props.styles[a];return d?d(u,l):u},r.getClassNames=function(a,l){var c,u;return(c=(u=r.props.classNames)[a])===null||c===void 0?void 0:c.call(u,l)},r.getElementId=function(a){return"".concat(r.instancePrefix,"-").concat(a)},r.getComponents=function(){return Vkt(r.props)},r.buildCategorizedOptions=function(){return g7e(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return m7e(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,l){r.setState({ariaSelection:ct({value:a},l)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var l=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():l&&r.openMenu("first"):(l&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.button!==0)&&!r.props.isDisabled){var l=r.props,c=l.isMulti,u=l.menuIsOpen;r.focusInput(),u?(r.setState({inputIsHiddenAfterUpdate:!c}),r.onMenuClose()):r.openMenu("first"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&Jj(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var l=a.touches,c=l&&l.item(0);c&&(r.initialTouchX=c.clientX,r.initialTouchY=c.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var l=a.touches,c=l&&l.item(0);if(c){var u=Math.abs(c.clientX-r.initialTouchX),d=Math.abs(c.clientY-r.initialTouchY),h=5;r.userIsDragging=u>h||d>h}},r.onTouchEnd=function(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var l=r.props.inputValue,c=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(c,{action:"input-change",prevInputValue:l}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var l=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:l}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){r.blockOptionHover||r.state.focusedOption===a||r.setState({focusedOption:a})},r.shouldHideSelectedOptions=function(){return C7e(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){var l=r.props,c=l.isMulti,u=l.backspaceRemovesValue,d=l.escapeClearsValue,h=l.inputValue,f=l.isClearable,g=l.isDisabled,m=l.menuIsOpen,v=l.onKeyDown,_=l.tabSelectsValue,b=l.openMenuOnFocus,y=r.state,C=y.focusedOption,x=y.focusedValue,E=y.selectValue;if(!g&&!(typeof v=="function"&&(v(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.key){case"ArrowLeft":if(!c||h)return;r.focusValue("previous");break;case"ArrowRight":if(!c||h)return;r.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)r.removeValue(x);else{if(!u)return;c?r.popValue():f&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!m||!_||!C||b&&r.isOptionSelected(C,E))return;r.selectOption(C);break;case"Enter":if(a.keyCode===229)break;if(m){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":m?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:h}),r.onMenuClose()):f&&d&&r.clearValue();break;case" ":if(h)return;if(!m){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":m?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":m?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!m)return;r.focusOption("pageup");break;case"PageDown":if(!m)return;r.focusOption("pagedown");break;case"Home":if(!m)return;r.focusOption("first");break;case"End":if(!m)return;r.focusOption("last");break;default:return}a.preventDefault()}},r.instancePrefix="react-select-"+(r.props.instanceId||++SIt),r.state.selectValue=NTe(i.value),i.menuIsOpen&&r.state.selectValue.length){var o=r.buildFocusableOptions(),s=o.indexOf(r.state.selectValue[0]);r.state.focusedOption=o[s]}return r}return xl(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&RTe(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&s&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(RTe(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(a[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[u]},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var c=s.length-1,u=-1;if(s.length){switch(r){case"previous":l===0?u=0:l===-1?u=c:u=l-1;break;case"next":l>-1&&l<c&&(u=l+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:s[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(s);s||(c=-1),r==="up"?l=c>0?c-1:a.length-1:r==="down"?l=(c+1)%a.length:r==="pageup"?(l=c-o,l<0&&(l=0)):r==="pagedown"?(l=c+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(IZ):ct(ct({},IZ),this.props.theme):IZ}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,h=d.isMulti,f=d.isRtl,g=d.options,m=this.hasValue();return{clearValue:r,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:m,isMulti:h,isRtl:f,options:g,selectOption:c,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,s=r.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(r,o){return v7e(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return b7e(this.props,r,o)}},{key:"filterOption",value:function(r,o){return y7e(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,s=r.isSearchable,a=r.inputId,l=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,h=r.required,f=this.getComponents(),g=f.Input,m=this.state,v=m.inputIsHidden,_=m.ariaSelection,b=this.commonProps,y=a||this.getElementId("input"),C=ct(ct(ct({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox"},d&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?(_==null?void 0:_.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?w.createElement(g,Ct({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:y,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},C)):w.createElement(Jkt,Ct({id:y,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:kH,onFocus:this.onInputFocus,disabled:o,tabIndex:c,inputMode:"none",form:u,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,c=o.MultiValueRemove,u=o.SingleValue,d=o.Placeholder,h=this.commonProps,f=this.props,g=f.controlShouldRenderValue,m=f.isDisabled,v=f.isMulti,_=f.inputValue,b=f.placeholder,y=this.state,C=y.selectValue,x=y.focusedValue,E=y.isFocused;if(!this.hasValue()||!g)return _?null:w.createElement(d,Ct({},h,{key:"placeholder",isDisabled:m,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return C.map(function(L,D){var A=L===x,O="".concat(r.getOptionLabel(L),"-").concat(r.getOptionValue(L));return w.createElement(s,Ct({},h,{components:{Container:a,Label:l,Remove:c},isFocused:A,isDisabled:m,key:O,index:D,removeProps:{onClick:function(){return r.removeValue(L)},onTouchEnd:function(){return r.removeValue(L)},onMouseDown:function(F){F.preventDefault()}},data:L}),r.formatOptionLabel(L,"value"))});if(_)return null;var k=C[0];return w.createElement(u,Ct({},h,{data:k,isDisabled:m}),this.formatOptionLabel(k,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return w.createElement(o,Ct({},s,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!o||!c)return null;var d={"aria-hidden":"true"};return w.createElement(o,Ct({},s,{innerProps:d,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,s=r.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return w.createElement(s,Ct({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return w.createElement(o,Ct({},s,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,c=o.MenuList,u=o.MenuPortal,d=o.LoadingMessage,h=o.NoOptionsMessage,f=o.Option,g=this.commonProps,m=this.state.focusedOption,v=this.props,_=v.captureMenuScroll,b=v.inputValue,y=v.isLoading,C=v.loadingMessage,x=v.minMenuHeight,E=v.maxMenuHeight,k=v.menuIsOpen,L=v.menuPlacement,D=v.menuPosition,A=v.menuPortalTarget,O=v.menuShouldBlockScroll,P=v.menuShouldScrollIntoView,F=v.noOptionsMessage,B=v.onMenuScrollToTop,M=v.onMenuScrollToBottom;if(!k)return null;var V=function(Q,Ee){var Fe=Q.type,He=Q.data,ke=Q.isDisabled,Me=Q.isSelected,je=Q.label,qe=Q.value,Be=m===He,_t=ke?void 0:function(){return r.onOptionHover(He)},Wt=ke?void 0:function(){return r.selectOption(He)},Tt="".concat(r.getElementId("option"),"-").concat(Ee),rn={id:Tt,onClick:Wt,onMouseMove:_t,onMouseOver:_t,tabIndex:-1};return w.createElement(f,Ct({},g,{innerProps:rn,data:He,isDisabled:ke,isSelected:Me,key:Tt,label:je,type:Fe,value:qe,isFocused:Be,innerRef:Be?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(Q.data,"menu"))},U;if(this.hasOptions())U=this.getCategorizedOptions().map(function(se){if(se.type==="group"){var Q=se.data,Ee=se.options,Fe=se.index,He="".concat(r.getElementId("group"),"-").concat(Fe),ke="".concat(He,"-heading");return w.createElement(s,Ct({},g,{key:He,data:Q,options:Ee,Heading:a,headingProps:{id:ke,data:se.data},label:r.formatGroupLabel(se.data)}),se.options.map(function(Me){return V(Me,"".concat(Fe,"-").concat(Me.index))}))}else if(se.type==="option")return V(se,"".concat(se.index))});else if(y){var W=C({inputValue:b});if(W===null)return null;U=w.createElement(d,g,W)}else{var q=F({inputValue:b});if(q===null)return null;U=w.createElement(h,g,q)}var H={minMenuHeight:x,maxMenuHeight:E,menuPlacement:L,menuPosition:D,menuShouldScrollIntoView:P},ie=w.createElement(NTt,Ct({},g,H),function(se){var Q=se.ref,Ee=se.placerProps,Fe=Ee.placement,He=Ee.maxHeight;return w.createElement(l,Ct({},g,H,{innerRef:Q,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove,id:r.getElementId("listbox")},isLoading:y,placement:Fe}),w.createElement(oIt,{captureEnabled:_,onTopArrive:B,onBottomArrive:M,lockEnabled:O},function(ke){return w.createElement(c,Ct({},g,{innerRef:function(je){r.getMenuListRef(je),ke(je)},isLoading:y,maxHeight:He,focusedOption:m}),U)}))});return A||D==="fixed"?w.createElement(u,Ct({},g,{appendTo:A,controlElement:this.controlRef,menuPlacement:L,menuPosition:D}),ie):ie}},{key:"renderFormField",value:function(){var r=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,c=o.name,u=o.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!a)return w.createElement(lIt,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(s){var h=d.map(function(m){return r.getOptionValue(m)}).join(s);return w.createElement("input",{name:c,type:"hidden",value:h})}else{var f=d.length>0?d.map(function(m,v){return w.createElement("input",{key:"i-".concat(v),name:c,type:"hidden",value:r.getOptionValue(m)})}):w.createElement("input",{name:c,type:"hidden",value:""});return w.createElement("div",null,f)}else{var g=d[0]?this.getOptionValue(d[0]):"";return w.createElement("input",{name:c,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,c=o.isFocused,u=o.selectValue,d=this.getFocusableOptions();return w.createElement(Kkt,Ct({},r,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:c,selectValue:u,focusableOptions:d}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,s=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,c=this.props,u=c.className,d=c.id,h=c.isDisabled,f=c.menuIsOpen,g=this.state.isFocused,m=this.commonProps=this.getCommonProps();return w.createElement(a,Ct({},m,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:g}),this.renderLiveRegion(),w.createElement(o,Ct({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:g,menuIsOpen:f}),w.createElement(l,Ct({},m,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),w.createElement(s,Ct({},m,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,c=o.ariaSelection,u=o.isFocused,d=o.prevWasFocused,h=r.options,f=r.value,g=r.menuIsOpen,m=r.inputValue,v=r.isMulti,_=NTe(f),b={};if(s&&(f!==s.value||h!==s.options||g!==s.menuIsOpen||m!==s.inputValue)){var y=g?yIt(r,_):[],C=a?CIt(o,_):null,x=wIt(o,y);b={selectValue:_,focusedOption:x,focusedValue:C,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},k=c,L=u&&d;return u&&!L&&(k={value:w8(v,_,_[0]||null),options:_,action:"initial-input-focus"},L=!d),(c==null?void 0:c.action)==="initial-input-focus"&&(k=null),ct(ct(ct({},b),E),{},{prevProps:r,ariaSelection:k,prevWasFocused:L})}}]),t}(w.Component);w7e.defaultProps=bIt;var EIt=w.forwardRef(function(n,e){var t=lxt(n);return w.createElement(w7e,Ct({ref:e},t))}),mv=EIt;function Cn(n){const e=ni(),{blankOptionValue:t,withBlank:i,children:r,value:o,defaultValue:s,customSelector:a,onValueChange:l,className:c,disabled:u,cypressRef:d,dismissable:h=!0,clearAfterSelection:f}=n,g=p("option",{value:t??""}),m=ae.Children.map([i?g:[],r],y=>w.isValidElement(y)&&{label:Array.isArray(y.props.children)?y.props.children.join(""):y.props.children,value:y.props.value}),v=m==null?void 0:m.find(y=>y.value===o),_=m==null?void 0:m.find(y=>y.value===s),b={input:y=>({...y,color:e.$3}),singleValue:y=>({...y,color:e.$3}),menu:y=>({...y,width:"max-content",minWidth:"100%",backgroundColor:e.$4,borderColor:e.$4,zIndex:50}),control:(y,{isDisabled:C})=>({...y,borderRadius:"3px",backgroundColor:e.$1,color:e.$3,borderColor:e.$5,cursor:C?"not-allowed":"pointer",pointerEvents:C?"auto":"unset"}),option:(y,{isSelected:C,isFocused:x})=>({...y,display:"flex",alignItems:"center",color:e.$3,backgroundColor:C||x?e.$7:e.$1,":hover":{backgroundColor:e.$7},minHeight:"1.875rem"})};return N("div",{className:Nt({"space-y-2":!!a}),children:[n.label&&N(pg,{className:"mb-2",for:n.id,children:[n.label,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),a?p(mv,{className:c,options:m,defaultValue:_,value:f?{label:"",value:""}:v,onChange:y=>y===null?l==null?void 0:l(t??""):l==null?void 0:l(y.value),isDisabled:u,styles:b,isSearchable:!0,isClearable:!!(h&&(v!=null&&v.value)&&(v==null?void 0:v.value)!==t),"data-cy":d}):N("select",{onChange:y=>{n.onValueChange&&n.onValueChange(y.target.value),n.onChange&&n.onChange(y)},id:n.id,className:Nt(`w-full py-2 rounded text-sm border disabled:cursor-not-allowed ${n.className}`),defaultValue:n.defaultValue,value:n.value,ref:n.innerRef,disabled:n.disabled,style:{backgroundColor:e.$1,borderColor:e.$5,color:e.$3,...n.style},"data-cy":n.cypressRef,children:[n.withBlank&&p("option",{value:n.blankOptionValue??""}),n.children]}),n.errorMessage&&p(Ls,{className:"mt-2",type:"danger",children:n.errorMessage})]})}const xIt=Oo(null);var eq={},TIt="Expected a function",GTe=0/0,kIt="[object Symbol]",IIt=/^\s+|\s+$/g,LIt=/^[-+]0x[0-9a-f]+$/i,DIt=/^0b[01]+$/i,AIt=/^0o[0-7]+$/i,NIt=parseInt,RIt=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,OIt=typeof self=="object"&&self&&self.Object===Object&&self,PIt=RIt||OIt||Function("return this")(),MIt=Object.prototype,FIt=MIt.toString,BIt=Math.max,$It=Math.min,LZ=function(){return PIt.Date.now()};function VIt(n,e,t){var i,r,o,s,a,l,c=0,u=!1,d=!1,h=!0;if(typeof n!="function")throw new TypeError(TIt);e=YTe(e)||0,noe(t)&&(u=!!t.leading,d="maxWait"in t,o=d?BIt(YTe(t.maxWait)||0,e):o,h="trailing"in t?!!t.trailing:h);function f(E){var k=i,L=r;return i=r=void 0,c=E,s=n.apply(L,k),s}function g(E){return c=E,a=setTimeout(_,e),u?f(E):s}function m(E){var k=E-l,L=E-c,D=e-k;return d?$It(D,o-L):D}function v(E){var k=E-l,L=E-c;return l===void 0||k>=e||k<0||d&&L>=o}function _(){var E=LZ();if(v(E))return b(E);a=setTimeout(_,m(E))}function b(E){return a=void 0,h&&i?f(E):(i=r=void 0,s)}function y(){a!==void 0&&clearTimeout(a),c=0,i=l=r=a=void 0}function C(){return a===void 0?s:b(LZ())}function x(){var E=LZ(),k=v(E);if(i=arguments,r=this,l=E,k){if(a===void 0)return g(l);if(d)return a=setTimeout(_,e),f(l)}return a===void 0&&(a=setTimeout(_,e)),s}return x.cancel=y,x.flush=C,x}function noe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function HIt(n){return!!n&&typeof n=="object"}function WIt(n){return typeof n=="symbol"||HIt(n)&&FIt.call(n)==kIt}function YTe(n){if(typeof n=="number")return n;if(WIt(n))return GTe;if(noe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=noe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(IIt,"");var t=DIt.test(n);return t||AIt.test(n)?NIt(n.slice(2),t?2:8):LIt.test(n)?GTe:+n}var zIt=VIt;function ioe(n){"@babel/helpers - typeof";return ioe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ioe(n)}Object.defineProperty(eq,"__esModule",{value:!0});eq.DebounceInput=void 0;var QTe=S7e(w),UIt=S7e(zIt),jIt=["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"];function S7e(n){return n&&n.__esModule?n:{default:n}}function qIt(n,e){if(n==null)return{};var t=KIt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function KIt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function XTe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Gg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?XTe(Object(t),!0).forEach(function(i){TC(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):XTe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function GIt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ZTe(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function YIt(n,e,t){return e&&ZTe(n.prototype,e),t&&ZTe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function QIt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&roe(n,e)}function roe(n,e){return roe=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},roe(n,e)}function XIt(n){var e=JIt();return function(){var i=DH(n),r;if(e){var o=DH(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ZIt(this,r)}}function ZIt(n,e){if(e&&(ioe(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GE(n)}function GE(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function JIt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function DH(n){return DH=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},DH(n)}function TC(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var E7e=function(n){QIt(t,n);var e=XIt(t);function t(i){var r;GIt(this,t),r=e.call(this,i),TC(GE(r),"onChange",function(s){s.persist();var a=r.state.value,l=r.props.minLength;r.setState({value:s.target.value},function(){var c=r.state.value;if(c.length>=l){r.notify(s);return}a.length>c.length&&r.notify(Gg(Gg({},s),{},{target:Gg(Gg({},s.target),{},{value:""})}))})}),TC(GE(r),"onKeyDown",function(s){s.key==="Enter"&&r.forceNotify(s);var a=r.props.onKeyDown;a&&(s.persist(),a(s))}),TC(GE(r),"onBlur",function(s){r.forceNotify(s);var a=r.props.onBlur;a&&(s.persist(),a(s))}),TC(GE(r),"createNotifier",function(s){if(s<0)r.notify=function(){return null};else if(s===0)r.notify=r.doNotify;else{var a=(0,UIt.default)(function(l){r.isDebouncing=!1,r.doNotify(l)},s);r.notify=function(l){r.isDebouncing=!0,a(l)},r.flush=function(){return a.flush()},r.cancel=function(){r.isDebouncing=!1,a.cancel()}}}),TC(GE(r),"doNotify",function(){var s=r.props.onChange;s.apply(void 0,arguments)}),TC(GE(r),"forceNotify",function(s){var a=r.props.debounceTimeout;if(!(!r.isDebouncing&&a>0)){r.cancel&&r.cancel();var l=r.state.value,c=r.props.minLength;l.length>=c?r.doNotify(s):r.doNotify(Gg(Gg({},s),{},{target:Gg(Gg({},s.target),{},{value:l})}))}}),r.isDebouncing=!1,r.state={value:typeof i.value>"u"||i.value===null?"":i.value};var o=r.props.debounceTimeout;return r.createNotifier(o),r}return YIt(t,[{key:"componentDidUpdate",value:function(r){if(!this.isDebouncing){var o=this.props,s=o.value,a=o.debounceTimeout,l=r.debounceTimeout,c=r.value,u=this.state.value;typeof s<"u"&&c!==s&&u!==s&&this.setState({value:s}),a!==l&&this.createNotifier(a)}}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var r=this.props,o=r.element;r.onChange,r.value,r.minLength,r.debounceTimeout;var s=r.forceNotifyByEnter,a=r.forceNotifyOnBlur,l=r.onKeyDown,c=r.onBlur,u=r.inputRef,d=qIt(r,jIt),h=this.state.value,f;s?f={onKeyDown:this.onKeyDown}:l?f={onKeyDown:l}:f={};var g;a?g={onBlur:this.onBlur}:c?g={onBlur:c}:g={};var m=u?{ref:u}:{};return QTe.default.createElement(o,Gg(Gg(Gg(Gg({},d),{},{onChange:this.onChange,value:h},f),g),m))}}]),t}(QTe.default.PureComponent);eq.DebounceInput=E7e;TC(E7e,"defaultProps",{element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0});var e2t=eq,ooe=e2t.DebounceInput;ooe.DebounceInput=ooe;var t2t=ooe;function x7e(n){return xn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"defs",attr:{},child:[{tag:"clipPath",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M124-288l388-672 388 672H124z",clipRule:"evenodd"}}]}]},{tag:"path",attr:{d:"M508 624a112 112 0 0 0 112-112c0-3.28-.15-6.53-.43-9.74L498.26 623.57c3.21.28 6.45.43 9.74.43zm370.72-458.44L836 122.88a8 8 0 0 0-11.31 0L715.37 232.23Q624.91 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.7 119.43 136.55 191.45L112.56 835a8 8 0 0 0 0 11.31L155.25 889a8 8 0 0 0 11.31 0l712.16-712.12a8 8 0 0 0 0-11.32zM332 512a176 176 0 0 1 258.88-155.28l-48.62 48.62a112.08 112.08 0 0 0-140.92 140.92l-48.62 48.62A175.09 175.09 0 0 1 332 512z"}},{tag:"path",attr:{d:"M942.2 486.2Q889.4 375 816.51 304.85L672.37 449A176.08 176.08 0 0 1 445 676.37L322.74 798.63Q407.82 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5z"}}]})(n)}function T7e(n){return xn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M396 512a112 112 0 1 0 224 0 112 112 0 1 0-224 0zm546.2-25.8C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM508 688c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z"}}]})(n)}function n2t(n){return xn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 0 0-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]})(n)}function i2t(n){return xn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]})(n)}function pg(n){const e=ni();return p("label",{className:`text-sm font-medium block ${n.className}`,htmlFor:n.for,style:{color:e.$3},children:n.children})}function We(n){const e=ni(),t=Ha({overwrite:!1}),i=n.type==="password",[r,o]=w.useState(!0),s=w.useMemo(()=>n.type==="password"&&r?"password":n.type==="password"&&!r?"text":n.type,[n.type,r]);return N("section",{style:{width:n.width},children:[n.label&&N(pg,{className:Nt("mb-2",{"whitespace-nowrap":n.withoutLabelWrapping}),for:n.id,children:[n.label,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),N("div",{className:"relative",children:[p(t2t.DebounceInput,{style:{backgroundColor:e.$1,borderColor:e.$5,color:e.$3,...n.style},min:n.min,max:n.type==="date"?"9999-12-31":void 0,maxLength:n.maxLength,autoComplete:n.autoComplete||"new-password",disabled:n.disabled,element:n.element||"input",inputRef:n.innerRef,debounceTimeout:n.debounceTimeout??300,required:n.required,id:n.id,type:s,className:Nt(`w-full py-2 px-3 rounded text-sm disabled:opacity-75 disabled:cursor-not-allowed ${n.className}`,{"border border-gray-300":n.border!==!1}),placeholder:n.placeholder||"",onBlur:a=>{a.target.value=a.target.value===""&&n.type==="number"?"0":a.target.value,n.onValueChange&&n.onValueChange(a.target.value),n.onChange&&n.onChange(a)},onChange:a=>{if(a.target.value=a.target.value===""&&n.type==="number"?"0":a.target.value,n.element==="textarea"&&t.preferences.auto_expand_product_table_notes){const l=a.target.scrollHeight+2;l<200&&(a.target.style.height=l+"px")}n.changeOverride&&n.changeOverride===!0&&(n.onValueChange&&n.onValueChange(a.target.value),n.onChange&&n.onChange(a))},onClick:a=>{if(n.onClick&&n.onClick(),n.element==="textarea"&&t.preferences.auto_expand_product_table_notes){const l=a.target.scrollHeight+2;l<200&&(a.target.style.height=l+"px"),l>200&&(a.target.style.height="200px")}},onBlurCapture:a=>{n.element==="textarea"&&a.target.style.removeProperty("height")},value:n.value,list:n.list,rows:n.textareaRows||5,step:n.step,"data-cy":n.cypressRef,name:n.name,readOnly:n.readOnly}),i&&p("span",{className:"absolute top-1/4 right-3 cursor-pointer",children:r?p(T7e,{className:"text-gray-400",fontSize:19,onClick:()=>o(!1)}):p(x7e,{className:"text-gray-400",fontSize:19,onClick:()=>o(!0)})})]}),n.errorMessage&&p(Ls,{className:"mt-2",type:"danger",children:n.errorMessage})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const TN=Oo({prevent:!1,actionKey:void 0}),k7e=Oo({lastLocation:"",nonPreventedLocations:[]});function r2t(){const n=Tl(),e=Ar(tq),[t,i]=Yo(TN),[r,o]=Yo(k7e);w.useEffect(()=>{const s=c=>{if(t.prevent&&t.actionKey!=="switchCompany")return c.preventDefault(),!0},a=r.lastLocation!==window.location.href;a&&t.prevent&&(o(c=>({...c,lastLocation:window.location.href})),history.pushState(null,document.title,window.location.href));const l=()=>{t.prevent&&(a&&history.pushState(null,document.title,window.location.href),i(c=>c&&{...c,actionKey:"browserBack"}),e(!0))};return window.addEventListener("popstate",l),window.addEventListener("beforeunload",s),()=>{window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",s)}},[t]),w.useEffect(()=>{!t.prevent&&o(s=>({...s,nonPreventedLocations:[...s.nonPreventedLocations,n.pathname]}))},[n])}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const tq=Oo(!1),I7e=Oo(void 0);function Mk(n){const{disablePrevention:e}=n||{},t=wi(),[i,r]=Yo(TN),o=Ar(tq),s=Ar(I7e);return({url:a,externalLink:l=!1,fn:c,actionKey:u})=>(i.prevent&&!e?(s({url:a,externalLink:l,fn:c}),r(d=>d&&{...d,actionKey:u}),o(!0)):(a&&(l?window.open(a,"_blank"):t(a)),c==null||c()),i.prevent)}function Li(n){const e=vo(),{prevent:t}=Fi(TN),i=Mk(),{withoutDefaultStyling:r,setBaseFont:o}=n,s={color:e},a=()=>n.to.startsWith("http://")||n.to.startsWith("https://")?n.to:`https://${n.to}`;return n.external?p("a",{target:"_blank",href:a(),className:Nt(`text-center ${n.className}`,{"text-sm":!o,"text-base":o,"hover:underline":!r}),style:r?void 0:s,rel:"noreferrer",onClick:l=>{t&&(l.preventDefault(),i({url:n.to,externalLink:!0}))},children:n.children}):p(C0,{className:Nt(`${n.className}`,{"text-sm":!o,"text-base":o,"hover:underline":!r}),style:r?void 0:s,to:n.to,onClick:l=>{t&&(l.preventDefault(),i({url:n.to}))},children:n.children})}function L7e(n){const e=vo();return N("fieldset",{children:[p("legend",{className:"sr-only",children:"Notification method"}),p("div",{className:"space-y-4 sm:flex sm:items-center sm:space-y-0 sm:space-x-10",children:n.options.map(t=>N("div",{className:"flex items-center",onChange:i=>{var r;return(r=n.onValueChange)==null?void 0:r.call(n,i.target.value)},children:[p("input",{value:t.value,onClick:n.onClick,onChange:()=>{},disabled:n.disabled,id:t.id,name:n.name,type:"radio",checked:t.value===n.defaultSelected,className:"focus:ring-gray-500 h-4 w-4 border-gray-300 disabled:opacity-75 disabled:cursor-not-allowed",style:{color:e}}),p("label",{htmlFor:t.id,className:Nt("ml-3 block text-sm font-medium",{"opacity-75 cursor-not-allowed":n.disabled,"cursor-pointer":typeof n.disabled>"u"||!n.disabled}),children:t.title})]},t.id))})]})}function VI(n,e,t){let i=t.initialDeps??[],r;return()=>{var o,s,a,l;let c;t.key&&((o=t.debug)!=null&&o.call(t))&&(c=Date.now());const u=n();if(!(u.length!==i.length||u.some((f,g)=>i[g]!==f)))return r;i=u;let h;if(t.key&&((s=t.debug)!=null&&s.call(t))&&(h=Date.now()),r=e(...u),t.key&&((a=t.debug)!=null&&a.call(t))){const f=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-h)*100)/100,m=g/16,v=(_,b)=>{for(_=String(_);_.length<b;)_=" "+_;return _};console.info(`%c⏱ ${v(g,5)} /${v(f,5)} ms`,` font-size: .6rem; font-weight: bold; color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(l=t==null?void 0:t.onChange)==null||l.call(t,r),r}}function DZ(n,e){if(n===void 0)throw new Error(`Unexpected undefined${e?`: ${e}`:""}`);return n}const o2t=(n,e)=>Math.abs(n-e)<1,s2t=(n,e,t)=>{let i;return function(...r){n.clearTimeout(i),i=n.setTimeout(()=>e.apply(this,r),t)}},a2t=n=>n,l2t=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),i=[];for(let r=e;r<=t;r++)i.push(r);return i},c2t=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;const r=s=>{const{width:a,height:l}=s;e({width:Math.round(a),height:Math.round(l)})};if(r(t.getBoundingClientRect()),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){r({width:l.inlineSize,height:l.blockSize});return}}r(t.getBoundingClientRect())});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},JTe={passive:!0},u2t=typeof window>"u"?!0:"onscrollend"in window,d2t=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;let r=0;const o=u2t?()=>{}:s2t(i,()=>{e(r,!1)},n.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:u,isRtl:d}=n.options;r=u?t.scrollLeft*(d&&-1||1):t.scrollTop,o(),e(r,c)},a=s(!0),l=s(!1);return l(),t.addEventListener("scroll",a,JTe),t.addEventListener("scrollend",l,JTe),()=>{t.removeEventListener("scroll",a),t.removeEventListener("scrollend",l)}},h2t=(n,e,t)=>{if(e!=null&&e.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(n.getBoundingClientRect()[t.options.horizontal?"width":"height"])},f2t=(n,{adjustments:e=0,behavior:t},i)=>{var r,o;const s=n+e;(o=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[i.options.horizontal?"left":"top"]:s,behavior:t})};class p2t{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),t=null},observe:r=>{var o;return(o=i())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=i())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,r])=>{typeof r>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:a2t,rangeExtractor:l2t,onChange:()=>{},measureElement:h2t,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,...t}},this.notify=t=>{var i,r;(r=(i=this.options).onChange)==null||r.call(i,this,t)},this.maybeNotify=VI(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const r=new Map,o=new Map;for(let s=i-1;s>=0;s--){const a=t[s];if(r.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=VI(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,i,r,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=VI(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<t;u++){const d=o(u),h=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),f=h?h.end+this.options.gap:i+r,g=a.get(d),m=typeof g=="number"?g:this.options.estimateSize(u),v=f+m,_=h?h.lane:u%this.options.lanes;c[u]={index:u,start:f,size:m,end:v,key:d,lane:_}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=VI(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,i,r)=>this.range=t.length>0&&i>0?g2t({measurements:t,outerSize:i,scrollOffset:r}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=VI(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,i,r,o)=>i===null?[]:t({startIndex:i.startIndex,endIndex:i.endIndex,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,r=t.getAttribute(i);return r?parseInt(r,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this._measureElement=(t,i)=>{const r=this.indexFromElement(t),o=this.measurementsCache[r];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,i,this))},this.resizeItem=(t,i)=>{const r=this.measurementsCache[t];if(!r)return;const o=this.itemSizeCache.get(r.key)??r.size,s=i-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,i)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((i,r)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=VI(()=>[this.getIndexes(),this.getMeasurements()],(t,i)=>{const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=i[a];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return DZ(i[D7e(0,i.length-1,r=>DZ(i[r]).start,t)])},this.getOffsetForAlignment=(t,i)=>{const r=this.getSize(),o=this.getScrollOffset();i==="auto"&&(t<=o?i="start":t>=o+r?i="end":i="start"),i==="start"?t=t:i==="end"?t=t-r:i==="center"&&(t=t-r/2);const s=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-r;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const o=this.getSize(),s=this.getScrollOffset();if(i==="auto")if(r.end>=s+o-this.options.scrollPaddingEnd)i="end";else if(r.start<=s+this.options.scrollPaddingStart)i="start";else return[s,i];const a=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,i),i]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:i="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,i),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:i="auto",behavior:r}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(t,i);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[c]=DZ(this.getOffsetForIndex(t,a));o2t(c,this.getScrollOffset())||this.scrollToIndex(t,{align:a,behavior:r})}else this.scrollToIndex(t,{align:a,behavior:r})}))},this.scrollBy=(t,{behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:i})},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let r;return i.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((t=i[i.length-1])==null?void 0:t.end)??0:Math.max(...i.slice(-this.options.lanes).map(o=>o.end)),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const D7e=(n,e,t,i)=>{for(;n<=e;){const r=(n+e)/2|0,o=t(r);if(o<i)n=r+1;else if(o>i)e=r-1;else return r}return n>0?n-1:0};function g2t({measurements:n,outerSize:e,scrollOffset:t}){const i=n.length-1,o=D7e(0,i,a=>n[a].start,t);let s=o;for(;s<i&&n[s].end<t+e;)s++;return{startIndex:o,endIndex:s}}const m2t=typeof document<"u"?w.useLayoutEffect:w.useEffect;function _2t(n){const e=w.useReducer(()=>({}),{})[1],t={...n,onChange:(r,o)=>{var s;o?sp.flushSync(e):e(),(s=n.onChange)==null||s.call(n,r,o)}},[i]=w.useState(()=>new p2t(t));return i.setOptions(t),w.useEffect(()=>i._didMount(),[]),m2t(()=>i._willUpdate()),i}function v2t(n){return _2t({observeElementRect:c2t,observeElementOffset:d2t,scrollToFn:f2t,...n})}var b2t=Object.defineProperty,y2t=(n,e,t)=>e in n?b2t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,AZ=(n,e,t)=>(y2t(n,typeof e!="symbol"?e+"":e,t),t);let C2t=class{constructor(){AZ(this,"current",this.detect()),AZ(this,"handoffState","pending"),AZ(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ky=new C2t,Xs=(n,e)=>{Ky.isServer?w.useEffect(n,e):w.useLayoutEffect(n,e)};function ig(n){let e=w.useRef(n);return Xs(()=>{e.current=n},[n]),e}function wme(n,e){let[t,i]=w.useState(n),r=ig(n);return Xs(()=>i(r.current),[r,i,...e]),t}let jn=function(n){let e=ig(n);return ae.useCallback((...t)=>e.current(...t),[e])};function A7e(n,e,t){let[i,r]=w.useState(t),o=n!==void 0,s=w.useRef(o),a=w.useRef(!1),l=w.useRef(!1);return o&&!s.current&&!a.current?(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?n:i,jn(c=>(o||r(c),e==null?void 0:e(c)))]}function nq(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(e=>setTimeout(()=>{throw e}))}function gg(){let n=[],e={addEventListener(t,i,r,o){return t.addEventListener(i,r,o),e.add(()=>t.removeEventListener(i,r,o))},requestAnimationFrame(...t){let i=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(i))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let i=setTimeout(...t);return e.add(()=>clearTimeout(i))},microTask(...t){let i={current:!0};return nq(()=>{i.current&&t[0]()}),e.add(()=>{i.current=!1})},style(t,i,r){let o=t.style.getPropertyValue(i);return Object.assign(t.style,{[i]:r}),this.add(()=>{Object.assign(t.style,{[i]:o})})},group(t){let i=gg();return t(i),this.add(()=>i.dispose())},add(t){return n.push(t),()=>{let i=n.indexOf(t);if(i>=0)for(let r of n.splice(i,1))r()}},dispose(){for(let t of n.splice(0))t()}};return e}function k1(){let[n]=w.useState(gg);return w.useEffect(()=>()=>n.dispose(),[n]),n}function w2t(){let n=typeof document>"u";return"useSyncExternalStore"in Am?(e=>e.useSyncExternalStore)(Am)(()=>()=>{},()=>!1,()=>!n):!1}function kN(){let n=w2t(),[e,t]=w.useState(Ky.isHandoffComplete);return e&&Ky.isHandoffComplete===!1&&t(!1),w.useEffect(()=>{e!==!0&&t(!0)},[e]),w.useEffect(()=>Ky.handoff(),[]),n?!1:e}var eke;let ic=(eke=ae.useId)!=null?eke:function(){let n=kN(),[e,t]=ae.useState(n?()=>Ky.nextId():null);return Xs(()=>{e===null&&t(Ky.nextId())},[e]),e!=null?""+e:void 0};function Bs(n,e,...t){if(n in e){let r=e[n];return typeof r=="function"?r(...t):r}let i=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,Bs),i}function bF(n){return Ky.isServer?null:n instanceof Node?n.ownerDocument:n!=null&&n.hasOwnProperty("current")&&n.current instanceof Node?n.current.ownerDocument:document}let soe=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var wd=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n))(wd||{}),P4=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(P4||{}),S2t=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(S2t||{});function yF(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(soe)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var iq=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(iq||{});function rq(n,e=0){var t;return n===((t=bF(n))==null?void 0:t.body)?!1:Bs(e,{0(){return n.matches(soe)},1(){let i=n;for(;i!==null;){if(i.matches(soe))return!0;i=i.parentElement}return!1}})}function N7e(n){let e=bF(n);gg().nextFrame(()=>{e&&!rq(e.activeElement,0)&&Ew(n)})}var E2t=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(E2t||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Ew(n){n==null||n.focus({preventScroll:!0})}let x2t=["textarea","input"].join(",");function T2t(n){var e,t;return(t=(e=n==null?void 0:n.matches)==null?void 0:e.call(n,x2t))!=null?t:!1}function Sme(n,e=t=>t){return n.slice().sort((t,i)=>{let r=e(t),o=e(i);if(r===null||o===null)return 0;let s=r.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function k2t(n,e){return pm(yF(),e,{relativeTo:n})}function pm(n,e,{sorted:t=!0,relativeTo:i=null,skipElements:r=[]}={}){let o=Array.isArray(n)?n.length>0?n[0].ownerDocument:document:n.ownerDocument,s=Array.isArray(n)?t?Sme(n):n:yF(n);r.length>0&&s.length>1&&(s=s.filter(f=>!r.includes(f))),i=i??o.activeElement;let a=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,s.indexOf(i))-1;if(e&4)return Math.max(0,s.indexOf(i))+1;if(e&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=e&32?{preventScroll:!0}:{},u=0,d=s.length,h;do{if(u>=d||u+d<=0)return 0;let f=l+u;if(e&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}h=s[f],h==null||h.focus(c),u+=a}while(h!==o.activeElement);return e&6&&T2t(h)&&h.select(),2}function R7e(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function I2t(){return/Android/gi.test(window.navigator.userAgent)}function O7e(){return R7e()||I2t()}function S8(n,e,t){let i=ig(e);w.useEffect(()=>{function r(o){i.current(o)}return document.addEventListener(n,r,t),()=>document.removeEventListener(n,r,t)},[n,t])}function P7e(n,e,t){let i=ig(e);w.useEffect(()=>{function r(o){i.current(o)}return window.addEventListener(n,r,t),()=>window.removeEventListener(n,r,t)},[n,t])}function oq(n,e,t=!0){let i=w.useRef(!1);w.useEffect(()=>{requestAnimationFrame(()=>{i.current=t})},[t]);function r(s,a){if(!i.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(d){return typeof d=="function"?u(d()):Array.isArray(d)||d instanceof Set?d:[d]}(n);for(let u of c){if(u===null)continue;let d=u instanceof HTMLElement?u:u.current;if(d!=null&&d.contains(l)||s.composed&&s.composedPath().includes(d))return}return!rq(l,iq.Loose)&&l.tabIndex!==-1&&s.preventDefault(),e(s,l)}let o=w.useRef(null);S8("pointerdown",s=>{var a,l;i.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),S8("mousedown",s=>{var a,l;i.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),S8("click",s=>{O7e()||o.current&&(r(s,()=>o.current),o.current=null)},!0),S8("touchend",s=>r(s,()=>s.target instanceof HTMLElement?s.target:null),!0),P7e("blur",s=>r(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function S0(...n){return w.useMemo(()=>bF(...n),[...n])}function tke(n){var e;if(n.type)return n.type;let t=(e=n.as)!=null?e:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function sq(n,e){let[t,i]=w.useState(()=>tke(n));return Xs(()=>{i(tke(n))},[n.type,n.as]),Xs(()=>{t||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&i("button")},[t,e]),t}let M7e=Symbol();function F7e(n,e=!0){return Object.assign(n,{[M7e]:e})}function La(...n){let e=w.useRef(n);w.useEffect(()=>{e.current=n},[n]);let t=jn(i=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(i):r.current=i)});return n.every(i=>i==null||(i==null?void 0:i[M7e]))?void 0:t}function nke(n){return[n.screenX,n.screenY]}function B7e(){let n=w.useRef([-1,-1]);return{wasMoved(e){let t=nke(e);return n.current[0]===t[0]&&n.current[1]===t[1]?!1:(n.current=t,!0)},update(e){n.current=nke(e)}}}function $7e({container:n,accept:e,walk:t,enabled:i=!0}){let r=w.useRef(e),o=w.useRef(t);w.useEffect(()=>{r.current=e,o.current=t},[e,t]),Xs(()=>{if(!n||!i)return;let s=bF(n);if(!s)return;let a=r.current,l=o.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[n,i,r,o])}function M4(n,e){let t=w.useRef([]),i=jn(n);w.useEffect(()=>{let r=[...t.current];for(let[o,s]of e.entries())if(t.current[o]!==s){let a=i(e,r);return t.current=e,a}},[i,...e])}function AH(...n){return Array.from(new Set(n.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}var Bm=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Bm||{}),qC=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(qC||{});function Zs({ourProps:n,theirProps:e,slot:t,defaultTag:i,features:r,visible:o=!0,name:s,mergeRefs:a}){a=a??D2t;let l=V7e(e,n);if(o)return E8(l,t,i,s,a);let c=r??0;if(c&2){let{static:u=!1,...d}=l;if(u)return E8(d,t,i,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Bs(u?0:1,{0(){return null},1(){return E8({...d,hidden:!0,style:{display:"none"}},t,i,s,a)}})}return E8(l,t,i,s,a)}function E8(n,e={},t,i,r){let{as:o=t,children:s,refName:a="ref",...l}=NZ(n,["unmount","static"]),c=n.ref!==void 0?{[a]:n.ref}:{},u=typeof s=="function"?s(e):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e));let d={};if(e){let h=!1,f=[];for(let[g,m]of Object.entries(e))typeof m=="boolean"&&(h=!0),m===!0&&f.push(g);h&&(d["data-headlessui-state"]=f.join(" "))}if(o===w.Fragment&&Object.keys(NH(l)).length>0){if(!w.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(m=>` - ${m}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(m=>` - ${m}`).join(` `)].join(` `));let h=u.props,f=typeof(h==null?void 0:h.className)=="function"?(...m)=>AH(h==null?void 0:h.className(...m),l.className):AH(h==null?void 0:h.className,l.className),g=f?{className:f}:{};return w.cloneElement(u,Object.assign({},V7e(u.props,NH(NZ(l,["ref"]))),d,c,{ref:r(u.ref,c.ref)},g))}return w.createElement(o,Object.assign({},NZ(l,["ref"]),o!==w.Fragment&&c,o!==w.Fragment&&d),u)}function L2t(){let n=w.useRef([]),e=w.useCallback(t=>{for(let i of n.current)i!=null&&(typeof i=="function"?i(t):i.current=t)},[]);return(...t)=>{if(!t.every(i=>i==null))return n.current=t,e}}function D2t(...n){return n.every(e=>e==null)?void 0:e=>{for(let t of n)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function V7e(...n){if(n.length===0)return{};if(n.length===1)return n[0];let e={},t={};for(let i of n)for(let r in i)r.startsWith("on")&&typeof i[r]=="function"?(t[r]!=null||(t[r]=[]),t[r].push(i[r])):e[r]=i[r];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(t).map(i=>[i,void 0])));for(let i in t)Object.assign(e,{[i](r,...o){let s=t[i];for(let a of s){if((r instanceof Event||(r==null?void 0:r.nativeEvent)instanceof Event)&&r.defaultPrevented)return;a(r,...o)}}});return e}function Js(n){var e;return Object.assign(w.forwardRef(n),{displayName:(e=n.displayName)!=null?e:n.name})}function NH(n){let e=Object.assign({},n);for(let t in e)e[t]===void 0&&delete e[t];return e}function NZ(n,e=[]){let t=Object.assign({},n);for(let i of e)i in t&&delete t[i];return t}let A2t="div";var n0=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(n0||{});function N2t(n,e){var t;let{features:i=1,...r}=n,o={ref:e,"aria-hidden":(i&2)===2?!0:(t=r["aria-hidden"])!=null?t:void 0,hidden:(i&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(i&4)===4&&(i&2)!==2&&{display:"none"}}};return Zs({ourProps:o,theirProps:r,slot:{},defaultTag:A2t,name:"Hidden"})}let g1=Js(N2t),Eme=w.createContext(null);Eme.displayName="OpenClosedContext";var Pa=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(Pa||{});function Fk(){return w.useContext(Eme)}function aq({value:n,children:e}){return ae.createElement(Eme.Provider,{value:n},e)}function R2t(n){function e(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let db=[];R2t(()=>{function n(e){e.target instanceof HTMLElement&&e.target!==document.body&&db[0]!==e.target&&(db.unshift(e.target),db=db.filter(t=>t!=null&&t.isConnected),db.splice(10))}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function IN(n){let e=n.parentElement,t=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(t=e),e=e.parentElement;let i=(e==null?void 0:e.getAttribute("disabled"))==="";return i&&O2t(t)?!1:i}function O2t(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function P2t(n){throw new Error("Unexpected object: "+n)}var ca=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(ca||{});function aoe(n,e){let t=e.resolveItems();if(t.length<=0)return null;let i=e.resolveActiveIndex(),r=i??-1;switch(n.focus){case 0:{for(let o=0;o<t.length;++o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 1:{for(let o=r-1;o>=0;--o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 2:{for(let o=r+1;o<t.length;++o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 3:{for(let o=t.length-1;o>=0;--o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 4:{for(let o=0;o<t.length;++o)if(e.resolveId(t[o],o,t)===n.id)return o;return i}case 5:return null;default:P2t(n)}}function H7e(n={},e=null,t=[]){for(let[i,r]of Object.entries(n))z7e(t,W7e(e,i),r);return t}function W7e(n,e){return n?n+"["+e+"]":e}function z7e(n,e,t){if(Array.isArray(t))for(let[i,r]of t.entries())z7e(n,W7e(e,i.toString()),r);else t instanceof Date?n.push([e,t.toISOString()]):typeof t=="boolean"?n.push([e,t?"1":"0"]):typeof t=="string"?n.push([e,t]):typeof t=="number"?n.push([e,`${t}`]):t==null?n.push([e,""]):H7e(t,e,n)}function M2t(n){var e,t;let i=(e=n==null?void 0:n.form)!=null?e:n.closest("form");if(i){for(let r of i.elements)if(r!==n&&(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image")){r.click();return}(t=i.requestSubmit)==null||t.call(i)}}var No=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(No||{}),F2t=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(F2t||{}),B2t=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(B2t||{}),$2t=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))($2t||{}),V2t=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.RegisterOption=3]="RegisterOption",n[n.UnregisterOption=4]="UnregisterOption",n[n.RegisterLabel=5]="RegisterLabel",n[n.SetActivationTrigger=6]="SetActivationTrigger",n[n.UpdateVirtualOptions=7]="UpdateVirtualOptions",n))(V2t||{});function RZ(n,e=t=>t){let t=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,i=e(n.options.slice()),r=i.length>0&&i[0].dataRef.current.order!==null?i.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):Sme(i,s=>s.dataRef.current.domRef.current),o=t?r.indexOf(t):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let H2t={1(n){var e;return(e=n.dataRef.current)!=null&&e.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1}},0(n){var e,t;if((e=n.dataRef.current)!=null&&e.disabled||n.comboboxState===0)return n;if((t=n.dataRef.current)!=null&&t.value){let i=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(i!==-1)return{...n,activeOptionIndex:i,comboboxState:0}}return{...n,comboboxState:0}},2(n,e){var t,i,r,o,s;if((t=n.dataRef.current)!=null&&t.disabled||(i=n.dataRef.current)!=null&&i.optionsRef.current&&!((r=n.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&n.comboboxState===1)return n;if(n.virtual){let u=e.focus===ca.Specific?e.idx:aoe(e,{resolveItems:()=>n.virtual.options,resolveActiveIndex:()=>{var h,f;return(f=(h=n.activeOptionIndex)!=null?h:n.virtual.options.findIndex(g=>!n.virtual.disabled(g)))!=null?f:null},resolveDisabled:n.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),d=(o=e.trigger)!=null?o:2;return n.activeOptionIndex===u&&n.activationTrigger===d?n:{...n,activeOptionIndex:u,activationTrigger:d}}let a=RZ(n);if(a.activeOptionIndex===null){let u=a.options.findIndex(d=>!d.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=e.focus===ca.Specific?e.idx:aoe(e,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=e.trigger)!=null?s:2;return n.activeOptionIndex===l&&n.activationTrigger===c?n:{...n,...a,activeOptionIndex:l,activationTrigger:c}},3:(n,e)=>{var t,i,r;if((t=n.dataRef.current)!=null&&t.virtual)return{...n,options:[...n.options,e.payload]};let o=e.payload,s=RZ(n,l=>(l.push(o),l));n.activeOptionIndex===null&&(i=n.dataRef.current)!=null&&i.isSelected(e.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...n,...s,activationTrigger:2};return(r=n.dataRef.current)!=null&&r.__demoMode&&n.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(n,e)=>{var t;if((t=n.dataRef.current)!=null&&t.virtual)return{...n,options:n.options.filter(r=>r.id!==e.id)};let i=RZ(n,r=>{let o=r.findIndex(s=>s.id===e.id);return o!==-1&&r.splice(o,1),r});return{...n,...i,activationTrigger:2}},5:(n,e)=>n.labelId===e.id?n:{...n,labelId:e.id},6:(n,e)=>n.activationTrigger===e.trigger?n:{...n,activationTrigger:e.trigger},7:(n,e)=>{var t;if(((t=n.virtual)==null?void 0:t.options)===e.options)return n;let i=n.activeOptionIndex;if(n.activeOptionIndex!==null){let r=e.options.indexOf(n.virtual.options[n.activeOptionIndex]);r!==-1?i=r:i=null}return{...n,activeOptionIndex:i,virtual:Object.assign({},n.virtual,{options:e.options})}}},xme=w.createContext(null);xme.displayName="ComboboxActionsContext";function CF(n){let e=w.useContext(xme);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,CF),t}return e}let U7e=w.createContext(null);function W2t(n){var e;let t=Bk("VirtualProvider"),[i,r]=w.useMemo(()=>{let l=t.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[t.optionsRef.current]),o=v2t({scrollPaddingStart:i,scrollPaddingEnd:r,count:t.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=t.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=w.useState(0);return Xs(()=>{a(l=>l+1)},[(e=t.virtual)==null?void 0:e.options]),ae.createElement(U7e.Provider,{value:o},ae.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&{}.JEST_WORKER_ID!==void 0||t.activationTrigger===0)return;t.activeOptionIndex!==null&&t.virtual.options.length>t.activeOptionIndex&&o.scrollToIndex(t.activeOptionIndex)}}},o.getVirtualItems().map(l=>{var c;return ae.createElement(w.Fragment,{key:l.key},ae.cloneElement((c=n.children)==null?void 0:c.call(n,{option:t.virtual.options[l.index],open:t.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":t.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let Tme=w.createContext(null);Tme.displayName="ComboboxDataContext";function Bk(n){let e=w.useContext(Tme);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Bk),t}return e}function z2t(n,e){return Bs(e.type,H2t,n,e)}let U2t=w.Fragment;function j2t(n,e){let{value:t,defaultValue:i,onChange:r,form:o,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:d=!1,immediate:h=!1,virtual:f=null,...g}=n,m=!1,v=null,[_=d?[]:void 0,b]=A7e(t,r,i),[y,C]=w.useReducer(z2t,{dataRef:w.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),x=w.useRef(!1),E=w.useRef({static:!1,hold:!1}),k=w.useRef(null),L=w.useRef(null),D=w.useRef(null),A=w.useRef(null),O=jn(typeof a=="string"?(je,qe)=>{let Be=a;return(je==null?void 0:je[Be])===(qe==null?void 0:qe[Be])}:a??((je,qe)=>je===qe)),P=jn(je=>y.options.findIndex(qe=>O(qe.dataRef.current.value,je))),F=w.useCallback(je=>Bs(M.mode,{1:()=>_.some(qe=>O(qe,je)),0:()=>O(_,je)}),[_]),B=jn(je=>y.activeOptionIndex===P(je)),M=w.useMemo(()=>({...y,immediate:m,optionsPropsRef:E,labelRef:k,inputRef:L,buttonRef:D,optionsRef:A,value:_,defaultValue:i,disabled:l,mode:d?1:0,virtual:y.virtual,get activeOptionIndex(){if(x.current&&y.activeOptionIndex===null&&y.options.length>0){let je=y.options.findIndex(qe=>!qe.dataRef.current.disabled);if(je!==-1)return je}return y.activeOptionIndex},calculateIndex:P,compare:O,isSelected:F,isActive:B,nullable:u,__demoMode:c}),[_,i,l,d,u,c,y,v]);Xs(()=>{},[v,void 0]),Xs(()=>{y.dataRef.current=M},[M]),oq([M.buttonRef,M.inputRef,M.optionsRef],()=>Fe.closeCombobox(),M.comboboxState===0);let V=w.useMemo(()=>{var je,qe,Be;return{open:M.comboboxState===0,disabled:l,activeIndex:M.activeOptionIndex,activeOption:M.activeOptionIndex===null?null:M.virtual?M.virtual.options[(je=M.activeOptionIndex)!=null?je:0]:(Be=(qe=M.options[M.activeOptionIndex])==null?void 0:qe.dataRef.current.value)!=null?Be:null,value:_}},[M,l,_]),U=jn(()=>{if(M.activeOptionIndex!==null){if(M.virtual)Q(M.virtual.options[M.activeOptionIndex]);else{let{dataRef:je}=M.options[M.activeOptionIndex];Q(je.current.value)}Fe.goToOption(ca.Specific,M.activeOptionIndex)}}),W=jn(()=>{C({type:0}),x.current=!0}),q=jn(()=>{C({type:1}),x.current=!1}),H=jn((je,qe,Be)=>(x.current=!1,je===ca.Specific?C({type:2,focus:ca.Specific,idx:qe,trigger:Be}):C({type:2,focus:je,trigger:Be}))),ie=jn((je,qe)=>(C({type:3,payload:{id:je,dataRef:qe}}),()=>{M.isActive(qe.current.value)&&(x.current=!0),C({type:4,id:je})})),se=jn(je=>(C({type:5,id:je}),()=>C({type:5,id:null}))),Q=jn(je=>Bs(M.mode,{0(){return b==null?void 0:b(je)},1(){let qe=M.value.slice(),Be=qe.findIndex(_t=>O(_t,je));return Be===-1?qe.push(je):qe.splice(Be,1),b==null?void 0:b(qe)}})),Ee=jn(je=>{C({type:6,trigger:je})}),Fe=w.useMemo(()=>({onChange:Q,registerOption:ie,registerLabel:se,goToOption:H,closeCombobox:q,openCombobox:W,setActivationTrigger:Ee,selectActiveOption:U}),[]),He=e===null?{}:{ref:e},ke=w.useRef(null),Me=k1();return w.useEffect(()=>{ke.current&&i!==void 0&&Me.addEventListener(ke.current,"reset",()=>{b==null||b(i)})},[ke,b]),ae.createElement(xme.Provider,{value:Fe},ae.createElement(Tme.Provider,{value:M},ae.createElement(aq,{value:Bs(M.comboboxState,{0:Pa.Open,1:Pa.Closed})},s!=null&&_!=null&&H7e({[s]:_}).map(([je,qe],Be)=>ae.createElement(g1,{features:n0.Hidden,ref:Be===0?_t=>{var Wt;ke.current=(Wt=_t==null?void 0:_t.closest("form"))!=null?Wt:null}:void 0,...NH({key:je,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,disabled:l,name:je,value:qe})})),Zs({ourProps:He,theirProps:g,slot:V,defaultTag:U2t,name:"Combobox"}))))}let q2t="input";function K2t(n,e){var t,i,r,o,s;let a=ic(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:d="text",...h}=n,f=Bk("Combobox.Input"),g=CF("Combobox.Input"),m=La(f.inputRef,e),v=S0(f.inputRef),_=w.useRef(!1),b=k1(),y=jn(()=>{g.onChange(null),f.optionsRef.current&&(f.optionsRef.current.scrollTop=0),g.goToOption(ca.Nothing)}),C=function(){var M;return typeof u=="function"&&f.value!==void 0?(M=u(f.value))!=null?M:"":typeof f.value=="string"?f.value:""}();M4(([M,V],[U,W])=>{if(_.current)return;let q=f.inputRef.current;q&&((W===0&&V===1||M!==U)&&(q.value=M),requestAnimationFrame(()=>{if(_.current||!q||(v==null?void 0:v.activeElement)!==q)return;let{selectionStart:H,selectionEnd:ie}=q;Math.abs((ie??0)-(H??0))===0&&H===0&&q.setSelectionRange(q.value.length,q.value.length)}))},[C,f.comboboxState,v]),M4(([M],[V])=>{if(M===0&&V===1){if(_.current)return;let U=f.inputRef.current;if(!U)return;let W=U.value,{selectionStart:q,selectionEnd:H,selectionDirection:ie}=U;U.value="",U.value=W,ie!==null?U.setSelectionRange(q,H,ie):U.setSelectionRange(q,H)}},[f.comboboxState]);let x=w.useRef(!1),E=jn(()=>{x.current=!0}),k=jn(()=>{b.nextFrame(()=>{x.current=!1})}),L=jn(M=>{switch(_.current=!0,M.key){case No.Enter:if(_.current=!1,f.comboboxState!==0||x.current)return;if(M.preventDefault(),M.stopPropagation(),f.activeOptionIndex===null){g.closeCombobox();return}g.selectActiveOption(),f.mode===0&&g.closeCombobox();break;case No.ArrowDown:return _.current=!1,M.preventDefault(),M.stopPropagation(),Bs(f.comboboxState,{0:()=>g.goToOption(ca.Next),1:()=>g.openCombobox()});case No.ArrowUp:return _.current=!1,M.preventDefault(),M.stopPropagation(),Bs(f.comboboxState,{0:()=>g.goToOption(ca.Previous),1:()=>{g.openCombobox(),b.nextFrame(()=>{f.value||g.goToOption(ca.Last)})}});case No.Home:if(M.shiftKey)break;return _.current=!1,M.preventDefault(),M.stopPropagation(),g.goToOption(ca.First);case No.PageUp:return _.current=!1,M.preventDefault(),M.stopPropagation(),g.goToOption(ca.First);case No.End:if(M.shiftKey)break;return _.current=!1,M.preventDefault(),M.stopPropagation(),g.goToOption(ca.Last);case No.PageDown:return _.current=!1,M.preventDefault(),M.stopPropagation(),g.goToOption(ca.Last);case No.Escape:return _.current=!1,f.comboboxState!==0?void 0:(M.preventDefault(),f.optionsRef.current&&!f.optionsPropsRef.current.static&&M.stopPropagation(),f.nullable&&f.mode===0&&f.value===null&&y(),g.closeCombobox());case No.Tab:if(_.current=!1,f.comboboxState!==0)return;f.mode===0&&f.activationTrigger!==1&&g.selectActiveOption(),g.closeCombobox();break}}),D=jn(M=>{c==null||c(M),f.nullable&&f.mode===0&&M.target.value===""&&y(),g.openCombobox()}),A=jn(M=>{var V,U,W;let q=(V=M.relatedTarget)!=null?V:db.find(H=>H!==M.currentTarget);if(_.current=!1,!((U=f.optionsRef.current)!=null&&U.contains(q))&&!((W=f.buttonRef.current)!=null&&W.contains(q))&&f.comboboxState===0)return M.preventDefault(),f.mode===0&&(f.nullable&&f.value===null?y():f.activationTrigger!==1&&g.selectActiveOption()),g.closeCombobox()}),O=jn(M=>{var V,U,W;let q=(V=M.relatedTarget)!=null?V:db.find(H=>H!==M.currentTarget);(U=f.buttonRef.current)!=null&&U.contains(q)||(W=f.optionsRef.current)!=null&&W.contains(q)||f.disabled||f.immediate&&f.comboboxState!==0&&(g.openCombobox(),b.nextFrame(()=>{g.setActivationTrigger(1)}))}),P=wme(()=>{if(f.labelId)return[f.labelId].join(" ")},[f.labelId]),F=w.useMemo(()=>({open:f.comboboxState===0,disabled:f.disabled}),[f]),B={ref:m,id:l,role:"combobox",type:d,"aria-controls":(t=f.optionsRef.current)==null?void 0:t.id,"aria-expanded":f.comboboxState===0,"aria-activedescendant":f.activeOptionIndex===null?void 0:f.virtual?(i=f.options.find(M=>{var V;return!((V=f.virtual)!=null&&V.disabled(M.dataRef.current.value))&&f.compare(M.dataRef.current.value,f.virtual.options[f.activeOptionIndex])}))==null?void 0:i.id:(r=f.options[f.activeOptionIndex])==null?void 0:r.id,"aria-labelledby":P,"aria-autocomplete":"list",defaultValue:(s=(o=n.defaultValue)!=null?o:f.defaultValue!==void 0?u==null?void 0:u(f.defaultValue):null)!=null?s:f.defaultValue,disabled:f.disabled,onCompositionStart:E,onCompositionEnd:k,onKeyDown:L,onChange:D,onFocus:O,onBlur:A};return Zs({ourProps:B,theirProps:h,slot:F,defaultTag:q2t,name:"Combobox.Input"})}let G2t="button";function Y2t(n,e){var t;let i=Bk("Combobox.Button"),r=CF("Combobox.Button"),o=La(i.buttonRef,e),s=ic(),{id:a=`headlessui-combobox-button-${s}`,...l}=n,c=k1(),u=jn(m=>{switch(m.key){case No.ArrowDown:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&r.openCombobox(),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case No.ArrowUp:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&(r.openCombobox(),c.nextFrame(()=>{i.value||r.goToOption(ca.Last)})),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case No.Escape:return i.comboboxState!==0?void 0:(m.preventDefault(),i.optionsRef.current&&!i.optionsPropsRef.current.static&&m.stopPropagation(),r.closeCombobox(),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})}));default:return}}),d=jn(m=>{if(IN(m.currentTarget))return m.preventDefault();i.comboboxState===0?r.closeCombobox():(m.preventDefault(),r.openCombobox()),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})})}),h=wme(()=>{if(i.labelId)return[i.labelId,a].join(" ")},[i.labelId,a]),f=w.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled,value:i.value}),[i]),g={ref:o,id:a,type:sq(n,i.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(t=i.optionsRef.current)==null?void 0:t.id,"aria-expanded":i.comboboxState===0,"aria-labelledby":h,disabled:i.disabled,onClick:d,onKeyDown:u};return Zs({ourProps:g,theirProps:l,slot:f,defaultTag:G2t,name:"Combobox.Button"})}let Q2t="label";function X2t(n,e){let t=ic(),{id:i=`headlessui-combobox-label-${t}`,...r}=n,o=Bk("Combobox.Label"),s=CF("Combobox.Label"),a=La(o.labelRef,e);Xs(()=>s.registerLabel(i),[i]);let l=jn(()=>{var u;return(u=o.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=w.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return Zs({ourProps:{ref:a,id:i,onClick:l},theirProps:r,slot:c,defaultTag:Q2t,name:"Combobox.Label"})}let Z2t="ul",J2t=Bm.RenderStrategy|Bm.Static;function eLt(n,e){let t=ic(),{id:i=`headlessui-combobox-options-${t}`,hold:r=!1,...o}=n,s=Bk("Combobox.Options"),a=La(s.optionsRef,e),l=Fk(),c=(()=>l!==null?(l&Pa.Open)===Pa.Open:s.comboboxState===0)();Xs(()=>{var f;s.optionsPropsRef.current.static=(f=n.static)!=null?f:!1},[s.optionsPropsRef,n.static]),Xs(()=>{s.optionsPropsRef.current.hold=r},[s.optionsPropsRef,r]),$7e({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(f){return f.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let u=wme(()=>{var f,g;return(g=s.labelId)!=null?g:(f=s.buttonRef.current)==null?void 0:f.id},[s.labelId,s.buttonRef.current]),d=w.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:i,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(o,{children:ae.createElement(W2t,null,o.children)}),Zs({ourProps:h,theirProps:o,slot:d,defaultTag:Z2t,features:J2t,visible:c,name:"Combobox.Options"})}let tLt="li";function nLt(n,e){var t;let i=ic(),{id:r=`headlessui-combobox-option-${i}`,disabled:o=!1,value:s,order:a=null,...l}=n,c=Bk("Combobox.Option"),u=CF("Combobox.Option"),d=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((t=c.options[c.activeOptionIndex])==null?void 0:t.id)===r,h=c.isSelected(s),f=w.useRef(null),g=ig({disabled:o,value:s,domRef:f,order:a}),m=w.useContext(U7e),v=La(e,f,m?m.measureElement:null),_=jn(()=>u.onChange(s));Xs(()=>u.registerOption(r,g),[g,r]);let b=w.useRef(!(c.virtual||c.__demoMode));Xs(()=>{if(!c.virtual||!c.__demoMode)return;let A=gg();return A.requestAnimationFrame(()=>{b.current=!0}),A.dispose},[c.virtual,c.__demoMode]),Xs(()=>{if(!b.current||c.comboboxState!==0||!d||c.activationTrigger===0)return;let A=gg();return A.requestAnimationFrame(()=>{var O,P;(P=(O=f.current)==null?void 0:O.scrollIntoView)==null||P.call(O,{block:"nearest"})}),A.dispose},[f,d,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let y=jn(A=>{var O;if(o||(O=c.virtual)!=null&&O.disabled(s))return A.preventDefault();_(),O7e()||requestAnimationFrame(()=>{var P;return(P=c.inputRef.current)==null?void 0:P.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=jn(()=>{var A;if(o||(A=c.virtual)!=null&&A.disabled(s))return u.goToOption(ca.Nothing);let O=c.calculateIndex(s);u.goToOption(ca.Specific,O)}),x=B7e(),E=jn(A=>x.update(A)),k=jn(A=>{var O;if(!x.wasMoved(A)||o||(O=c.virtual)!=null&&O.disabled(s)||d)return;let P=c.calculateIndex(s);u.goToOption(ca.Specific,P,0)}),L=jn(A=>{var O;x.wasMoved(A)&&(o||(O=c.virtual)!=null&&O.disabled(s)||d&&(c.optionsPropsRef.current.hold||u.goToOption(ca.Nothing)))}),D=w.useMemo(()=>({active:d,selected:h,disabled:o}),[d,h,o]);return Zs({ourProps:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:y,onFocus:C,onPointerEnter:E,onMouseEnter:E,onPointerMove:k,onMouseMove:k,onPointerLeave:L,onMouseLeave:L},theirProps:l,slot:D,defaultTag:tLt,name:"Combobox.Option"})}let iLt=Js(j2t),rLt=Js(Y2t),oLt=Js(K2t),sLt=Js(X2t),aLt=Js(eLt),lLt=Js(nLt),YE=Object.assign(iLt,{Input:oLt,Button:rLt,Label:sLt,Options:aLt,Option:lLt});function kme(n,e,t,i){let r=ig(t);w.useEffect(()=>{n=n??window;function o(s){r.current(s)}return n.addEventListener(e,o,i),()=>n.removeEventListener(e,o,i)},[n,e,i])}function wF(){let n=w.useRef(!1);return Xs(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function j7e(n){let e=jn(n),t=w.useRef(!1);w.useEffect(()=>(t.current=!1,()=>{t.current=!0,nq(()=>{t.current&&e()})}),[e])}var jp=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(jp||{});function Ime(){let n=w.useRef(0);return P7e("keydown",e=>{e.key==="Tab"&&(n.current=e.shiftKey?1:0)},!0),n}function q7e(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let e=new Set;for(let t of n.current)t.current instanceof HTMLElement&&e.add(t.current);return e}let cLt="div";var K7e=(n=>(n[n.None=1]="None",n[n.InitialFocus=2]="InitialFocus",n[n.TabLock=4]="TabLock",n[n.FocusLock=8]="FocusLock",n[n.RestoreFocus=16]="RestoreFocus",n[n.All=30]="All",n))(K7e||{});function uLt(n,e){let t=w.useRef(null),i=La(t,e),{initialFocus:r,containers:o,features:s=30,...a}=n;kN()||(s=1);let l=S0(t);fLt({ownerDocument:l},!!(s&16));let c=pLt({ownerDocument:l,container:t,initialFocus:r},!!(s&2));gLt({ownerDocument:l,container:t,containers:o,previousActiveElement:c},!!(s&8));let u=Ime(),d=jn(m=>{let v=t.current;v&&(_=>_())(()=>{Bs(u.current,{[jp.Forwards]:()=>{pm(v,wd.First,{skipElements:[m.relatedTarget]})},[jp.Backwards]:()=>{pm(v,wd.Last,{skipElements:[m.relatedTarget]})}})})}),h=k1(),f=w.useRef(!1),g={ref:i,onKeyDown(m){m.key=="Tab"&&(f.current=!0,h.requestAnimationFrame(()=>{f.current=!1}))},onBlur(m){let v=q7e(o);t.current instanceof HTMLElement&&v.add(t.current);let _=m.relatedTarget;_ instanceof HTMLElement&&_.dataset.headlessuiFocusGuard!=="true"&&(G7e(v,_)||(f.current?pm(t.current,Bs(u.current,{[jp.Forwards]:()=>wd.Next,[jp.Backwards]:()=>wd.Previous})|wd.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&Ew(m.target)))}};return ae.createElement(ae.Fragment,null,!!(s&4)&&ae.createElement(g1,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:n0.Focusable}),Zs({ourProps:g,theirProps:a,defaultTag:cLt,name:"FocusTrap"}),!!(s&4)&&ae.createElement(g1,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:n0.Focusable}))}let dLt=Js(uLt),tO=Object.assign(dLt,{features:K7e});function hLt(n=!0){let e=w.useRef(db.slice());return M4(([t],[i])=>{i===!0&&t===!1&&nq(()=>{e.current.splice(0)}),i===!1&&t===!0&&(e.current=db.slice())},[n,db,e]),jn(()=>{var t;return(t=e.current.find(i=>i!=null&&i.isConnected))!=null?t:null})}function fLt({ownerDocument:n},e){let t=hLt(e);M4(()=>{e||(n==null?void 0:n.activeElement)===(n==null?void 0:n.body)&&Ew(t())},[e]),j7e(()=>{e&&Ew(t())})}function pLt({ownerDocument:n,container:e,initialFocus:t},i){let r=w.useRef(null),o=wF();return M4(()=>{if(!i)return;let s=e.current;s&&nq(()=>{if(!o.current)return;let a=n==null?void 0:n.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===a){r.current=a;return}}else if(s.contains(a)){r.current=a;return}t!=null&&t.current?Ew(t.current):pm(s,wd.First)===P4.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),r.current=n==null?void 0:n.activeElement})},[i]),r}function gLt({ownerDocument:n,container:e,containers:t,previousActiveElement:i},r){let o=wF();kme(n==null?void 0:n.defaultView,"focus",s=>{if(!r||!o.current)return;let a=q7e(t);e.current instanceof HTMLElement&&a.add(e.current);let l=i.current;if(!l)return;let c=s.target;c&&c instanceof HTMLElement?G7e(a,c)?(i.current=c,Ew(c)):(s.preventDefault(),s.stopPropagation(),Ew(l)):Ew(i.current)},!0)}function G7e(n,e){for(let t of n)if(t.contains(e))return!0;return!1}let Y7e=w.createContext(!1);function mLt(){return w.useContext(Y7e)}function loe(n){return ae.createElement(Y7e.Provider,{value:n.force},n.children)}function _Lt(n){let e=mLt(),t=w.useContext(Q7e),i=S0(n),[r,o]=w.useState(()=>{if(!e&&t!==null||Ky.isServer)return null;let s=i==null?void 0:i.getElementById("headlessui-portal-root");if(s)return s;if(i===null)return null;let a=i.createElement("div");return a.setAttribute("id","headlessui-portal-root"),i.body.appendChild(a)});return w.useEffect(()=>{r!==null&&(i!=null&&i.body.contains(r)||i==null||i.body.appendChild(r))},[r,i]),w.useEffect(()=>{e||t!==null&&o(t.current)},[t,o,e]),r}let vLt=w.Fragment;function bLt(n,e){let t=n,i=w.useRef(null),r=La(F7e(u=>{i.current=u}),e),o=S0(i),s=_Lt(i),[a]=w.useState(()=>{var u;return Ky.isServer?null:(u=o==null?void 0:o.createElement("div"))!=null?u:null}),l=w.useContext(coe),c=kN();return Xs(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),Xs(()=>{if(a&&l)return l.register(a)},[l,a]),j7e(()=>{var u;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((u=s.parentElement)==null||u.removeChild(s)))}),c?!s||!a?null:sp.createPortal(Zs({ourProps:{ref:r},theirProps:t,defaultTag:vLt,name:"Portal"}),a):null}let yLt=w.Fragment,Q7e=w.createContext(null);function CLt(n,e){let{target:t,...i}=n,r={ref:La(e)};return ae.createElement(Q7e.Provider,{value:t},Zs({ourProps:r,theirProps:i,defaultTag:yLt,name:"Popover.Group"}))}let coe=w.createContext(null);function X7e(){let n=w.useContext(coe),e=w.useRef([]),t=jn(o=>(e.current.push(o),n&&n.register(o),()=>i(o))),i=jn(o=>{let s=e.current.indexOf(o);s!==-1&&e.current.splice(s,1),n&&n.unregister(o)}),r=w.useMemo(()=>({register:t,unregister:i,portals:e}),[t,i,e]);return[e,w.useMemo(()=>function({children:o}){return ae.createElement(coe.Provider,{value:r},o)},[r])]}let wLt=Js(bLt),SLt=Js(CLt),uoe=Object.assign(wLt,{Group:SLt});function ELt(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const xLt=typeof Object.is=="function"?Object.is:ELt,{useState:TLt,useEffect:kLt,useLayoutEffect:ILt,useDebugValue:LLt}=Am;function DLt(n,e,t){const i=e(),[{inst:r},o]=TLt({inst:{value:i,getSnapshot:e}});return ILt(()=>{r.value=i,r.getSnapshot=e,OZ(r)&&o({inst:r})},[n,i,e]),kLt(()=>(OZ(r)&&o({inst:r}),n(()=>{OZ(r)&&o({inst:r})})),[n]),LLt(i),i}function OZ(n){const e=n.getSnapshot,t=n.value;try{const i=e();return!xLt(t,i)}catch{return!0}}function ALt(n,e,t){return e()}const NLt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RLt=!NLt,OLt=RLt?ALt:DLt,PLt="useSyncExternalStore"in Am?(n=>n.useSyncExternalStore)(Am):OLt;function MLt(n){return PLt(n.subscribe,n.getSnapshot,n.getSnapshot)}function FLt(n,e){let t=n(),i=new Set;return{getSnapshot(){return t},subscribe(r){return i.add(r),()=>i.delete(r)},dispatch(r,...o){let s=e[r].call(t,...o);s&&(t=s,i.forEach(a=>a()))}}}function BLt(){let n;return{before({doc:e}){var t;let i=e.documentElement;n=((t=e.defaultView)!=null?t:window).innerWidth-i.clientWidth},after({doc:e,d:t}){let i=e.documentElement,r=i.clientWidth-i.offsetWidth,o=n-r;t.style(i,"paddingRight",`${o}px`)}}}function $Lt(){return R7e()?{before({doc:n,d:e,meta:t}){function i(r){return t.containers.flatMap(o=>o()).some(o=>o.contains(r))}e.microTask(()=>{var r;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let a=gg();a.style(n.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>a.dispose()))}let o=(r=window.scrollY)!=null?r:window.pageYOffset,s=null;e.addEventListener(n,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=n.querySelector(c);u&&!i(u)&&(s=u)}catch{}},!0),e.addEventListener(n,"touchstart",a=>{if(a.target instanceof HTMLElement)if(i(a.target)){let l=a.target;for(;l.parentElement&&i(l.parentElement);)l=l.parentElement;e.style(l,"overscrollBehavior","contain")}else e.style(a.target,"touchAction","none")}),e.addEventListener(n,"touchmove",a=>{if(a.target instanceof HTMLElement)if(i(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()},{passive:!1}),e.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;o!==l&&window.scrollTo(0,o),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function VLt(){return{before({doc:n,d:e}){e.style(n.documentElement,"overflow","hidden")}}}function HLt(n){let e={};for(let t of n)Object.assign(e,t(e));return e}let Fx=FLt(()=>new Map,{PUSH(n,e){var t;let i=(t=this.get(n))!=null?t:{doc:n,count:0,d:gg(),meta:new Set};return i.count++,i.meta.add(e),this.set(n,i),this},POP(n,e){let t=this.get(n);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:n,d:e,meta:t}){let i={doc:n,d:e,meta:HLt(t)},r=[$Lt(),BLt(),VLt()];r.forEach(({before:o})=>o==null?void 0:o(i)),r.forEach(({after:o})=>o==null?void 0:o(i))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});Fx.subscribe(()=>{let n=Fx.getSnapshot(),e=new Map;for(let[t]of n)e.set(t,t.documentElement.style.overflow);for(let t of n.values()){let i=e.get(t.doc)==="hidden",r=t.count!==0;(r&&!i||!r&&i)&&Fx.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&Fx.dispatch("TEARDOWN",t)}});function WLt(n,e,t){let i=MLt(Fx),r=n?i.get(n):void 0,o=r?r.count>0:!1;return Xs(()=>{if(!(!n||!e))return Fx.dispatch("PUSH",n,t),()=>Fx.dispatch("POP",n,t)},[e,n]),o}let PZ=new Map,nO=new Map;function ike(n,e=!0){Xs(()=>{var t;if(!e)return;let i=typeof n=="function"?n():n.current;if(!i)return;function r(){var s;if(!i)return;let a=(s=nO.get(i))!=null?s:1;if(a===1?nO.delete(i):nO.set(i,a-1),a!==1)return;let l=PZ.get(i);l&&(l["aria-hidden"]===null?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden",l["aria-hidden"]),i.inert=l.inert,PZ.delete(i))}let o=(t=nO.get(i))!=null?t:0;return nO.set(i,o+1),o!==0||(PZ.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),i.setAttribute("aria-hidden","true"),i.inert=!0),r},[n,e])}function Z7e({defaultContainers:n=[],portals:e,mainTreeNodeRef:t}={}){var i;let r=w.useRef((i=t==null?void 0:t.current)!=null?i:null),o=S0(r),s=jn(()=>{var a,l,c;let u=[];for(let d of n)d!==null&&(d instanceof HTMLElement?u.push(d):"current"in d&&d.current instanceof HTMLElement&&u.push(d.current));if(e!=null&&e.current)for(let d of e.current)u.push(d);for(let d of(a=o==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])d!==document.body&&d!==document.head&&d instanceof HTMLElement&&d.id!=="headlessui-portal-root"&&(d.contains(r.current)||d.contains((c=(l=r.current)==null?void 0:l.getRootNode())==null?void 0:c.host)||u.some(h=>d.contains(h))||u.push(d));return u});return{resolveContainers:s,contains:jn(a=>s().some(l=>l.contains(a))),mainTreeNodeRef:r,MainTreeNode:w.useMemo(()=>function(){return t!=null?null:ae.createElement(g1,{features:n0.Hidden,ref:r})},[r,t])}}function zLt(){let n=w.useRef(null);return{mainTreeNodeRef:n,MainTreeNode:w.useMemo(()=>function(){return ae.createElement(g1,{features:n0.Hidden,ref:n})},[n])}}let Lme=w.createContext(()=>{});Lme.displayName="StackContext";var doe=(n=>(n[n.Add=0]="Add",n[n.Remove=1]="Remove",n))(doe||{});function ULt(){return w.useContext(Lme)}function jLt({children:n,onUpdate:e,type:t,element:i,enabled:r}){let o=ULt(),s=jn((...a)=>{e==null||e(...a),o(...a)});return Xs(()=>{let a=r===void 0||r===!0;return a&&s(0,t,i),()=>{a&&s(1,t,i)}},[s,t,i,r]),ae.createElement(Lme.Provider,{value:s},n)}let J7e=w.createContext(null);function e$e(){let n=w.useContext(J7e);if(n===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,e$e),e}return n}function t$e(){let[n,e]=w.useState([]);return[n.length>0?n.join(" "):void 0,w.useMemo(()=>function(t){let i=jn(o=>(e(s=>[...s,o]),()=>e(s=>{let a=s.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),r=w.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return ae.createElement(J7e.Provider,{value:r},t.children)},[e])]}let qLt="p";function KLt(n,e){let t=ic(),{id:i=`headlessui-description-${t}`,...r}=n,o=e$e(),s=La(e);Xs(()=>o.register(i),[i,o.register]);let a={ref:s,...o.props,id:i};return Zs({ourProps:a,theirProps:r,slot:o.slot||{},defaultTag:qLt,name:o.name||"Description"})}let GLt=Js(KLt),n$e=Object.assign(GLt,{});var YLt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(YLt||{}),QLt=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(QLt||{});let XLt={0(n,e){return n.titleId===e.id?n:{...n,titleId:e.id}}},RH=w.createContext(null);RH.displayName="DialogContext";function SF(n){let e=w.useContext(RH);if(e===null){let t=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,SF),t}return e}function ZLt(n,e,t=()=>[document.body]){WLt(n,e,i=>{var r;return{containers:[...(r=i.containers)!=null?r:[],t]}})}function JLt(n,e){return Bs(e.type,XLt,n,e)}let eDt="div",tDt=Bm.RenderStrategy|Bm.Static;function nDt(n,e){let t=ic(),{id:i=`headlessui-dialog-${t}`,open:r,onClose:o,initialFocus:s,role:a="dialog",__demoMode:l=!1,...c}=n,[u,d]=w.useState(0),h=w.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(h.current||(h.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let f=Fk();r===void 0&&f!==null&&(r=(f&Pa.Open)===Pa.Open);let g=w.useRef(null),m=La(g,e),v=S0(g),_=n.hasOwnProperty("open")||f!==null,b=n.hasOwnProperty("onClose");if(!_&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!_)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof r!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let y=r?0:1,[C,x]=w.useReducer(JLt,{titleId:null,descriptionId:null,panelRef:w.createRef()}),E=jn(()=>o(!1)),k=jn(Be=>x({type:0,id:Be})),L=kN()?l?!1:y===0:!1,D=u>1,A=w.useContext(RH)!==null,[O,P]=X7e(),F={get current(){var Be;return(Be=C.panelRef.current)!=null?Be:g.current}},{resolveContainers:B,mainTreeNodeRef:M,MainTreeNode:V}=Z7e({portals:O,defaultContainers:[F]}),U=D?"parent":"leaf",W=f!==null?(f&Pa.Closing)===Pa.Closing:!1,q=(()=>A||W?!1:L)(),H=w.useCallback(()=>{var Be,_t;return(_t=Array.from((Be=v==null?void 0:v.querySelectorAll("body > *"))!=null?Be:[]).find(Wt=>Wt.id==="headlessui-portal-root"?!1:Wt.contains(M.current)&&Wt instanceof HTMLElement))!=null?_t:null},[M]);ike(H,q);let ie=(()=>D?!0:L)(),se=w.useCallback(()=>{var Be,_t;return(_t=Array.from((Be=v==null?void 0:v.querySelectorAll("[data-headlessui-portal]"))!=null?Be:[]).find(Wt=>Wt.contains(M.current)&&Wt instanceof HTMLElement))!=null?_t:null},[M]);ike(se,ie);let Q=(()=>!(!L||D))();oq(B,Be=>{Be.preventDefault(),E()},Q);let Ee=(()=>!(D||y!==0))();kme(v==null?void 0:v.defaultView,"keydown",Be=>{Ee&&(Be.defaultPrevented||Be.key===No.Escape&&(Be.preventDefault(),Be.stopPropagation(),E()))});let Fe=(()=>!(W||y!==0||A))();ZLt(v,Fe,B),w.useEffect(()=>{if(y!==0||!g.current)return;let Be=new ResizeObserver(_t=>{for(let Wt of _t){let Tt=Wt.target.getBoundingClientRect();Tt.x===0&&Tt.y===0&&Tt.width===0&&Tt.height===0&&E()}});return Be.observe(g.current),()=>Be.disconnect()},[y,g,E]);let[He,ke]=t$e(),Me=w.useMemo(()=>[{dialogState:y,close:E,setTitleId:k},C],[y,C,E,k]),je=w.useMemo(()=>({open:y===0}),[y]),qe={ref:m,id:i,role:a,"aria-modal":y===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":He};return ae.createElement(jLt,{type:"Dialog",enabled:y===0,element:g,onUpdate:jn((Be,_t)=>{_t==="Dialog"&&Bs(Be,{[doe.Add]:()=>d(Wt=>Wt+1),[doe.Remove]:()=>d(Wt=>Wt-1)})})},ae.createElement(loe,{force:!0},ae.createElement(uoe,null,ae.createElement(RH.Provider,{value:Me},ae.createElement(uoe.Group,{target:g},ae.createElement(loe,{force:!1},ae.createElement(ke,{slot:je,name:"Dialog.Description"},ae.createElement(tO,{initialFocus:s,containers:B,features:L?Bs(U,{parent:tO.features.RestoreFocus,leaf:tO.features.All&~tO.features.FocusLock}):tO.features.None},ae.createElement(P,null,Zs({ourProps:qe,theirProps:c,slot:je,defaultTag:eDt,features:tDt,visible:y===0,name:"Dialog"}))))))))),ae.createElement(V,null))}let iDt="div";function rDt(n,e){let t=ic(),{id:i=`headlessui-dialog-overlay-${t}`,...r}=n,[{dialogState:o,close:s}]=SF("Dialog.Overlay"),a=La(e),l=jn(u=>{if(u.target===u.currentTarget){if(IN(u.currentTarget))return u.preventDefault();u.preventDefault(),u.stopPropagation(),s()}}),c=w.useMemo(()=>({open:o===0}),[o]);return Zs({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:l},theirProps:r,slot:c,defaultTag:iDt,name:"Dialog.Overlay"})}let oDt="div";function sDt(n,e){let t=ic(),{id:i=`headlessui-dialog-backdrop-${t}`,...r}=n,[{dialogState:o},s]=SF("Dialog.Backdrop"),a=La(e);w.useEffect(()=>{if(s.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let l=w.useMemo(()=>({open:o===0}),[o]);return ae.createElement(loe,{force:!0},ae.createElement(uoe,null,Zs({ourProps:{ref:a,id:i,"aria-hidden":!0},theirProps:r,slot:l,defaultTag:oDt,name:"Dialog.Backdrop"})))}let aDt="div";function lDt(n,e){let t=ic(),{id:i=`headlessui-dialog-panel-${t}`,...r}=n,[{dialogState:o},s]=SF("Dialog.Panel"),a=La(e,s.panelRef),l=w.useMemo(()=>({open:o===0}),[o]),c=jn(u=>{u.stopPropagation()});return Zs({ourProps:{ref:a,id:i,onClick:c},theirProps:r,slot:l,defaultTag:aDt,name:"Dialog.Panel"})}let cDt="h2";function uDt(n,e){let t=ic(),{id:i=`headlessui-dialog-title-${t}`,...r}=n,[{dialogState:o,setTitleId:s}]=SF("Dialog.Title"),a=La(e);w.useEffect(()=>(s(i),()=>s(null)),[i,s]);let l=w.useMemo(()=>({open:o===0}),[o]);return Zs({ourProps:{ref:a,id:i},theirProps:r,slot:l,defaultTag:cDt,name:"Dialog.Title"})}let dDt=Js(nDt),hDt=Js(sDt),fDt=Js(lDt),pDt=Js(rDt),gDt=Js(uDt),aT=Object.assign(dDt,{Backdrop:hDt,Panel:fDt,Overlay:pDt,Title:gDt,Description:n$e}),rke=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function oke(n){var e,t;let i=(e=n.innerText)!=null?e:"",r=n.cloneNode(!0);if(!(r instanceof HTMLElement))return i;let o=!1;for(let a of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),o=!0;let s=o?(t=r.innerText)!=null?t:"":i;return rke.test(s)&&(s=s.replace(rke,"")),s}function mDt(n){let e=n.getAttribute("aria-label");if(typeof e=="string")return e.trim();let t=n.getAttribute("aria-labelledby");if(t){let i=t.split(" ").map(r=>{let o=document.getElementById(r);if(o){let s=o.getAttribute("aria-label");return typeof s=="string"?s.trim():oke(o).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return oke(n).trim()}function _Dt(n){let e=w.useRef(""),t=w.useRef("");return jn(()=>{let i=n.current;if(!i)return"";let r=i.innerText;if(e.current===r)return t.current;let o=mDt(i).trim().toLowerCase();return e.current=r,t.current=o,o})}var vDt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(vDt||{}),bDt=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(bDt||{}),yDt=(n=>(n[n.OpenMenu=0]="OpenMenu",n[n.CloseMenu=1]="CloseMenu",n[n.GoToItem=2]="GoToItem",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterItem=5]="RegisterItem",n[n.UnregisterItem=6]="UnregisterItem",n))(yDt||{});function MZ(n,e=t=>t){let t=n.activeItemIndex!==null?n.items[n.activeItemIndex]:null,i=Sme(e(n.items.slice()),o=>o.dataRef.current.domRef.current),r=t?i.indexOf(t):null;return r===-1&&(r=null),{items:i,activeItemIndex:r}}let CDt={1(n){return n.menuState===1?n:{...n,activeItemIndex:null,menuState:1}},0(n){return n.menuState===0?n:{...n,__demoMode:!1,menuState:0}},2:(n,e)=>{var t;let i=MZ(n),r=aoe(e,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...n,...i,searchQuery:"",activeItemIndex:r,activationTrigger:(t=e.trigger)!=null?t:1}},3:(n,e)=>{let t=n.searchQuery!==""?0:1,i=n.searchQuery+e.value.toLowerCase(),r=(n.activeItemIndex!==null?n.items.slice(n.activeItemIndex+t).concat(n.items.slice(0,n.activeItemIndex+t)):n.items).find(s=>{var a;return((a=s.dataRef.current.textValue)==null?void 0:a.startsWith(i))&&!s.dataRef.current.disabled}),o=r?n.items.indexOf(r):-1;return o===-1||o===n.activeItemIndex?{...n,searchQuery:i}:{...n,searchQuery:i,activeItemIndex:o,activationTrigger:1}},4(n){return n.searchQuery===""?n:{...n,searchQuery:"",searchActiveItemIndex:null}},5:(n,e)=>{let t=MZ(n,i=>[...i,{id:e.id,dataRef:e.dataRef}]);return{...n,...t}},6:(n,e)=>{let t=MZ(n,i=>{let r=i.findIndex(o=>o.id===e.id);return r!==-1&&i.splice(r,1),i});return{...n,...t,activationTrigger:1}}},Dme=w.createContext(null);Dme.displayName="MenuContext";function lq(n){let e=w.useContext(Dme);if(e===null){let t=new Error(`<${n} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,lq),t}return e}function wDt(n,e){return Bs(e.type,CDt,n,e)}let SDt=w.Fragment;function EDt(n,e){let{__demoMode:t=!1,...i}=n,r=w.useReducer(wDt,{__demoMode:t,menuState:t?0:1,buttonRef:w.createRef(),itemsRef:w.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:s,buttonRef:a},l]=r,c=La(e);oq([a,s],(f,g)=>{var m;l({type:1}),rq(g,iq.Loose)||(f.preventDefault(),(m=a.current)==null||m.focus())},o===0);let u=jn(()=>{l({type:1})}),d=w.useMemo(()=>({open:o===0,close:u}),[o,u]),h={ref:c};return ae.createElement(Dme.Provider,{value:r},ae.createElement(aq,{value:Bs(o,{0:Pa.Open,1:Pa.Closed})},Zs({ourProps:h,theirProps:i,slot:d,defaultTag:SDt,name:"Menu"})))}let xDt="button";function TDt(n,e){var t;let i=ic(),{id:r=`headlessui-menu-button-${i}`,...o}=n,[s,a]=lq("Menu.Button"),l=La(s.buttonRef,e),c=k1(),u=jn(m=>{switch(m.key){case No.Space:case No.Enter:case No.ArrowDown:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:ca.First}));break;case No.ArrowUp:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:ca.Last}));break}}),d=jn(m=>{switch(m.key){case No.Space:m.preventDefault();break}}),h=jn(m=>{if(IN(m.currentTarget))return m.preventDefault();n.disabled||(s.menuState===0?(a({type:1}),c.nextFrame(()=>{var v;return(v=s.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})})):(m.preventDefault(),a({type:0})))}),f=w.useMemo(()=>({open:s.menuState===0}),[s]),g={ref:l,id:r,type:sq(n,s.buttonRef),"aria-haspopup":"menu","aria-controls":(t=s.itemsRef.current)==null?void 0:t.id,"aria-expanded":s.menuState===0,onKeyDown:u,onKeyUp:d,onClick:h};return Zs({ourProps:g,theirProps:o,slot:f,defaultTag:xDt,name:"Menu.Button"})}let kDt="div",IDt=Bm.RenderStrategy|Bm.Static;function LDt(n,e){var t,i;let r=ic(),{id:o=`headlessui-menu-items-${r}`,...s}=n,[a,l]=lq("Menu.Items"),c=La(a.itemsRef,e),u=S0(a.itemsRef),d=k1(),h=Fk(),f=(()=>h!==null?(h&Pa.Open)===Pa.Open:a.menuState===0)();w.useEffect(()=>{let b=a.itemsRef.current;b&&a.menuState===0&&b!==(u==null?void 0:u.activeElement)&&b.focus({preventScroll:!0})},[a.menuState,a.itemsRef,u]),$7e({container:a.itemsRef.current,enabled:a.menuState===0,accept(b){return b.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:b.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(b){b.setAttribute("role","none")}});let g=jn(b=>{var y,C;switch(d.dispose(),b.key){case No.Space:if(a.searchQuery!=="")return b.preventDefault(),b.stopPropagation(),l({type:3,value:b.key});case No.Enter:if(b.preventDefault(),b.stopPropagation(),l({type:1}),a.activeItemIndex!==null){let{dataRef:x}=a.items[a.activeItemIndex];(C=(y=x.current)==null?void 0:y.domRef.current)==null||C.click()}N7e(a.buttonRef.current);break;case No.ArrowDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ca.Next});case No.ArrowUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ca.Previous});case No.Home:case No.PageUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ca.First});case No.End:case No.PageDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ca.Last});case No.Escape:b.preventDefault(),b.stopPropagation(),l({type:1}),gg().nextFrame(()=>{var x;return(x=a.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})});break;case No.Tab:b.preventDefault(),b.stopPropagation(),l({type:1}),gg().nextFrame(()=>{k2t(a.buttonRef.current,b.shiftKey?wd.Previous:wd.Next)});break;default:b.key.length===1&&(l({type:3,value:b.key}),d.setTimeout(()=>l({type:4}),350));break}}),m=jn(b=>{switch(b.key){case No.Space:b.preventDefault();break}}),v=w.useMemo(()=>({open:a.menuState===0}),[a]),_={"aria-activedescendant":a.activeItemIndex===null||(t=a.items[a.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(i=a.buttonRef.current)==null?void 0:i.id,id:o,onKeyDown:g,onKeyUp:m,role:"menu",tabIndex:0,ref:c};return Zs({ourProps:_,theirProps:s,slot:v,defaultTag:kDt,features:IDt,visible:f,name:"Menu.Items"})}let DDt=w.Fragment;function ADt(n,e){let t=ic(),{id:i=`headlessui-menu-item-${t}`,disabled:r=!1,...o}=n,[s,a]=lq("Menu.Item"),l=s.activeItemIndex!==null?s.items[s.activeItemIndex].id===i:!1,c=w.useRef(null),u=La(e,c);Xs(()=>{if(s.__demoMode||s.menuState!==0||!l||s.activationTrigger===0)return;let x=gg();return x.requestAnimationFrame(()=>{var E,k;(k=(E=c.current)==null?void 0:E.scrollIntoView)==null||k.call(E,{block:"nearest"})}),x.dispose},[s.__demoMode,c,l,s.menuState,s.activationTrigger,s.activeItemIndex]);let d=_Dt(c),h=w.useRef({disabled:r,domRef:c,get textValue(){return d()}});Xs(()=>{h.current.disabled=r},[h,r]),Xs(()=>(a({type:5,id:i,dataRef:h}),()=>a({type:6,id:i})),[h,i]);let f=jn(()=>{a({type:1})}),g=jn(x=>{if(r)return x.preventDefault();a({type:1}),N7e(s.buttonRef.current)}),m=jn(()=>{if(r)return a({type:2,focus:ca.Nothing});a({type:2,focus:ca.Specific,id:i})}),v=B7e(),_=jn(x=>v.update(x)),b=jn(x=>{v.wasMoved(x)&&(r||l||a({type:2,focus:ca.Specific,id:i,trigger:0}))}),y=jn(x=>{v.wasMoved(x)&&(r||l&&a({type:2,focus:ca.Nothing}))}),C=w.useMemo(()=>({active:l,disabled:r,close:f}),[l,r,f]);return Zs({ourProps:{id:i,ref:u,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,disabled:void 0,onClick:g,onFocus:m,onPointerEnter:_,onMouseEnter:_,onPointerMove:b,onMouseMove:b,onPointerLeave:y,onMouseLeave:y},theirProps:o,slot:C,defaultTag:DDt,name:"Menu.Item"})}let NDt=Js(EDt),RDt=Js(TDt),ODt=Js(LDt),PDt=Js(ADt),Q1=Object.assign(NDt,{Button:RDt,Items:ODt,Item:PDt});var MDt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(MDt||{}),FDt=(n=>(n[n.TogglePopover=0]="TogglePopover",n[n.ClosePopover=1]="ClosePopover",n[n.SetButton=2]="SetButton",n[n.SetButtonId=3]="SetButtonId",n[n.SetPanel=4]="SetPanel",n[n.SetPanelId=5]="SetPanelId",n))(FDt||{});let BDt={0:n=>{let e={...n,popoverState:Bs(n.popoverState,{0:1,1:0})};return e.popoverState===0&&(e.__demoMode=!1),e},1(n){return n.popoverState===1?n:{...n,popoverState:1}},2(n,e){return n.button===e.button?n:{...n,button:e.button}},3(n,e){return n.buttonId===e.buttonId?n:{...n,buttonId:e.buttonId}},4(n,e){return n.panel===e.panel?n:{...n,panel:e.panel}},5(n,e){return n.panelId===e.panelId?n:{...n,panelId:e.panelId}}},Ame=w.createContext(null);Ame.displayName="PopoverContext";function cq(n){let e=w.useContext(Ame);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,cq),t}return e}let Nme=w.createContext(null);Nme.displayName="PopoverAPIContext";function Rme(n){let e=w.useContext(Nme);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Rme),t}return e}let Ome=w.createContext(null);Ome.displayName="PopoverGroupContext";function i$e(){return w.useContext(Ome)}let uq=w.createContext(null);uq.displayName="PopoverPanelContext";function $Dt(){return w.useContext(uq)}function VDt(n,e){return Bs(e.type,BDt,n,e)}let HDt="div";function WDt(n,e){var t;let{__demoMode:i=!1,...r}=n,o=w.useRef(null),s=La(e,F7e(V=>{o.current=V})),a=w.useRef([]),l=w.useReducer(VDt,{__demoMode:i,popoverState:i?0:1,buttons:a,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:w.createRef(),afterPanelSentinel:w.createRef()}),[{popoverState:c,button:u,buttonId:d,panel:h,panelId:f,beforePanelSentinel:g,afterPanelSentinel:m},v]=l,_=S0((t=o.current)!=null?t:u),b=w.useMemo(()=>{if(!u||!h)return!1;for(let se of document.querySelectorAll("body > *"))if(Number(se==null?void 0:se.contains(u))^Number(se==null?void 0:se.contains(h)))return!0;let V=yF(),U=V.indexOf(u),W=(U+V.length-1)%V.length,q=(U+1)%V.length,H=V[W],ie=V[q];return!h.contains(H)&&!h.contains(ie)},[u,h]),y=ig(d),C=ig(f),x=w.useMemo(()=>({buttonId:y,panelId:C,close:()=>v({type:1})}),[y,C,v]),E=i$e(),k=E==null?void 0:E.registerPopover,L=jn(()=>{var V;return(V=E==null?void 0:E.isFocusWithinPopoverGroup())!=null?V:(_==null?void 0:_.activeElement)&&((u==null?void 0:u.contains(_.activeElement))||(h==null?void 0:h.contains(_.activeElement)))});w.useEffect(()=>k==null?void 0:k(x),[k,x]);let[D,A]=X7e(),O=Z7e({mainTreeNodeRef:E==null?void 0:E.mainTreeNodeRef,portals:D,defaultContainers:[u,h]});kme(_==null?void 0:_.defaultView,"focus",V=>{var U,W,q,H;V.target!==window&&V.target instanceof HTMLElement&&c===0&&(L()||u&&h&&(O.contains(V.target)||(W=(U=g.current)==null?void 0:U.contains)!=null&&W.call(U,V.target)||(H=(q=m.current)==null?void 0:q.contains)!=null&&H.call(q,V.target)||v({type:1})))},!0),oq(O.resolveContainers,(V,U)=>{v({type:1}),rq(U,iq.Loose)||(V.preventDefault(),u==null||u.focus())},c===0);let P=jn(V=>{v({type:1});let U=(()=>V?V instanceof HTMLElement?V:"current"in V&&V.current instanceof HTMLElement?V.current:u:u)();U==null||U.focus()}),F=w.useMemo(()=>({close:P,isPortalled:b}),[P,b]),B=w.useMemo(()=>({open:c===0,close:P}),[c,P]),M={ref:s};return ae.createElement(uq.Provider,{value:null},ae.createElement(Ame.Provider,{value:l},ae.createElement(Nme.Provider,{value:F},ae.createElement(aq,{value:Bs(c,{0:Pa.Open,1:Pa.Closed})},ae.createElement(A,null,Zs({ourProps:M,theirProps:r,slot:B,defaultTag:HDt,name:"Popover"}),ae.createElement(O.MainTreeNode,null))))))}let zDt="button";function UDt(n,e){let t=ic(),{id:i=`headlessui-popover-button-${t}`,...r}=n,[o,s]=cq("Popover.Button"),{isPortalled:a}=Rme("Popover.Button"),l=w.useRef(null),c=`headlessui-focus-sentinel-${ic()}`,u=i$e(),d=u==null?void 0:u.closeOthers,h=$Dt()!==null;w.useEffect(()=>{if(!h)return s({type:3,buttonId:i}),()=>{s({type:3,buttonId:null})}},[h,i,s]);let[f]=w.useState(()=>Symbol()),g=La(l,e,h?null:O=>{if(O)o.buttons.current.push(f);else{let P=o.buttons.current.indexOf(f);P!==-1&&o.buttons.current.splice(P,1)}o.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),O&&s({type:2,button:O})}),m=La(l,e),v=S0(l),_=jn(O=>{var P,F,B;if(h){if(o.popoverState===1)return;switch(O.key){case No.Space:case No.Enter:O.preventDefault(),(F=(P=O.target).click)==null||F.call(P),s({type:1}),(B=o.button)==null||B.focus();break}}else switch(O.key){case No.Space:case No.Enter:O.preventDefault(),O.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),s({type:0});break;case No.Escape:if(o.popoverState!==0)return d==null?void 0:d(o.buttonId);if(!l.current||v!=null&&v.activeElement&&!l.current.contains(v.activeElement))return;O.preventDefault(),O.stopPropagation(),s({type:1});break}}),b=jn(O=>{h||O.key===No.Space&&O.preventDefault()}),y=jn(O=>{var P,F;IN(O.currentTarget)||n.disabled||(h?(s({type:1}),(P=o.button)==null||P.focus()):(O.preventDefault(),O.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),s({type:0}),(F=o.button)==null||F.focus()))}),C=jn(O=>{O.preventDefault(),O.stopPropagation()}),x=o.popoverState===0,E=w.useMemo(()=>({open:x}),[x]),k=sq(n,l),L=h?{ref:m,type:k,onKeyDown:_,onClick:y}:{ref:g,id:o.buttonId,type:k,"aria-expanded":o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:_,onKeyUp:b,onClick:y,onMouseDown:C},D=Ime(),A=jn(()=>{let O=o.panel;if(!O)return;function P(){Bs(D.current,{[jp.Forwards]:()=>pm(O,wd.First),[jp.Backwards]:()=>pm(O,wd.Last)})===P4.Error&&pm(yF().filter(F=>F.dataset.headlessuiFocusGuard!=="true"),Bs(D.current,{[jp.Forwards]:wd.Next,[jp.Backwards]:wd.Previous}),{relativeTo:o.button})}P()});return ae.createElement(ae.Fragment,null,Zs({ourProps:L,theirProps:r,slot:E,defaultTag:zDt,name:"Popover.Button"}),x&&!h&&a&&ae.createElement(g1,{id:c,features:n0.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:A}))}let jDt="div",qDt=Bm.RenderStrategy|Bm.Static;function KDt(n,e){let t=ic(),{id:i=`headlessui-popover-overlay-${t}`,...r}=n,[{popoverState:o},s]=cq("Popover.Overlay"),a=La(e),l=Fk(),c=(()=>l!==null?(l&Pa.Open)===Pa.Open:o===0)(),u=jn(h=>{if(IN(h.currentTarget))return h.preventDefault();s({type:1})}),d=w.useMemo(()=>({open:o===0}),[o]);return Zs({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:u},theirProps:r,slot:d,defaultTag:jDt,features:qDt,visible:c,name:"Popover.Overlay"})}let GDt="div",YDt=Bm.RenderStrategy|Bm.Static;function QDt(n,e){let t=ic(),{id:i=`headlessui-popover-panel-${t}`,focus:r=!1,...o}=n,[s,a]=cq("Popover.Panel"),{close:l,isPortalled:c}=Rme("Popover.Panel"),u=`headlessui-focus-sentinel-before-${ic()}`,d=`headlessui-focus-sentinel-after-${ic()}`,h=w.useRef(null),f=La(h,e,L=>{a({type:4,panel:L})}),g=S0(h),m=L2t();Xs(()=>(a({type:5,panelId:i}),()=>{a({type:5,panelId:null})}),[i,a]);let v=Fk(),_=(()=>v!==null?(v&Pa.Open)===Pa.Open:s.popoverState===0)(),b=jn(L=>{var D;switch(L.key){case No.Escape:if(s.popoverState!==0||!h.current||g!=null&&g.activeElement&&!h.current.contains(g.activeElement))return;L.preventDefault(),L.stopPropagation(),a({type:1}),(D=s.button)==null||D.focus();break}});w.useEffect(()=>{var L;n.static||s.popoverState===1&&((L=n.unmount)==null||L)&&a({type:4,panel:null})},[s.popoverState,n.unmount,n.static,a]),w.useEffect(()=>{if(s.__demoMode||!r||s.popoverState!==0||!h.current)return;let L=g==null?void 0:g.activeElement;h.current.contains(L)||pm(h.current,wd.First)},[s.__demoMode,r,h,s.popoverState]);let y=w.useMemo(()=>({open:s.popoverState===0,close:l}),[s,l]),C={ref:f,id:i,onKeyDown:b,onBlur:r&&s.popoverState===0?L=>{var D,A,O,P,F;let B=L.relatedTarget;B&&h.current&&((D=h.current)!=null&&D.contains(B)||(a({type:1}),((O=(A=s.beforePanelSentinel.current)==null?void 0:A.contains)!=null&&O.call(A,B)||(F=(P=s.afterPanelSentinel.current)==null?void 0:P.contains)!=null&&F.call(P,B))&&B.focus({preventScroll:!0})))}:void 0,tabIndex:-1},x=Ime(),E=jn(()=>{let L=h.current;if(!L)return;function D(){Bs(x.current,{[jp.Forwards]:()=>{var A;pm(L,wd.First)===P4.Error&&((A=s.afterPanelSentinel.current)==null||A.focus())},[jp.Backwards]:()=>{var A;(A=s.button)==null||A.focus({preventScroll:!0})}})}D()}),k=jn(()=>{let L=h.current;if(!L)return;function D(){Bs(x.current,{[jp.Forwards]:()=>{var A;if(!s.button)return;let O=yF(),P=O.indexOf(s.button),F=O.slice(0,P+1),B=[...O.slice(P+1),...F];for(let M of B.slice())if(M.dataset.headlessuiFocusGuard==="true"||(A=s.panel)!=null&&A.contains(M)){let V=B.indexOf(M);V!==-1&&B.splice(V,1)}pm(B,wd.First,{sorted:!1})},[jp.Backwards]:()=>{var A;pm(L,wd.Previous)===P4.Error&&((A=s.button)==null||A.focus())}})}D()});return ae.createElement(uq.Provider,{value:i},_&&c&&ae.createElement(g1,{id:u,ref:s.beforePanelSentinel,features:n0.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:E}),Zs({mergeRefs:m,ourProps:C,theirProps:o,slot:y,defaultTag:GDt,features:YDt,visible:_,name:"Popover.Panel"}),_&&c&&ae.createElement(g1,{id:d,ref:s.afterPanelSentinel,features:n0.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:k}))}let XDt="div";function ZDt(n,e){let t=w.useRef(null),i=La(t,e),[r,o]=w.useState([]),s=zLt(),a=jn(m=>{o(v=>{let _=v.indexOf(m);if(_!==-1){let b=v.slice();return b.splice(_,1),b}return v})}),l=jn(m=>(o(v=>[...v,m]),()=>a(m))),c=jn(()=>{var m;let v=bF(t);if(!v)return!1;let _=v.activeElement;return(m=t.current)!=null&&m.contains(_)?!0:r.some(b=>{var y,C;return((y=v.getElementById(b.buttonId.current))==null?void 0:y.contains(_))||((C=v.getElementById(b.panelId.current))==null?void 0:C.contains(_))})}),u=jn(m=>{for(let v of r)v.buttonId.current!==m&&v.close()}),d=w.useMemo(()=>({registerPopover:l,unregisterPopover:a,isFocusWithinPopoverGroup:c,closeOthers:u,mainTreeNodeRef:s.mainTreeNodeRef}),[l,a,c,u,s.mainTreeNodeRef]),h=w.useMemo(()=>({}),[]),f=n,g={ref:i};return ae.createElement(Ome.Provider,{value:d},Zs({ourProps:g,theirProps:f,slot:h,defaultTag:XDt,name:"Popover.Group"}),ae.createElement(s.MainTreeNode,null))}let JDt=Js(WDt),eAt=Js(UDt),tAt=Js(KDt),nAt=Js(QDt),iAt=Js(ZDt),FZ=Object.assign(JDt,{Button:eAt,Overlay:tAt,Panel:nAt,Group:iAt}),r$e=w.createContext(null);function o$e(){let n=w.useContext(r$e);if(n===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,o$e),e}return n}function rAt(){let[n,e]=w.useState([]);return[n.length>0?n.join(" "):void 0,w.useMemo(()=>function(t){let i=jn(o=>(e(s=>[...s,o]),()=>e(s=>{let a=s.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),r=w.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return ae.createElement(r$e.Provider,{value:r},t.children)},[e])]}let oAt="label";function sAt(n,e){let t=ic(),{id:i=`headlessui-label-${t}`,passive:r=!1,...o}=n,s=o$e(),a=La(e);Xs(()=>s.register(i),[i,s.register]);let l={ref:a,...s.props,id:i};return r&&("onClick"in l&&(delete l.htmlFor,delete l.onClick),"onClick"in o&&delete o.onClick),Zs({ourProps:l,theirProps:o,slot:s.slot||{},defaultTag:oAt,name:s.name||"Label"})}let aAt=Js(sAt),lAt=Object.assign(aAt,{});function cAt(n=0){let[e,t]=w.useState(n),i=wF(),r=w.useCallback(l=>{i.current&&t(c=>c|l)},[e,i]),o=w.useCallback(l=>!!(e&l),[e]),s=w.useCallback(l=>{i.current&&t(c=>c&~l)},[t,i]),a=w.useCallback(l=>{i.current&&t(c=>c^l)},[t]);return{flags:e,addFlag:r,hasFlag:o,removeFlag:s,toggleFlag:a}}let Pme=w.createContext(null);Pme.displayName="GroupContext";let uAt=w.Fragment;function dAt(n){var e;let[t,i]=w.useState(null),[r,o]=rAt(),[s,a]=t$e(),l=w.useMemo(()=>({switch:t,setSwitch:i,labelledby:r,describedby:s}),[t,i,r,s]),c={},u=n;return ae.createElement(a,{name:"Switch.Description"},ae.createElement(o,{name:"Switch.Label",props:{htmlFor:(e=l.switch)==null?void 0:e.id,onClick(d){t&&(d.currentTarget.tagName==="LABEL"&&d.preventDefault(),t.click(),t.focus({preventScroll:!0}))}}},ae.createElement(Pme.Provider,{value:l},Zs({ourProps:c,theirProps:u,defaultTag:uAt,name:"Switch.Group"}))))}let hAt="button";function fAt(n,e){var t;let i=ic(),{id:r=`headlessui-switch-${i}`,checked:o,defaultChecked:s=!1,onChange:a,disabled:l=!1,name:c,value:u,form:d,...h}=n,f=w.useContext(Pme),g=w.useRef(null),m=La(g,e,f===null?null:f.setSwitch),[v,_]=A7e(o,a,s),b=jn(()=>_==null?void 0:_(!v)),y=jn(D=>{if(IN(D.currentTarget))return D.preventDefault();D.preventDefault(),b()}),C=jn(D=>{D.key===No.Space?(D.preventDefault(),b()):D.key===No.Enter&&M2t(D.currentTarget)}),x=jn(D=>D.preventDefault()),E=w.useMemo(()=>({checked:v}),[v]),k={id:r,ref:m,role:"switch",type:sq(n,g),tabIndex:n.tabIndex===-1?0:(t=n.tabIndex)!=null?t:0,"aria-checked":v,"aria-labelledby":f==null?void 0:f.labelledby,"aria-describedby":f==null?void 0:f.describedby,disabled:l,onClick:y,onKeyUp:C,onKeyPress:x},L=k1();return w.useEffect(()=>{var D;let A=(D=g.current)==null?void 0:D.closest("form");A&&s!==void 0&&L.addEventListener(A,"reset",()=>{_(s)})},[g,_]),ae.createElement(ae.Fragment,null,c!=null&&v&&ae.createElement(g1,{features:n0.Hidden,...NH({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:l,form:d,checked:v,name:c,value:u})}),Zs({ourProps:k,theirProps:h,slot:E,defaultTag:hAt,name:"Switch"}))}let pAt=Js(fAt),gAt=dAt,hoe=Object.assign(pAt,{Group:gAt,Label:lAt,Description:n$e});function mAt(n){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,n(...t)}}function BZ(n,...e){n&&e.length>0&&n.classList.add(...e)}function $Z(n,...e){n&&e.length>0&&n.classList.remove(...e)}function _At(n,e){let t=gg();if(!n)return t.dispose;let{transitionDuration:i,transitionDelay:r}=getComputedStyle(n),[o,s]=[i,r].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,d)=>d-u);return c}),a=o+s;if(a!==0){t.group(c=>{c.setTimeout(()=>{e(),c.dispose()},a),c.addEventListener(n,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=t.addEventListener(n,"transitionend",c=>{c.target===c.currentTarget&&(e(),l())})}else e();return t.add(()=>e()),t.dispose}function vAt(n,e,t,i){let r=t?"enter":"leave",o=gg(),s=i!==void 0?mAt(i):()=>{};r==="enter"&&(n.removeAttribute("hidden"),n.style.display="");let a=Bs(r,{enter:()=>e.enter,leave:()=>e.leave}),l=Bs(r,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),c=Bs(r,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return $Z(n,...e.base,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),BZ(n,...e.base,...a,...c),o.nextFrame(()=>{$Z(n,...e.base,...a,...c),BZ(n,...e.base,...a,...l),_At(n,()=>($Z(n,...e.base,...a),BZ(n,...e.base,...e.entered),s()))}),o.dispose}function bAt({immediate:n,container:e,direction:t,classes:i,onStart:r,onStop:o}){let s=wF(),a=k1(),l=ig(t);Xs(()=>{n&&(l.current="enter")},[n]),Xs(()=>{let c=gg();a.add(c.dispose);let u=e.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),r.current(l.current),c.add(vAt(u,i.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[t])}function X1(n=""){return n.split(/\s+/).filter(e=>e.length>1)}let dq=w.createContext(null);dq.displayName="TransitionContext";var yAt=(n=>(n.Visible="visible",n.Hidden="hidden",n))(yAt||{});function CAt(){let n=w.useContext(dq);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function wAt(){let n=w.useContext(hq);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let hq=w.createContext(null);hq.displayName="NestingContext";function fq(n){return"children"in n?fq(n.children):n.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function s$e(n,e){let t=ig(n),i=w.useRef([]),r=wF(),o=k1(),s=jn((f,g=qC.Hidden)=>{let m=i.current.findIndex(({el:v})=>v===f);m!==-1&&(Bs(g,{[qC.Unmount](){i.current.splice(m,1)},[qC.Hidden](){i.current[m].state="hidden"}}),o.microTask(()=>{var v;!fq(i)&&r.current&&((v=t.current)==null||v.call(t))}))}),a=jn(f=>{let g=i.current.find(({el:m})=>m===f);return g?g.state!=="visible"&&(g.state="visible"):i.current.push({el:f,state:"visible"}),()=>s(f,qC.Unmount)}),l=w.useRef([]),c=w.useRef(Promise.resolve()),u=w.useRef({enter:[],leave:[],idle:[]}),d=jn((f,g,m)=>{l.current.splice(0),e&&(e.chains.current[g]=e.chains.current[g].filter(([v])=>v!==f)),e==null||e.chains.current[g].push([f,new Promise(v=>{l.current.push(v)})]),e==null||e.chains.current[g].push([f,new Promise(v=>{Promise.all(u.current[g].map(([_,b])=>b)).then(()=>v())})]),g==="enter"?c.current=c.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(g)):m(g)}),h=jn((f,g,m)=>{Promise.all(u.current[g].splice(0).map(([v,_])=>_)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>m(g))});return w.useMemo(()=>({children:i,register:a,unregister:s,onStart:d,onStop:h,wait:c,chains:u}),[a,s,i,d,h,u,c])}function SAt(){}let EAt=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ske(n){var e;let t={};for(let i of EAt)t[i]=(e=n[i])!=null?e:SAt;return t}function xAt(n){let e=w.useRef(ske(n));return w.useEffect(()=>{e.current=ske(n)},[n]),e}let TAt="div",a$e=Bm.RenderStrategy;function kAt(n,e){var t,i;let{beforeEnter:r,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:d,leave:h,leaveFrom:f,leaveTo:g,...m}=n,v=w.useRef(null),_=La(v,e),b=(t=m.unmount)==null||t?qC.Unmount:qC.Hidden,{show:y,appear:C,initial:x}=CAt(),[E,k]=w.useState(y?"visible":"hidden"),L=wAt(),{register:D,unregister:A}=L;w.useEffect(()=>D(v),[D,v]),w.useEffect(()=>{if(b===qC.Hidden&&v.current){if(y&&E!=="visible"){k("visible");return}return Bs(E,{hidden:()=>A(v),visible:()=>D(v)})}},[E,v,D,A,y,b]);let O=ig({base:X1(m.className),enter:X1(l),enterFrom:X1(c),enterTo:X1(u),entered:X1(d),leave:X1(h),leaveFrom:X1(f),leaveTo:X1(g)}),P=xAt({beforeEnter:r,afterEnter:o,beforeLeave:s,afterLeave:a}),F=kN();w.useEffect(()=>{if(F&&E==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,E,F]);let B=x&&!C,M=C&&y&&x,V=(()=>!F||B?"idle":y?"enter":"leave")(),U=cAt(0),W=jn(Ee=>Bs(Ee,{enter:()=>{U.addFlag(Pa.Opening),P.current.beforeEnter()},leave:()=>{U.addFlag(Pa.Closing),P.current.beforeLeave()},idle:()=>{}})),q=jn(Ee=>Bs(Ee,{enter:()=>{U.removeFlag(Pa.Opening),P.current.afterEnter()},leave:()=>{U.removeFlag(Pa.Closing),P.current.afterLeave()},idle:()=>{}})),H=s$e(()=>{k("hidden"),A(v)},L),ie=w.useRef(!1);bAt({immediate:M,container:v,classes:O,direction:V,onStart:ig(Ee=>{ie.current=!0,H.onStart(v,Ee,W)}),onStop:ig(Ee=>{ie.current=!1,H.onStop(v,Ee,q),Ee==="leave"&&!fq(H)&&(k("hidden"),A(v))})});let se=m,Q={ref:_};return M?se={...se,className:AH(m.className,...O.current.enter,...O.current.enterFrom)}:ie.current&&(se.className=AH(m.className,(i=v.current)==null?void 0:i.className),se.className===""&&delete se.className),ae.createElement(hq.Provider,{value:H},ae.createElement(aq,{value:Bs(E,{visible:Pa.Open,hidden:Pa.Closed})|U.flags},Zs({ourProps:Q,theirProps:se,defaultTag:TAt,features:a$e,visible:E==="visible",name:"Transition.Child"})))}function IAt(n,e){let{show:t,appear:i=!1,unmount:r=!0,...o}=n,s=w.useRef(null),a=La(s,e);kN();let l=Fk();if(t===void 0&&l!==null&&(t=(l&Pa.Open)===Pa.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=w.useState(t?"visible":"hidden"),d=s$e(()=>{u("hidden")}),[h,f]=w.useState(!0),g=w.useRef([t]);Xs(()=>{h!==!1&&g.current[g.current.length-1]!==t&&(g.current.push(t),f(!1))},[g,t]);let m=w.useMemo(()=>({show:t,appear:i,initial:h}),[t,i,h]);w.useEffect(()=>{if(t)u("visible");else if(!fq(d))u("hidden");else{let y=s.current;if(!y)return;let C=y.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[t,d]);let v={unmount:r},_=jn(()=>{var y;h&&f(!1),(y=n.beforeEnter)==null||y.call(n)}),b=jn(()=>{var y;h&&f(!1),(y=n.beforeLeave)==null||y.call(n)});return ae.createElement(hq.Provider,{value:d},ae.createElement(dq.Provider,{value:m},Zs({ourProps:{...v,as:w.Fragment,children:ae.createElement(l$e,{ref:a,...v,...o,beforeEnter:_,beforeLeave:b})},theirProps:{},defaultTag:w.Fragment,features:a$e,visible:c==="visible",name:"Transition"})))}function LAt(n,e){let t=w.useContext(dq)!==null,i=Fk()!==null;return ae.createElement(ae.Fragment,null,!t&&i?ae.createElement(foe,{ref:e,...n}):ae.createElement(l$e,{ref:e,...n}))}let foe=Js(IAt),l$e=Js(kAt),DAt=Js(LAt),Y_=Object.assign(foe,{Child:DAt,Root:foe});const AAt=rl(hoe)` &:focus { outline: 2px solid ${n=>n.theme.ringColor}; } border-color: ${n=>n.theme.borderColor}; background-color: ${n=>n.theme.backgroundColor}; `;function ft(n){const e=ni(),t=vo(),[i,r]=w.useState(!1),[o,s]=w.useState(!1);return w.useEffect(()=>{r(!!n.checked),s(!!n.disabled)},[n.checked,n.disabled]),N(hoe.Group,{as:"div",className:"flex items-center",children:[p(AAt,{theme:{ringColor:e.$5,borderColor:e.$5,backgroundColor:i?t:e.$5},className:Nt("relative inline-flex items-center flex-shrink-0 h-6 w-11 rounded-full transition-colors ease-in-out duration-200",{"pointer-events-none opacity-75":o,"border cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2":!o}),checked:i,onChange:a=>{o||(r(a),n.onChange&&n.onChange(a),n.onValueChange&&n.onValueChange(a))},"data-cy":n.cypressRef,children:p("span",{"aria-hidden":"true",className:Nt(i?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow ring-0 transition ease-in-out duration-200")})}),n.label&&p(hoe.Label,{as:"span",className:"ml-3",children:p("span",{className:"text-sm",children:n.label})})]})}function Mme(n){const e=ni();return n.pages.length===0?null:p("nav",{className:"flex","aria-label":"Breadcrumb",style:{color:e.$3,opacity:e.$10},children:N("ol",{role:"list",className:"flex items-center space-x-4",children:[p("li",{children:p("div",{children:N(Li,{to:"/dashboard",withoutDefaultStyling:!0,children:[p(Y8e,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),p("span",{className:"sr-only",children:"Home"})]})})}),n.pages.map(t=>p("li",{children:N("div",{className:"flex items-center",children:[p(dge,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),p(Li,{to:t.href,className:"ml-4 text-sm font-medium",withoutDefaultStyling:!0,children:t.name})]})},t.name))]})})}const NAt="/invoiceninja-logo@light-e793224d.png";/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const RAt={logo:NAt};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function pq(){var t,i;const n=ji(),e=ci();return((t=n==null?void 0:n.settings)==null?void 0:t.company_logo)||((i=e==null?void 0:e.settings)==null?void 0:i.company_logo)||RAt.logo}function OAt(){var t;const n=ci(),[e]=pe();return((t=n==null?void 0:n.settings)==null?void 0:t.name)||e("untitled_company")}const PAt=rl.button` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `,MAt=rl(C0)` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function tn(n){const e=ni(),{prevent:t}=Fi(TN),i=Mk({disablePrevention:n.disablePreventNavigation}),{actionKey:r}=n;return n.to?N(MAt,{theme:{color:e.$3,hoverColor:e.$7},to:n.to,className:Nt({"flex items-center":n.icon},`w-full text-left z-50 block px-4 py-2 text-sm text-gray-700 rounded-lg ${n.className}`),onClick:o=>{t&&(o.preventDefault(),i({url:n.to}))},children:[n.icon,p("div",{className:Nt({"ml-2":n.icon}),children:n.children})]}):N(PAt,{theme:{color:e.$3,hoverColor:e.$7},type:"button",onClick:o=>i({fn:()=>{var s,a;(s=n.onClick)==null||s.call(n,o),(a=n.setVisible)==null||a.call(n,!1)},actionKey:r}),ref:n.innerRef,className:Nt({"flex items-center":n.icon},`w-full text-left z-50 block px-4 py-2 text-sm rounded-lg ${n.className} `),"data-cy":n.cypressRef,children:[n.icon&&p("div",{children:n.icon}),p("div",{className:Nt({"ml-2":n.icon}),children:n.children})]})}function FAt(n){const{renderFragmentOnly:e,children:t}=n;return e?p(dt,{children:t}):p(Y_.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:t})}function Ui(n){const[e,t]=w.useState(!1),{enableCloseOnClickAway:i,disableClosing:r}=n;w.useEffect(()=>{t(n.visible)},[n.visible]);const o=ni();return p(Y_.Root,{show:e,as:w.Fragment,children:p(aT,{as:"div",className:"fixed z-10 inset-0 overflow-y-auto",onClose:s=>{(!r||i)&&t(s),(!r||i)&&n.onClose(s)},initialFocus:n.initialFocusRef,children:N("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[p(Y_.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:p(aT.Overlay,{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),p("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),p(FAt,{renderFragmentOnly:!!n.renderTransitionChildAsFragment&&e,children:N("div",{style:{backgroundColor:o.$2,color:o.$3,colorScheme:o.$0},className:Nt("inline-block align-bottom rounded text-left shadow-xl transform transition-all sm:my-8 sm:align-middle w-full",{"max-w-sm":n.size==="extraSmall"||typeof n.size>"u","max-w-lg":n.size==="small","max-w-7xl":n.size==="large","max-w-2xl":n.size==="regular","bg-white":n.backgroundColor==="white","bg-gray-50":n.backgroundColor==="gray","overflow-hidden":!n.overflowVisible,"px-4 pt-5 pb-4 sm:p-6":!n.withoutPadding}),onClick:s=>n.stopPropagationInHeader&&s.stopPropagation(),children:[n.title&&N("div",{className:"flex flex-col justify-between items-start",style:{backgroundColor:o.$2,color:o.$3,colorScheme:o.$0},children:[N("div",{className:"flex w-full justify-between",children:[p(aT.Title,{as:"h3",className:"text-lg leading-6 font-medium",style:{backgroundColor:o.$2,color:o.$3,colorScheme:o.$0},children:n.title}),!n.disableClosing&&p(kg,{className:"cursor-pointer",onClick:()=>n.onClose(!1),fontSize:22,"data-cy":n.closeButtonCypressRef})]}),p("div",{className:"mt-2",children:n.text&&p("p",{style:{backgroundColor:o.$2,color:o.$3,colorScheme:o.$0},className:"text-sm",children:n.text})})]}),n.children&&p("div",{style:{backgroundColor:o.$2,color:o.$3,colorScheme:o.$0},className:Nt("text-sm flex flex-col space-y-4",{"justify-center items-center":n.centerContent,"mt-5 sm:mt-6":!n.disableClosing}),children:n.children})]})})]})})})}function BAt(n){const[e]=pe(),t=Qi(),i=wi(),{id:r}=il(),o=Tl(),s=ni(),a=_o(),[l,c]=w.useState(!1),u=(h,f,g)=>{if(t(sF({type:yN.TOKEN,user:f,token:g})),localStorage.setItem("X-CURRENT-INDEX",h.toString()),a.invalidateQueries(),r){const m="/"+(o.pathname.includes("/settings/gateways")?"settings/online_payments":o.pathname.split("/")[1]||"dashboard");i(m)}window.location.reload()},d=async()=>{l||(ce.processing(),c(!0),Ae("POST",Te("/api/v1/companies")).then(()=>{Ae("POST",Te("/api/v1/refresh")).then(h=>{const f=h.data.data,g=f.length-1,m=f[g];t(w0(f)),ce.success("created_new_company"),n.setIsModalOpen(!1),u(g,m.user,m.token.token)}).finally(()=>localStorage.setItem("COMPANY-EDIT-OPENED","false"))}).finally(()=>c(!1)))};return N(Ui,{title:e("add_company"),visible:n.isModalOpen,onClose:()=>n.setIsModalOpen(!1),backgroundColor:"white",children:[p("span",{className:"text-lg",style:{backgroundColor:s.$2,color:s.$3,colorScheme:s.$0},children:e("are_you_sure")}),N("div",{className:"flex justify-end space-x-4 mt-5",children:[p(Gt,{className:"text-gray-900",onClick:()=>n.setIsModalOpen(!1),type:"minimal",children:p("span",{className:"text-base mx-3",children:e("cancel")})}),p(Gt,{onClick:d,children:p("span",{className:"text-base mx-3",children:e("yes")})})]})]})}var c$e={exports:{}},u$e={};const Cp=hfe(ubt),iO=hfe(uvt),$At=hfe(bvt);(function(n){var e,t,i=Bo&&Bo.__generator||function(Ge,xt){var qt,hn,ut,Ie,nt={label:0,sent:function(){if(1&ut[0])throw ut[1];return ut[1]},trys:[],ops:[]};return Ie={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(Ie[Symbol.iterator]=function(){return this}),Ie;function Ve(ye){return function(Xe){return function(yt){if(qt)throw new TypeError("Generator is already executing.");for(;nt;)try{if(qt=1,hn&&(ut=2&yt[0]?hn.return:yt[0]?hn.throw||((ut=hn.return)&&ut.call(hn),0):hn.next)&&!(ut=ut.call(hn,yt[1])).done)return ut;switch(hn=0,ut&&(yt=[2&yt[0],ut.value]),yt[0]){case 0:case 1:ut=yt;break;case 4:return nt.label++,{value:yt[1],done:!1};case 5:nt.label++,hn=yt[1],yt=[0];continue;case 7:yt=nt.ops.pop(),nt.trys.pop();continue;default:if(!((ut=(ut=nt.trys).length>0&&ut[ut.length-1])||yt[0]!==6&&yt[0]!==2)){nt=0;continue}if(yt[0]===3&&(!ut||yt[1]>ut[0]&&yt[1]<ut[3])){nt.label=yt[1];break}if(yt[0]===6&&nt.label<ut[1]){nt.label=ut[1],ut=yt;break}if(ut&&nt.label<ut[2]){nt.label=ut[2],nt.ops.push(yt);break}ut[2]&&nt.ops.pop(),nt.trys.pop();continue}yt=xt.call(Ge,nt)}catch(it){yt=[6,it],hn=0}finally{qt=ut=0}if(5&yt[0])throw yt[1];return{value:yt[0]?yt[1]:void 0,done:!0}}([ye,Xe])}}},r=Bo&&Bo.__spreadArray||function(Ge,xt){for(var qt=0,hn=xt.length,ut=Ge.length;qt<hn;qt++,ut++)Ge[ut]=xt[qt];return Ge},o=Object.create,s=Object.defineProperty,a=Object.defineProperties,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,m=function(Ge,xt,qt){return xt in Ge?s(Ge,xt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):Ge[xt]=qt},v=function(Ge,xt){for(var qt in xt||(xt={}))f.call(xt,qt)&&m(Ge,qt,xt[qt]);if(d)for(var hn=0,ut=d(xt);hn<ut.length;hn++)g.call(xt,qt=ut[hn])&&m(Ge,qt,xt[qt]);return Ge},_=function(Ge,xt){return a(Ge,c(xt))},b=function(Ge){return s(Ge,"__esModule",{value:!0})},y=function(Ge,xt){var qt={};for(var hn in Ge)f.call(Ge,hn)&&xt.indexOf(hn)<0&&(qt[hn]=Ge[hn]);if(Ge!=null&&d)for(var ut=0,Ie=d(Ge);ut<Ie.length;ut++)xt.indexOf(hn=Ie[ut])<0&&g.call(Ge,hn)&&(qt[hn]=Ge[hn]);return qt},C=function(Ge){return function(xt,qt,hn){if(qt&&typeof qt=="object"||typeof qt=="function")for(var ut=function(Ve){f.call(xt,Ve)||Ve==="default"||s(xt,Ve,{get:function(){return qt[Ve]},enumerable:!(hn=l(qt,Ve))||hn.enumerable})},Ie=0,nt=u(qt);Ie<nt.length;Ie++)ut(nt[Ie]);return xt}(b(s(Ge!=null?o(h(Ge)):{},"default",Ge&&Ge.__esModule&&"default"in Ge?{get:function(){return Ge.default},enumerable:!0}:{value:Ge,enumerable:!0})),Ge)},x=function(Ge,xt,qt){return new Promise(function(hn,ut){var Ie=function(ye){try{Ve(qt.next(ye))}catch(Xe){ut(Xe)}},nt=function(ye){try{Ve(qt.throw(ye))}catch(Xe){ut(Xe)}},Ve=function(ye){return ye.done?hn(ye.value):Promise.resolve(ye.value).then(Ie,nt)};Ve((qt=qt.apply(Ge,xt)).next())})};b(n),function(Ge,xt){for(var qt in xt)s(Ge,qt,{get:xt[qt],enumerable:!0})}(n,{QueryStatus:function(){return e},buildCreateApi:function(){return Ot},copyWithStructuralSharing:function(){return L},coreModule:function(){return hi},coreModuleName:function(){return on},createApi:function(){return to},defaultSerializeQueryArgs:function(){return fe},fakeBaseQuery:function(){return Ft},fetchBaseQuery:function(){return B},retry:function(){return W},setupListeners:function(){return Fe},skipSelector:function(){return Oe},skipToken:function(){return me}}),(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var E=function(Ge){return[].concat.apply([],Ge)},k=C(Cp).isPlainObject;function L(Ge,xt){if(Ge===xt||!(k(Ge)&&k(xt)||Array.isArray(Ge)&&Array.isArray(xt)))return xt;for(var qt=Object.keys(xt),hn=Object.keys(Ge),ut=qt.length===hn.length,Ie=Array.isArray(xt)?[]:{},nt=0,Ve=qt;nt<Ve.length;nt++){var ye=Ve[nt];Ie[ye]=L(Ge[ye],xt[ye]),ut&&(ut=Ge[ye]===Ie[ye])}return ut?Ge:Ie}var D=C(Cp),A=function(){for(var Ge=[],xt=0;xt<arguments.length;xt++)Ge[xt]=arguments[xt];return fetch.apply(void 0,Ge)},O=function(Ge){return Ge.status>=200&&Ge.status<=299},P=function(Ge){return/ion\/(vnd\.api\+)?json/.test(Ge.get("content-type")||"")};function F(Ge){if(!(0,D.isPlainObject)(Ge))return Ge;for(var xt=v({},Ge),qt=0,hn=Object.entries(xt);qt<hn.length;qt++){var ut=hn[qt];ut[1]===void 0&&delete xt[ut[0]]}return xt}function B(Ge){var xt=this;Ge===void 0&&(Ge={});var qt=Ge.baseUrl,hn=Ge.prepareHeaders,ut=hn===void 0?function(pn){return pn}:hn,Ie=Ge.fetchFn,nt=Ie===void 0?A:Ie,Ve=Ge.paramsSerializer,ye=Ge.isJsonContentType,Xe=ye===void 0?P:ye,yt=Ge.jsonContentType,it=yt===void 0?"application/json":yt,fn=Ge.jsonReplacer,In=Ge.timeout,ti=Ge.responseHandler,gi=Ge.validateStatus,Vi=y(Ge,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&nt===A&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(pn,ii){return x(xt,null,function(){var lr,hr,na,va,Ua,os,gs,Ho,kl,cc,xi,co,bo,Ws,Wo,zs,Mo,Kr,uo,Tr,Fr,so,qi,Xn,bi,qn,oi,Si,Ki,Sn,wn,Kn,gt,Pt,vn,Zn;return i(this,function(Wn){switch(Wn.label){case 0:return lr=ii.signal,hr=ii.getState,na=ii.extra,va=ii.endpoint,Ua=ii.forced,os=ii.type,kl=(Ho=typeof pn=="string"?{url:pn}:pn).url,xi=(cc=Ho.headers)===void 0?new Headers(Vi.headers):cc,bo=(co=Ho.params)===void 0?void 0:co,Wo=(Ws=Ho.responseHandler)===void 0?ti??"json":Ws,Mo=(zs=Ho.validateStatus)===void 0?gi??O:zs,uo=(Kr=Ho.timeout)===void 0?In:Kr,Tr=y(Ho,["url","headers","params","responseHandler","validateStatus","timeout"]),Fr=v(_(v({},Vi),{signal:lr}),Tr),xi=new Headers(F(xi)),so=Fr,[4,ut(xi,{getState:hr,extra:na,endpoint:va,forced:Ua,type:os})];case 1:so.headers=Wn.sent()||xi,qi=function(ui){return typeof ui=="object"&&((0,D.isPlainObject)(ui)||Array.isArray(ui)||typeof ui.toJSON=="function")},!Fr.headers.has("content-type")&&qi(Fr.body)&&Fr.headers.set("content-type",it),qi(Fr.body)&&Xe(Fr.headers)&&(Fr.body=JSON.stringify(Fr.body,fn)),bo&&(Xn=~kl.indexOf("?")?"&":"?",bi=Ve?Ve(bo):new URLSearchParams(F(bo)),kl+=Xn+bi),kl=function(ui,Br){if(!ui)return Br;if(!Br)return ui;if(function(Xr){return new RegExp("(^|:)//").test(Xr)}(Br))return Br;var ho=ui.endsWith("/")||!Br.startsWith("?")?"/":"";return ui=function(Xr){return Xr.replace(/\/$/,"")}(ui),""+ui+ho+function(Xr){return Xr.replace(/^\//,"")}(Br)}(qt,kl),qn=new Request(kl,Fr),oi=new Request(kl,Fr),gs={request:oi},Ki=!1,Sn=uo&&setTimeout(function(){Ki=!0,ii.abort()},uo),Wn.label=2;case 2:return Wn.trys.push([2,4,5,6]),[4,nt(qn)];case 3:return Si=Wn.sent(),[3,6];case 4:return wn=Wn.sent(),[2,{error:{status:Ki?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(wn)},meta:gs}];case 5:return Sn&&clearTimeout(Sn),[7];case 6:Kn=Si.clone(),gs.response=Kn,Pt="",Wn.label=7;case 7:return Wn.trys.push([7,9,,10]),[4,Promise.all([Hn(Si,Wo).then(function(ui){return gt=ui},function(ui){return vn=ui}),Kn.text().then(function(ui){return Pt=ui},function(){})])];case 8:if(Wn.sent(),vn)throw vn;return[3,10];case 9:return Zn=Wn.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Si.status,data:Pt,error:String(Zn)},meta:gs}];case 10:return[2,Mo(Si,gt)?{data:gt,meta:gs}:{error:{status:Si.status,data:gt},meta:gs}]}})})};function Hn(pn,ii){return x(this,null,function(){var lr;return i(this,function(hr){switch(hr.label){case 0:return typeof ii=="function"?[2,ii(pn)]:(ii==="content-type"&&(ii=Xe(pn.headers)?"json":"text"),ii!=="json"?[3,2]:[4,pn.text()]);case 1:return[2,(lr=hr.sent()).length?JSON.parse(lr):null];case 2:return[2,pn.text()]}})})}}var M=function(Ge,xt){xt===void 0&&(xt=void 0),this.value=Ge,this.meta=xt};function V(Ge,xt){return Ge===void 0&&(Ge=0),xt===void 0&&(xt=5),x(this,null,function(){var qt,hn;return i(this,function(ut){switch(ut.label){case 0:return qt=Math.min(Ge,xt),hn=~~((Math.random()+.4)*(300<<qt)),[4,new Promise(function(Ie){return setTimeout(function(nt){return Ie(nt)},hn)})];case 1:return ut.sent(),[2]}})})}var U={},W=Object.assign(function(Ge,xt){return function(qt,hn,ut){return x(void 0,null,function(){var Ie,nt,Ve,ye,Xe,yt,it;return i(this,function(fn){switch(fn.label){case 0:Ie=[5,(xt||U).maxRetries,(ut||U).maxRetries].filter(function(In){return In!==void 0}),nt=Ie.slice(-1)[0],Ve=function(In,ti,gi){return gi.attempt<=nt},ye=v(v({maxRetries:nt,backoff:V,retryCondition:Ve},xt),ut),Xe=0,fn.label=1;case 1:fn.label=2;case 2:return fn.trys.push([2,4,,6]),[4,Ge(qt,hn,ut)];case 3:if((yt=fn.sent()).error)throw new M(yt);return[2,yt];case 4:if(it=fn.sent(),Xe++,it.throwImmediately){if(it instanceof M)return[2,it.value];throw it}return it instanceof M&&!ye.retryCondition(it.value.error,qt,{attempt:Xe,baseQueryApi:hn,extraOptions:ut})?[2,it.value]:[4,ye.backoff(Xe,ye.maxRetries)];case 5:return fn.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(Ge){throw Object.assign(new M({error:Ge}),{throwImmediately:!0})}}),q=C(Cp),H=(0,q.createAction)("__rtkq/focused"),ie=(0,q.createAction)("__rtkq/unfocused"),se=(0,q.createAction)("__rtkq/online"),Q=(0,q.createAction)("__rtkq/offline"),Ee=!1;function Fe(Ge,xt){return xt?xt(Ge,{onFocus:H,onFocusLost:ie,onOffline:Q,onOnline:se}):(qt=function(){return Ge(H())},hn=function(){return Ge(se())},ut=function(){return Ge(Q())},Ie=function(){window.document.visibilityState==="visible"?qt():Ge(ie())},Ee||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",Ie,!1),window.addEventListener("focus",qt,!1),window.addEventListener("online",hn,!1),window.addEventListener("offline",ut,!1),Ee=!0),function(){window.removeEventListener("focus",qt),window.removeEventListener("visibilitychange",Ie),window.removeEventListener("online",hn),window.removeEventListener("offline",ut),Ee=!1});var qt,hn,ut,Ie}var He,ke,Me=C(Cp);function je(Ge){return Ge.type===He.query}function qe(Ge,xt,qt,hn,ut,Ie){return typeof Ge=="function"?Ge(xt,qt,hn,ut).map(Be).map(Ie):Array.isArray(Ge)?Ge.map(Be).map(Ie):[]}function Be(Ge){return typeof Ge=="string"?{type:Ge}:Ge}(ke=He||(He={})).query="query",ke.mutation="mutation";var _t=C(Cp);function Wt(Ge){return Ge!=null}var Tt=Symbol("forceQueryFn"),rn=function(Ge){return typeof Ge[Tt]=="function"},_n=C(Cp),wt=C(iO),pt=C(Cp);function ot(Ge){return Ge}function we(Ge,xt,qt,hn){return qe(qt[Ge.meta.arg.endpointName][xt],(0,_n.isFulfilled)(Ge)?Ge.payload:void 0,(0,_n.isRejectedWithValue)(Ge)?Ge.payload:void 0,Ge.meta.arg.originalArgs,"baseQueryMeta"in Ge.meta?Ge.meta.baseQueryMeta:void 0,hn)}var Se=C(iO),re=C(iO);function Y(Ge,xt,qt){var hn=Ge[xt];hn&&qt(hn)}function Z(Ge){var xt;return(xt="arg"in Ge?Ge.arg.fixedCacheKey:Ge.fixedCacheKey)!=null?xt:Ge.requestId}function le(Ge,xt,qt){var hn=Ge[Z(xt)];hn&&qt(hn)}var te={},me=Symbol.for("RTKQ/skipToken"),Oe=me,et={status:e.uninitialized},Et=(0,Me.createNextState)(et,function(){}),Qe=(0,Me.createNextState)(et,function(){}),At=C(Cp),Ut=WeakMap?new WeakMap:void 0,fe=function(Ge){var xt=Ge.endpointName,qt=Ge.queryArgs,hn="",ut=Ut==null?void 0:Ut.get(qt);if(typeof ut=="string")hn=ut;else{var Ie=JSON.stringify(qt,function(nt,Ve){return(0,At.isPlainObject)(Ve)?Object.keys(Ve).sort().reduce(function(ye,Xe){return ye[Xe]=Ve[Xe],ye},{}):Ve});(0,At.isPlainObject)(qt)&&(Ut==null||Ut.set(qt,Ie)),hn=Ie}return xt+"("+hn+")"},Re=C(Cp),Je=C($At);function Ot(){for(var Ge=[],xt=0;xt<arguments.length;xt++)Ge[xt]=arguments[xt];return function(qt){var hn=(0,Je.defaultMemoize)(function(ye){var Xe,yt;return(yt=qt.extractRehydrationInfo)==null?void 0:yt.call(qt,ye,{reducerPath:(Xe=qt.reducerPath)!=null?Xe:"api"})}),ut=_(v({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},qt),{extractRehydrationInfo:hn,serializeQueryArgs:function(ye){var Xe=fe;if("serializeQueryArgs"in ye.endpointDefinition){var yt=ye.endpointDefinition.serializeQueryArgs;Xe=function(it){var fn=yt(it);return typeof fn=="string"?fn:fe(_(v({},it),{queryArgs:fn}))}}else qt.serializeQueryArgs&&(Xe=qt.serializeQueryArgs);return Xe(ye)},tagTypes:r([],qt.tagTypes||[])}),Ie={endpointDefinitions:{},batch:function(ye){ye()},apiUid:(0,Re.nanoid)(),extractRehydrationInfo:hn,hasRehydrationInfo:(0,Je.defaultMemoize)(function(ye){return hn(ye)!=null})},nt={injectEndpoints:function(ye){for(var Xe=ye.endpoints({query:function(Hn){return _(v({},Hn),{type:He.query})},mutation:function(Hn){return _(v({},Hn),{type:He.mutation})}}),yt=0,it=Object.entries(Xe);yt<it.length;yt++){var fn=it[yt],In=fn[0],ti=fn[1];if(ye.overrideExisting||!(In in Ie.endpointDefinitions)){Ie.endpointDefinitions[In]=ti;for(var gi=0,Vi=Ve;gi<Vi.length;gi++)Vi[gi].injectEndpoint(In,ti)}}return nt},enhanceEndpoints:function(ye){var Xe=ye.addTagTypes,yt=ye.endpoints;if(Xe)for(var it=0,fn=Xe;it<fn.length;it++){var In=fn[it];ut.tagTypes.includes(In)||ut.tagTypes.push(In)}if(yt)for(var ti=0,gi=Object.entries(yt);ti<gi.length;ti++){var Vi=gi[ti],Hn=Vi[0],pn=Vi[1];typeof pn=="function"?pn(Ie.endpointDefinitions[Hn]):Object.assign(Ie.endpointDefinitions[Hn]||{},pn)}return nt}},Ve=Ge.map(function(ye){return ye.init(nt,ut,Ie)});return nt.injectEndpoints({endpoints:qt.endpoints})}}function Ft(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var jt,Jt=C(Cp),ei=function(Ge){var xt=Ge.reducerPath,qt=Ge.api,hn=Ge.context,ut=Ge.internalState,Ie=qt.internalActions,nt=Ie.removeQueryResult,Ve=Ie.unsubscribeQueryResult;function ye(it){var fn=ut.currentSubscriptions[it];return!!fn&&!function(In){for(var ti in In)return!1;return!0}(fn)}var Xe={};function yt(it,fn,In,ti){var gi,Vi=hn.endpointDefinitions[fn],Hn=(gi=Vi==null?void 0:Vi.keepUnusedDataFor)!=null?gi:ti.keepUnusedDataFor;if(Hn!==1/0){var pn=Math.max(0,Math.min(Hn,2147482647e-3));if(!ye(it)){var ii=Xe[it];ii&&clearTimeout(ii),Xe[it]=setTimeout(function(){ye(it)||In.dispatch(nt({queryCacheKey:it})),delete Xe[it]},1e3*pn)}}}return function(it,fn,In){var ti;if(Ve.match(it)){var gi=fn.getState()[xt];yt(Ua=it.payload.queryCacheKey,(ti=gi.queries[Ua])==null?void 0:ti.endpointName,fn,gi.config)}if(qt.util.resetApiState.match(it))for(var Vi=0,Hn=Object.entries(Xe);Vi<Hn.length;Vi++){var pn=Hn[Vi],ii=pn[0],lr=pn[1];lr&&clearTimeout(lr),delete Xe[ii]}if(hn.hasRehydrationInfo(it)){gi=fn.getState()[xt];for(var hr=hn.extractRehydrationInfo(it).queries,na=0,va=Object.entries(hr);na<va.length;na++){var Ua,os=va[na],gs=os[1];yt(Ua=os[0],gs==null?void 0:gs.endpointName,fn,gi.config)}}}},sr=C(Cp),zn=function(Ge){var xt=Ge.reducerPath,qt=Ge.context,hn=Ge.context.endpointDefinitions,ut=Ge.mutationThunk,Ie=Ge.api,nt=Ge.assertTagType,Ve=Ge.refetchQuery,ye=Ie.internalActions.removeQueryResult,Xe=(0,sr.isAnyOf)((0,sr.isFulfilled)(ut),(0,sr.isRejectedWithValue)(ut));function yt(it,fn){var In=fn.getState(),ti=In[xt],gi=Ie.util.selectInvalidatedBy(In,it);qt.batch(function(){for(var Vi,Hn=0,pn=Array.from(gi.values());Hn<pn.length;Hn++){var ii=pn[Hn].queryCacheKey,lr=ti.queries[ii],hr=(Vi=ti.subscriptions[ii])!=null?Vi:{};lr&&(Object.keys(hr).length===0?fn.dispatch(ye({queryCacheKey:ii})):lr.status!==e.uninitialized&&fn.dispatch(Ve(lr,ii)))}})}return function(it,fn){Xe(it)&&yt(we(it,"invalidatesTags",hn,nt),fn),Ie.util.invalidateTags.match(it)&&yt(qe(it.payload,void 0,void 0,void 0,void 0,nt),fn)}},Tn=function(Ge){var xt=Ge.reducerPath,qt=Ge.queryThunk,hn=Ge.api,ut=Ge.refetchQuery,Ie=Ge.internalState,nt={};function Ve(it,fn){var In=it.queryCacheKey,ti=fn.getState()[xt].queries[In];if(ti&&ti.status!==e.uninitialized){var gi=yt(Ie.currentSubscriptions[In]);if(Number.isFinite(gi)){var Vi=nt[In];Vi!=null&&Vi.timeout&&(clearTimeout(Vi.timeout),Vi.timeout=void 0);var Hn=Date.now()+gi,pn=nt[In]={nextPollTimestamp:Hn,pollingInterval:gi,timeout:setTimeout(function(){pn.timeout=void 0,fn.dispatch(ut(ti,In))},gi)}}}}function ye(it,fn){var In=it.queryCacheKey,ti=fn.getState()[xt].queries[In];if(ti&&ti.status!==e.uninitialized){var gi=yt(Ie.currentSubscriptions[In]);if(Number.isFinite(gi)){var Vi=nt[In],Hn=Date.now()+gi;(!Vi||Hn<Vi.nextPollTimestamp)&&Ve({queryCacheKey:In},fn)}else Xe(In)}}function Xe(it){var fn=nt[it];fn!=null&&fn.timeout&&clearTimeout(fn.timeout),delete nt[it]}function yt(it){it===void 0&&(it={});var fn=Number.POSITIVE_INFINITY;for(var In in it)it[In].pollingInterval&&(fn=Math.min(it[In].pollingInterval,fn));return fn}return function(it,fn){(hn.internalActions.updateSubscriptionOptions.match(it)||hn.internalActions.unsubscribeQueryResult.match(it))&&ye(it.payload,fn),(qt.pending.match(it)||qt.rejected.match(it)&&it.meta.condition)&&ye(it.meta.arg,fn),(qt.fulfilled.match(it)||qt.rejected.match(it)&&!it.meta.condition)&&Ve(it.meta.arg,fn),hn.util.resetApiState.match(it)&&function(){for(var In=0,ti=Object.keys(nt);In<ti.length;In++)Xe(ti[In])}()}},pi=C(Cp),Ei=new Error("Promise never resolved before cacheEntryRemoved."),$i=function(Ge){var xt=Ge.api,qt=Ge.reducerPath,hn=Ge.context,ut=Ge.queryThunk,Ie=Ge.mutationThunk,nt=(0,pi.isAsyncThunkAction)(ut),Ve=(0,pi.isAsyncThunkAction)(Ie),ye=(0,pi.isFulfilled)(ut,Ie),Xe={};function yt(it,fn,In,ti,gi){var Vi=hn.endpointDefinitions[it],Hn=Vi==null?void 0:Vi.onCacheEntryAdded;if(Hn){var pn={},ii=new Promise(function(os){pn.cacheEntryRemoved=os}),lr=Promise.race([new Promise(function(os){pn.valueResolved=os}),ii.then(function(){throw Ei})]);lr.catch(function(){}),Xe[In]=pn;var hr=xt.endpoints[it].select(Vi.type===He.query?fn:In),na=ti.dispatch(function(os,gs,Ho){return Ho}),va=_(v({},ti),{getCacheEntry:function(){return hr(ti.getState())},requestId:gi,extra:na,updateCachedData:Vi.type===He.query?function(os){return ti.dispatch(xt.util.updateQueryData(it,fn,os))}:void 0,cacheDataLoaded:lr,cacheEntryRemoved:ii}),Ua=Hn(fn,va);Promise.resolve(Ua).catch(function(os){if(os!==Ei)throw os})}}return function(it,fn,In){var ti=function(hr){return nt(hr)?hr.meta.arg.queryCacheKey:Ve(hr)?hr.meta.requestId:xt.internalActions.removeQueryResult.match(hr)?hr.payload.queryCacheKey:xt.internalActions.removeMutationResult.match(hr)?Z(hr.payload):""}(it);if(ut.pending.match(it)){var gi=In[qt].queries[ti],Vi=fn.getState()[qt].queries[ti];!gi&&Vi&&yt(it.meta.arg.endpointName,it.meta.arg.originalArgs,ti,fn,it.meta.requestId)}else if(Ie.pending.match(it))(Vi=fn.getState()[qt].mutations[ti])&&yt(it.meta.arg.endpointName,it.meta.arg.originalArgs,ti,fn,it.meta.requestId);else if(ye(it))(lr=Xe[ti])!=null&&lr.valueResolved&&(lr.valueResolved({data:it.payload,meta:it.meta.baseQueryMeta}),delete lr.valueResolved);else if(xt.internalActions.removeQueryResult.match(it)||xt.internalActions.removeMutationResult.match(it))(lr=Xe[ti])&&(delete Xe[ti],lr.cacheEntryRemoved());else if(xt.util.resetApiState.match(it))for(var Hn=0,pn=Object.entries(Xe);Hn<pn.length;Hn++){var ii=pn[Hn],lr=ii[1];delete Xe[ii[0]],lr.cacheEntryRemoved()}}},Pr=C(Cp),ro=function(Ge){var xt=Ge.api,qt=Ge.context,hn=Ge.queryThunk,ut=Ge.mutationThunk,Ie=(0,Pr.isPending)(hn,ut),nt=(0,Pr.isRejected)(hn,ut),Ve=(0,Pr.isFulfilled)(hn,ut),ye={};return function(Xe,yt){var it,fn,In;if(Ie(Xe)){var ti=Xe.meta,gi=ti.requestId,Vi=ti.arg,Hn=Vi.endpointName,pn=Vi.originalArgs,ii=qt.endpointDefinitions[Hn],lr=ii==null?void 0:ii.onQueryStarted;if(lr){var hr={},na=new Promise(function(cc,xi){hr.resolve=cc,hr.reject=xi});na.catch(function(){}),ye[gi]=hr;var va=xt.endpoints[Hn].select(ii.type===He.query?pn:gi),Ua=yt.dispatch(function(cc,xi,co){return co}),os=_(v({},yt),{getCacheEntry:function(){return va(yt.getState())},requestId:gi,extra:Ua,updateCachedData:ii.type===He.query?function(cc){return yt.dispatch(xt.util.updateQueryData(Hn,pn,cc))}:void 0,queryFulfilled:na});lr(pn,os)}}else if(Ve(Xe)){var gs=Xe.meta,Ho=gs.baseQueryMeta;(it=ye[gi=gs.requestId])==null||it.resolve({data:Xe.payload,meta:Ho}),delete ye[gi]}else if(nt(Xe)){var kl=Xe.meta;Ho=kl.baseQueryMeta,(In=ye[gi=kl.requestId])==null||In.reject({error:(fn=Xe.payload)!=null?fn:Xe.error,isUnhandledError:!kl.rejectedWithValue,meta:Ho}),delete ye[gi]}}},Vo=function(Ge){var xt=Ge.api,qt=Ge.context.apiUid;return function(hn,ut){xt.util.resetApiState.match(hn)&&ut.dispatch(xt.internalActions.middlewareRegistered(qt))}},oo=C(iO),ta=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof Bo<"u"?Bo:globalThis):function(Ge){return(jt||(jt=Promise.resolve())).then(Ge).catch(function(xt){return setTimeout(function(){throw xt},0)})};function Mr(Ge){for(var xt=[],qt=1;qt<arguments.length;qt++)xt[qt-1]=arguments[qt];Object.assign.apply(Object,r([Ge],xt))}var er=C(iO),on=Symbol(),hi=function(){return{name:on,init:function(Ge,xt,qt){var hn=xt.baseQuery,ut=xt.reducerPath,Ie=xt.serializeQueryArgs,nt=xt.keepUnusedDataFor,Ve=xt.refetchOnMountOrArgChange,ye=xt.refetchOnFocus,Xe=xt.refetchOnReconnect;(0,er.enablePatches)();var yt=function(xi){return xi};Object.assign(Ge,{reducerPath:ut,endpoints:{},internalActions:{onOnline:se,onOffline:Q,onFocus:H,onFocusLost:ie},util:{}});var it=function(xi){var co=this,bo=xi.reducerPath,Ws=xi.baseQuery,Wo=xi.context.endpointDefinitions,zs=xi.serializeQueryArgs,Mo=xi.api,Kr=xi.assertTagType,uo=function(Xn,bi){return x(co,[Xn,bi],function(qn,oi){var Si,Ki,Sn,wn,Kn,gt,Pt,vn,Zn,Wn,ui,Br,ho,Xr=oi.signal,ja=oi.abort,kr=oi.rejectWithValue,Dn=oi.fulfillWithValue,Ts=oi.dispatch,Il=oi.getState,nu=oi.extra;return i(this,function(ms){switch(ms.label){case 0:Si=Wo[qn.endpointName],ms.label=1;case 1:return ms.trys.push([1,8,,13]),Ki=ot,Sn=void 0,wn={signal:Xr,abort:ja,dispatch:Ts,getState:Il,extra:nu,endpoint:qn.endpointName,type:qn.type,forced:qn.type==="query"?Tr(qn,Il()):void 0},(Kn=qn.type==="query"?qn[Tt]:void 0)?(Sn=Kn(),[3,6]):[3,2];case 2:return Si.query?[4,Ws(Si.query(qn.originalArgs),wn,Si.extraOptions)]:[3,4];case 3:return Sn=ms.sent(),Si.transformResponse&&(Ki=Si.transformResponse),[3,6];case 4:return[4,Si.queryFn(qn.originalArgs,wn,Si.extraOptions,function(Wl){return Ws(Wl,wn,Si.extraOptions)})];case 5:Sn=ms.sent(),ms.label=6;case 6:if(Sn.error)throw new M(Sn.error,Sn.meta);return gt=Dn,[4,Ki(Sn.data,Sn.meta,qn.originalArgs)];case 7:return[2,gt.apply(void 0,[ms.sent(),(Br={fulfilledTimeStamp:Date.now(),baseQueryMeta:Sn.meta},Br[pt.SHOULD_AUTOBATCH]=!0,Br)])];case 8:if(Pt=ms.sent(),!((vn=Pt)instanceof M))return[3,12];Zn=ot,Si.query&&Si.transformErrorResponse&&(Zn=Si.transformErrorResponse),ms.label=9;case 9:return ms.trys.push([9,11,,12]),Wn=kr,[4,Zn(vn.value,vn.meta,qn.originalArgs)];case 10:return[2,Wn.apply(void 0,[ms.sent(),(ho={baseQueryMeta:vn.meta},ho[pt.SHOULD_AUTOBATCH]=!0,ho)])];case 11:return ui=ms.sent(),vn=ui,[3,12];case 12:throw console.error(vn),vn;case 13:return[2]}})})};function Tr(Xn,bi){var qn,oi,Si,Ki,Sn=(oi=(qn=bi[bo])==null?void 0:qn.queries)==null?void 0:oi[Xn.queryCacheKey],wn=(Si=bi[bo])==null?void 0:Si.config.refetchOnMountOrArgChange,Kn=Sn==null?void 0:Sn.fulfilledTimeStamp,gt=(Ki=Xn.forceRefetch)!=null?Ki:Xn.subscribe&&wn;return!!gt&&(gt===!0||(Number(new Date)-Number(Kn))/1e3>=gt)}var Fr=(0,pt.createAsyncThunk)(bo+"/executeQuery",uo,{getPendingMeta:function(){var Xn;return(Xn={startedTimeStamp:Date.now()})[pt.SHOULD_AUTOBATCH]=!0,Xn},condition:function(Xn,bi){var qn,oi,Si,Ki=(0,bi.getState)(),Sn=(oi=(qn=Ki[bo])==null?void 0:qn.queries)==null?void 0:oi[Xn.queryCacheKey],wn=Sn==null?void 0:Sn.fulfilledTimeStamp,Kn=Xn.originalArgs,gt=Sn==null?void 0:Sn.originalArgs,Pt=Wo[Xn.endpointName];return!(!rn(Xn)&&((Sn==null?void 0:Sn.status)==="pending"||!Tr(Xn,Ki)&&(!je(Pt)||!((Si=Pt==null?void 0:Pt.forceRefetch)!=null&&Si.call(Pt,{currentArg:Kn,previousArg:gt,endpointState:Sn,state:Ki})))&&wn))},dispatchConditionRejection:!0}),so=(0,pt.createAsyncThunk)(bo+"/executeMutation",uo,{getPendingMeta:function(){var Xn;return(Xn={startedTimeStamp:Date.now()})[pt.SHOULD_AUTOBATCH]=!0,Xn}});function qi(Xn){return function(bi){var qn,oi;return((oi=(qn=bi==null?void 0:bi.meta)==null?void 0:qn.arg)==null?void 0:oi.endpointName)===Xn}}return{queryThunk:Fr,mutationThunk:so,prefetch:function(Xn,bi,qn){return function(oi,Si){var Ki=function(Pt){return"force"in Pt}(qn)&&qn.force,Sn=function(Pt){return"ifOlderThan"in Pt}(qn)&&qn.ifOlderThan,wn=function(Pt){return Pt===void 0&&(Pt=!0),Mo.endpoints[Xn].initiate(bi,{forceRefetch:Pt})},Kn=Mo.endpoints[Xn].select(bi)(Si());if(Ki)oi(wn());else if(Sn){var gt=Kn==null?void 0:Kn.fulfilledTimeStamp;if(!gt)return void oi(wn());(Number(new Date)-Number(new Date(gt)))/1e3>=Sn&&oi(wn())}else oi(wn(!1))}},updateQueryData:function(Xn,bi,qn,oi){return oi===void 0&&(oi=!0),function(Si,Ki){var Sn,wn,Kn,gt=Mo.endpoints[Xn].select(bi)(Ki()),Pt={patches:[],inversePatches:[],undo:function(){return Si(Mo.util.patchQueryData(Xn,bi,Pt.inversePatches,oi))}};if(gt.status===e.uninitialized)return Pt;if("data"in gt)if((0,wt.isDraftable)(gt.data)){var vn=(0,wt.produceWithPatches)(gt.data,qn),Zn=vn[0],Wn=vn[2];(Sn=Pt.patches).push.apply(Sn,vn[1]),(wn=Pt.inversePatches).push.apply(wn,Wn),Kn=Zn}else Kn=qn(gt.data),Pt.patches.push({op:"replace",path:[],value:Kn}),Pt.inversePatches.push({op:"replace",path:[],value:gt.data});return Si(Mo.util.patchQueryData(Xn,bi,Pt.patches,oi)),Pt}},upsertQueryData:function(Xn,bi,qn){return function(oi){var Si;return oi(Mo.endpoints[Xn].initiate(bi,((Si={subscribe:!1,forceRefetch:!0})[Tt]=function(){return{data:qn}},Si)))}},patchQueryData:function(Xn,bi,qn,oi){return function(Si,Ki){var Sn=Wo[Xn],wn=zs({queryArgs:bi,endpointDefinition:Sn,endpointName:Xn});if(Si(Mo.internalActions.queryResultPatched({queryCacheKey:wn,patches:qn})),oi){var Kn=Mo.endpoints[Xn].select(bi)(Ki()),gt=qe(Sn.providesTags,Kn.data,void 0,bi,{},Kr);Si(Mo.internalActions.updateProvidedBy({queryCacheKey:wn,providedTags:gt}))}}},buildMatchThunkActions:function(Xn,bi){return{matchPending:(0,_n.isAllOf)((0,_n.isPending)(Xn),qi(bi)),matchFulfilled:(0,_n.isAllOf)((0,_n.isFulfilled)(Xn),qi(bi)),matchRejected:(0,_n.isAllOf)((0,_n.isRejected)(Xn),qi(bi))}}}}({baseQuery:hn,reducerPath:ut,context:qt,api:Ge,serializeQueryArgs:Ie,assertTagType:yt}),fn=it.queryThunk,In=it.mutationThunk,ti=it.patchQueryData,gi=it.updateQueryData,Vi=it.upsertQueryData,Hn=it.prefetch,pn=it.buildMatchThunkActions,ii=function(xi){var co=xi.reducerPath,bo=xi.queryThunk,Ws=xi.mutationThunk,Wo=xi.context,zs=Wo.endpointDefinitions,Mo=Wo.apiUid,Kr=Wo.extractRehydrationInfo,uo=Wo.hasRehydrationInfo,Tr=xi.assertTagType,Fr=xi.config,so=(0,_t.createAction)(co+"/resetApiState"),qi=(0,_t.createSlice)({name:co+"/queries",initialState:te,reducers:{removeQueryResult:{reducer:function(Sn,wn){delete Sn[wn.payload.queryCacheKey]},prepare:(0,_t.prepareAutoBatched)()},queryResultPatched:{reducer:function(Sn,wn){var Kn=wn.payload,gt=Kn.patches;Y(Sn,Kn.queryCacheKey,function(Pt){Pt.data=(0,re.applyPatches)(Pt.data,gt.concat())})},prepare:(0,_t.prepareAutoBatched)()}},extraReducers:function(Sn){Sn.addCase(bo.pending,function(wn,Kn){var gt,Pt=Kn.meta,vn=Kn.meta.arg,Zn=rn(vn);(vn.subscribe||Zn)&&(wn[gt=vn.queryCacheKey]!=null||(wn[gt]={status:e.uninitialized,endpointName:vn.endpointName})),Y(wn,vn.queryCacheKey,function(Wn){Wn.status=e.pending,Wn.requestId=Zn&&Wn.requestId?Wn.requestId:Pt.requestId,vn.originalArgs!==void 0&&(Wn.originalArgs=vn.originalArgs),Wn.startedTimeStamp=Pt.startedTimeStamp})}).addCase(bo.fulfilled,function(wn,Kn){var gt=Kn.meta,Pt=Kn.payload;Y(wn,gt.arg.queryCacheKey,function(vn){var Zn;if(vn.requestId===gt.requestId||rn(gt.arg)){var Wn=zs[gt.arg.endpointName].merge;if(vn.status=e.fulfilled,Wn)if(vn.data!==void 0){var ui=gt.fulfilledTimeStamp,Br=gt.arg,ho=gt.baseQueryMeta,Xr=gt.requestId,ja=(0,_t.createNextState)(vn.data,function(kr){return Wn(kr,Pt,{arg:Br.originalArgs,baseQueryMeta:ho,fulfilledTimeStamp:ui,requestId:Xr})});vn.data=ja}else vn.data=Pt;else vn.data=(Zn=zs[gt.arg.endpointName].structuralSharing)==null||Zn?L((0,Se.isDraft)(vn.data)?(0,re.original)(vn.data):vn.data,Pt):Pt;delete vn.error,vn.fulfilledTimeStamp=gt.fulfilledTimeStamp}})}).addCase(bo.rejected,function(wn,Kn){var gt=Kn.meta,Pt=gt.condition,vn=gt.requestId,Zn=Kn.error,Wn=Kn.payload;Y(wn,gt.arg.queryCacheKey,function(ui){if(!Pt){if(ui.requestId!==vn)return;ui.status=e.rejected,ui.error=Wn??Zn}})}).addMatcher(uo,function(wn,Kn){for(var gt=Kr(Kn).queries,Pt=0,vn=Object.entries(gt);Pt<vn.length;Pt++){var Zn=vn[Pt],Wn=Zn[1];(Wn==null?void 0:Wn.status)!==e.fulfilled&&(Wn==null?void 0:Wn.status)!==e.rejected||(wn[Zn[0]]=Wn)}})}}),Xn=(0,_t.createSlice)({name:co+"/mutations",initialState:te,reducers:{removeMutationResult:{reducer:function(Sn,wn){var Kn=Z(wn.payload);Kn in Sn&&delete Sn[Kn]},prepare:(0,_t.prepareAutoBatched)()}},extraReducers:function(Sn){Sn.addCase(Ws.pending,function(wn,Kn){var gt=Kn.meta,Pt=gt.requestId,vn=gt.arg,Zn=gt.startedTimeStamp;vn.track&&(wn[Z(Kn.meta)]={requestId:Pt,status:e.pending,endpointName:vn.endpointName,startedTimeStamp:Zn})}).addCase(Ws.fulfilled,function(wn,Kn){var gt=Kn.payload,Pt=Kn.meta;Pt.arg.track&&le(wn,Pt,function(vn){vn.requestId===Pt.requestId&&(vn.status=e.fulfilled,vn.data=gt,vn.fulfilledTimeStamp=Pt.fulfilledTimeStamp)})}).addCase(Ws.rejected,function(wn,Kn){var gt=Kn.payload,Pt=Kn.error,vn=Kn.meta;vn.arg.track&&le(wn,vn,function(Zn){Zn.requestId===vn.requestId&&(Zn.status=e.rejected,Zn.error=gt??Pt)})}).addMatcher(uo,function(wn,Kn){for(var gt=Kr(Kn).mutations,Pt=0,vn=Object.entries(gt);Pt<vn.length;Pt++){var Zn=vn[Pt],Wn=Zn[0],ui=Zn[1];(ui==null?void 0:ui.status)!==e.fulfilled&&(ui==null?void 0:ui.status)!==e.rejected||Wn===(ui==null?void 0:ui.requestId)||(wn[Wn]=ui)}})}}),bi=(0,_t.createSlice)({name:co+"/invalidation",initialState:te,reducers:{updateProvidedBy:{reducer:function(Sn,wn){for(var Kn,gt,Pt,vn,Zn=wn.payload,Wn=Zn.queryCacheKey,ui=Zn.providedTags,Br=0,ho=Object.values(Sn);Br<ho.length;Br++)for(var Xr=0,ja=Object.values(ho[Br]);Xr<ja.length;Xr++){var kr=ja[Xr],Dn=kr.indexOf(Wn);Dn!==-1&&kr.splice(Dn,1)}for(var Ts=0,Il=ui;Ts<Il.length;Ts++){var nu=Il[Ts],ms=nu.type,Wl=nu.id,zl=(vn=(gt=(Kn=Sn[ms])!=null?Kn:Sn[ms]={})[Pt=Wl||"__internal_without_id"])!=null?vn:gt[Pt]=[];zl.includes(Wn)||zl.push(Wn)}},prepare:(0,_t.prepareAutoBatched)()}},extraReducers:function(Sn){Sn.addCase(qi.actions.removeQueryResult,function(wn,Kn){for(var gt=Kn.payload.queryCacheKey,Pt=0,vn=Object.values(wn);Pt<vn.length;Pt++)for(var Zn=0,Wn=Object.values(vn[Pt]);Zn<Wn.length;Zn++){var ui=Wn[Zn],Br=ui.indexOf(gt);Br!==-1&&ui.splice(Br,1)}}).addMatcher(uo,function(wn,Kn){for(var gt,Pt,vn,Zn,Wn=Kr(Kn).provided,ui=0,Br=Object.entries(Wn);ui<Br.length;ui++)for(var ho=Br[ui],Xr=ho[0],ja=0,kr=Object.entries(ho[1]);ja<kr.length;ja++)for(var Dn=kr[ja],Ts=Dn[0],Il=Dn[1],nu=(Zn=(Pt=(gt=wn[Xr])!=null?gt:wn[Xr]={})[vn=Ts||"__internal_without_id"])!=null?Zn:Pt[vn]=[],ms=0,Wl=Il;ms<Wl.length;ms++){var zl=Wl[ms];nu.includes(zl)||nu.push(zl)}}).addMatcher((0,_t.isAnyOf)((0,_t.isFulfilled)(bo),(0,_t.isRejectedWithValue)(bo)),function(wn,Kn){var gt=we(Kn,"providesTags",zs,Tr);bi.caseReducers.updateProvidedBy(wn,bi.actions.updateProvidedBy({queryCacheKey:Kn.meta.arg.queryCacheKey,providedTags:gt}))})}}),qn=(0,_t.createSlice)({name:co+"/subscriptions",initialState:te,reducers:{updateSubscriptionOptions:function(Sn,wn){},unsubscribeQueryResult:function(Sn,wn){},internal_probeSubscription:function(Sn,wn){}}}),oi=(0,_t.createSlice)({name:co+"/internalSubscriptions",initialState:te,reducers:{subscriptionsUpdated:{reducer:function(Sn,wn){return(0,re.applyPatches)(Sn,wn.payload)},prepare:(0,_t.prepareAutoBatched)()}}}),Si=(0,_t.createSlice)({name:co+"/config",initialState:v({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},Fr),reducers:{middlewareRegistered:function(Sn,wn){Sn.middlewareRegistered=Sn.middlewareRegistered!=="conflict"&&Mo===wn.payload||"conflict"}},extraReducers:function(Sn){Sn.addCase(se,function(wn){wn.online=!0}).addCase(Q,function(wn){wn.online=!1}).addCase(H,function(wn){wn.focused=!0}).addCase(ie,function(wn){wn.focused=!1}).addMatcher(uo,function(wn){return v({},wn)})}}),Ki=(0,_t.combineReducers)({queries:qi.reducer,mutations:Xn.reducer,provided:bi.reducer,subscriptions:oi.reducer,config:Si.reducer});return{reducer:function(Sn,wn){return Ki(so.match(wn)?void 0:Sn,wn)},actions:_(v(v(v(v(v(v({},Si.actions),qi.actions),qn.actions),oi.actions),Xn.actions),bi.actions),{unsubscribeMutationResult:Xn.actions.removeMutationResult,resetApiState:so})}}({context:qt,queryThunk:fn,mutationThunk:In,reducerPath:ut,assertTagType:yt,config:{refetchOnFocus:ye,refetchOnReconnect:Xe,refetchOnMountOrArgChange:Ve,keepUnusedDataFor:nt,reducerPath:ut}}),lr=ii.reducer,hr=ii.actions;Mr(Ge.util,{patchQueryData:ti,updateQueryData:gi,upsertQueryData:Vi,prefetch:Hn,resetApiState:hr.resetApiState}),Mr(Ge.internalActions,hr);var na=function(xi){var co=xi.reducerPath,bo=xi.queryThunk,Ws=xi.api,Wo=xi.context,zs=Wo.apiUid,Mo={invalidateTags:(0,Jt.createAction)(co+"/invalidateTags")},Kr=[Vo,ei,zn,Tn,$i,ro];return{middleware:function(Tr){var Fr=!1,so=_(v({},xi),{internalState:{currentSubscriptions:{}},refetchQuery:uo}),qi=Kr.map(function(qn){return qn(so)}),Xn=function(qn){var oi=qn.api,Si=qn.queryThunk,Ki=qn.internalState,Sn=oi.reducerPath+"/subscriptions",wn=null,Kn=!1,gt=oi.internalActions,Pt=gt.updateSubscriptionOptions,vn=gt.unsubscribeQueryResult;return function(Zn,Wn){var ui,Br;if(wn||(wn=JSON.parse(JSON.stringify(Ki.currentSubscriptions))),oi.util.resetApiState.match(Zn))return wn=Ki.currentSubscriptions={},[!0,!1];if(oi.internalActions.internal_probeSubscription.match(Zn)){var ho=Zn.payload;return[!1,!!((ui=Ki.currentSubscriptions[ho.queryCacheKey])!=null&&ui[ho.requestId])]}var Xr=function(Dn,Ts){var Il,nu,ms,Wl,zl,Fg,R0,_l,o_;if(Pt.match(Ts)){var yh=Ts.payload,Bg=yh.queryCacheKey,Iu=yh.requestId;return(Il=Dn==null?void 0:Dn[Bg])!=null&&Il[Iu]&&(Dn[Bg][Iu]=yh.options),!0}if(vn.match(Ts)){var iu=Ts.payload;return Iu=iu.requestId,Dn[Bg=iu.queryCacheKey]&&delete Dn[Bg][Iu],!0}if(oi.internalActions.removeQueryResult.match(Ts))return delete Dn[Ts.payload.queryCacheKey],!0;if(Si.pending.match(Ts)){var O0=Ts.meta;if(Iu=O0.requestId,(of=O0.arg).subscribe)return($g=(ms=Dn[nu=of.queryCacheKey])!=null?ms:Dn[nu]={})[Iu]=(zl=(Wl=of.subscriptionOptions)!=null?Wl:$g[Iu])!=null?zl:{},!0}if(Si.rejected.match(Ts)){var $g,Vg=Ts.meta,of=Vg.arg;if(Iu=Vg.requestId,Vg.condition&&of.subscribe)return($g=(R0=Dn[Fg=of.queryCacheKey])!=null?R0:Dn[Fg]={})[Iu]=(o_=(_l=of.subscriptionOptions)!=null?_l:$g[Iu])!=null?o_:{},!0}return!1}(Ki.currentSubscriptions,Zn);if(Xr){Kn||(ta(function(){var Dn=JSON.parse(JSON.stringify(Ki.currentSubscriptions)),Ts=(0,oo.produceWithPatches)(wn,function(){return Dn});Wn.next(oi.internalActions.subscriptionsUpdated(Ts[1])),wn=Dn,Kn=!1}),Kn=!0);var ja=!!((Br=Zn.type)!=null&&Br.startsWith(Sn)),kr=Si.rejected.match(Zn)&&Zn.meta.condition&&!!Zn.meta.arg.subscribe;return[!ja&&!kr,!1]}return[!0,!1]}}(so),bi=function(qn){var oi=qn.reducerPath,Si=qn.context,Ki=qn.refetchQuery,Sn=qn.internalState,wn=qn.api.internalActions.removeQueryResult;function Kn(gt,Pt){var vn=gt.getState()[oi],Zn=vn.queries,Wn=Sn.currentSubscriptions;Si.batch(function(){for(var ui=0,Br=Object.keys(Wn);ui<Br.length;ui++){var ho=Br[ui],Xr=Zn[ho],ja=Wn[ho];ja&&Xr&&(Object.values(ja).some(function(kr){return kr[Pt]===!0})||Object.values(ja).every(function(kr){return kr[Pt]===void 0})&&vn.config[Pt])&&(Object.keys(ja).length===0?gt.dispatch(wn({queryCacheKey:ho})):Xr.status!==e.uninitialized&>.dispatch(Ki(Xr,ho)))}})}return function(gt,Pt){H.match(gt)&&Kn(Pt,"refetchOnFocus"),se.match(gt)&&Kn(Pt,"refetchOnReconnect")}}(so);return function(qn){return function(oi){Fr||(Fr=!0,Tr.dispatch(Ws.internalActions.middlewareRegistered(zs)));var Si,Ki=_(v({},Tr),{next:qn}),Sn=Tr.getState(),wn=Xn(oi,Ki,Sn),Kn=wn[1];if(Si=wn[0]?qn(oi):Kn,Tr.getState()[co]&&(bi(oi,Ki,Sn),function(vn){return!!vn&&typeof vn.type=="string"&&vn.type.startsWith(co+"/")}(oi)||Wo.hasRehydrationInfo(oi)))for(var gt=0,Pt=qi;gt<Pt.length;gt++)(0,Pt[gt])(oi,Ki,Sn);return Si}}},actions:Mo};function uo(Tr,Fr,so){return so===void 0&&(so={}),bo(v({type:"query",endpointName:Tr.endpointName,originalArgs:Tr.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:Fr},so))}}({reducerPath:ut,context:qt,queryThunk:fn,mutationThunk:In,api:Ge,assertTagType:yt}),va=na.middleware;Mr(Ge.util,na.actions),Mr(Ge,{reducer:lr,middleware:va});var Ua=function(xi){var co=xi.serializeQueryArgs,bo=xi.reducerPath,Ws=function(Kr){return Et},Wo=function(Kr){return Qe};return{buildQuerySelector:function(Kr,uo){return function(Tr){var Fr=co({queryArgs:Tr,endpointDefinition:uo,endpointName:Kr});return(0,Me.createSelector)(Tr===me?Ws:function(so){var qi,Xn,bi;return(bi=(Xn=(qi=Mo(so))==null?void 0:qi.queries)==null?void 0:Xn[Fr])!=null?bi:Et},zs)}},buildMutationSelector:function(){return function(Kr){var uo,Tr;return Tr=typeof Kr=="object"?(uo=Z(Kr))!=null?uo:me:Kr,(0,Me.createSelector)(Tr===me?Wo:function(Fr){var so,qi,Xn;return(Xn=(qi=(so=Mo(Fr))==null?void 0:so.mutations)==null?void 0:qi[Tr])!=null?Xn:Qe},zs)}},selectInvalidatedBy:function(Kr,uo){for(var Tr,Fr=Kr[bo],so=new Set,qi=0,Xn=uo.map(Be);qi<Xn.length;qi++){var bi=Xn[qi],qn=Fr.provided[bi.type];if(qn)for(var oi=0,Si=(Tr=bi.id!==void 0?qn[bi.id]:E(Object.values(qn)))!=null?Tr:[];oi<Si.length;oi++)so.add(Si[oi])}return E(Array.from(so.values()).map(function(Ki){var Sn=Fr.queries[Ki];return Sn?[{queryCacheKey:Ki,endpointName:Sn.endpointName,originalArgs:Sn.originalArgs}]:[]}))}};function zs(Kr){return v(v({},Kr),{status:uo=Kr.status,isUninitialized:uo===e.uninitialized,isLoading:uo===e.pending,isSuccess:uo===e.fulfilled,isError:uo===e.rejected});var uo}function Mo(Kr){return Kr[bo]}}({serializeQueryArgs:Ie,reducerPath:ut}),os=Ua.buildQuerySelector,gs=Ua.buildMutationSelector;Mr(Ge.util,{selectInvalidatedBy:Ua.selectInvalidatedBy});var Ho=function(xi){var co=xi.serializeQueryArgs,bo=xi.queryThunk,Ws=xi.mutationThunk,Wo=xi.api,zs=xi.context,Mo=new Map,Kr=new Map,uo=Wo.internalActions,Tr=uo.unsubscribeQueryResult,Fr=uo.removeMutationResult,so=uo.updateSubscriptionOptions;return{buildInitiateQuery:function(qi,Xn){var bi=function(qn,oi){var Si=oi===void 0?{}:oi,Ki=Si.subscribe,Sn=Ki===void 0||Ki,wn=Si.forceRefetch,Kn=Si.subscriptionOptions,gt=Si[Tt];return function(Pt,vn){var Zn,Wn,ui=co({queryArgs:qn,endpointDefinition:Xn,endpointName:qi}),Br=bo(((Zn={type:"query",subscribe:Sn,forceRefetch:wn,subscriptionOptions:Kn,endpointName:qi,originalArgs:qn,queryCacheKey:ui})[Tt]=gt,Zn)),ho=Wo.endpoints[qi].select(qn),Xr=Pt(Br),ja=ho(vn()),kr=Xr.requestId,Dn=Xr.abort,Ts=ja.requestId!==kr,Il=(Wn=Mo.get(Pt))==null?void 0:Wn[ui],nu=function(){return ho(vn())},ms=Object.assign(gt?Xr.then(nu):Ts&&!Il?Promise.resolve(ja):Promise.all([Il,Xr]).then(nu),{arg:qn,requestId:kr,subscriptionOptions:Kn,queryCacheKey:ui,abort:Dn,unwrap:function(){return x(this,null,function(){var zl;return i(this,function(Fg){switch(Fg.label){case 0:return[4,ms];case 1:if((zl=Fg.sent()).isError)throw zl.error;return[2,zl.data]}})})},refetch:function(){return Pt(bi(qn,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){Sn&&Pt(Tr({queryCacheKey:ui,requestId:kr}))},updateSubscriptionOptions:function(zl){ms.subscriptionOptions=zl,Pt(so({endpointName:qi,requestId:kr,queryCacheKey:ui,options:zl}))}});if(!Il&&!Ts&&!gt){var Wl=Mo.get(Pt)||{};Wl[ui]=ms,Mo.set(Pt,Wl),ms.then(function(){delete Wl[ui],Object.keys(Wl).length||Mo.delete(Pt)})}return ms}};return bi},buildInitiateMutation:function(qi){return function(Xn,bi){var qn=bi===void 0?{}:bi,oi=qn.track,Si=oi===void 0||oi,Ki=qn.fixedCacheKey;return function(Sn,wn){var Kn=Ws({type:"mutation",endpointName:qi,originalArgs:Xn,track:Si,fixedCacheKey:Ki}),gt=Sn(Kn),Pt=gt.requestId,vn=gt.abort,Zn=gt.unwrap,Wn=gt.unwrap().then(function(Xr){return{data:Xr}}).catch(function(Xr){return{error:Xr}}),ui=function(){Sn(Fr({requestId:Pt,fixedCacheKey:Ki}))},Br=Object.assign(Wn,{arg:gt.arg,requestId:Pt,abort:vn,unwrap:Zn,unsubscribe:ui,reset:ui}),ho=Kr.get(Sn)||{};return Kr.set(Sn,ho),ho[Pt]=Br,Br.then(function(){delete ho[Pt],Object.keys(ho).length||Kr.delete(Sn)}),Ki&&(ho[Ki]=Br,Br.then(function(){ho[Ki]===Br&&(delete ho[Ki],Object.keys(ho).length||Kr.delete(Sn))})),Br}}},getRunningQueryThunk:function(qi,Xn){return function(bi){var qn,oi=co({queryArgs:Xn,endpointDefinition:zs.endpointDefinitions[qi],endpointName:qi});return(qn=Mo.get(bi))==null?void 0:qn[oi]}},getRunningMutationThunk:function(qi,Xn){return function(bi){var qn;return(qn=Kr.get(bi))==null?void 0:qn[Xn]}},getRunningQueriesThunk:function(){return function(qi){return Object.values(Mo.get(qi)||{}).filter(Wt)}},getRunningMutationsThunk:function(){return function(qi){return Object.values(Kr.get(qi)||{}).filter(Wt)}},getRunningOperationPromises:function(){var qi=function(Xn){return Array.from(Xn.values()).flatMap(function(bi){return bi?Object.values(bi):[]})};return r(r([],qi(Mo)),qi(Kr)).filter(Wt)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK. Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details. See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:fn,mutationThunk:In,api:Ge,serializeQueryArgs:Ie,context:qt}),kl=Ho.buildInitiateQuery,cc=Ho.buildInitiateMutation;return Mr(Ge.util,{getRunningOperationPromises:Ho.getRunningOperationPromises,getRunningOperationPromise:Ho.removalWarning,getRunningMutationThunk:Ho.getRunningMutationThunk,getRunningMutationsThunk:Ho.getRunningMutationsThunk,getRunningQueryThunk:Ho.getRunningQueryThunk,getRunningQueriesThunk:Ho.getRunningQueriesThunk}),{name:on,injectEndpoint:function(xi,co){var bo,Ws=Ge;(bo=Ws.endpoints)[xi]!=null||(bo[xi]={}),je(co)?Mr(Ws.endpoints[xi],{name:xi,select:os(xi,co),initiate:kl(xi,co)},pn(fn,xi)):co.type===He.mutation&&Mr(Ws.endpoints[xi],{name:xi,select:gs(),initiate:cc(xi)},pn(In,xi))}}}}},to=Ot(hi())})(u$e);c$e.exports=u$e;var VAt=c$e.exports;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const HAt={api:{},latestQueryUrl:""},d$e=gN({name:"companyDocuments",initialState:HAt,reducers:{updateLatestQueryUrl:(n,e)=>{n.latestQueryUrl=e.payload.url}}});d$e.actions;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const WAt={currentPage:1,filter:""},h$e=gN({name:"products",initialState:WAt,reducers:{updateCurrentPage:(n,e)=>{n.currentPage=e.payload.number},updateFilter:(n,e)=>{n.filter=e.payload.filter}}});h$e.actions;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const zAt={colors:{primary:"#117DC0"},darkMode:!1,activeSettings:{name:"",level:"company"}},f$e=gN({name:"settings",initialState:zAt,reducers:{updatePrimaryColor:(n,e)=>{n.colors.primary=e.payload.color},setDarkMode:(n,e)=>{n.darkMode=e.payload.status},setActiveSettings:(n,e)=>{n.activeSettings=e.payload.status}}}),{updatePrimaryColor:K2r,setDarkMode:G2r,setActiveSettings:EF}=f$e.actions;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const GD=$Be({reducer:{companyUsers:B8e.reducer,companyDocuments:d$e.reducer,user:c8e.reducer,products:h$e.reducer,settings:f$e.reducer},middleware:n=>n({serializableCheck:!1})});VAt.setupListeners(GD.dispatch);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ake(){return!0}function UAt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 2H9c-1.103 0-2 .897-2 2v6H5c-1.103 0-2 .897-2 2v9a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4c0-1.103-.897-2-2-2zM5 12h6v8H5v-8zm14 8h-6v-8c0-1.103-.897-2-2-2H9V4h10v16z"}},{tag:"path",attr:{d:"M11 6h2v2h-2zm4 0h2v2h-2zm0 4.031h2V12h-2zM15 14h2v2h-2zm-8 .001h2v2H7z"}}]})(n)}function jAt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 21h14c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2zM5 5h14l.001 14H5V5z"}},{tag:"path",attr:{d:"m6.293 13.293 1.414 1.414L12 10.414l4.293 4.293 1.414-1.414L12 7.586z"}}]})(n)}function Fme(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.903 8.586a.997.997 0 0 0-.196-.293l-6-6a.997.997 0 0 0-.293-.196c-.03-.014-.062-.022-.094-.033a.991.991 0 0 0-.259-.051C13.04 2.011 13.021 2 13 2H6c-1.103 0-2 .897-2 2v16c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V9c0-.021-.011-.04-.013-.062a.952.952 0 0 0-.051-.259c-.01-.032-.019-.063-.033-.093zM16.586 8H14V5.414L16.586 8zM6 20V4h6v5a1 1 0 0 0 1 1h5l.002 10H6z"}},{tag:"path",attr:{d:"M8 12h8v2H8zm0 4h8v2H8zm0-8h2v2H8z"}}]})(n)}function qAt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.5 18.5C2.5 20.43 4.07 22 6 22s3.5-1.57 3.5-3.5c0-1.58-1.06-2.903-2.5-3.337v-3.488c.244.273.509.527.813.744 1.18.844 2.617 1.098 3.918 1.098.966 0 1.853-.14 2.506-.281a3.5 3.5 0 0 0 3.264 2.265c1.93 0 3.5-1.57 3.5-3.5s-1.57-3.5-3.5-3.5a3.5 3.5 0 0 0-3.404 2.718c-1.297.321-3.664.616-5.119-.426-.666-.477-1.09-1.239-1.306-2.236C8.755 7.96 9.5 6.821 9.5 5.5 9.5 3.57 7.93 2 6 2S2.5 3.57 2.5 5.5c0 1.58 1.06 2.903 2.5 3.337v6.326c-1.44.434-2.5 1.757-2.5 3.337zm15-8c.827 0 1.5.673 1.5 1.5s-.673 1.5-1.5 1.5S16 12.827 16 12s.673-1.5 1.5-1.5zm-10 8c0 .827-.673 1.5-1.5 1.5s-1.5-.673-1.5-1.5S5.173 17 6 17s1.5.673 1.5 1.5zm-3-13C4.5 4.673 5.173 4 6 4s1.5.673 1.5 1.5S6.827 7 6 7s-1.5-.673-1.5-1.5z"}}]})(n)}function Y2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 4H3a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1zm-1 11a3 3 0 0 0-3 3H7a3 3 0 0 0-3-3V9a3 3 0 0 0 3-3h10a3 3 0 0 0 3 3v6z"}},{tag:"path",attr:{d:"M12 8c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4zm0 6c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2z"}}]})(n)}function qp(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}},{tag:"path",attr:{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"}}]})(n)}function lke(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"}}]})(n)}function KAt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7 20h2V8h3L8 4 4 8h3zm13-4h-3V4h-2v12h-3l4 4z"}}]})(n)}function GAt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 12h2v4h-2z"}},{tag:"path",attr:{d:"M20 7V5c0-1.103-.897-2-2-2H5C3.346 3 2 4.346 2 6v12c0 2.201 1.794 3 3 3h15c1.103 0 2-.897 2-2V9c0-1.103-.897-2-2-2zM5 5h13v2H5a1.001 1.001 0 0 1 0-2zm15 14H5.012C4.55 18.988 4 18.805 4 18V8.815c.314.113.647.185 1 .185h15v10z"}}]})(n)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function xF(){return Oc(n=>n.companyUsers.api[n.companyUsers.currentIndex])}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ps(){const n=xF();return e=>{const t=(n==null?void 0:n.permissions)??"",[i]=e.split("_");return!!(n!=null&&n.is_admin||n!=null&&n.is_owner||t.includes(e)||t.includes(`${i}_all`)&&e!=="view_reports"&&e!=="view_dashboard")}}function Po(){const n=xF();return{isAdmin:!!(n!=null&&n.is_admin),isOwner:!!(n!=null&&n.is_owner||n!=null&&n.is_owner)}}function p$e(){var C,x;const[n]=pe(),e=Qi(),t=wi(),i=Oc(E=>E.companyUsers),{id:r}=il(),o=Rk(),s=pq(),a=pa(),l=Tl(),c=ni(),u=OAt(),d=_o(),{isAdmin:h,isOwner:f}=Po(),g=ci(),[m,v]=w.useState(!1),[_,b]=w.useState(!1),y=E=>{if(e(sF({type:yN.TOKEN,user:i.api[E].user,token:i.api[E].token.token})),localStorage.setItem("X-CURRENT-INDEX",E.toString()),localStorage.setItem("COMPANY-EDIT-OPENED","false"),sessionStorage.setItem("COMPANY-ACTIVITY-SHOWN","false"),d.invalidateQueries(),r){const k="/"+(l.pathname.includes("/settings/gateways")?"settings/online_payments":l.pathname.split("/")[1]||"dashboard");t(k)}window.location.reload()};return w.useEffect(()=>{i.api.length<10&&v(!0),f1()&&v(!1)},[g]),N(dt,{children:[p(BAt,{isModalOpen:_,setIsModalOpen:b}),N(Q1,{as:"div",className:"relative inline-block text-left w-full","data-cy":"companyDropdown",children:[N(Q1.Button,{className:"flex items-center justify-between w-full rounded font-medium pl-2",children:[N("div",{className:"flex items-center justify-center space-x-3",children:[p("img",{className:"w-8",src:s,alt:"Company logo"}),N("div",{className:"flex flex-col items-between",children:[p("span",{className:"text-sm text-start w-28 truncate",children:u}),((a==null?void 0:a.first_name)||(a==null?void 0:a.last_name))&&N("span",{className:"text-xs text-start w-28 truncate",children:[a.first_name," ",a.last_name]})]})]}),p(fF,{size:18,className:"text-gray-300"})]}),p(Y_,{as:w.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:N(Q1.Items,{style:{backgroundColor:c.$1,borderColor:c.$4},className:"border origin-top-right absolute left-0 mt-2 w-56 rounded shadow-lg",children:[p("div",{className:"py-1",children:p(Q1.Item,{children:N(tn,{children:[p("p",{className:"text-sm",children:n("signed_in_as")}),p("p",{className:"text-sm font-medium truncate",children:a==null?void 0:a.email})]})})}),p("div",{className:"py-1",children:((C=i==null?void 0:i.api)==null?void 0:C.length)>=1&&((x=i==null?void 0:i.api)==null?void 0:x.map((E,k)=>p(Q1.Item,{children:p(tn,{actionKey:"switchCompany",onClick:()=>y(k),children:N("div",{className:"flex items-center space-x-3",children:[p("span",{children:E.company.settings.name||n("untitled_company")}),i.currentIndex===k&&p(MD,{size:18})]})})},k)))}),N("div",{className:"py-1",children:[m&&o&&(h||f)&&p(Q1.Item,{children:p(tn,{className:"flex items-center",onClick:()=>b(!0),icon:p(vt,{element:qp,size:22}),children:p("span",{children:n("add_company")})})}),(h||f)&&p(Q1.Item,{children:p(tn,{to:"/settings/account_management",icon:p(vt,{element:WEt,size:22}),children:n("account_management")})}),p(Q1.Item,{children:p(tn,{to:"/logout",icon:p(vt,{element:HEt,size:22}),children:n("logout")})})]})]})})]})]})}var YAt="tippy-box",g$e="tippy-content",QAt="tippy-backdrop",m$e="tippy-arrow",_$e="tippy-svg-arrow",QE={passive:!0,capture:!0},v$e=function(){return document.body};function VZ(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Bme(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function b$e(n,e){return typeof n=="function"?n.apply(void 0,e):n}function cke(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function XAt(n){return n.split(/\s+/).filter(Boolean)}function v2(n){return[].concat(n)}function uke(n,e){n.indexOf(e)===-1&&n.push(e)}function ZAt(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function JAt(n){return n.split("-")[0]}function OH(n){return[].slice.call(n)}function dke(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function QP(){return document.createElement("div")}function gq(n){return["Element","Fragment"].some(function(e){return Bme(n,e)})}function eNt(n){return Bme(n,"NodeList")}function tNt(n){return Bme(n,"MouseEvent")}function nNt(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function iNt(n){return gq(n)?[n]:eNt(n)?OH(n):Array.isArray(n)?n:OH(document.querySelectorAll(n))}function HZ(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function hke(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function rNt(n){var e,t=v2(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function oNt(n,e){var t=e.clientX,i=e.clientY;return n.every(function(r){var o=r.popperRect,s=r.popperState,a=r.props,l=a.interactiveBorder,c=JAt(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-i+d>l,v=i-o.bottom-h>l,_=o.left-t+f>l,b=t-o.right-g>l;return m||v||_||b})}function WZ(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function fke(n,e){for(var t=e;t;){var i;if(n.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var ib={isTouch:!1},pke=0;function sNt(){ib.isTouch||(ib.isTouch=!0,window.performance&&document.addEventListener("mousemove",y$e))}function y$e(){var n=performance.now();n-pke<20&&(ib.isTouch=!1,document.removeEventListener("mousemove",y$e)),pke=n}function aNt(){var n=document.activeElement;if(nNt(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function lNt(){document.addEventListener("touchstart",sNt,QE),window.addEventListener("blur",aNt)}var cNt=typeof window<"u"&&typeof document<"u",uNt=cNt?!!window.msCrypto:!1,dNt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},hNt={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Q_=Object.assign({appendTo:v$e,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},dNt,hNt),fNt=Object.keys(Q_),pNt=function(e){var t=Object.keys(e);t.forEach(function(i){Q_[i]=e[i]})};function C$e(n){var e=n.plugins||[],t=e.reduce(function(i,r){var o=r.name,s=r.defaultValue;if(o){var a;i[o]=n[o]!==void 0?n[o]:(a=Q_[o])!=null?a:s}return i},{});return Object.assign({},n,t)}function gNt(n,e){var t=e?Object.keys(C$e(Object.assign({},Q_,{plugins:e}))):fNt,i=t.reduce(function(r,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return r;if(o==="content")r[o]=s;else try{r[o]=JSON.parse(s)}catch{r[o]=s}return r},{});return i}function gke(n,e){var t=Object.assign({},e,{content:b$e(e.content,[n])},e.ignoreAttributes?{}:gNt(n,e.plugins));return t.aria=Object.assign({},Q_.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var mNt=function(){return"innerHTML"};function poe(n,e){n[mNt()]=e}function mke(n){var e=QP();return n===!0?e.className=m$e:(e.className=_$e,gq(n)?e.appendChild(n):poe(e,n)),e}function _ke(n,e){gq(e.content)?(poe(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?poe(n,e.content):n.textContent=e.content)}function goe(n){var e=n.firstElementChild,t=OH(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(g$e)}),arrow:t.find(function(i){return i.classList.contains(m$e)||i.classList.contains(_$e)}),backdrop:t.find(function(i){return i.classList.contains(QAt)})}}function w$e(n){var e=QP(),t=QP();t.className=YAt,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=QP();i.className=g$e,i.setAttribute("data-state","hidden"),_ke(i,n.props),e.appendChild(t),t.appendChild(i),r(n.props,n.props);function r(o,s){var a=goe(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&_ke(c,n.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(mke(s.arrow))):l.appendChild(mke(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:r}}w$e.$$tippy=!0;var _Nt=1,x8=[],zZ=[];function vNt(n,e){var t=gke(n,Object.assign({},Q_,C$e(dke(e)))),i,r,o,s=!1,a=!1,l=!1,c=!1,u,d,h,f=[],g=cke(Tt,t.interactiveDebounce),m,v=_Nt++,_=null,b=ZAt(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:v,reference:n,popper:QP(),popperInstance:_,props:t,state:y,plugins:b,clearDelayTimeouts:te,setProps:me,setContent:Oe,show:et,hide:Et,hideWithInteractivity:Qe,enable:Z,disable:le,unmount:At,destroy:Ut};if(!t.render)return C;var x=t.render(C),E=x.popper,k=x.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+C.id,C.popper=E,n._tippy=C,E._tippy=C;var L=b.map(function(fe){return fe.fn(C)}),D=n.hasAttribute("aria-expanded");return Be(),H(),U(),W("onCreate",[C]),t.showOnCreate&&re(),E.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),E.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&B().addEventListener("mousemove",g)}),C;function A(){var fe=C.props.touch;return Array.isArray(fe)?fe:[fe,0]}function O(){return A()[0]==="hold"}function P(){var fe;return!!((fe=C.props.render)!=null&&fe.$$tippy)}function F(){return m||n}function B(){var fe=F().parentNode;return fe?rNt(fe):document}function M(){return goe(E)}function V(fe){return C.state.isMounted&&!C.state.isVisible||ib.isTouch||u&&u.type==="focus"?0:VZ(C.props.delay,fe?0:1,Q_.delay)}function U(fe){fe===void 0&&(fe=!1),E.style.pointerEvents=C.props.interactive&&!fe?"":"none",E.style.zIndex=""+C.props.zIndex}function W(fe,Re,Je){if(Je===void 0&&(Je=!0),L.forEach(function(Ft){Ft[fe]&&Ft[fe].apply(Ft,Re)}),Je){var Ot;(Ot=C.props)[fe].apply(Ot,Re)}}function q(){var fe=C.props.aria;if(fe.content){var Re="aria-"+fe.content,Je=E.id,Ot=v2(C.props.triggerTarget||n);Ot.forEach(function(Ft){var jt=Ft.getAttribute(Re);if(C.state.isVisible)Ft.setAttribute(Re,jt?jt+" "+Je:Je);else{var Jt=jt&&jt.replace(Je,"").trim();Jt?Ft.setAttribute(Re,Jt):Ft.removeAttribute(Re)}})}}function H(){if(!(D||!C.props.aria.expanded)){var fe=v2(C.props.triggerTarget||n);fe.forEach(function(Re){C.props.interactive?Re.setAttribute("aria-expanded",C.state.isVisible&&Re===F()?"true":"false"):Re.removeAttribute("aria-expanded")})}}function ie(){B().removeEventListener("mousemove",g),x8=x8.filter(function(fe){return fe!==g})}function se(fe){if(!(ib.isTouch&&(l||fe.type==="mousedown"))){var Re=fe.composedPath&&fe.composedPath()[0]||fe.target;if(!(C.props.interactive&&fke(E,Re))){if(v2(C.props.triggerTarget||n).some(function(Je){return fke(Je,Re)})){if(ib.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else W("onClickOutside",[C,fe]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||He())}}}function Q(){l=!0}function Ee(){l=!1}function Fe(){var fe=B();fe.addEventListener("mousedown",se,!0),fe.addEventListener("touchend",se,QE),fe.addEventListener("touchstart",Ee,QE),fe.addEventListener("touchmove",Q,QE)}function He(){var fe=B();fe.removeEventListener("mousedown",se,!0),fe.removeEventListener("touchend",se,QE),fe.removeEventListener("touchstart",Ee,QE),fe.removeEventListener("touchmove",Q,QE)}function ke(fe,Re){je(fe,function(){!C.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&Re()})}function Me(fe,Re){je(fe,Re)}function je(fe,Re){var Je=M().box;function Ot(Ft){Ft.target===Je&&(WZ(Je,"remove",Ot),Re())}if(fe===0)return Re();WZ(Je,"remove",d),WZ(Je,"add",Ot),d=Ot}function qe(fe,Re,Je){Je===void 0&&(Je=!1);var Ot=v2(C.props.triggerTarget||n);Ot.forEach(function(Ft){Ft.addEventListener(fe,Re,Je),f.push({node:Ft,eventType:fe,handler:Re,options:Je})})}function Be(){O()&&(qe("touchstart",Wt,{passive:!0}),qe("touchend",rn,{passive:!0})),XAt(C.props.trigger).forEach(function(fe){if(fe!=="manual")switch(qe(fe,Wt),fe){case"mouseenter":qe("mouseleave",rn);break;case"focus":qe(uNt?"focusout":"blur",_n);break;case"focusin":qe("focusout",_n);break}})}function _t(){f.forEach(function(fe){var Re=fe.node,Je=fe.eventType,Ot=fe.handler,Ft=fe.options;Re.removeEventListener(Je,Ot,Ft)}),f=[]}function Wt(fe){var Re,Je=!1;if(!(!C.state.isEnabled||wt(fe)||a)){var Ot=((Re=u)==null?void 0:Re.type)==="focus";u=fe,m=fe.currentTarget,H(),!C.state.isVisible&&tNt(fe)&&x8.forEach(function(Ft){return Ft(fe)}),fe.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||s)&&C.props.hideOnClick!==!1&&C.state.isVisible?Je=!0:re(fe),fe.type==="click"&&(s=!Je),Je&&!Ot&&Y(fe)}}function Tt(fe){var Re=fe.target,Je=F().contains(Re)||E.contains(Re);if(!(fe.type==="mousemove"&&Je)){var Ot=Se().concat(E).map(function(Ft){var jt,Jt=Ft._tippy,ei=(jt=Jt.popperInstance)==null?void 0:jt.state;return ei?{popperRect:Ft.getBoundingClientRect(),popperState:ei,props:t}:null}).filter(Boolean);oNt(Ot,fe)&&(ie(),Y(fe))}}function rn(fe){var Re=wt(fe)||C.props.trigger.indexOf("click")>=0&&s;if(!Re){if(C.props.interactive){C.hideWithInteractivity(fe);return}Y(fe)}}function _n(fe){C.props.trigger.indexOf("focusin")<0&&fe.target!==F()||C.props.interactive&&fe.relatedTarget&&E.contains(fe.relatedTarget)||Y(fe)}function wt(fe){return ib.isTouch?O()!==fe.type.indexOf("touch")>=0:!1}function pt(){ot();var fe=C.props,Re=fe.popperOptions,Je=fe.placement,Ot=fe.offset,Ft=fe.getReferenceClientRect,jt=fe.moveTransition,Jt=P()?goe(E).arrow:null,ei=Ft?{getBoundingClientRect:Ft,contextElement:Ft.contextElement||F()}:n,sr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pi){var Ei=pi.state;if(P()){var $i=M(),Pr=$i.box;["placement","reference-hidden","escaped"].forEach(function(ro){ro==="placement"?Pr.setAttribute("data-placement",Ei.placement):Ei.attributes.popper["data-popper-"+ro]?Pr.setAttribute("data-"+ro,""):Pr.removeAttribute("data-"+ro)}),Ei.attributes.popper={}}}},zn=[{name:"offset",options:{offset:Ot}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!jt}},sr];P()&&Jt&&zn.push({name:"arrow",options:{element:Jt,padding:3}}),zn.push.apply(zn,(Re==null?void 0:Re.modifiers)||[]),C.popperInstance=L9e(ei,E,Object.assign({},Re,{placement:Je,onFirstUpdate:h,modifiers:zn}))}function ot(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function we(){var fe=C.props.appendTo,Re,Je=F();C.props.interactive&&fe===v$e||fe==="parent"?Re=Je.parentNode:Re=b$e(fe,[Je]),Re.contains(E)||Re.appendChild(E),C.state.isMounted=!0,pt()}function Se(){return OH(E.querySelectorAll("[data-tippy-root]"))}function re(fe){C.clearDelayTimeouts(),fe&&W("onTrigger",[C,fe]),Fe();var Re=V(!0),Je=A(),Ot=Je[0],Ft=Je[1];ib.isTouch&&Ot==="hold"&&Ft&&(Re=Ft),Re?i=setTimeout(function(){C.show()},Re):C.show()}function Y(fe){if(C.clearDelayTimeouts(),W("onUntrigger",[C,fe]),!C.state.isVisible){He();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(fe.type)>=0&&s)){var Re=V(!1);Re?r=setTimeout(function(){C.state.isVisible&&C.hide()},Re):o=requestAnimationFrame(function(){C.hide()})}}function Z(){C.state.isEnabled=!0}function le(){C.hide(),C.state.isEnabled=!1}function te(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function me(fe){if(!C.state.isDestroyed){W("onBeforeUpdate",[C,fe]),_t();var Re=C.props,Je=gke(n,Object.assign({},Re,dke(fe),{ignoreAttributes:!0}));C.props=Je,Be(),Re.interactiveDebounce!==Je.interactiveDebounce&&(ie(),g=cke(Tt,Je.interactiveDebounce)),Re.triggerTarget&&!Je.triggerTarget?v2(Re.triggerTarget).forEach(function(Ot){Ot.removeAttribute("aria-expanded")}):Je.triggerTarget&&n.removeAttribute("aria-expanded"),H(),U(),k&&k(Re,Je),C.popperInstance&&(pt(),Se().forEach(function(Ot){requestAnimationFrame(Ot._tippy.popperInstance.forceUpdate)})),W("onAfterUpdate",[C,fe])}}function Oe(fe){C.setProps({content:fe})}function et(){var fe=C.state.isVisible,Re=C.state.isDestroyed,Je=!C.state.isEnabled,Ot=ib.isTouch&&!C.props.touch,Ft=VZ(C.props.duration,0,Q_.duration);if(!(fe||Re||Je||Ot)&&!F().hasAttribute("disabled")&&(W("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,P()&&(E.style.visibility="visible"),U(),Fe(),C.state.isMounted||(E.style.transition="none"),P()){var jt=M(),Jt=jt.box,ei=jt.content;HZ([Jt,ei],0)}h=function(){var zn;if(!(!C.state.isVisible||c)){if(c=!0,E.offsetHeight,E.style.transition=C.props.moveTransition,P()&&C.props.animation){var Tn=M(),pi=Tn.box,Ei=Tn.content;HZ([pi,Ei],Ft),hke([pi,Ei],"visible")}q(),H(),uke(zZ,C),(zn=C.popperInstance)==null||zn.forceUpdate(),W("onMount",[C]),C.props.animation&&P()&&Me(Ft,function(){C.state.isShown=!0,W("onShown",[C])})}},we()}}function Et(){var fe=!C.state.isVisible,Re=C.state.isDestroyed,Je=!C.state.isEnabled,Ot=VZ(C.props.duration,1,Q_.duration);if(!(fe||Re||Je)&&(W("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,s=!1,P()&&(E.style.visibility="hidden"),ie(),He(),U(!0),P()){var Ft=M(),jt=Ft.box,Jt=Ft.content;C.props.animation&&(HZ([jt,Jt],Ot),hke([jt,Jt],"hidden"))}q(),H(),C.props.animation?P()&&ke(Ot,C.unmount):C.unmount()}}function Qe(fe){B().addEventListener("mousemove",g),uke(x8,g),g(fe)}function At(){C.state.isVisible&&C.hide(),C.state.isMounted&&(ot(),Se().forEach(function(fe){fe._tippy.unmount()}),E.parentNode&&E.parentNode.removeChild(E),zZ=zZ.filter(function(fe){return fe!==C}),C.state.isMounted=!1,W("onHidden",[C]))}function Ut(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),_t(),delete n._tippy,C.state.isDestroyed=!0,W("onDestroy",[C]))}}function TF(n,e){e===void 0&&(e={});var t=Q_.plugins.concat(e.plugins||[]);lNt();var i=Object.assign({},e,{plugins:t}),r=iNt(n),o=r.reduce(function(s,a){var l=a&&vNt(a,i);return l&&s.push(l),s},[]);return gq(n)?o[0]:o}TF.defaultProps=Q_;TF.setDefaultProps=pNt;TF.currentInput=ib;Object.assign({},eme,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}});TF.setDefaultProps({render:w$e});function S$e(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var E$e=typeof window<"u"&&typeof document<"u";function moe(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function vke(){return E$e&&document.createElement("div")}function bNt(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function x$e(n,e){if(n===e)return!0;if(typeof n=="object"&&n!=null&&typeof e=="object"&&e!=null){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(var t in n)if(e.hasOwnProperty(t)){if(!x$e(n[t],e[t]))return!1}else return!1;return!0}else return!1}function yNt(n){var e=[];return n.forEach(function(t){e.find(function(i){return x$e(t,i)})||e.push(t)}),e}function CNt(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:yNt([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var UZ=E$e?w.useLayoutEffect:w.useEffect;function wNt(n){var e=w.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function bke(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var SNt={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,i=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function r(){e.props.className&&!i()||bke(t,"add",e.props.className)}function o(){i()&&bke(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:o,onAfterUpdate:r}}};function ENt(n){function e(t){var i=t.children,r=t.content,o=t.visible,s=t.singleton,a=t.render,l=t.reference,c=t.disabled,u=c===void 0?!1:c,d=t.ignoreAttributes,h=d===void 0?!0:d;t.__source,t.__self;var f=S$e(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=s!==void 0,v=w.useState(!1),_=v[0],b=v[1],y=w.useState({}),C=y[0],x=y[1],E=w.useState(),k=E[0],L=E[1],D=wNt(function(){return{container:vke(),renders:1}}),A=Object.assign({ignoreAttributes:h},f,{content:D.container});g&&(A.trigger="manual",A.hideOnClick=!1),m&&(u=!0);var O=A,P=A.plugins||[];a&&(O=Object.assign({},A,{plugins:m&&s.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(V,U){var W=s.data.children.find(function(q){var H=q.instance;return H.reference===U.currentTarget});V.state.$$activeSingletonInstance=W.instance,L(W.content)}}}}]):P,render:function(){return{popper:D.container}}}));var F=[l].concat(i?[i.type]:[]);return UZ(function(){var B=l;l&&l.hasOwnProperty("current")&&(B=l.current);var M=n(B||D.ref||vke(),Object.assign({},O,{plugins:[SNt].concat(A.plugins||[])}));return D.instance=M,u&&M.disable(),o&&M.show(),m&&s.hook({instance:M,content:r,props:O,setSingletonContent:L}),b(!0),function(){M.destroy(),s==null||s.cleanup(M)}},F),UZ(function(){var B;if(D.renders===1){D.renders++;return}var M=D.instance;M.setProps(CNt(M.props,O)),(B=M.popperInstance)==null||B.forceUpdate(),u?M.disable():M.enable(),g&&(o?M.show():M.hide()),m&&s.hook({instance:M,content:r,props:O,setSingletonContent:L})}),UZ(function(){var B;if(a){var M=D.instance;M.setProps({popperOptions:Object.assign({},M.props.popperOptions,{modifiers:[].concat((((B=M.props.popperOptions)==null?void 0:B.modifiers)||[]).filter(function(V){var U=V.name;return U!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(U){var W,q=U.state,H=(W=q.modifiersData)==null?void 0:W.hide;(C.placement!==q.placement||C.referenceHidden!==(H==null?void 0:H.isReferenceHidden)||C.escaped!==(H==null?void 0:H.hasPopperEscaped))&&x({placement:q.placement,referenceHidden:H==null?void 0:H.isReferenceHidden,escaped:H==null?void 0:H.hasPopperEscaped}),q.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(F)),ae.createElement(ae.Fragment,null,i?w.cloneElement(i,{ref:function(M){D.ref=M,moe(i.ref,M)}}):null,_&&sp.createPortal(a?a(bNt(C),k,D.instance):r,D.container))}return e}var xNt=function(n,e){return w.forwardRef(function(i,r){var o=i.children,s=S$e(i,["children"]);return ae.createElement(n,Object.assign({},e,s),o?w.cloneElement(o,{ref:function(l){moe(r,l),moe(o.ref,l)}}):null)})},TNt=xNt(ENt(TF));const NE=TNt;/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ig(){var e;const n=Oc(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.account}var kNt=function(e){return INt(e)&&!LNt(e)};function INt(n){return!!n&&typeof n=="object"}function LNt(n){var e=Object.prototype.toString.call(n);return e==="[object RegExp]"||e==="[object Date]"||NNt(n)}var DNt=typeof Symbol=="function"&&Symbol.for,ANt=DNt?Symbol.for("react.element"):60103;function NNt(n){return n.$$typeof===ANt}function RNt(n){return Array.isArray(n)?[]:{}}function PH(n,e){return e.clone!==!1&&e.isMergeableObject(n)?F4(RNt(n),n,e):n}function ONt(n,e,t){return n.concat(e).map(function(i){return PH(i,t)})}function PNt(n,e,t){var i={};return t.isMergeableObject(n)&&Object.keys(n).forEach(function(r){i[r]=PH(n[r],t)}),Object.keys(e).forEach(function(r){!t.isMergeableObject(e[r])||!n[r]?i[r]=PH(e[r],t):i[r]=F4(n[r],e[r],t)}),i}function F4(n,e,t){t=t||{},t.arrayMerge=t.arrayMerge||ONt,t.isMergeableObject=t.isMergeableObject||kNt;var i=Array.isArray(e),r=Array.isArray(n),o=i===r;return o?i?t.arrayMerge(n,e,t):PNt(n,e,t):PH(e,t)}F4.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,r){return F4(i,r,t)},{})};var _oe=F4,MNt=typeof global=="object"&&global&&global.Object===Object&&global;const T$e=MNt;var FNt=typeof self=="object"&&self&&self.Object===Object&&self,BNt=T$e||FNt||Function("return this")();const E0=BNt;var $Nt=E0.Symbol;const aS=$Nt;var k$e=Object.prototype,VNt=k$e.hasOwnProperty,HNt=k$e.toString,rO=aS?aS.toStringTag:void 0;function WNt(n){var e=VNt.call(n,rO),t=n[rO];try{n[rO]=void 0;var i=!0}catch{}var r=HNt.call(n);return i&&(e?n[rO]=t:delete n[rO]),r}var zNt=Object.prototype,UNt=zNt.toString;function jNt(n){return UNt.call(n)}var qNt="[object Null]",KNt="[object Undefined]",yke=aS?aS.toStringTag:void 0;function $k(n){return n==null?n===void 0?KNt:qNt:yke&&yke in Object(n)?WNt(n):jNt(n)}function I$e(n,e){return function(t){return n(e(t))}}var GNt=I$e(Object.getPrototypeOf,Object);const $me=GNt;function Vk(n){return n!=null&&typeof n=="object"}var YNt="[object Object]",QNt=Function.prototype,XNt=Object.prototype,L$e=QNt.toString,ZNt=XNt.hasOwnProperty,JNt=L$e.call(Object);function Cke(n){if(!Vk(n)||$k(n)!=YNt)return!1;var e=$me(n);if(e===null)return!0;var t=ZNt.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&L$e.call(t)==JNt}var wke=Array.isArray,Ske=Object.keys,eRt=Object.prototype.hasOwnProperty,tRt=typeof Element<"u";function voe(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){var t=wke(n),i=wke(e),r,o,s;if(t&&i){if(o=n.length,o!=e.length)return!1;for(r=o;r--!==0;)if(!voe(n[r],e[r]))return!1;return!0}if(t!=i)return!1;var a=n instanceof Date,l=e instanceof Date;if(a!=l)return!1;if(a&&l)return n.getTime()==e.getTime();var c=n instanceof RegExp,u=e instanceof RegExp;if(c!=u)return!1;if(c&&u)return n.toString()==e.toString();var d=Ske(n);if(o=d.length,o!==Ske(e).length)return!1;for(r=o;r--!==0;)if(!eRt.call(e,d[r]))return!1;if(tRt&&n instanceof Element&&e instanceof Element)return n===e;for(r=o;r--!==0;)if(s=d[r],!(s==="_owner"&&n.$$typeof)&&!voe(n[s],e[s]))return!1;return!0}return n!==n&&e!==e}var nRt=function(e,t){try{return voe(e,t)}catch(i){if(i.message&&i.message.match(/stack|recursion/i)||i.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",i.name,i.message),!1;throw i}};const XE=nl(nRt);var iRt=!0;function rRt(n,e){if(!iRt){if(n)return;var t="Warning: "+e;typeof console<"u"&&console.warn(t);try{throw Error(t)}catch{}}}function oRt(){this.__data__=[],this.size=0}function D$e(n,e){return n===e||n!==n&&e!==e}function mq(n,e){for(var t=n.length;t--;)if(D$e(n[t][0],e))return t;return-1}var sRt=Array.prototype,aRt=sRt.splice;function lRt(n){var e=this.__data__,t=mq(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():aRt.call(e,t,1),--this.size,!0}function cRt(n){var e=this.__data__,t=mq(e,n);return t<0?void 0:e[t][1]}function uRt(n){return mq(this.__data__,n)>-1}function dRt(n,e){var t=this.__data__,i=mq(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function I1(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}I1.prototype.clear=oRt;I1.prototype.delete=lRt;I1.prototype.get=cRt;I1.prototype.has=uRt;I1.prototype.set=dRt;function hRt(){this.__data__=new I1,this.size=0}function fRt(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function pRt(n){return this.__data__.get(n)}function gRt(n){return this.__data__.has(n)}function kF(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var mRt="[object AsyncFunction]",_Rt="[object Function]",vRt="[object GeneratorFunction]",bRt="[object Proxy]";function A$e(n){if(!kF(n))return!1;var e=$k(n);return e==_Rt||e==vRt||e==mRt||e==bRt}var yRt=E0["__core-js_shared__"];const jZ=yRt;var Eke=function(){var n=/[^.]+$/.exec(jZ&&jZ.keys&&jZ.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function CRt(n){return!!Eke&&Eke in n}var wRt=Function.prototype,SRt=wRt.toString;function Hk(n){if(n!=null){try{return SRt.call(n)}catch{}try{return n+""}catch{}}return""}var ERt=/[\\^$.*+?()[\]{}|]/g,xRt=/^\[object .+?Constructor\]$/,TRt=Function.prototype,kRt=Object.prototype,IRt=TRt.toString,LRt=kRt.hasOwnProperty,DRt=RegExp("^"+IRt.call(LRt).replace(ERt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ARt(n){if(!kF(n)||CRt(n))return!1;var e=A$e(n)?DRt:xRt;return e.test(Hk(n))}function NRt(n,e){return n==null?void 0:n[e]}function Wk(n,e){var t=NRt(n,e);return ARt(t)?t:void 0}var RRt=Wk(E0,"Map");const B4=RRt;var ORt=Wk(Object,"create");const $4=ORt;function PRt(){this.__data__=$4?$4(null):{},this.size=0}function MRt(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var FRt="__lodash_hash_undefined__",BRt=Object.prototype,$Rt=BRt.hasOwnProperty;function VRt(n){var e=this.__data__;if($4){var t=e[n];return t===FRt?void 0:t}return $Rt.call(e,n)?e[n]:void 0}var HRt=Object.prototype,WRt=HRt.hasOwnProperty;function zRt(n){var e=this.__data__;return $4?e[n]!==void 0:WRt.call(e,n)}var URt="__lodash_hash_undefined__";function jRt(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$4&&e===void 0?URt:e,this}function PT(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}PT.prototype.clear=PRt;PT.prototype.delete=MRt;PT.prototype.get=VRt;PT.prototype.has=zRt;PT.prototype.set=jRt;function qRt(){this.size=0,this.__data__={hash:new PT,map:new(B4||I1),string:new PT}}function KRt(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function _q(n,e){var t=n.__data__;return KRt(e)?t[typeof e=="string"?"string":"hash"]:t.map}function GRt(n){var e=_q(this,n).delete(n);return this.size-=e?1:0,e}function YRt(n){return _q(this,n).get(n)}function QRt(n){return _q(this,n).has(n)}function XRt(n,e){var t=_q(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function qS(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}qS.prototype.clear=qRt;qS.prototype.delete=GRt;qS.prototype.get=YRt;qS.prototype.has=QRt;qS.prototype.set=XRt;var ZRt=200;function JRt(n,e){var t=this.__data__;if(t instanceof I1){var i=t.__data__;if(!B4||i.length<ZRt-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new qS(i)}return t.set(n,e),this.size=t.size,this}function LN(n){var e=this.__data__=new I1(n);this.size=e.size}LN.prototype.clear=hRt;LN.prototype.delete=fRt;LN.prototype.get=pRt;LN.prototype.has=gRt;LN.prototype.set=JRt;function eOt(n,e){for(var t=-1,i=n==null?0:n.length;++t<i&&e(n[t],t,n)!==!1;);return n}var tOt=function(){try{var n=Wk(Object,"defineProperty");return n({},"",{}),n}catch{}}();const xke=tOt;function N$e(n,e,t){e=="__proto__"&&xke?xke(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var nOt=Object.prototype,iOt=nOt.hasOwnProperty;function R$e(n,e,t){var i=n[e];(!(iOt.call(n,e)&&D$e(i,t))||t===void 0&&!(e in n))&&N$e(n,e,t)}function vq(n,e,t,i){var r=!t;t||(t={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=i?i(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),r?N$e(t,a,l):R$e(t,a,l)}return t}function rOt(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var oOt="[object Arguments]";function Tke(n){return Vk(n)&&$k(n)==oOt}var O$e=Object.prototype,sOt=O$e.hasOwnProperty,aOt=O$e.propertyIsEnumerable,lOt=Tke(function(){return arguments}())?Tke:function(n){return Vk(n)&&sOt.call(n,"callee")&&!aOt.call(n,"callee")};const cOt=lOt;var uOt=Array.isArray;const IF=uOt;function dOt(){return!1}var P$e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kke=P$e&&typeof module=="object"&&module&&!module.nodeType&&module,hOt=kke&&kke.exports===P$e,Ike=hOt?E0.Buffer:void 0,fOt=Ike?Ike.isBuffer:void 0,pOt=fOt||dOt;const M$e=pOt;var gOt=9007199254740991,mOt=/^(?:0|[1-9]\d*)$/;function _Ot(n,e){var t=typeof n;return e=e??gOt,!!e&&(t=="number"||t!="symbol"&&mOt.test(n))&&n>-1&&n%1==0&&n<e}var vOt=9007199254740991;function F$e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=vOt}var bOt="[object Arguments]",yOt="[object Array]",COt="[object Boolean]",wOt="[object Date]",SOt="[object Error]",EOt="[object Function]",xOt="[object Map]",TOt="[object Number]",kOt="[object Object]",IOt="[object RegExp]",LOt="[object Set]",DOt="[object String]",AOt="[object WeakMap]",NOt="[object ArrayBuffer]",ROt="[object DataView]",OOt="[object Float32Array]",POt="[object Float64Array]",MOt="[object Int8Array]",FOt="[object Int16Array]",BOt="[object Int32Array]",$Ot="[object Uint8Array]",VOt="[object Uint8ClampedArray]",HOt="[object Uint16Array]",WOt="[object Uint32Array]",cl={};cl[OOt]=cl[POt]=cl[MOt]=cl[FOt]=cl[BOt]=cl[$Ot]=cl[VOt]=cl[HOt]=cl[WOt]=!0;cl[bOt]=cl[yOt]=cl[NOt]=cl[COt]=cl[ROt]=cl[wOt]=cl[SOt]=cl[EOt]=cl[xOt]=cl[TOt]=cl[kOt]=cl[IOt]=cl[LOt]=cl[DOt]=cl[AOt]=!1;function zOt(n){return Vk(n)&&F$e(n.length)&&!!cl[$k(n)]}function Vme(n){return function(e){return n(e)}}var B$e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,XP=B$e&&typeof module=="object"&&module&&!module.nodeType&&module,UOt=XP&&XP.exports===B$e,qZ=UOt&&T$e.process,jOt=function(){try{var n=XP&&XP.require&&XP.require("util").types;return n||qZ&&qZ.binding&&qZ.binding("util")}catch{}}();const YD=jOt;var Lke=YD&&YD.isTypedArray,qOt=Lke?Vme(Lke):zOt;const KOt=qOt;var GOt=Object.prototype,YOt=GOt.hasOwnProperty;function $$e(n,e){var t=IF(n),i=!t&&cOt(n),r=!t&&!i&&M$e(n),o=!t&&!i&&!r&&KOt(n),s=t||i||r||o,a=s?rOt(n.length,String):[],l=a.length;for(var c in n)(e||YOt.call(n,c))&&!(s&&(c=="length"||r&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||_Ot(c,l)))&&a.push(c);return a}var QOt=Object.prototype;function Hme(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||QOt;return n===t}var XOt=I$e(Object.keys,Object);const ZOt=XOt;var JOt=Object.prototype,ePt=JOt.hasOwnProperty;function tPt(n){if(!Hme(n))return ZOt(n);var e=[];for(var t in Object(n))ePt.call(n,t)&&t!="constructor"&&e.push(t);return e}function V$e(n){return n!=null&&F$e(n.length)&&!A$e(n)}function Wme(n){return V$e(n)?$$e(n):tPt(n)}function nPt(n,e){return n&&vq(e,Wme(e),n)}function iPt(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var rPt=Object.prototype,oPt=rPt.hasOwnProperty;function sPt(n){if(!kF(n))return iPt(n);var e=Hme(n),t=[];for(var i in n)i=="constructor"&&(e||!oPt.call(n,i))||t.push(i);return t}function zme(n){return V$e(n)?$$e(n,!0):sPt(n)}function aPt(n,e){return n&&vq(e,zme(e),n)}var H$e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dke=H$e&&typeof module=="object"&&module&&!module.nodeType&&module,lPt=Dke&&Dke.exports===H$e,Ake=lPt?E0.Buffer:void 0,Nke=Ake?Ake.allocUnsafe:void 0;function cPt(n,e){if(e)return n.slice();var t=n.length,i=Nke?Nke(t):new n.constructor(t);return n.copy(i),i}function W$e(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}function uPt(n,e){for(var t=-1,i=n==null?0:n.length,r=0,o=[];++t<i;){var s=n[t];e(s,t,n)&&(o[r++]=s)}return o}function z$e(){return[]}var dPt=Object.prototype,hPt=dPt.propertyIsEnumerable,Rke=Object.getOwnPropertySymbols,fPt=Rke?function(n){return n==null?[]:(n=Object(n),uPt(Rke(n),function(e){return hPt.call(n,e)}))}:z$e;const Ume=fPt;function pPt(n,e){return vq(n,Ume(n),e)}function U$e(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var gPt=Object.getOwnPropertySymbols,mPt=gPt?function(n){for(var e=[];n;)U$e(e,Ume(n)),n=$me(n);return e}:z$e;const j$e=mPt;function _Pt(n,e){return vq(n,j$e(n),e)}function q$e(n,e,t){var i=e(n);return IF(n)?i:U$e(i,t(n))}function vPt(n){return q$e(n,Wme,Ume)}function bPt(n){return q$e(n,zme,j$e)}var yPt=Wk(E0,"DataView");const boe=yPt;var CPt=Wk(E0,"Promise");const yoe=CPt;var wPt=Wk(E0,"Set");const Coe=wPt;var SPt=Wk(E0,"WeakMap");const woe=SPt;var Oke="[object Map]",EPt="[object Object]",Pke="[object Promise]",Mke="[object Set]",Fke="[object WeakMap]",Bke="[object DataView]",xPt=Hk(boe),TPt=Hk(B4),kPt=Hk(yoe),IPt=Hk(Coe),LPt=Hk(woe),ZE=$k;(boe&&ZE(new boe(new ArrayBuffer(1)))!=Bke||B4&&ZE(new B4)!=Oke||yoe&&ZE(yoe.resolve())!=Pke||Coe&&ZE(new Coe)!=Mke||woe&&ZE(new woe)!=Fke)&&(ZE=function(n){var e=$k(n),t=e==EPt?n.constructor:void 0,i=t?Hk(t):"";if(i)switch(i){case xPt:return Bke;case TPt:return Oke;case kPt:return Pke;case IPt:return Mke;case LPt:return Fke}return e});const jme=ZE;var DPt=Object.prototype,APt=DPt.hasOwnProperty;function NPt(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&APt.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var RPt=E0.Uint8Array;const $ke=RPt;function qme(n){var e=new n.constructor(n.byteLength);return new $ke(e).set(new $ke(n)),e}function OPt(n,e){var t=e?qme(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var PPt=/\w*$/;function MPt(n){var e=new n.constructor(n.source,PPt.exec(n));return e.lastIndex=n.lastIndex,e}var Vke=aS?aS.prototype:void 0,Hke=Vke?Vke.valueOf:void 0;function FPt(n){return Hke?Object(Hke.call(n)):{}}function BPt(n,e){var t=e?qme(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var $Pt="[object Boolean]",VPt="[object Date]",HPt="[object Map]",WPt="[object Number]",zPt="[object RegExp]",UPt="[object Set]",jPt="[object String]",qPt="[object Symbol]",KPt="[object ArrayBuffer]",GPt="[object DataView]",YPt="[object Float32Array]",QPt="[object Float64Array]",XPt="[object Int8Array]",ZPt="[object Int16Array]",JPt="[object Int32Array]",eMt="[object Uint8Array]",tMt="[object Uint8ClampedArray]",nMt="[object Uint16Array]",iMt="[object Uint32Array]";function rMt(n,e,t){var i=n.constructor;switch(e){case KPt:return qme(n);case $Pt:case VPt:return new i(+n);case GPt:return OPt(n,t);case YPt:case QPt:case XPt:case ZPt:case JPt:case eMt:case tMt:case nMt:case iMt:return BPt(n,t);case HPt:return new i;case WPt:case jPt:return new i(n);case zPt:return MPt(n);case UPt:return new i;case qPt:return FPt(n)}}var Wke=Object.create,oMt=function(){function n(){}return function(e){if(!kF(e))return{};if(Wke)return Wke(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();const sMt=oMt;function aMt(n){return typeof n.constructor=="function"&&!Hme(n)?sMt($me(n)):{}}var lMt="[object Map]";function cMt(n){return Vk(n)&&jme(n)==lMt}var zke=YD&&YD.isMap,uMt=zke?Vme(zke):cMt;const dMt=uMt;var hMt="[object Set]";function fMt(n){return Vk(n)&&jme(n)==hMt}var Uke=YD&&YD.isSet,pMt=Uke?Vme(Uke):fMt;const gMt=pMt;var mMt=1,_Mt=2,vMt=4,K$e="[object Arguments]",bMt="[object Array]",yMt="[object Boolean]",CMt="[object Date]",wMt="[object Error]",G$e="[object Function]",SMt="[object GeneratorFunction]",EMt="[object Map]",xMt="[object Number]",Y$e="[object Object]",TMt="[object RegExp]",kMt="[object Set]",IMt="[object String]",LMt="[object Symbol]",DMt="[object WeakMap]",AMt="[object ArrayBuffer]",NMt="[object DataView]",RMt="[object Float32Array]",OMt="[object Float64Array]",PMt="[object Int8Array]",MMt="[object Int16Array]",FMt="[object Int32Array]",BMt="[object Uint8Array]",$Mt="[object Uint8ClampedArray]",VMt="[object Uint16Array]",HMt="[object Uint32Array]",qa={};qa[K$e]=qa[bMt]=qa[AMt]=qa[NMt]=qa[yMt]=qa[CMt]=qa[RMt]=qa[OMt]=qa[PMt]=qa[MMt]=qa[FMt]=qa[EMt]=qa[xMt]=qa[Y$e]=qa[TMt]=qa[kMt]=qa[IMt]=qa[LMt]=qa[BMt]=qa[$Mt]=qa[VMt]=qa[HMt]=!0;qa[wMt]=qa[G$e]=qa[DMt]=!1;function v$(n,e,t,i,r,o){var s,a=e&mMt,l=e&_Mt,c=e&vMt;if(t&&(s=r?t(n,i,r,o):t(n)),s!==void 0)return s;if(!kF(n))return n;var u=IF(n);if(u){if(s=NPt(n),!a)return W$e(n,s)}else{var d=jme(n),h=d==G$e||d==SMt;if(M$e(n))return cPt(n,a);if(d==Y$e||d==K$e||h&&!r){if(s=l||h?{}:aMt(n),!a)return l?_Pt(n,aPt(s,n)):pPt(n,nPt(s,n))}else{if(!qa[d])return r?n:{};s=rMt(n,d,a)}}o||(o=new LN);var f=o.get(n);if(f)return f;o.set(n,s),gMt(n)?n.forEach(function(v){s.add(v$(v,e,t,v,n,o))}):dMt(n)&&n.forEach(function(v,_){s.set(_,v$(v,e,t,_,n,o))});var g=c?l?bPt:vPt:l?zme:Wme,m=u?void 0:g(n);return eOt(m||n,function(v,_){m&&(_=v,v=n[_]),R$e(s,_,v$(v,e,t,_,n,o))}),s}var WMt=4;function jke(n){return v$(n,WMt)}function Q$e(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t<i;)r[t]=e(n[t],t,n);return r}var zMt="[object Symbol]";function Kme(n){return typeof n=="symbol"||Vk(n)&&$k(n)==zMt}var UMt="Expected a function";function Gme(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(UMt);var t=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=t.cache;if(o.has(r))return o.get(r);var s=n.apply(this,i);return t.cache=o.set(r,s)||o,s};return t.cache=new(Gme.Cache||qS),t}Gme.Cache=qS;var jMt=500;function qMt(n){var e=Gme(n,function(i){return t.size===jMt&&t.clear(),i}),t=e.cache;return e}var KMt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,GMt=/\\(\\)?/g,YMt=qMt(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(KMt,function(t,i,r,o){e.push(r?o.replace(GMt,"$1"):i||t)}),e});const QMt=YMt;var XMt=1/0;function ZMt(n){if(typeof n=="string"||Kme(n))return n;var e=n+"";return e=="0"&&1/n==-XMt?"-0":e}var JMt=1/0,qke=aS?aS.prototype:void 0,Kke=qke?qke.toString:void 0;function X$e(n){if(typeof n=="string")return n;if(IF(n))return Q$e(n,X$e)+"";if(Kme(n))return Kke?Kke.call(n):"";var e=n+"";return e=="0"&&1/n==-JMt?"-0":e}function e4t(n){return n==null?"":X$e(n)}function Z$e(n){return IF(n)?Q$e(n,ZMt):Kme(n)?[n]:W$e(QMt(e4t(n)))}function Pu(){return Pu=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Pu.apply(this,arguments)}function J$e(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var bq=w.createContext(void 0);bq.displayName="FormikContext";bq.Provider;bq.Consumer;function t4t(){var n=w.useContext(bq);return n||rRt(!1),n}var g_=function(e){return typeof e=="function"},yq=function(e){return e!==null&&typeof e=="object"},n4t=function(e){return String(Math.floor(Number(e)))===e},KZ=function(e){return Object.prototype.toString.call(e)==="[object String]"},GZ=function(e){return yq(e)&&g_(e.then)};function Lp(n,e,t,i){i===void 0&&(i=0);for(var r=Z$e(e);n&&i<r.length;)n=n[r[i++]];return i!==r.length&&!n||n===void 0?t:n}function lT(n,e,t){for(var i=jke(n),r=i,o=0,s=Z$e(e);o<s.length-1;o++){var a=s[o],l=Lp(n,s.slice(0,o+1));if(l&&(yq(l)||Array.isArray(l)))r=r[a]=jke(l);else{var c=s[o+1];r=r[a]=n4t(c)&&Number(c)>=0?[]:{}}}return(o===0?n:r)[s[o]]===t?n:(t===void 0?delete r[s[o]]:r[s[o]]=t,o===0&&t===void 0&&delete i[s[o]],i)}function eVe(n,e,t,i){t===void 0&&(t=new WeakMap),i===void 0&&(i={});for(var r=0,o=Object.keys(n);r<o.length;r++){var s=o[r],a=n[s];yq(a)?t.get(a)||(t.set(a,!0),i[s]=Array.isArray(a)?[]:{},eVe(a,e,t,i[s])):i[s]=e}return i}function i4t(n,e){switch(e.type){case"SET_VALUES":return Pu({},n,{values:e.payload});case"SET_TOUCHED":return Pu({},n,{touched:e.payload});case"SET_ERRORS":return XE(n.errors,e.payload)?n:Pu({},n,{errors:e.payload});case"SET_STATUS":return Pu({},n,{status:e.payload});case"SET_ISSUBMITTING":return Pu({},n,{isSubmitting:e.payload});case"SET_ISVALIDATING":return Pu({},n,{isValidating:e.payload});case"SET_FIELD_VALUE":return Pu({},n,{values:lT(n.values,e.payload.field,e.payload.value)});case"SET_FIELD_TOUCHED":return Pu({},n,{touched:lT(n.touched,e.payload.field,e.payload.value)});case"SET_FIELD_ERROR":return Pu({},n,{errors:lT(n.errors,e.payload.field,e.payload.value)});case"RESET_FORM":return Pu({},n,e.payload);case"SET_FORMIK_STATE":return e.payload(n);case"SUBMIT_ATTEMPT":return Pu({},n,{touched:eVe(n.values,!0),isSubmitting:!0,submitCount:n.submitCount+1});case"SUBMIT_FAILURE":return Pu({},n,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Pu({},n,{isSubmitting:!1});default:return n}}var RE={},T8={};function td(n){var e=n.validateOnChange,t=e===void 0?!0:e,i=n.validateOnBlur,r=i===void 0?!0:i,o=n.validateOnMount,s=o===void 0?!1:o,a=n.isInitialValid,l=n.enableReinitialize,c=l===void 0?!1:l,u=n.onSubmit,d=J$e(n,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),h=Pu({validateOnChange:t,validateOnBlur:r,validateOnMount:s,onSubmit:u},d),f=w.useRef(h.initialValues),g=w.useRef(h.initialErrors||RE),m=w.useRef(h.initialTouched||T8),v=w.useRef(h.initialStatus),_=w.useRef(!1),b=w.useRef({});w.useEffect(function(){return _.current=!0,function(){_.current=!1}},[]);var y=w.useState(0),C=y[1],x=w.useRef({values:h.initialValues,errors:h.initialErrors||RE,touched:h.initialTouched||T8,status:h.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=x.current,k=w.useCallback(function(re){var Y=x.current;x.current=i4t(Y,re),Y!==x.current&&C(function(Z){return Z+1})},[]),L=w.useCallback(function(re,Y){return new Promise(function(Z,le){var te=h.validate(re,Y);te==null?Z(RE):GZ(te)?te.then(function(me){Z(me||RE)},function(me){le(me)}):Z(te)})},[h.validate]),D=w.useCallback(function(re,Y){var Z=h.validationSchema,le=g_(Z)?Z(Y):Z,te=Y&&le.validateAt?le.validateAt(Y,re):o4t(re,le);return new Promise(function(me,Oe){te.then(function(){me(RE)},function(et){et.name==="ValidationError"?me(r4t(et)):Oe(et)})})},[h.validationSchema]),A=w.useCallback(function(re,Y){return new Promise(function(Z){return Z(b.current[re].validate(Y))})},[]),O=w.useCallback(function(re){var Y=Object.keys(b.current).filter(function(le){return g_(b.current[le].validate)}),Z=Y.length>0?Y.map(function(le){return A(le,Lp(re,le))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Z).then(function(le){return le.reduce(function(te,me,Oe){return me==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||me&&(te=lT(te,Y[Oe],me)),te},{})})},[A]),P=w.useCallback(function(re){return Promise.all([O(re),h.validationSchema?D(re):{},h.validate?L(re):{}]).then(function(Y){var Z=Y[0],le=Y[1],te=Y[2],me=_oe.all([Z,le,te],{arrayMerge:s4t});return me})},[h.validate,h.validationSchema,O,L,D]),F=Yg(function(re){return re===void 0&&(re=E.values),k({type:"SET_ISVALIDATING",payload:!0}),P(re).then(function(Y){return _.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:Y})),Y})});w.useEffect(function(){s&&_.current===!0&&XE(f.current,h.initialValues)&&F(f.current)},[s,F]);var B=w.useCallback(function(re){var Y=re&&re.values?re.values:f.current,Z=re&&re.errors?re.errors:g.current?g.current:h.initialErrors||{},le=re&&re.touched?re.touched:m.current?m.current:h.initialTouched||{},te=re&&re.status?re.status:v.current?v.current:h.initialStatus;f.current=Y,g.current=Z,m.current=le,v.current=te;var me=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!re&&!!re.isSubmitting,errors:Z,touched:le,status:te,values:Y,isValidating:!!re&&!!re.isValidating,submitCount:re&&re.submitCount&&typeof re.submitCount=="number"?re.submitCount:0}})};if(h.onReset){var Oe=h.onReset(E.values,Wt);GZ(Oe)?Oe.then(me):me()}else me()},[h.initialErrors,h.initialStatus,h.initialTouched,h.onReset]);w.useEffect(function(){_.current===!0&&!XE(f.current,h.initialValues)&&c&&(f.current=h.initialValues,B(),s&&F(f.current))},[c,h.initialValues,B,s,F]),w.useEffect(function(){c&&_.current===!0&&!XE(g.current,h.initialErrors)&&(g.current=h.initialErrors||RE,k({type:"SET_ERRORS",payload:h.initialErrors||RE}))},[c,h.initialErrors]),w.useEffect(function(){c&&_.current===!0&&!XE(m.current,h.initialTouched)&&(m.current=h.initialTouched||T8,k({type:"SET_TOUCHED",payload:h.initialTouched||T8}))},[c,h.initialTouched]),w.useEffect(function(){c&&_.current===!0&&!XE(v.current,h.initialStatus)&&(v.current=h.initialStatus,k({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var M=Yg(function(re){if(b.current[re]&&g_(b.current[re].validate)){var Y=Lp(E.values,re),Z=b.current[re].validate(Y);return GZ(Z)?(k({type:"SET_ISVALIDATING",payload:!0}),Z.then(function(le){return le}).then(function(le){k({type:"SET_FIELD_ERROR",payload:{field:re,value:le}}),k({type:"SET_ISVALIDATING",payload:!1})})):(k({type:"SET_FIELD_ERROR",payload:{field:re,value:Z}}),Promise.resolve(Z))}else if(h.validationSchema)return k({type:"SET_ISVALIDATING",payload:!0}),D(E.values,re).then(function(le){return le}).then(function(le){k({type:"SET_FIELD_ERROR",payload:{field:re,value:Lp(le,re)}}),k({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),V=w.useCallback(function(re,Y){var Z=Y.validate;b.current[re]={validate:Z}},[]),U=w.useCallback(function(re){delete b.current[re]},[]),W=Yg(function(re,Y){k({type:"SET_TOUCHED",payload:re});var Z=Y===void 0?r:Y;return Z?F(E.values):Promise.resolve()}),q=w.useCallback(function(re){k({type:"SET_ERRORS",payload:re})},[]),H=Yg(function(re,Y){var Z=g_(re)?re(E.values):re;k({type:"SET_VALUES",payload:Z});var le=Y===void 0?t:Y;return le?F(Z):Promise.resolve()}),ie=w.useCallback(function(re,Y){k({type:"SET_FIELD_ERROR",payload:{field:re,value:Y}})},[]),se=Yg(function(re,Y,Z){k({type:"SET_FIELD_VALUE",payload:{field:re,value:Y}});var le=Z===void 0?t:Z;return le?F(lT(E.values,re,Y)):Promise.resolve()}),Q=w.useCallback(function(re,Y){var Z=Y,le=re,te;if(!KZ(re)){re.persist&&re.persist();var me=re.target?re.target:re.currentTarget,Oe=me.type,et=me.name,Et=me.id,Qe=me.value,At=me.checked,Ut=me.outerHTML,fe=me.options,Re=me.multiple;Z=Y||et||Et,le=/number|range/.test(Oe)?(te=parseFloat(Qe),isNaN(te)?"":te):/checkbox/.test(Oe)?l4t(Lp(E.values,Z),At,Qe):fe&&Re?a4t(fe):Qe}Z&&se(Z,le)},[se,E.values]),Ee=Yg(function(re){if(KZ(re))return function(Y){return Q(Y,re)};Q(re)}),Fe=Yg(function(re,Y,Z){Y===void 0&&(Y=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:re,value:Y}});var le=Z===void 0?r:Z;return le?F(E.values):Promise.resolve()}),He=w.useCallback(function(re,Y){re.persist&&re.persist();var Z=re.target,le=Z.name,te=Z.id,me=Z.outerHTML,Oe=Y||le||te;Fe(Oe,!0)},[Fe]),ke=Yg(function(re){if(KZ(re))return function(Y){return He(Y,re)};He(re)}),Me=w.useCallback(function(re){g_(re)?k({type:"SET_FORMIK_STATE",payload:re}):k({type:"SET_FORMIK_STATE",payload:function(){return re}})},[]),je=w.useCallback(function(re){k({type:"SET_STATUS",payload:re})},[]),qe=w.useCallback(function(re){k({type:"SET_ISSUBMITTING",payload:re})},[]),Be=Yg(function(){return k({type:"SUBMIT_ATTEMPT"}),F().then(function(re){var Y=re instanceof Error,Z=!Y&&Object.keys(re).length===0;if(Z){var le;try{if(le=Tt(),le===void 0)return}catch(te){throw te}return Promise.resolve(le).then(function(te){return _.current&&k({type:"SUBMIT_SUCCESS"}),te}).catch(function(te){if(_.current)throw k({type:"SUBMIT_FAILURE"}),te})}else if(_.current&&(k({type:"SUBMIT_FAILURE"}),Y))throw re})}),_t=Yg(function(re){re&&re.preventDefault&&g_(re.preventDefault)&&re.preventDefault(),re&&re.stopPropagation&&g_(re.stopPropagation)&&re.stopPropagation(),Be().catch(function(Y){console.warn("Warning: An unhandled error was caught from submitForm()",Y)})}),Wt={resetForm:B,validateForm:F,validateField:M,setErrors:q,setFieldError:ie,setFieldTouched:Fe,setFieldValue:se,setStatus:je,setSubmitting:qe,setTouched:W,setValues:H,setFormikState:Me,submitForm:Be},Tt=Yg(function(){return u(E.values,Wt)}),rn=Yg(function(re){re&&re.preventDefault&&g_(re.preventDefault)&&re.preventDefault(),re&&re.stopPropagation&&g_(re.stopPropagation)&&re.stopPropagation(),B()}),_n=w.useCallback(function(re){return{value:Lp(E.values,re),error:Lp(E.errors,re),touched:!!Lp(E.touched,re),initialValue:Lp(f.current,re),initialTouched:!!Lp(m.current,re),initialError:Lp(g.current,re)}},[E.errors,E.touched,E.values]),wt=w.useCallback(function(re){return{setValue:function(Z,le){return se(re,Z,le)},setTouched:function(Z,le){return Fe(re,Z,le)},setError:function(Z){return ie(re,Z)}}},[se,Fe,ie]),pt=w.useCallback(function(re){var Y=yq(re),Z=Y?re.name:re,le=Lp(E.values,Z),te={name:Z,value:le,onChange:Ee,onBlur:ke};if(Y){var me=re.type,Oe=re.value,et=re.as,Et=re.multiple;me==="checkbox"?Oe===void 0?te.checked=!!le:(te.checked=!!(Array.isArray(le)&&~le.indexOf(Oe)),te.value=Oe):me==="radio"?(te.checked=le===Oe,te.value=Oe):et==="select"&&Et&&(te.value=te.value||[],te.multiple=!0)}return te},[ke,Ee,E.values]),ot=w.useMemo(function(){return!XE(f.current,E.values)},[f.current,E.values]),we=w.useMemo(function(){return typeof a<"u"?ot?E.errors&&Object.keys(E.errors).length===0:a!==!1&&g_(a)?a(h):a:E.errors&&Object.keys(E.errors).length===0},[a,ot,E.errors,h]),Se=Pu({},E,{initialValues:f.current,initialErrors:g.current,initialTouched:m.current,initialStatus:v.current,handleBlur:ke,handleChange:Ee,handleReset:rn,handleSubmit:_t,resetForm:B,setErrors:q,setFormikState:Me,setFieldTouched:Fe,setFieldValue:se,setFieldError:ie,setStatus:je,setSubmitting:qe,setTouched:W,setValues:H,submitForm:Be,validateForm:F,validateField:M,isValid:we,dirty:ot,unregisterField:U,registerField:V,getFieldProps:pt,getFieldMeta:_n,getFieldHelpers:wt,validateOnBlur:r,validateOnChange:t,validateOnMount:s});return Se}function r4t(n){var e={};if(n.inner){if(n.inner.length===0)return lT(e,n.path,n.message);for(var r=n.inner,t=Array.isArray(r),i=0,r=t?r:r[Symbol.iterator]();;){var o;if(t){if(i>=r.length)break;o=r[i++]}else{if(i=r.next(),i.done)break;o=i.value}var s=o;Lp(e,s.path)||(e=lT(e,s.path,s.message))}}return e}function o4t(n,e,t,i){t===void 0&&(t=!1);var r=Soe(n);return e[t?"validateSync":"validate"](r,{abortEarly:!1,context:i||r})}function Soe(n){var e=Array.isArray(n)?[]:{};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){var i=String(t);Array.isArray(n[i])===!0?e[i]=n[i].map(function(r){return Array.isArray(r)===!0||Cke(r)?Soe(r):r!==""?r:void 0}):Cke(n[i])?e[i]=Soe(n[i]):e[i]=n[i]!==""?n[i]:void 0}return e}function s4t(n,e,t){var i=n.slice();return e.forEach(function(o,s){if(typeof i[s]>"u"){var a=t.clone!==!1,l=a&&t.isMergeableObject(o);i[s]=l?_oe(Array.isArray(o)?[]:{},o,t):o}else t.isMergeableObject(o)?i[s]=_oe(n[s],o,t):n.indexOf(o)===-1&&i.push(o)}),i}function a4t(n){return Array.from(n).filter(function(e){return e.selected}).map(function(e){return e.value})}function l4t(n,e,t){if(typeof n=="boolean")return!!e;var i=[],r=!1,o=-1;if(Array.isArray(n))i=n,o=n.indexOf(t),r=o>=0;else if(!t||t=="true"||t=="false")return!!e;return e&&t&&!r?i.concat(t):r?i.slice(0,o).concat(i.slice(o+1)):i}var c4t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Yg(n){var e=w.useRef(n);return c4t(function(){e.current=n}),w.useCallback(function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return e.current.apply(void 0,i)},[])}var u4t=w.forwardRef(function(n,e){var t=n.action,i=J$e(n,["action"]),r=t??"#",o=t4t(),s=o.handleReset,a=o.handleSubmit;return w.createElement("form",Pu({onSubmit:a,ref:e,onReset:s,action:r},i))});u4t.displayName="Form";/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function LF(){const n=Qi();return(e,t)=>{n(Ak({property:e,value:t}))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function d4t(){const n=Qi();return e=>{Ae("PUT",Te("/api/v1/company_users/:id",{id:e.id}),e).then(t=>{un.set({...e},"company_user",t.data.data),En(["company_users"]),n(qy(e))})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Yme=Oo(!1);function ap(n){const[e]=pe(),t=wi(),i=Tl(),r=w.useRef(null),[o,s]=w.useState(""),[a,l]=w.useState(n.show??!1),c=Fi(Yme);w.useEffect(()=>{l(n.show)},[n.show]);const u=d=>{d==null||d.preventDefault(),n.onSave(o,!!o),s(""),n.onClose(!1)};return w.useEffect(()=>{a&&!c&&u()},[a]),N(Ui,{onClose:()=>{i.pathname.startsWith("/settings/users")&&!n.tableActions?t("/settings/users"):n.onClose(!1),s("")},visible:a&&c,title:e("confirmation"),text:e("please_enter_your_password"),initialFocusRef:r,children:[p("form",{onSubmit:d=>u(d),children:p(We,{innerRef:r,id:"current_password",type:"password",label:e("current_password"),required:!0,changeOverride:!0,value:o,onChange:d=>s(d.target.value)})}),p(Gt,{disabled:o.length===0,onClick:d=>u(d),disableWithoutIcon:!0,children:e("continue")})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Lg(){const n=Ar(Yme);return e=>{e?ce.error("password_error_incorrect"):ce.dismiss(),n(!0)}}const YZ=rl.div` background-color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function h4t(n){const[e]=pe(),t=pa(),i=Qi(),r=ni(),o=Lg(),{isAboutVisible:s,setIsAboutVisible:a,currentSystemInfo:l,latestVersion:c}=n,[u,d]=w.useState(!1),[h,f]=w.useState(!1),[g,m]=w.useState(!1),[v,_]=w.useState(!1),[b,y]=w.useState(!1),[C,x]=w.useState(l),E=D=>{(!u||D)&&(ce.processing(),d(!0),Ae("GET",Te("/api/v1/health_check")).then(A=>{x(A.data),f(!0),ce.dismiss()}).finally(()=>d(!1)))},k=()=>{u||(ce.processing(),d(!0),Ae("GET",Te("/api/v1/ping?clear_cache=true")).then(()=>{Ae("POST",Te("/api/v1/refresh?current_company=true")).then(D=>{i(w0(D.data.data)),ce.dismiss(),E(!0)}).finally(()=>d(!1))}).catch(()=>d(!1)))},L=(D,A)=>{u||(d(!0),y(!0),Ae("POST",Te("/api/v1/self-update"),{},{headers:{"X-Api-Password":D}}).then(()=>window.location.reload()).catch(O=>{var P;((P=O.response)==null?void 0:P.status)===412&&(o(A),_(!0))}).finally(()=>{d(!1),y(!1)}))};return N(dt,{children:[N(Ui,{title:e("about"),visible:s,onClose:()=>!u&&a(!1),disableClosing:h||g||v||b,children:[N("div",{className:"flex flex-col text-center",children:[N("div",{className:"flex flex-col",children:[N("span",{className:"text-gray-800",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]}),p("span",{children:t==null?void 0:t.email})]}),N("span",{className:"mt-4",children:["v",l==null?void 0:l.api_version]})]}),N(Gt,{behavior:"button",className:"flex items-center",onClick:E,disableWithoutIcon:!0,disabled:u,children:[p(vt,{element:g1t,color:"white"}),p("span",{children:e("health_check")})]}),c&&(l==null?void 0:l.api_version)&&l.api_version!==c&&!(l!=null&&l.is_docker)&&N(Gt,{behavior:"button",className:"flex items-center",onClick:()=>m(!0),disableWithoutIcon:!0,disabled:u,children:[p(vt,{element:uCt,color:"white"}),p("span",{children:e("force_update")})]}),N("div",{className:"flex flex-wrap justify-center items-center space-x-4 pt-6",children:[p("a",{href:"https://twitter.com/invoiceninja",target:"_blank",rel:"noreferrer",children:p(gwt,{})}),p("a",{href:"https://www.facebook.com/invoiceninja",target:"_blank",rel:"noreferrer",children:p(gCt,{})}),p("a",{href:"https://github.com/invoiceninja",target:"_blank",rel:"noreferrer",children:p(wCt,{})}),p("a",{href:"https://www.youtube.com/channel/UCXAHcBvhW05PDtWYIq7WDFA/videos",target:"_blank",rel:"noreferrer",children:p(Swt,{})}),p("a",{href:"http://slack.invoiceninja.com/",target:"_blank",rel:"noreferrer",children:p(iwt,{})})]})]}),N(Ui,{title:e("health_check"),visible:h,onClose:()=>f(!1),children:[N("div",{className:"flex flex-col space-y-3",children:[N("div",{className:"flex justify-between items-center py-1 px-3",children:[N("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("system")}),N("span",{children:[e("email"),": ",C==null?void 0:C.mail_mailer]}),N("span",{children:[e("queue"),": ",C==null?void 0:C.queue]}),N("span",{children:[e("pdf"),": ",C==null?void 0:C.pdf_engine]})]}),p("div",{children:p(vt,{element:C!=null&&C.system_health?mZ:Tb,color:C!=null&&C.system_health?"green":"red",size:25})})]}),N("div",{className:"flex justify-between items-center py-1 px-3",children:[N("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("database_connection")}),p("span",{children:C!=null&&C.simple_db_check?e("passed"):e("failed")})]}),p("div",{children:p(vt,{element:C!=null&&C.simple_db_check?mZ:Tb,color:C!=null&&C.simple_db_check?"green":"red",size:25})})]}),N("div",{className:"flex justify-between items-center py-1 px-3",children:[N("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:"PHP"}),N("span",{children:[e("web"),": ",C==null?void 0:C.php_version.current_php_version]}),N("span",{children:[e("cli"),": ",C==null?void 0:C.php_version.current_php_cli_version]}),N("span",{children:["Memory: ",C==null?void 0:C.php_version.memory_limit]}),N("span",{children:["API: ",C==null?void 0:C.api_version]})]}),p("div",{children:p(vt,{element:C!=null&&C.php_version.is_okay?mZ:Tb,color:C!=null&&C.php_version.is_okay?"green":"red",size:25})})]}),(!(C!=null&&C.env_writable)||(C==null?void 0:C.file_permissions)!=="Ok")&&!(C!=null&&C.is_docker)&&N(YZ,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var D;return(D=window.open("https://invoiceninja.github.io/en/self-host-installation/#file-permissions","_blank"))==null?void 0:D.focus()},children:[N("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("permissions")}),p("span",{children:C!=null&&C.env_writable?C==null?void 0:C.file_permissions:e("env_not_writable")})]}),p("div",{children:p(vt,{element:Tb,color:"red",size:25})})]}),(C==null?void 0:C.pdf_engine)!=="SnapPDF PDF Generator"&&N(YZ,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var D;return(D=window.open("https://invoiceninja.github.io/en/self-host-troubleshooting/#pdf-conversion-issues","_blank"))==null?void 0:D.focus()},children:[N("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("snappdf_not_enabled")}),p("span",{children:e("use_snappdf")})]}),p("div",{children:p(vt,{element:STe,size:25})})]}),!!(C!=null&&C.exchange_rate_api_not_configured)&&N(YZ,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var D;return(D=window.open("https://invoiceninja.github.io/en/self-host-installation/#currency-conversion","_blank"))==null?void 0:D.focus()},children:[N("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("exchange_rate_not_enabled")}),p("span",{children:e("add_open_exchange")})]}),p("div",{children:p(vt,{element:STe,size:25})})]})]}),N("div",{className:"flex justify-between",children:[p(Gt,{behavior:"button",type:"secondary",onClick:k,disableWithoutIcon:!0,disabled:u,children:e("clear_cache")}),p(Gt,{behavior:"button",onClick:E,disableWithoutIcon:!0,disabled:u,children:e("refresh")})]})]}),p(Ui,{title:e("update_available"),visible:g,onClose:()=>m(!1),disableClosing:u||v||b,children:N("div",{className:"flex flex-col space-y-5",children:[p("span",{className:"font-medium text-base",children:e("a_new_version_is_available")}),N("div",{className:"flex flex-col",children:[N("span",{children:["· ",e("installed_version"),":"," ",l==null?void 0:l.api_version]}),N("span",{children:["· ",e("latest_version"),": ",c]})]}),N("div",{className:"flex justify-between",children:[p(Gt,{behavior:"button",type:"secondary",onClick:()=>{var D;return(D=window.open("https://github.com/invoiceninja/invoiceninja/releases","_blank"))==null?void 0:D.focus()},disableWithoutIcon:!0,disabled:u,children:e("release_notes")}),p(Gt,{behavior:"button",onClick:()=>{a(!1),m(!1),_(!0)},disableWithoutIcon:!0,disabled:u,children:e("update_now")})]})]})}),p(Ui,{title:e("self-update"),visible:b,onClose:()=>{},disableClosing:!0,children:p("span",{className:"text-center py-3 font-medium",children:e("in_progress")})}),p(ap,{show:v,onClose:_,onSave:L})]})}function Q2r(n){return xn({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M131.5 217.5L55.1 100.1c47.6-59.2 119-91.8 192-92.1 42.3-.3 85.5 10.5 124.8 33.2 43.4 25.2 76.4 61.4 97.4 103L264 133.4c-58.1-3.4-113.4 29.3-132.5 84.1zm32.9 38.5c0 46.2 37.4 83.6 83.6 83.6s83.6-37.4 83.6-83.6-37.4-83.6-83.6-83.6-83.6 37.3-83.6 83.6zm314.9-89.2L339.6 174c37.9 44.3 38.5 108.2 6.6 157.2L234.1 503.6c46.5 2.5 94.4-7.7 137.8-32.9 107.4-62 150.9-192 107.4-303.9zM133.7 303.6L40.4 120.1C14.9 159.1 0 205.9 0 256c0 124 90.8 226.7 209.5 244.9l63.7-124.8c-57.6 10.8-113.2-20.8-139.5-72.5z"}}]})(n)}function f4t(n){return xn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M94.12 315.1c0 25.9-21.16 47.06-47.06 47.06S0 341 0 315.1c0-25.9 21.16-47.06 47.06-47.06h47.06v47.06zm23.72 0c0-25.9 21.16-47.06 47.06-47.06s47.06 21.16 47.06 47.06v117.84c0 25.9-21.16 47.06-47.06 47.06s-47.06-21.16-47.06-47.06V315.1zm47.06-188.98c-25.9 0-47.06-21.16-47.06-47.06S139 32 164.9 32s47.06 21.16 47.06 47.06v47.06H164.9zm0 23.72c25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06H47.06C21.16 243.96 0 222.8 0 196.9s21.16-47.06 47.06-47.06H164.9zm188.98 47.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06h-47.06V196.9zm-23.72 0c0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06V79.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06V196.9zM283.1 385.88c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06v-47.06h47.06zm0-23.72c-25.9 0-47.06-21.16-47.06-47.06 0-25.9 21.16-47.06 47.06-47.06h117.84c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06H283.1z"}}]})(n)}function p4t(n){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 128V96h20c6.627 0 12-5.373 12-12V44c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v20H64V44c0-6.627-5.373-12-12-12H12C5.373 32 0 37.373 0 44v40c0 6.627 5.373 12 12 12h20v320H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-20h384v20c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20V128zM96 276V140c0-6.627 5.373-12 12-12h168c6.627 0 12 5.373 12 12v136c0 6.627-5.373 12-12 12H108c-6.627 0-12-5.373-12-12zm320 96c0 6.627-5.373 12-12 12H236c-6.627 0-12-5.373-12-12v-52h72c13.255 0 24-10.745 24-24v-72h84c6.627 0 12 5.373 12 12v136z"}}]})(n)}function g4t(n){return xn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"}}]})(n)}function m4t(n){return xn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"}}]})(n)}function _4t(n){return xn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z"}}]})(n)}function v4t(n){const[e]=pe(),{isVisible:t,setIsVisible:i,installedVersion:r,latestVersion:o}=n,s=Lg(),[a,l]=w.useState(!1),[c,u]=w.useState(!1),[d,h]=w.useState(!1),f=(g,m)=>{a||(l(!0),u(!0),Ae("POST",Te("/api/v1/self-update"),{},{headers:{"X-Api-Password":g}}).then(()=>window.location.reload()).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===412&&(s(m),h(!0))}).finally(()=>{l(!1),u(!1)}))};return N(dt,{children:[p(Ui,{title:e("update"),visible:t,onClose:()=>i(!1),disableClosing:a,children:N("div",{className:"flex flex-col space-y-6",children:[N("div",{className:"flex flex-col space-y-2",children:[N("div",{className:"flex space-x-2",children:[N("span",{className:"font-medium",children:[e("installed_version"),":"]}),p("span",{children:r})]}),N("div",{className:"flex space-x-2",children:[N("span",{className:"font-medium",children:[e("latest_version"),":"]}),p("span",{children:o})]})]}),p(Gt,{behavior:"button",onClick:()=>h(!0),disabled:a,disableWithoutIcon:!0,children:e("update")})]})}),p(Ui,{title:e("self-update"),visible:c,onClose:()=>{},disableClosing:!0,children:N("span",{className:"text-center py-3 font-medium",children:[e("in_progress"),"."]})}),p(ap,{show:d,onClose:h,onSave:f})]})}function tVe(n){var A,O;const[e]=pe(),t=ni(),i=T1(),r=Ig(),o=pa(),{mobileNavbar:s}=n,a=Qi(),l=d4t(),c=LF(),{data:u}=Ti({queryKey:["/pdf.invoicing.co/api/version"],queryFn:()=>Ipe.get("https://pdf.invoicing.co/api/version").then(P=>P.data),staleTime:1/0}),{data:d}=Ti({queryKey:["/api/v1/health_check"],queryFn:()=>Ae("GET",Te("/api/v1/health_check")).then(P=>P.data),staleTime:1/0,enabled:Rk()}),[h,f]=w.useState(!1),[g,m]=w.useState(!1),[v,_]=w.useState(!1),[b,y]=w.useState(!1),[C,x]=w.useState(!1),E=!!((A=i==null?void 0:i.company_user)!=null&&A.react_settings.show_mini_sidebar),k=u&&(d==null?void 0:d.api_version)&&d.api_version!==u&&!(d!=null&&d.is_docker),L=td({initialValues:{message:"",platform:"R",send_logs:!1},onSubmit:P=>{ce.processing(),Ae("POST",Te("/api/v1/support/messages/send"),P).then(()=>ce.success("your_message_has_been_received")).finally(()=>{L.setSubmitting(!1),f(!1)})}}),D=()=>{y(!0),Ae("POST",Te("/api/v1/refresh")).then(P=>{a(w0(P.data.data)),y(!1),_(!1)})};return w.useEffect(()=>{var F,B,M,V;const P=(B=(F=i==null?void 0:i.company_user)==null?void 0:F.react_settings)==null?void 0:B.show_mini_sidebar;i&&typeof P<"u"&&((V=(M=o==null?void 0:o.company_user)==null?void 0:M.react_settings)==null?void 0:V.show_mini_sidebar)!==P&&l(i)},[(O=i==null?void 0:i.company_user)==null?void 0:O.react_settings.show_mini_sidebar]),N(dt,{children:[N(Ui,{title:e("contact_us"),visible:h,onClose:f,children:[p(We,{label:e("from"),id:"from",value:`${i==null?void 0:i.first_name} - ${i==null?void 0:i.email}`,disabled:!0}),p(We,{element:"textarea",label:e("message"),id:"message",onChange:L.handleChange}),p(ft,{id:"send_errors",label:e("include_recent_errors"),onChange:P=>L.setFieldValue("send_logs",P)}),p(Gt,{onClick:()=>L.submitForm(),disabled:L.isSubmitting,children:e("send")})]}),N(Ui,{title:e("crons_not_enabled"),visible:v,onClose:_,children:[p(Gt,{onClick:()=>{window.open("https://invoiceninja.github.io/en/self-host-troubleshooting/#cron-not-running-queue-not-running","_blank")},children:e("learn_more")}),p(Gt,{disabled:b,onClick:D,children:e("refresh_data")}),p(Gt,{onClick:()=>{_(!1)},children:e("dismiss")})]}),p(v4t,{isVisible:C,setIsVisible:x,installedVersion:d==null?void 0:d.api_version,latestVersion:u}),p(h4t,{isAboutVisible:g,setIsAboutVisible:m,currentSystemInfo:d,latestVersion:u}),N("nav",{style:{borderColor:t.$5},className:Nt("flex py-4 text-white border-t",{"justify-end":s,"justify-around":!s,"px-2":!k}),children:[!E&&!s&&N(dt,{children:[k&&p("div",{className:"cursor-pointer",onClick:()=>x(!0),children:p(NE,{duration:0,content:e("update_available"),className:"text-white rounded text-xs mb-2",children:p("div",{children:p(vt,{element:Tb,color:"white",size:23.5})})})}),r&&!r.is_scheduler_running&&p("button",{className:"hover:bg-ninja-gray-darker rounded-full",onClick:()=>_(!0),children:p(NE,{duration:0,content:e("error"),className:"text-white rounded text-xs mb-2",children:p(v1t,{})})}),p("div",{className:"flex",children:p(NE,{duration:0,content:e("contact_us"),className:"text-white rounded text-xs mb-2",children:p("div",{className:"cursor-pointer",onClick:()=>window.open("https://slack.invoiceninja.com","_blank"),children:p(vt,{element:f4t,color:"white",size:23})})})}),p("a",{href:"https://forum.invoiceninja.com",target:"_blank",className:"hover:bg-ninja-gray-darker rounded-full",rel:"noreferrer",children:p(NE,{duration:0,content:e("support_forum"),className:"text-white rounded text-xs mb-2",children:p(WCt,{})})}),p("a",{href:n.docsLink&&`https://invoiceninja.github.io/${n.docsLink}`||"https://invoiceninja.github.io",target:"_blank",className:"hover:bg-ninja-gray-darker rounded-full",rel:"noreferrer",children:p(NE,{duration:0,content:e("user_guide"),className:"text-white rounded text-xs mb-2",children:p(xge,{})})}),p("button",{className:"hover:bg-ninja-gray-darker rounded-full overflow-visible",onClick:()=>m(!0),children:p(NE,{duration:0,content:e("about"),className:"text-white rounded text-xs mb-2",children:p(Q8e,{})})})]}),p("button",{className:"rounded-full",onClick:()=>c("company_user.react_settings.show_mini_sidebar",!E),children:p(NE,{duration:0,content:p("span",{style:{fontSize:E?"0.6rem":"0.75rem"},children:e(E?"show_menu":"hide_menu")}),className:"text-white rounded mb-1.5",children:E?p(dge,{}):p(K8e,{})})})]})]})}function K(n){const e=ni();return N("div",{className:Nt(`sm:grid sm:gap-10 flex flex-col lg:flex-row ${n.className}`,{"px-5 sm:px-6":!n.noExternalPadding,"py-4 sm:py-3":!n.noVerticalPadding,"lg:items-center":!n.withoutItemsCenter,"sm:grid-cols-2":n.twoGridColumns,"sm:grid-cols-3":!n.twoGridColumns}),onClick:n.onClick,style:{color:e.$3,colorScheme:e.$0},children:[N("dt",{className:Nt("text-sm flex flex-col",{"opacity-75":n.disabledLabels}),style:{color:e.$3,colorScheme:e.$0},children:[N("span",{className:Nt("font-medium",{"whitespace-nowrap":n.withoutWrappingLeftSide}),style:{color:e.$3,colorScheme:e.$0},children:[n.leftSide,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),n.leftSideHelp&&(typeof n.leftSideHelp=="object"?n.leftSideHelp:p("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:n.leftSideHelp},style:{color:e.$3,colorScheme:e.$0,opacity:.8}}))]}),p("dd",{className:Nt("mt-4 text-sm sm:mt-0",{"flex flex-col sm:flex-row sm:justify-end":n.pushContentToRight,"sm:col-span-1":n.twoGridColumns,"sm:col-span-2":!n.twoGridColumns}),style:{color:e.$3,colorScheme:e.$0},children:n.children})]})}var b4t="tippy-content",y4t="tippy-backdrop",C4t="tippy-arrow",w4t="tippy-svg-arrow",JE={passive:!0,capture:!0},nVe=function(){return document.body};function QZ(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Qme(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function iVe(n,e){return typeof n=="function"?n.apply(void 0,e):n}function Gke(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function S4t(n){return n.split(/\s+/).filter(Boolean)}function b2(n){return[].concat(n)}function Yke(n,e){n.indexOf(e)===-1&&n.push(e)}function E4t(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function x4t(n){return n.split("-")[0]}function MH(n){return[].slice.call(n)}function Qke(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function T4t(){return document.createElement("div")}function rVe(n){return["Element","Fragment"].some(function(e){return Qme(n,e)})}function k4t(n){return Qme(n,"NodeList")}function I4t(n){return Qme(n,"MouseEvent")}function L4t(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function D4t(n){return rVe(n)?[n]:k4t(n)?MH(n):Array.isArray(n)?n:MH(document.querySelectorAll(n))}function XZ(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Xke(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function A4t(n){var e,t=b2(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function N4t(n,e){var t=e.clientX,i=e.clientY;return n.every(function(r){var o=r.popperRect,s=r.popperState,a=r.props,l=a.interactiveBorder,c=x4t(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-i+d>l,v=i-o.bottom-h>l,_=o.left-t+f>l,b=t-o.right-g>l;return m||v||_||b})}function ZZ(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function Zke(n,e){for(var t=e;t;){var i;if(n.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var rb={isTouch:!1},Jke=0;function R4t(){rb.isTouch||(rb.isTouch=!0,window.performance&&document.addEventListener("mousemove",oVe))}function oVe(){var n=performance.now();n-Jke<20&&(rb.isTouch=!1,document.removeEventListener("mousemove",oVe)),Jke=n}function O4t(){var n=document.activeElement;if(L4t(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function P4t(){document.addEventListener("touchstart",R4t,JE),window.addEventListener("blur",O4t)}var M4t=typeof window<"u"&&typeof document<"u",F4t=M4t?!!window.msCrypto:!1,B4t={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},$4t={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},X_=Object.assign({appendTo:nVe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},B4t,$4t),V4t=Object.keys(X_),H4t=function(e){var t=Object.keys(e);t.forEach(function(i){X_[i]=e[i]})};function sVe(n){var e=n.plugins||[],t=e.reduce(function(i,r){var o=r.name,s=r.defaultValue;if(o){var a;i[o]=n[o]!==void 0?n[o]:(a=X_[o])!=null?a:s}return i},{});return Object.assign({},n,t)}function W4t(n,e){var t=e?Object.keys(sVe(Object.assign({},X_,{plugins:e}))):V4t,i=t.reduce(function(r,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return r;if(o==="content")r[o]=s;else try{r[o]=JSON.parse(s)}catch{r[o]=s}return r},{});return i}function eIe(n,e){var t=Object.assign({},e,{content:iVe(e.content,[n])},e.ignoreAttributes?{}:W4t(n,e.plugins));return t.aria=Object.assign({},X_.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}function tIe(n){var e=n.firstElementChild,t=MH(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(b4t)}),arrow:t.find(function(i){return i.classList.contains(C4t)||i.classList.contains(w4t)}),backdrop:t.find(function(i){return i.classList.contains(y4t)})}}var z4t=1,k8=[],JZ=[];function U4t(n,e){var t=eIe(n,Object.assign({},X_,sVe(Qke(e)))),i,r,o,s=!1,a=!1,l=!1,c=!1,u,d,h,f=[],g=Gke(Tt,t.interactiveDebounce),m,v=z4t++,_=null,b=E4t(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:v,reference:n,popper:T4t(),popperInstance:_,props:t,state:y,plugins:b,clearDelayTimeouts:te,setProps:me,setContent:Oe,show:et,hide:Et,hideWithInteractivity:Qe,enable:Z,disable:le,unmount:At,destroy:Ut};if(!t.render)return C;var x=t.render(C),E=x.popper,k=x.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+C.id,C.popper=E,n._tippy=C,E._tippy=C;var L=b.map(function(fe){return fe.fn(C)}),D=n.hasAttribute("aria-expanded");return Be(),H(),U(),W("onCreate",[C]),t.showOnCreate&&re(),E.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),E.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&B().addEventListener("mousemove",g)}),C;function A(){var fe=C.props.touch;return Array.isArray(fe)?fe:[fe,0]}function O(){return A()[0]==="hold"}function P(){var fe;return!!((fe=C.props.render)!=null&&fe.$$tippy)}function F(){return m||n}function B(){var fe=F().parentNode;return fe?A4t(fe):document}function M(){return tIe(E)}function V(fe){return C.state.isMounted&&!C.state.isVisible||rb.isTouch||u&&u.type==="focus"?0:QZ(C.props.delay,fe?0:1,X_.delay)}function U(fe){fe===void 0&&(fe=!1),E.style.pointerEvents=C.props.interactive&&!fe?"":"none",E.style.zIndex=""+C.props.zIndex}function W(fe,Re,Je){if(Je===void 0&&(Je=!0),L.forEach(function(Ft){Ft[fe]&&Ft[fe].apply(Ft,Re)}),Je){var Ot;(Ot=C.props)[fe].apply(Ot,Re)}}function q(){var fe=C.props.aria;if(fe.content){var Re="aria-"+fe.content,Je=E.id,Ot=b2(C.props.triggerTarget||n);Ot.forEach(function(Ft){var jt=Ft.getAttribute(Re);if(C.state.isVisible)Ft.setAttribute(Re,jt?jt+" "+Je:Je);else{var Jt=jt&&jt.replace(Je,"").trim();Jt?Ft.setAttribute(Re,Jt):Ft.removeAttribute(Re)}})}}function H(){if(!(D||!C.props.aria.expanded)){var fe=b2(C.props.triggerTarget||n);fe.forEach(function(Re){C.props.interactive?Re.setAttribute("aria-expanded",C.state.isVisible&&Re===F()?"true":"false"):Re.removeAttribute("aria-expanded")})}}function ie(){B().removeEventListener("mousemove",g),k8=k8.filter(function(fe){return fe!==g})}function se(fe){if(!(rb.isTouch&&(l||fe.type==="mousedown"))){var Re=fe.composedPath&&fe.composedPath()[0]||fe.target;if(!(C.props.interactive&&Zke(E,Re))){if(b2(C.props.triggerTarget||n).some(function(Je){return Zke(Je,Re)})){if(rb.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else W("onClickOutside",[C,fe]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||He())}}}function Q(){l=!0}function Ee(){l=!1}function Fe(){var fe=B();fe.addEventListener("mousedown",se,!0),fe.addEventListener("touchend",se,JE),fe.addEventListener("touchstart",Ee,JE),fe.addEventListener("touchmove",Q,JE)}function He(){var fe=B();fe.removeEventListener("mousedown",se,!0),fe.removeEventListener("touchend",se,JE),fe.removeEventListener("touchstart",Ee,JE),fe.removeEventListener("touchmove",Q,JE)}function ke(fe,Re){je(fe,function(){!C.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&Re()})}function Me(fe,Re){je(fe,Re)}function je(fe,Re){var Je=M().box;function Ot(Ft){Ft.target===Je&&(ZZ(Je,"remove",Ot),Re())}if(fe===0)return Re();ZZ(Je,"remove",d),ZZ(Je,"add",Ot),d=Ot}function qe(fe,Re,Je){Je===void 0&&(Je=!1);var Ot=b2(C.props.triggerTarget||n);Ot.forEach(function(Ft){Ft.addEventListener(fe,Re,Je),f.push({node:Ft,eventType:fe,handler:Re,options:Je})})}function Be(){O()&&(qe("touchstart",Wt,{passive:!0}),qe("touchend",rn,{passive:!0})),S4t(C.props.trigger).forEach(function(fe){if(fe!=="manual")switch(qe(fe,Wt),fe){case"mouseenter":qe("mouseleave",rn);break;case"focus":qe(F4t?"focusout":"blur",_n);break;case"focusin":qe("focusout",_n);break}})}function _t(){f.forEach(function(fe){var Re=fe.node,Je=fe.eventType,Ot=fe.handler,Ft=fe.options;Re.removeEventListener(Je,Ot,Ft)}),f=[]}function Wt(fe){var Re,Je=!1;if(!(!C.state.isEnabled||wt(fe)||a)){var Ot=((Re=u)==null?void 0:Re.type)==="focus";u=fe,m=fe.currentTarget,H(),!C.state.isVisible&&I4t(fe)&&k8.forEach(function(Ft){return Ft(fe)}),fe.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||s)&&C.props.hideOnClick!==!1&&C.state.isVisible?Je=!0:re(fe),fe.type==="click"&&(s=!Je),Je&&!Ot&&Y(fe)}}function Tt(fe){var Re=fe.target,Je=F().contains(Re)||E.contains(Re);if(!(fe.type==="mousemove"&&Je)){var Ot=Se().concat(E).map(function(Ft){var jt,Jt=Ft._tippy,ei=(jt=Jt.popperInstance)==null?void 0:jt.state;return ei?{popperRect:Ft.getBoundingClientRect(),popperState:ei,props:t}:null}).filter(Boolean);N4t(Ot,fe)&&(ie(),Y(fe))}}function rn(fe){var Re=wt(fe)||C.props.trigger.indexOf("click")>=0&&s;if(!Re){if(C.props.interactive){C.hideWithInteractivity(fe);return}Y(fe)}}function _n(fe){C.props.trigger.indexOf("focusin")<0&&fe.target!==F()||C.props.interactive&&fe.relatedTarget&&E.contains(fe.relatedTarget)||Y(fe)}function wt(fe){return rb.isTouch?O()!==fe.type.indexOf("touch")>=0:!1}function pt(){ot();var fe=C.props,Re=fe.popperOptions,Je=fe.placement,Ot=fe.offset,Ft=fe.getReferenceClientRect,jt=fe.moveTransition,Jt=P()?tIe(E).arrow:null,ei=Ft?{getBoundingClientRect:Ft,contextElement:Ft.contextElement||F()}:n,sr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pi){var Ei=pi.state;if(P()){var $i=M(),Pr=$i.box;["placement","reference-hidden","escaped"].forEach(function(ro){ro==="placement"?Pr.setAttribute("data-placement",Ei.placement):Ei.attributes.popper["data-popper-"+ro]?Pr.setAttribute("data-"+ro,""):Pr.removeAttribute("data-"+ro)}),Ei.attributes.popper={}}}},zn=[{name:"offset",options:{offset:Ot}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!jt}},sr];P()&&Jt&&zn.push({name:"arrow",options:{element:Jt,padding:3}}),zn.push.apply(zn,(Re==null?void 0:Re.modifiers)||[]),C.popperInstance=L9e(ei,E,Object.assign({},Re,{placement:Je,onFirstUpdate:h,modifiers:zn}))}function ot(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function we(){var fe=C.props.appendTo,Re,Je=F();C.props.interactive&&fe===nVe||fe==="parent"?Re=Je.parentNode:Re=iVe(fe,[Je]),Re.contains(E)||Re.appendChild(E),C.state.isMounted=!0,pt()}function Se(){return MH(E.querySelectorAll("[data-tippy-root]"))}function re(fe){C.clearDelayTimeouts(),fe&&W("onTrigger",[C,fe]),Fe();var Re=V(!0),Je=A(),Ot=Je[0],Ft=Je[1];rb.isTouch&&Ot==="hold"&&Ft&&(Re=Ft),Re?i=setTimeout(function(){C.show()},Re):C.show()}function Y(fe){if(C.clearDelayTimeouts(),W("onUntrigger",[C,fe]),!C.state.isVisible){He();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(fe.type)>=0&&s)){var Re=V(!1);Re?r=setTimeout(function(){C.state.isVisible&&C.hide()},Re):o=requestAnimationFrame(function(){C.hide()})}}function Z(){C.state.isEnabled=!0}function le(){C.hide(),C.state.isEnabled=!1}function te(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function me(fe){if(!C.state.isDestroyed){W("onBeforeUpdate",[C,fe]),_t();var Re=C.props,Je=eIe(n,Object.assign({},Re,Qke(fe),{ignoreAttributes:!0}));C.props=Je,Be(),Re.interactiveDebounce!==Je.interactiveDebounce&&(ie(),g=Gke(Tt,Je.interactiveDebounce)),Re.triggerTarget&&!Je.triggerTarget?b2(Re.triggerTarget).forEach(function(Ot){Ot.removeAttribute("aria-expanded")}):Je.triggerTarget&&n.removeAttribute("aria-expanded"),H(),U(),k&&k(Re,Je),C.popperInstance&&(pt(),Se().forEach(function(Ot){requestAnimationFrame(Ot._tippy.popperInstance.forceUpdate)})),W("onAfterUpdate",[C,fe])}}function Oe(fe){C.setProps({content:fe})}function et(){var fe=C.state.isVisible,Re=C.state.isDestroyed,Je=!C.state.isEnabled,Ot=rb.isTouch&&!C.props.touch,Ft=QZ(C.props.duration,0,X_.duration);if(!(fe||Re||Je||Ot)&&!F().hasAttribute("disabled")&&(W("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,P()&&(E.style.visibility="visible"),U(),Fe(),C.state.isMounted||(E.style.transition="none"),P()){var jt=M(),Jt=jt.box,ei=jt.content;XZ([Jt,ei],0)}h=function(){var zn;if(!(!C.state.isVisible||c)){if(c=!0,E.offsetHeight,E.style.transition=C.props.moveTransition,P()&&C.props.animation){var Tn=M(),pi=Tn.box,Ei=Tn.content;XZ([pi,Ei],Ft),Xke([pi,Ei],"visible")}q(),H(),Yke(JZ,C),(zn=C.popperInstance)==null||zn.forceUpdate(),W("onMount",[C]),C.props.animation&&P()&&Me(Ft,function(){C.state.isShown=!0,W("onShown",[C])})}},we()}}function Et(){var fe=!C.state.isVisible,Re=C.state.isDestroyed,Je=!C.state.isEnabled,Ot=QZ(C.props.duration,1,X_.duration);if(!(fe||Re||Je)&&(W("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,s=!1,P()&&(E.style.visibility="hidden"),ie(),He(),U(!0),P()){var Ft=M(),jt=Ft.box,Jt=Ft.content;C.props.animation&&(XZ([jt,Jt],Ot),Xke([jt,Jt],"hidden"))}q(),H(),C.props.animation?P()&&ke(Ot,C.unmount):C.unmount()}}function Qe(fe){B().addEventListener("mousemove",g),Yke(k8,g),g(fe)}function At(){C.state.isVisible&&C.hide(),C.state.isMounted&&(ot(),Se().forEach(function(fe){fe._tippy.unmount()}),E.parentNode&&E.parentNode.removeChild(E),JZ=JZ.filter(function(fe){return fe!==C}),C.state.isMounted=!1,W("onHidden",[C]))}function Ut(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),_t(),delete n._tippy,C.state.isDestroyed=!0,W("onDestroy",[C]))}}function DF(n,e){e===void 0&&(e={});var t=X_.plugins.concat(e.plugins||[]);P4t();var i=Object.assign({},e,{plugins:t}),r=D4t(n),o=r.reduce(function(s,a){var l=a&&U4t(a,i);return l&&s.push(l),s},[]);return rVe(n)?o[0]:o}DF.defaultProps=X_;DF.setDefaultProps=H4t;DF.currentInput=rb;Object.assign({},eme,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}});DF.setDefaultProps({animation:!1});function aVe(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var lVe=typeof window<"u"&&typeof document<"u";function Eoe(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function nIe(){return lVe&&document.createElement("div")}function j4t(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function cVe(n,e){if(n===e)return!0;if(typeof n=="object"&&n!=null&&typeof e=="object"&&e!=null){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(var t in n)if(e.hasOwnProperty(t)){if(!cVe(n[t],e[t]))return!1}else return!1;return!0}else return!1}function q4t(n){var e=[];return n.forEach(function(t){e.find(function(i){return cVe(t,i)})||e.push(t)}),e}function K4t(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:q4t([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var eJ=lVe?w.useLayoutEffect:w.useEffect;function G4t(n){var e=w.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function iIe(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var Y4t={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,i=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function r(){e.props.className&&!i()||iIe(t,"add",e.props.className)}function o(){i()&&iIe(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:o,onAfterUpdate:r}}};function Q4t(n){function e(t){var i=t.children,r=t.content,o=t.visible,s=t.singleton,a=t.render,l=t.reference,c=t.disabled,u=c===void 0?!1:c,d=t.ignoreAttributes,h=d===void 0?!0:d;t.__source,t.__self;var f=aVe(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=s!==void 0,v=w.useState(!1),_=v[0],b=v[1],y=w.useState({}),C=y[0],x=y[1],E=w.useState(),k=E[0],L=E[1],D=G4t(function(){return{container:nIe(),renders:1}}),A=Object.assign({ignoreAttributes:h},f,{content:D.container});g&&(A.trigger="manual",A.hideOnClick=!1),m&&(u=!0);var O=A,P=A.plugins||[];a&&(O=Object.assign({},A,{plugins:m&&s.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(V,U){var W=s.data.children.find(function(q){var H=q.instance;return H.reference===U.currentTarget});V.state.$$activeSingletonInstance=W.instance,L(W.content)}}}}]):P,render:function(){return{popper:D.container}}}));var F=[l].concat(i?[i.type]:[]);return eJ(function(){var B=l;l&&l.hasOwnProperty("current")&&(B=l.current);var M=n(B||D.ref||nIe(),Object.assign({},O,{plugins:[Y4t].concat(A.plugins||[])}));return D.instance=M,u&&M.disable(),o&&M.show(),m&&s.hook({instance:M,content:r,props:O,setSingletonContent:L}),b(!0),function(){M.destroy(),s==null||s.cleanup(M)}},F),eJ(function(){var B;if(D.renders===1){D.renders++;return}var M=D.instance;M.setProps(K4t(M.props,O)),(B=M.popperInstance)==null||B.forceUpdate(),u?M.disable():M.enable(),g&&(o?M.show():M.hide()),m&&s.hook({instance:M,content:r,props:O,setSingletonContent:L})}),eJ(function(){var B;if(a){var M=D.instance;M.setProps({popperOptions:Object.assign({},M.props.popperOptions,{modifiers:[].concat((((B=M.props.popperOptions)==null?void 0:B.modifiers)||[]).filter(function(V){var U=V.name;return U!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(U){var W,q=U.state,H=(W=q.modifiersData)==null?void 0:W.hide;(C.placement!==q.placement||C.referenceHidden!==(H==null?void 0:H.isReferenceHidden)||C.escaped!==(H==null?void 0:H.hasPopperEscaped))&&x({placement:q.placement,referenceHidden:H==null?void 0:H.isReferenceHidden,escaped:H==null?void 0:H.hasPopperEscaped}),q.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(F)),ae.createElement(ae.Fragment,null,i?w.cloneElement(i,{ref:function(M){D.ref=M,Eoe(i.ref,M)}}):null,_&&sp.createPortal(a?a(j4t(C),k,D.instance):r,D.container))}return e}var X4t=function(n,e){return w.forwardRef(function(i,r){var o=i.children,s=aVe(i,["children"]);return ae.createElement(n,Object.assign({},e,s),o?w.cloneElement(o,{ref:function(l){Eoe(r,l),Eoe(o.ref,l)}}):null)})},Z4t=X4t(Q4t(DF),{render:function(){return""}});const AF=Z4t;function J4t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.addEventListener&&n.addEventListener.apply(n,e)}function e3t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.removeEventListener&&n.removeEventListener.apply(n,e)}var t3t=["mousedown","touchstart"],n3t=function(n,e,t){t===void 0&&(t=t3t);var i=w.useRef(e);w.useEffect(function(){i.current=e},[e]),w.useEffect(function(){for(var r=function(l){var c=n.current;c&&!c.contains(l.target)&&i.current(l)},o=0,s=t;o<s.length;o++){var a=s[o];J4t(document,a,r)}return function(){for(var l=0,c=t;l<c.length;l++){var u=c[l];e3t(document,u,r)}}},[t,n])};const zk=n3t;function i3t(n,e){e===void 0&&(e=0);var t=w.useRef(!1),i=w.useRef(),r=w.useRef(n),o=w.useCallback(function(){return t.current},[]),s=w.useCallback(function(){t.current=!1,i.current&&clearTimeout(i.current),i.current=setTimeout(function(){t.current=!0,r.current()},e)},[e]),a=w.useCallback(function(){t.current=null,i.current&&clearTimeout(i.current)},[]);return w.useEffect(function(){r.current=n},[n]),w.useEffect(function(){return s(),a},[e]),[o,a,s]}function QD(n,e,t){e===void 0&&(e=0),t===void 0&&(t=[]);var i=i3t(n,e),r=i[0],o=i[1],s=i[2];return w.useEffect(s,t),[r,o]}const r3t=rl.button` color: ${n=>n.theme.color} !important; background-color: ${n=>n.theme.backgroundColor} !important; border-color: ${n=>n.theme.borderColor} !important; `,o3t=rl.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function $m(n){const e=w.useRef(null),[t,i]=w.useState(!1),r=vo(),[o,s]=w.useState(),a=(c,u)=>c==="div"?{onClick:()=>i(!1),key:u}:{setVisible:i,key:u};zk(e,()=>{t&&i(!1)}),w.useEffect(()=>{s(w.Children.toArray(n.children))},[n.children]);const l=ni();return p("div",{ref:e,children:p(AF,{disabled:n.disabled,placement:"bottom",interactive:!0,render:()=>p(o3t,{theme:{hoverColor:l.$2},className:`border box rounded-md shadow-lg focus:outline-none whitespace-normal ${n.className}`,style:{backgroundColor:l.$1,borderColor:l.$4,minWidth:n.minWidth??"12rem",maxWidth:n.maxWidth??"14.7rem"},"data-cy":n.cypressRef,children:o==null?void 0:o.map((c,u)=>c&&(c.type==tn||c.type=="div")?w.cloneElement(c,a(c.type,u)):c)}),visible:t,children:n.customLabel?p("div",{onClick:c=>{c.stopPropagation(),c.preventDefault(),i(!t)},children:n.customLabel}):N(r3t,{theme:{backgroundColor:r,color:l.$9,borderColor:l.$5},type:"button",disabled:n.disabled,onClick:()=>i(!t),className:Nt(`border inline-flex items-center space-x-2 px-4 justify-center rounded text-sm disabled:cursor-not-allowed disabled:opacity-75 py-2 ${n.className}`,{"hover:bg-white hover:border-gray-300":!n.cardActions,"hover:opacity-90":n.cardActions}),style:{backgroundColor:n.cardActions&&r,color:n.cardActions?"white":""},"data-cy":"chevronDownButton",children:[!n.cardActions&&p("span",{children:n.label}),p(fF,{size:n.cardActions?18:14})]})})})}function Qt(n){const[e]=pe(),{padding:t="regular",height:i}=n,[r,o]=w.useState(n.collapsed),s=ni();return p("div",{className:Nt(`border shadow rounded overflow-visible ${n.className}`,{"overflow-y-auto":n.withScrollableBody,"h-full":i==="full"}),style:{...n.style,backgroundColor:s.$1,color:s.$3,borderColor:s.$4},children:N("form",{onSubmit:n.onFormSubmit,className:Nt({"h-full":i==="full"}),children:[n.title&&p("div",{className:Nt({"bg-white sticky top-0":n.withScrollableBody,"px-4 sm:px-6 py-3":t=="small","px-4 sm:px-6 py-5":t=="regular","border-b":!n.withoutHeaderBorder}),onClick:()=>typeof n.collapsed<"u"&&o(!r),style:{borderColor:s.$4},children:N("div",{className:Nt("flex items-center justify-between",{"cursor-pointer select-none":typeof n.collapsed<"u"}),children:[N("div",{children:[p("h3",{className:Nt("leading-6 font-medium",{"text-lg":t=="regular","text-md":t=="small"}),children:n.title}),n.description&&p("p",{className:"mt-1 max-w-2xl text-sm",children:n.description})]}),n.topRight,typeof n.collapsed<"u"&&r&&p(fF,{}),typeof n.collapsed<"u"&&!r&&p(Q1t,{})]})}),N("div",{className:Nt(n.childrenClassName,{hidden:r,"py-0":n.withoutBodyPadding,"py-4":t==="regular"&&!n.withoutBodyPadding,"py-2":t==="small"&&!n.withoutBodyPadding,"h-full":i==="full"}),children:[n.isLoading&&p(K,{leftSide:p(ns,{})}),n.withContainer?p(x0,{children:n.children}):n.children]}),(n.withSaveButton||n.additionalAction)&&p("div",{className:"border-t px-4 py-5 sm:p-0",style:{borderColor:s.$4},children:p("dl",{className:"sm:divide-y sm:divide-gray-200",children:N("div",{className:"sm:py-5 sm:px-6 flex justify-end space-x-4",children:[n.additionalAction,n.withSaveButton&&!n.additionalSaveOptions&&p(Gt,{onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),n.withSaveButton&&n.additionalSaveOptions&&N("div",{className:"flex",children:[p(Gt,{className:"rounded-br-none rounded-tr-none px-3",onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),p($m,{className:"rounded-bl-none rounded-tl-none h-full px-1 border-gray-200 border-l-1 border-y-0 border-r-0",disabled:n.disableSubmitButton,cardActions:!0,children:n.additionalSaveOptions.map((a,l)=>p(tn,{icon:a.icon,disabled:n.disableSubmitButton,onClick:a.onClick,children:a.text},l))})]})]})})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function x0(n){return p("div",{className:"px-6 py-4 space-y-6",children:n.children})}const s3t=rl.button` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; }: `,a3t=rl.a` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; }: `,l3t=rl(C0)` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; }: `;function wl(n){const e=ni(),t=`block w-full text-left px-4 sm:px-6 block py-4 space-x-3 text-sm ${n.className}`;return n.to?p(l3t,{theme:{hoverColor:e.$4,color:e.$3},to:n.to,style:{pointerEvents:n.disableNavigation?"none":"all"},className:t,children:n.children}):n.href?p(a3t,{theme:{hoverColor:e.$4,color:e.$3},target:"_blank",href:n.href,className:t,rel:"noreferrer",children:n.children}):p(s3t,{theme:{hoverColor:e.$4,color:e.$3},type:"button",onClick:n.onClick,onChange:n.onChange,className:t,children:n.children})}/*! * hex-color-regex <https://github.com/regexps/hex-color-regex> * * Copyright (c) 2015 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk) * Released under the MIT license. */var c3t=function(e){return e=e&&typeof e=="object"?e:{},e.strict?/^#([a-f0-9]{3,4}|[a-f0-9]{4}(?:[a-f0-9]{2}){1,2})\b$/i:/#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})\b/gi};const u3t=nl(c3t),d3t=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2f7dc3","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b","#616161","#000000","#57a6e4","#324da1","#4c9a1c","#cd8900","#b93700"],b$=["sidebar_active_background_color","sidebar_active_font_color","sidebar_inactive_background_color","sidebar_inactive_font_color","invoice_header_background_color","invoice_header_font_color","table_alternate_row_background_color"],xoe={light:{palette:["#58a6e4","#324ea1","#4c9a1d","#cd8900","#b83700"]},dark:{palette:["#298aaa","#0c45a3","#407535","#a87001","#8b3c40"]},cerulean:{palette:["#043c73","#2fa3e7","#74a739","#dd5601","#c71b22"]},cosmo:{palette:["#9954bc","#2680e3","#3db616","#ff7518","#ff0039"]},cyborg:{palette:["#9933cc","#299fd6","#76b400","#ff8802","#cc0100"]},darkly:{palette:["#3498dc","#375a7f","#00bc8c","#f29c13","#e74b3c"]},flatly:{palette:["#3498dc","#2c3f51","#12bd9d","#f29c13","#e74b3c"]},journal:{palette:["#346599","#eb6864","#1fb34d","#f6e524","#f57900"]},litera:{palette:["#1aa1b8","#4581eb","#00b975","#f0ad4e","#d9534f"]},lumen:{palette:["#75caeb","#158cba","#29b72b","#ff851b","#ff4136"]},lux:{palette:["#209bcf","#1a1a1a","#4ac073","#f0ad4e","#d9534f"]},materia:{palette:["#9c27b0","#2196f3","#4dae51","#ff9800","#e61d23"]},minty:{palette:["#6cc3d6","#78c2ad","#55cc9d","#ffce67","#ff7852"]},pulse:{palette:["#009cdd","#583196","#0fba54","#efa31b","#fc3938"]},sandstone:{palette:["#2aaae0","#335d87","#94c44b","#f37c3d","#d9534f"]},simplex:{palette:["#009acf","#d9230d","#479505","#d9831f","#9c479f"]},sketchy:{palette:["#1aa1b8","#333333","#29a645","#ffc008","#db3546"]},slate:{palette:["#5ac0de","#3a3f43","#62c362","#f89407","#ee5f5a"]},solar:{palette:["#258bd2","#b58802","#2aa198","#cb4a15","#d33582"]},spacelab:{palette:["#3199f3","#456e9c","#3cb521","#d47500","#cd0300"]},superhero:{palette:["#cd0300","#df6919","#5bb85b","#f0ad4e","#d9534f"]},united:{palette:["#1aa1b8","#e9551f","#38b549","#eeb83e","#de382c"]},yeti:{palette:["#5ac0de","#008cba","#44ab6a","#ea9005","#f14125"]}};function h3t(){return(n,e)=>n&&u3t().test(n)?n:e}function Dg(){var t,i,r;const n=Ha(),e={$1:"",$2:"",$3:"",$4:"",$5:""};return(r=(i=xoe[(t=n==null?void 0:n.color_theme)==null?void 0:t.status_color_theme])==null?void 0:i.palette)==null||r.forEach((o,s)=>{e[`$${s+1}`]=o}),e}function Xme(){const n=Ha(),e={$1:"",$2:"",$3:"",$4:"",$5:"",$6:"",$7:""};return b$.forEach((t,i)=>{var r;e[`$${i+1}`]=((r=n==null?void 0:n.color_theme)==null?void 0:r[t])||""}),e}function f3t(){var s;const[n]=pe(),e=Ha(),t=Qi(),i=LF(),r=()=>{let a="";b$.forEach(l=>{var c,u;!a&&((c=e==null?void 0:e.color_theme)!=null&&c[l])&&(a=e.color_theme[l]),a&&((u=e==null?void 0:e.color_theme)!=null&&u[l])&&(a+=","+e.color_theme[l])}),navigator.clipboard.writeText(a).then(()=>ce.success("copied_to_clipboard",{value:""}))},o=()=>{const a=un.cloneDeep(e==null?void 0:e.color_theme);a&&(b$.forEach(l=>{a[l]=""}),t(Ak({property:"company_user.react_settings.color_theme",value:a})))};return N(dt,{children:[p(K,{leftSide:n("status_color_theme"),children:p(Cn,{value:((s=e==null?void 0:e.color_theme)==null?void 0:s.status_color_theme)||"light",onValueChange:a=>i("company_user.react_settings.color_theme.status_color_theme",a),customSelector:!0,children:Object.keys(xoe).map((a,l)=>{var c,u;return p("option",{value:a,children:N("div",{className:"flex w-full space-x-2",children:[p("span",{className:"flex w-1/4 capitalize truncate",children:n(a)}),p("div",{className:"flex",children:(u=(c=xoe[a])==null?void 0:c.palette)==null?void 0:u.map(d=>p("div",{style:{backgroundColor:d,width:50,height:20}},d))})]})},l)})})}),b$.map(a=>p(K,{leftSide:n(a),children:p(p3t,{fieldKey:a})},a)),N("div",{className:"flex justify-end px-6 mt-10 space-x-4",children:[p(Gt,{behavior:"button",type:"secondary",onClick:o,children:n("clear_all")}),p(Gt,{behavior:"button",onClick:r,children:n("export_colors")})]})]})}function p3t(n){var r;const{fieldKey:e}=n,t=Ha(),i=LF();return N("div",{className:"flex space-x-20",children:[p(We,{value:((r=t==null?void 0:t.color_theme)==null?void 0:r[e])||"",onValueChange:o=>i(`company_user.react_settings.color_theme.${e}`,o)}),p(g3t,{fieldKey:e})]})}function g3t(n){var u;const[e]=pe(),{fieldKey:t}=n,i=Ha(),r=h3t(),o=LF(),[s,a]=w.useState(!1),[l,c]=w.useState("");return w.useEffect(()=>{var d;s&&c(((d=i==null?void 0:i.color_theme)==null?void 0:d[t])||"")},[s]),N(dt,{children:[N("div",{className:"flex items-center space-x-2",children:[p("div",{className:"cursor-pointer hover:opacity-75",onClick:()=>a(!0),style:{width:100,height:38,backgroundColor:r((u=i==null?void 0:i.color_theme)==null?void 0:u[t],"#9e9e9e")}}),p(vt,{className:"cursor-pointer",element:t0,size:26,onClick:()=>o(`company_user.react_settings.color_theme.${t}`,"")})]}),p(Ui,{title:e(t),visible:s,size:"small",onClose:()=>a(!1),children:N("div",{className:"flex flex-col space-y-6",children:[p("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:d3t.map(d=>p("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>c(d),style:{height:32,backgroundColor:d},children:l===d&&p(vt,{className:"absolute",element:sme,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},d))}),p(Gt,{className:"self-end",behavior:"button",onClick:()=>{o(`company_user.react_settings.color_theme.${t}`,l),a(!1)},children:e("done")})]})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const DN=n=>{n=n.replace("#",""),n.length===3&&(n=n.split("").map(r=>r+r).join(""));const e=parseInt(n.substring(0,2),16),t=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16);return{red:e,green:t,blue:i,hex:`#${n}`}},NF=(n,e,t)=>n+e+t>384;function RF(){return(n,e)=>"#"+n.replace(/^#/,"").replace(/../g,r=>{const o="0"+Math.min(255,Math.max(0,parseInt(r,16)+e)).toString(16),s=o.length;return o.substring(s-2,s)})}const m3t=rl.div` background-color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `,rIe=rl(Li)` &:hover { background-color: ${n=>{if(n.theme.hoverColor){const e=DN(n.theme.hoverColor);return`rgba(${e.red}, ${e.green}, ${e.blue}, 0.1)`}return n.theme.hoverColor}}; } `;function Toe(n){var s;const{item:e}=n,t=ni(),i=T1(),r=Xme(),o=!!((s=i==null?void 0:i.company_user)!=null&&s.react_settings.show_mini_sidebar);return e.visible?N(m3t,{theme:{color:e.current?r.$1||t.$8:r.$3||"transparent",hoverColor:r.$1||t.$8},className:Nt("flex items-center justify-between group px-4 text-sm font-medium",{"text-white border-l-4 border-transparent":e.current,"text-gray-300 border-l-4 border-transparent":!e.current}),children:[p(rIe,{to:e.href,className:"w-full",withoutDefaultStyling:!0,children:N("div",{className:"flex justify-start items-center my-2",style:{color:e.current?r.$2:r.$4},children:[p(e.icon,{className:Nt("mr-3 flex-shrink-0 h-5 w-5",{"text-white":e.current,"text-gray-300 group-hover:text-white":!e.current}),"aria-hidden":"true",style:{color:e.current?r.$2:r.$4}}),!o&&e.name]})}),e.rightButton&&!o&&e.rightButton.visible&&p(rIe,{theme:{hoverColor:t.$13},to:e.rightButton.to,className:"rounded-full p-1.5",withoutDefaultStyling:!0,children:p(e.rightButton.icon,{className:"h-5 w-5",style:{color:e.current?r.$2:r.$4}})})]},e.name):p(dt,{})}function wu(n){const e=ni(),{width:t,placement:i,withoutArrow:r,tooltipElement:o,message:s,disabled:a,withoutWrapping:l}=n,c=w.useRef(null),[u,d]=w.useState(0),[h,f]=w.useState(!1);return w.useEffect(()=>{var v,_;const g=(v=c==null?void 0:c.current)==null?void 0:v.offsetWidth,m=(_=c==null?void 0:c.current)==null?void 0:_.children[0];m&&g&&(m.offsetWidth>g?(d(g+10),f(!0)):d(m.offsetWidth+10))},[c,n.message]),p("div",{className:Nt(n.className,{"max-w-sm":n.size===void 0||n.size==="small","max-w-md":n.size==="regular","max-w-xl":n.size==="large"}),children:p(AF,{placement:i||"top-start",interactive:!0,render:()=>N("div",{className:"flex flex-col items-center",onClick:g=>g.stopPropagation(),children:[N("div",{className:Nt("relative p-2 text-xs text-center text-white rounded-md",{"leading-1":h,"leading-none":!h,"whitespace-normal break-all":!!s&&!l,"whitespace-nowrap":l}),style:{width:t||u,backgroundColor:e.$5,color:e.$3},children:[s,o]}),!r&&p(vt,{className:"rotate-90 -mt-2.5",element:UEt,size:24,style:{color:e.$5}})]}),disabled:a,children:p("div",{ref:c,className:Nt("cursor-pointer",{"truncate w-full":n.truncate,"flex items-center":n.centerVertically}),children:n.children})})})}function _3t(n){var o;const e=T1(),t=!!((o=e==null?void 0:e.company_user)!=null&&o.react_settings.show_mini_sidebar),i=pq(),r=ni();return p("div",{className:Nt("hidden md:flex z-10 md:flex-col md:fixed md:inset-y-0",{"md:w-16":t,"md:w-64":!t}),children:N("div",{style:{backgroundColor:r.$6,borderColor:r.$4},className:"flex flex-col flex-grow overflow-y-auto border-r",children:[p("div",{style:{borderColor:r.$5,backgroundColor:r.$1,color:r.$3},className:Nt("flex items-center flex-shrink-0 h-16 border-b",{"pl-3 pr-6":!t,"justify-center":t}),children:t?p("img",{className:"w-8",src:i,alt:"Company logo"}):p(p$e,{})}),N("div",{className:"flex-grow flex flex-col mt-4",children:[p("nav",{className:"flex-1 pb-4 space-y-1","data-cy":"navigationBar",children:n.navigation.map((s,a)=>t?p(wu,{message:s.name,width:"auto",placement:"right",withoutArrow:!0,withoutWrapping:!0,children:p(Toe,{item:s},a)},a):p(Toe,{item:s},a))}),p(tVe,{docsLink:n.docsLink})]})]})})}function v3t(n){var o;const e=pq(),t=ni(),i=T1(),r=!!((o=i==null?void 0:i.company_user)!=null&&o.react_settings.show_mini_sidebar);return p(Y_.Root,{show:n.sidebarOpen,as:w.Fragment,children:N(aT,{as:"div",className:"fixed inset-0 flex z-40 md:hidden",onClose:n.setSidebarOpen,style:{width:r?"4rem":"19.4rem"},children:[p(Y_.Child,{as:w.Fragment,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:p(aT.Overlay,{className:"fixed inset-0 bg-gray-600 bg-opacity-75"})}),p(Y_.Child,{as:w.Fragment,enter:"transition ease-in-out duration-300",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:N("div",{className:"relative flex-1 flex flex-col max-w-xs w-full bg-ninja-gray dark:bg-gray-900",children:[p(Y_.Child,{as:w.Fragment,enter:"ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:p("div",{className:"absolute top-0 right-0 -mr-12 pt-2",children:N("button",{type:"button",className:"ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white",onClick:()=>n.setSidebarOpen(!1),children:[p("span",{className:"sr-only",children:"Close sidebar"}),p(kg,{className:"text-white"})]})})}),p("div",{className:"flex-shrink-0 flex items-center px-4 py-3 border-b h-16 justify-center border-gray-600",style:{backgroundColor:t.$1,color:t.$3},children:r?p("img",{className:"w-8",src:e,alt:"Company logo"}):p(p$e,{})}),N("div",{className:"flex flex-col flex-1 h-0 overflow-y-auto mt-4",children:[p("nav",{className:"flex-1 space-y-1",children:n.navigation.map((s,a)=>p(Toe,{item:s},a))}),p(tVe,{mobileNavbar:!0})]})]})}),p("div",{className:"flex-shrink-0 w-14","aria-hidden":"true"})]})})}var Ci=(n=>(n[n.Invoices=4096]="Invoices",n[n.RecurringInvoices=1]="RecurringInvoices",n[n.Quotes=4]="Quotes",n[n.Credits=2]="Credits",n[n.Projects=32]="Projects",n[n.Tasks=8]="Tasks",n[n.Vendors=64]="Vendors",n[n.Expenses=16]="Expenses",n[n.RecurringExpenses=512]="RecurringExpenses",n[n.PurchaseOrders=16384]="PurchaseOrders",n[n.Transactions=256]="Transactions",n))(Ci||{});const b3t=[{label:"invoices",bitmask:4096},{label:"recurring_invoices",bitmask:1},{label:"quotes",bitmask:4},{label:"credits",bitmask:2},{label:"projects",bitmask:32},{label:"tasks",bitmask:8},{label:"vendors",bitmask:64},{label:"expenses",bitmask:16},{label:"purchase_orders",bitmask:16384},{label:"recurring_expenses",bitmask:512},{label:"transactions",bitmask:256}];function y3t(){const[n]=pe(),e=ji(),t=Qi(),i=(r,o)=>t(Go({object:"company",property:"enabled_modules",value:(e==null?void 0:e.enabled_modules)^o}));return p(Qt,{title:n("enabled_modules"),children:b3t.map((r,o)=>p(K,{leftSide:n(r.label),children:p(ft,{checked:!!((e==null?void 0:e.enabled_modules)&r.bitmask),onChange:s=>i(s,r.bitmask)},r.label)},o))})}function _i(n){const e=ni();return p("div",{style:{borderColor:n.borderColor||e.$4},className:Nt("border-b",{"pt-6 mb-4 border-b":!n.withoutPadding},n.className??"")})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Vm(){return!0}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function rc(){return!0}function C3t(){const[n]=pe(),{isAdmin:e}=Po();return N(Qt,{title:n("integrations"),children:[((Vm()||rc())&&Ro()||Rk())&&e&&p(wl,{to:"/settings/integrations/api_tokens",children:n("api_tokens")}),p(wl,{to:"/settings/integrations/api_webhooks",children:n("api_webhooks")}),p(wl,{href:"https://invoiceninja.github.io",children:n("api_docs")}),p(_i,{}),p(wl,{className:"mt-4",href:"https://zapier.com/apps/invoice-ninja/integrations",children:"Zapier"}),p(wl,{to:"/settings/integrations/analytics",children:n("analytics")})]})}function w3t(){const[n]=pe(),e="https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",[t,i]=w.useState(!1),r=td({initialValues:{license:""},onSubmit:o=>{ce.processing(),Ae("POST",Te("/api/v1/claim_license?license_key=:key",{key:o.license})).then(()=>{ce.success("bought_white_label"),i(!1)}).finally(()=>r.setSubmitting(!1))}});return N(dt,{children:[p(Ui,{title:n("apply_license"),visible:t,onClose:i,children:N("form",{onSubmit:r.handleSubmit,className:"space-y-4",children:[p(We,{onChange:r.handleChange,label:n("license"),id:"license",required:!0}),p(Gt,{disabled:r.isSubmitting,variant:"block",children:n("submit")})]})}),p(_i,{withoutPadding:!0}),p(wl,{href:e,children:n("purchase_license")}),p(wl,{onClick:()=>i(!0),children:n("apply_license")})]})}var uVe={exports:{}},ga={};/** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Zme=Symbol.for("react.element"),Jme=Symbol.for("react.portal"),Cq=Symbol.for("react.fragment"),wq=Symbol.for("react.strict_mode"),Sq=Symbol.for("react.profiler"),Eq=Symbol.for("react.provider"),xq=Symbol.for("react.context"),S3t=Symbol.for("react.server_context"),Tq=Symbol.for("react.forward_ref"),kq=Symbol.for("react.suspense"),Iq=Symbol.for("react.suspense_list"),Lq=Symbol.for("react.memo"),Dq=Symbol.for("react.lazy"),E3t=Symbol.for("react.offscreen"),dVe;dVe=Symbol.for("react.module.reference");function Km(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case Zme:switch(n=n.type,n){case Cq:case Sq:case wq:case kq:case Iq:return n;default:switch(n=n&&n.$$typeof,n){case S3t:case xq:case Tq:case Dq:case Lq:case Eq:return n;default:return e}}case Jme:return e}}}ga.ContextConsumer=xq;ga.ContextProvider=Eq;ga.Element=Zme;ga.ForwardRef=Tq;ga.Fragment=Cq;ga.Lazy=Dq;ga.Memo=Lq;ga.Portal=Jme;ga.Profiler=Sq;ga.StrictMode=wq;ga.Suspense=kq;ga.SuspenseList=Iq;ga.isAsyncMode=function(){return!1};ga.isConcurrentMode=function(){return!1};ga.isContextConsumer=function(n){return Km(n)===xq};ga.isContextProvider=function(n){return Km(n)===Eq};ga.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===Zme};ga.isForwardRef=function(n){return Km(n)===Tq};ga.isFragment=function(n){return Km(n)===Cq};ga.isLazy=function(n){return Km(n)===Dq};ga.isMemo=function(n){return Km(n)===Lq};ga.isPortal=function(n){return Km(n)===Jme};ga.isProfiler=function(n){return Km(n)===Sq};ga.isStrictMode=function(n){return Km(n)===wq};ga.isSuspense=function(n){return Km(n)===kq};ga.isSuspenseList=function(n){return Km(n)===Iq};ga.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===Cq||n===Sq||n===wq||n===kq||n===Iq||n===E3t||typeof n=="object"&&n!==null&&(n.$$typeof===Dq||n.$$typeof===Lq||n.$$typeof===Eq||n.$$typeof===xq||n.$$typeof===Tq||n.$$typeof===dVe||n.getModuleId!==void 0)};ga.typeOf=Km;uVe.exports=ga;var hVe=uVe.exports;function FH(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return ae.Children.forEach(n,function(i){i==null&&!e.keepEmpty||(Array.isArray(i)?t=t.concat(FH(i)):hVe.isFragment(i)&&i.props?t=t.concat(FH(i.props.children,e)):t.push(i))}),t}var koe={},x3t=function(e){};function T3t(n,e){}function k3t(n,e){}function I3t(){koe={}}function fVe(n,e,t){!e&&!koe[t]&&(n(!1,t),koe[t]=!0)}function Nd(n,e){fVe(T3t,n,e)}function pVe(n,e){fVe(k3t,n,e)}Nd.preMessage=x3t;Nd.resetWarned=I3t;Nd.noteOnce=pVe;function BH(n){return n instanceof HTMLElement||n instanceof SVGElement}function y$(n){return BH(n)?n:n instanceof ae.Component?ij.findDOMNode(n):null}function OF(n,e,t){var i=w.useRef({});return(!("value"in i.current)||t(i.current.condition,e))&&(i.current.value=n(),i.current.condition=e),i.current.value}function e_e(n,e){typeof n=="function"?n(e):Qr(n)==="object"&&n&&"current"in n&&(n.current=e)}function Aq(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=e.filter(function(r){return r});return i.length<=1?i[0]:function(r){e.forEach(function(o){e_e(o,r)})}}function t_e(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return OF(function(){return Aq.apply(void 0,e)},e,function(i,r){return i.length!==r.length||i.every(function(o,s){return o!==r[s]})})}function PF(n){var e,t,i=hVe.isMemo(n)?n.type.type:n.type;return!(typeof i=="function"&&!((e=i.prototype)!==null&&e!==void 0&&e.render)||typeof n=="function"&&!((t=n.prototype)!==null&&t!==void 0&&t.render))}var Ioe=w.createContext(null);function L3t(n){var e=n.children,t=n.onBatchResize,i=w.useRef(0),r=w.useRef([]),o=w.useContext(Ioe),s=w.useCallback(function(a,l,c){i.current+=1;var u=i.current;r.current.push({size:a,element:l,data:c}),Promise.resolve().then(function(){u===i.current&&(t==null||t(r.current),r.current=[])}),o==null||o(a,l,c)},[t,o]);return w.createElement(Ioe.Provider,{value:s},e)}var gVe=function(){if(typeof Map<"u")return Map;function n(e,t){var i=-1;return e.some(function(r,o){return r[0]===t?(i=o,!0):!1}),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var i=n(this.__entries__,t),r=this.__entries__[i];return r&&r[1]},e.prototype.set=function(t,i){var r=n(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},e.prototype.delete=function(t){var i=this.__entries__,r=n(i,t);~r&&i.splice(r,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,i){i===void 0&&(i=null);for(var r=0,o=this.__entries__;r<o.length;r++){var s=o[r];t.call(i,s[1],s[0])}},e}()}(),Loe=typeof window<"u"&&typeof document<"u"&&window.document===document,$H=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),D3t=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind($H):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),A3t=2;function N3t(n,e){var t=!1,i=!1,r=0;function o(){t&&(t=!1,n()),i&&a()}function s(){D3t(o)}function a(){var l=Date.now();if(t){if(l-r<A3t)return;i=!0}else t=!0,i=!1,setTimeout(s,e);r=l}return a}var R3t=20,O3t=["top","right","bottom","left","width","height","size","weight"],P3t=typeof MutationObserver<"u",M3t=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=N3t(this.refresh.bind(this),R3t)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,i=t.indexOf(e);~i&&t.splice(i,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!Loe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),P3t?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!Loe||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,i=t===void 0?"":t,r=O3t.some(function(o){return!!~i.indexOf(o)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),mVe=function(n,e){for(var t=0,i=Object.keys(e);t<i.length;t++){var r=i[t];Object.defineProperty(n,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return n},XD=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||$H},_Ve=Nq(0,0,0,0);function VH(n){return parseFloat(n)||0}function oIe(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(i,r){var o=n["border-"+r+"-width"];return i+VH(o)},0)}function F3t(n){for(var e=["top","right","bottom","left"],t={},i=0,r=e;i<r.length;i++){var o=r[i],s=n["padding-"+o];t[o]=VH(s)}return t}function B3t(n){var e=n.getBBox();return Nq(0,0,e.width,e.height)}function $3t(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return _Ve;var i=XD(n).getComputedStyle(n),r=F3t(i),o=r.left+r.right,s=r.top+r.bottom,a=VH(i.width),l=VH(i.height);if(i.boxSizing==="border-box"&&(Math.round(a+o)!==e&&(a-=oIe(i,"left","right")+o),Math.round(l+s)!==t&&(l-=oIe(i,"top","bottom")+s)),!H3t(n)){var c=Math.round(a+o)-e,u=Math.round(l+s)-t;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Nq(r.left,r.top,a,l)}var V3t=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof XD(n).SVGGraphicsElement}:function(n){return n instanceof XD(n).SVGElement&&typeof n.getBBox=="function"}}();function H3t(n){return n===XD(n).document.documentElement}function W3t(n){return Loe?V3t(n)?B3t(n):$3t(n):_Ve}function z3t(n){var e=n.x,t=n.y,i=n.width,r=n.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return mVe(s,{x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:r+t,left:e}),s}function Nq(n,e,t,i){return{x:n,y:e,width:t,height:i}}var U3t=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Nq(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=W3t(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n}(),j3t=function(){function n(e,t){var i=z3t(t);mVe(this,{target:e,contentRect:i})}return n}(),q3t=function(){function n(e,t,i){if(this.activeObservations_=[],this.observations_=new gVe,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=i}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof XD(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new U3t(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof XD(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(i){return new j3t(i.target,i.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),vVe=typeof WeakMap<"u"?new WeakMap:new gVe,bVe=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=M3t.getInstance(),i=new q3t(e,t,this);vVe.set(this,i)}return n}();["observe","unobserve","disconnect"].forEach(function(n){bVe.prototype[n]=function(){var e;return(e=vVe.get(this))[n].apply(e,arguments)}});var K3t=function(){return typeof $H.ResizeObserver<"u"?$H.ResizeObserver:bVe}(),KC=new Map;function G3t(n){n.forEach(function(e){var t,i=e.target;(t=KC.get(i))===null||t===void 0||t.forEach(function(r){return r(i)})})}var yVe=new K3t(G3t);function Y3t(n,e){KC.has(n)||(KC.set(n,new Set),yVe.observe(n)),KC.get(n).add(e)}function Q3t(n,e){KC.has(n)&&(KC.get(n).delete(e),KC.get(n).size||(yVe.unobserve(n),KC.delete(n)))}var X3t=function(n){xv(t,n);var e=Ok(t);function t(){return El(this,t),e.apply(this,arguments)}return xl(t,[{key:"render",value:function(){return this.props.children}}]),t}(w.Component);function Z3t(n,e){var t=n.children,i=n.disabled,r=w.useRef(null),o=w.useRef(null),s=w.useContext(Ioe),a=typeof t=="function",l=a?t(r):t,c=w.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&w.isValidElement(l)&&PF(l),d=u?l.ref:null,h=t_e(d,r),f=function(){var _;return y$(r.current)||(r.current&&Qr(r.current)==="object"?y$((_=r.current)===null||_===void 0?void 0:_.nativeElement):null)||y$(o.current)};w.useImperativeHandle(e,function(){return f()});var g=w.useRef(n);g.current=n;var m=w.useCallback(function(v){var _=g.current,b=_.onResize,y=_.data,C=v.getBoundingClientRect(),x=C.width,E=C.height,k=v.offsetWidth,L=v.offsetHeight,D=Math.floor(x),A=Math.floor(E);if(c.current.width!==D||c.current.height!==A||c.current.offsetWidth!==k||c.current.offsetHeight!==L){var O={width:D,height:A,offsetWidth:k,offsetHeight:L};c.current=O;var P=k===Math.round(x)?x:k,F=L===Math.round(E)?E:L,B=ct(ct({},O),{},{offsetWidth:P,offsetHeight:F});s==null||s(B,v,y),b&&Promise.resolve().then(function(){b(B,v)})}},[]);return w.useEffect(function(){var v=f();return v&&!i&&Y3t(v,m),function(){return Q3t(v,m)}},[r.current,i]),w.createElement(X3t,{ref:o},u?w.cloneElement(l,{ref:h}):l)}var J3t=w.forwardRef(Z3t),e5t="rc-observer-key";function t5t(n,e){var t=n.children,i=typeof t=="function"?[t]:FH(t);return i.map(function(r,o){var s=(r==null?void 0:r.key)||"".concat(e5t,"-").concat(o);return w.createElement(J3t,Ct({},n,{key:s,ref:o===0?e:void 0}),r)})}var n_e=w.forwardRef(t5t);n_e.Collection=L3t;function n5t(n,e){var t=ct({},n);return Array.isArray(e)&&e.forEach(function(i){delete t[i]}),t}var CVe=function(e){return+setTimeout(e,16)},wVe=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(CVe=function(e){return window.requestAnimationFrame(e)},wVe=function(e){return window.cancelAnimationFrame(e)});var sIe=0,i_e=new Map;function SVe(n){i_e.delete(n)}var Qf=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;sIe+=1;var i=sIe;function r(o){if(o===0)SVe(i),e();else{var s=CVe(function(){r(o-1)});i_e.set(i,s)}}return r(t),i};Qf.cancel=function(n){var e=i_e.get(n);return SVe(e),wVe(e)};function r_e(n){for(var e=0,t,i=0,r=n.length;r>=4;++i,r-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function HH(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=new Set;function r(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=i.has(o);if(Nd(!l,"Warning: There may be circular references"),l)return!1;if(o===s)return!0;if(t&&a>1)return!1;i.add(o);var c=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var u=0;u<o.length;u++)if(!r(o[u],s[u],c))return!1;return!0}if(o&&s&&Qr(o)==="object"&&Qr(s)==="object"){var d=Object.keys(o);return d.length!==Object.keys(s).length?!1:d.every(function(h){return r(o[h],s[h],c)})}return!1}return r(n,e)}var aIe="%",i5t=function(){function n(e){El(this,n),Ze(this,"instanceId",void 0),Ze(this,"cache",new Map),this.instanceId=e}return xl(n,[{key:"get",value:function(t){return this.cache.get(t.join(aIe))||null}},{key:"update",value:function(t,i){var r=t.join(aIe),o=this.cache.get(r),s=i(o);s===null?this.cache.delete(r):this.cache.set(r,s)}}]),n}(),Doe="data-token-hash",cT="data-css-hash",j2="__cssinjs_instance__";function r5t(){var n=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var e=document.body.querySelectorAll("style[".concat(cT,"]"))||[],t=document.head.firstChild;Array.from(e).forEach(function(r){r[j2]=r[j2]||n,r[j2]===n&&document.head.insertBefore(r,t)});var i={};Array.from(document.querySelectorAll("style[".concat(cT,"]"))).forEach(function(r){var o=r.getAttribute(cT);if(i[o]){if(r[j2]===n){var s;(s=r.parentNode)===null||s===void 0||s.removeChild(r)}}else i[o]=!0})}return new i5t(n)}var o_e=w.createContext({hashPriority:"low",cache:r5t(),defaultCache:!0});function Xf(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function o5t(n,e){if(!n)return!1;if(n.contains)return n.contains(e);for(var t=e;t;){if(t===n)return!0;t=t.parentNode}return!1}var lIe="data-rc-order",cIe="data-rc-priority",s5t="rc-util-key",Aoe=new Map;function EVe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=n.mark;return e?e.startsWith("data-")?e:"data-".concat(e):s5t}function Rq(n){if(n.attachTo)return n.attachTo;var e=document.querySelector("head");return e||document.body}function a5t(n){return n==="queue"?"prependQueue":n?"prepend":"append"}function xVe(n){return Array.from((Aoe.get(n)||n).children).filter(function(e){return e.tagName==="STYLE"})}function TVe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Xf())return null;var t=e.csp,i=e.prepend,r=e.priority,o=r===void 0?0:r,s=a5t(i),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(lIe,s),a&&o&&l.setAttribute(cIe,"".concat(o)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=n;var c=Rq(e),u=c.firstChild;if(i){if(a){var d=xVe(c).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(lIe)))return!1;var f=Number(h.getAttribute(cIe)||0);return o>=f});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function kVe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=Rq(e);return xVe(t).find(function(i){return i.getAttribute(EVe(e))===n})}function WH(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=kVe(n,e);if(t){var i=Rq(e);i.removeChild(t)}}function l5t(n,e){var t=Aoe.get(n);if(!t||!o5t(document,t)){var i=TVe("",e),r=i.parentNode;Aoe.set(n,r),n.removeChild(i)}}function ZD(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=Rq(t);l5t(i,t);var r=kVe(e,t);if(r){var o,s;if((o=t.csp)!==null&&o!==void 0&&o.nonce&&r.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;r.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return r.innerHTML!==n&&(r.innerHTML=n),r}var l=TVe(n,t);return l.setAttribute(EVe(t),e),l}function c5t(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}var s_e=function(){function n(){El(this,n),Ze(this,"cache",void 0),Ze(this,"keys",void 0),Ze(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return xl(n,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(t){var i,r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l,c;s=(l=s)===null||l===void 0||(c=l.map)===null||c===void 0?void 0:c.get(a)}}),(i=s)!==null&&i!==void 0&&i.value&&o&&(s.value[1]=this.cacheCallTimes++),(r=s)===null||r===void 0?void 0:r.value}},{key:"get",value:function(t){var i;return(i=this.internalGet(t,!0))===null||i===void 0?void 0:i[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,i){var r=this;if(!this.has(t)){if(this.size()+1>n.MAX_CACHE_SIZE+n.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(c,u){var d=ln(c,2),h=d[1];return r.internalGet(u)[1]<h?[u,r.internalGet(u)[1]]:c},[this.keys[0],this.cacheCallTimes]),s=ln(o,1),a=s[0];this.delete(a)}this.keys.push(t)}var l=this.cache;t.forEach(function(c,u){if(u===t.length-1)l.set(c,{value:[i,r.cacheCallTimes++]});else{var d=l.get(c);d?d.map||(d.map=new Map):l.set(c,{map:new Map}),l=l.get(c).map}})}},{key:"deleteByPath",value:function(t,i){var r=t.get(i[0]);if(i.length===1){var o;return r.map?t.set(i[0],{map:r.map}):t.delete(i[0]),(o=r.value)===null||o===void 0?void 0:o[0]}var s=this.deleteByPath(r.map,i.slice(1));return(!r.map||r.map.size===0)&&!r.value&&t.delete(i[0]),s}},{key:"delete",value:function(t){if(this.has(t))return this.keys=this.keys.filter(function(i){return!c5t(i,t)}),this.deleteByPath(this.cache,t)}}]),n}();Ze(s_e,"MAX_CACHE_SIZE",20);Ze(s_e,"MAX_CACHE_OFFSET",5);var uIe=0,IVe=function(){function n(e){El(this,n),Ze(this,"derivatives",void 0),Ze(this,"id",void 0),this.derivatives=Array.isArray(e)?e:[e],this.id=uIe,e.length===0&&(e.length>0,void 0),uIe+=1}return xl(n,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(i,r){return r(t,i)},void 0)}}]),n}(),tJ=new s_e;function Noe(n){var e=Array.isArray(n)?n:[n];return tJ.has(e)||tJ.set(e,new IVe(e)),tJ.get(e)}var u5t=new WeakMap,nJ={};function d5t(n,e){for(var t=u5t,i=0;i<e.length;i+=1){var r=e[i];t.has(r)||t.set(r,new WeakMap),t=t.get(r)}return t.has(nJ)||t.set(nJ,n()),t.get(nJ)}var dIe=new WeakMap;function zH(n){var e=dIe.get(n)||"";return e||(Object.keys(n).forEach(function(t){var i=n[t];e+=t,i instanceof IVe?e+=i.id:i&&Qr(i)==="object"?e+=zH(i):e+=i}),dIe.set(n,e)),e}function h5t(n,e){return r_e("".concat(e,"_").concat(zH(n)))}var ZP="random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,""),LVe="_bAmBoO_";function f5t(n,e,t){if(Xf()){var i,r;ZD(n,ZP);var o=document.createElement("div");o.style.position="fixed",o.style.left="0",o.style.top="0",e==null||e(o),document.body.appendChild(o);var s=t?t(o):(i=getComputedStyle(o).content)===null||i===void 0?void 0:i.includes(LVe);return(r=o.parentNode)===null||r===void 0||r.removeChild(o),WH(ZP),s}return!1}var iJ=void 0;function p5t(){return iJ===void 0&&(iJ=f5t("@layer ".concat(ZP," { .").concat(ZP,' { content: "').concat(LVe,'"!important; } }'),function(n){n.className=ZP})),iJ}var hIe=Xf()?w.useLayoutEffect:w.useEffect,oh=function(e,t){var i=w.useRef(!0);hIe(function(){return e(i.current)},t),hIe(function(){return i.current=!1,function(){i.current=!0}},[])},fIe=function(e,t){oh(function(i){if(!i)return e()},t)},g5t=ct({},Am),pIe=g5t.useInsertionEffect,m5t=function(e,t,i){w.useMemo(e,i),oh(function(){return t(!0)},i)},_5t=pIe?function(n,e,t){return pIe(function(){return n(),e()},t)}:m5t,v5t=ct({},Am),b5t=v5t.useInsertionEffect,y5t=function(e){var t=[],i=!1;function r(o){i||t.push(o)}return w.useEffect(function(){return i=!1,function(){i=!0,t.length&&t.forEach(function(o){return o()})}},e),r},C5t=function(){return function(e){e()}},w5t=typeof b5t<"u"?y5t:C5t;function DVe(n,e,t,i,r){var o=w.useContext(o_e),s=o.cache,a=[n].concat(Jr(e)),l=a.join("_"),c=w5t([l]),u=function(g){s.update(a,function(m){var v=m||[],_=ln(v,2),b=_[0],y=b===void 0?0:b,C=_[1],x=C,E=x||t(),k=[y,E];return g?g(k):k})};w.useMemo(function(){u()},[l]);var d=s.get(a),h=d[1];return _5t(function(){r==null||r(h)},function(f){return u(function(g){var m=ln(g,2),v=m[0],_=m[1];return f&&v===0&&(r==null||r(h)),[v+1,_]}),function(){s.update(a,function(g){var m=g||[],v=ln(m,2),_=v[0],b=_===void 0?0:_,y=v[1],C=b-1;return C===0?(c(function(){return i==null?void 0:i(y,!1)}),null):[b-1,y]})}},[l]),h}var S5t={},E5t="css",px=new Map;function x5t(n){px.set(n,(px.get(n)||0)+1)}function T5t(n,e){if(typeof document<"u"){var t=document.querySelectorAll("style[".concat(Doe,'="').concat(n,'"]'));t.forEach(function(i){if(i[j2]===e){var r;(r=i.parentNode)===null||r===void 0||r.removeChild(i)}})}}var k5t=0;function I5t(n,e){px.set(n,(px.get(n)||0)-1);var t=Array.from(px.keys()),i=t.filter(function(r){var o=px.get(r)||0;return o<=0});t.length-i.length>k5t&&i.forEach(function(r){T5t(r,e),px.delete(r)})}var L5t=function(e,t,i,r){var o=i.getDerivativeToken(e),s=ct(ct({},o),t);return r&&(s=r(s)),s};function D5t(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=w.useContext(o_e),r=i.cache.instanceId,o=t.salt,s=o===void 0?"":o,a=t.override,l=a===void 0?S5t:a,c=t.formatToken,u=t.getComputedToken,d=d5t(function(){return Object.assign.apply(Object,[{}].concat(Jr(e)))},e),h=zH(d),f=zH(l),g=DVe("token",[s,n.id,h,f],function(){var m=u?u(d,l,n):L5t(d,l,n,c),v=h5t(m,s);m._tokenKey=v,x5t(v);var _="".concat(E5t,"-").concat(r_e(v));return m._hashId=_,[m,_]},function(m){I5t(m[0]._tokenKey,r)});return g}var A5t={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gIe="data-ant-cssinjs-cache-path",AVe="_FILE_STYLE__",uT,NVe=!0;function N5t(){if(!uT&&(uT={},Xf())){var n=document.createElement("div");n.className=gIe,n.style.position="fixed",n.style.visibility="hidden",n.style.top="-9999px",document.body.appendChild(n);var e=getComputedStyle(n).content||"";e=e.replace(/^"/,"").replace(/"$/,""),e.split(";").forEach(function(r){var o=r.split(":"),s=ln(o,2),a=s[0],l=s[1];uT[a]=l});var t=document.querySelector("style[".concat(gIe,"]"));if(t){var i;NVe=!1,(i=t.parentNode)===null||i===void 0||i.removeChild(t)}document.body.removeChild(n)}}function R5t(n){return N5t(),!!uT[n]}function O5t(n){var e=uT[n],t=null;if(e&&Xf())if(NVe)t=AVe;else{var i=document.querySelector("style[".concat(cT,'="').concat(uT[n],'"]'));i?t=i.innerHTML:delete uT[n]}return[t,e]}var mIe=Xf(),P5t="_skip_check_",RVe="_multi_value_";function _Ie(n){var e=sT(z9e(n),U9e);return e.replace(/\{%%%\:[^;];}/g,";")}function M5t(n){return Qr(n)==="object"&&n&&(P5t in n||RVe in n)}function F5t(n,e,t){if(!e)return n;var i=".".concat(e),r=t==="low"?":where(".concat(i,")"):i,o=n.split(",").map(function(s){var a,l=s.trim().split(/\s+/),c=l[0]||"",u=((a=c.match(/^\w+/))===null||a===void 0?void 0:a[0])||"";return c="".concat(u).concat(r).concat(c.slice(u.length)),[c].concat(Jr(l.slice(1))).join(" ")});return o.join(",")}var B5t=function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=i.root,o=i.injectHash,s=i.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",f={};function g(y){var C=y.getName(a);if(!f[C]){var x=n(y.style,t,{root:!1,parentSelectors:s}),E=ln(x,1),k=E[0];f[C]="@keyframes ".concat(y.getName(a)).concat(k)}}function m(y){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(x){Array.isArray(x)?m(x,C):x&&C.push(x)}),C}var v=m(Array.isArray(e)?e:[e]);if(v.forEach(function(y){var C=typeof y=="string"&&!r?{}:y;if(typeof C=="string")h+="".concat(C,` `);else if(C._keyframe)g(C);else{var x=d.reduce(function(E,k){var L;return(k==null||(L=k.visit)===null||L===void 0?void 0:L.call(k,E))||E},C);Object.keys(x).forEach(function(E){var k=x[E];if(Qr(k)==="object"&&k&&(E!=="animationName"||!k._keyframe)&&!M5t(k)){var L=!1,D=E.trim(),A=!1;(r||o)&&a?D.startsWith("@")?L=!0:D=F5t(E,a,c):r&&!a&&(D==="&"||D==="")&&(D="",A=!0);var O=n(k,t,{root:A,injectHash:L,parentSelectors:[].concat(Jr(s),[D])}),P=ln(O,2),F=P[0],B=P[1];f=ct(ct({},f),B),h+="".concat(D).concat(F)}else{let U=function(W,q){var H=W.replace(/[A-Z]/g,function(se){return"-".concat(se.toLowerCase())}),ie=q;!A5t[W]&&typeof ie=="number"&&ie!==0&&(ie="".concat(ie,"px")),W==="animationName"&&q!==null&&q!==void 0&&q._keyframe&&(g(q),ie=q.getName(a)),h+="".concat(H,":").concat(ie,";")};var M,V=(M=k==null?void 0:k.value)!==null&&M!==void 0?M:k;Qr(k)==="object"&&k!==null&&k!==void 0&&k[RVe]&&Array.isArray(V)?V.forEach(function(W){U(E,W)}):U(E,V)}})}}),!r)h="{".concat(h,"}");else if(l&&p5t()){var _=l.split(","),b=_[_.length-1].trim();h="@layer ".concat(b," {").concat(h,"}"),_.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function $5t(n,e){return r_e("".concat(n.join("%")).concat(e))}function V5t(){return null}function Roe(n,e){var t=n.token,i=n.path,r=n.hashId,o=n.layer,s=n.nonce,a=n.clientOnly,l=n.order,c=l===void 0?0:l,u=w.useContext(o_e),d=u.autoClear;u.mock;var h=u.defaultCache,f=u.hashPriority,g=u.container,m=u.ssrInline,v=u.transformers,_=u.linters,b=u.cache,y=t._tokenKey,C=[y].concat(Jr(i)),x=mIe,E=DVe("style",C,function(){var O=C.join("|");if(R5t(O)){var P=O5t(O),F=ln(P,2),B=F[0],M=F[1];if(B)return[B,y,M,{},a,c]}var V=e(),U=B5t(V,{hashId:r,hashPriority:f,layer:o,path:i.join("-"),transformers:v,linters:_}),W=ln(U,2),q=W[0],H=W[1],ie=_Ie(q),se=$5t(C,ie);return[ie,y,se,H,a,c]},function(O,P){var F=ln(O,3),B=F[2];(P||d)&&mIe&&WH(B,{mark:cT})},function(O){var P=ln(O,4),F=P[0];P[1];var B=P[2],M=P[3];if(x&&F!==AVe){var V={mark:cT,prepend:"queue",attachTo:g,priority:c},U=typeof s=="function"?s():s;U&&(V.csp={nonce:U});var W=ZD(F,B,V);W[j2]=b.instanceId,W.setAttribute(Doe,y),Object.keys(M).forEach(function(q){ZD(_Ie(M[q]),"_effect-".concat(q),V)})}}),k=ln(E,3),L=k[0],D=k[1],A=k[2];return function(O){var P;if(!m||x||!h)P=w.createElement(V5t,null);else{var F;P=w.createElement("style",Ct({},(F={},Ze(F,Doe,D),Ze(F,cT,A),F),{dangerouslySetInnerHTML:{__html:L}}))}return w.createElement(w.Fragment,null,P,O)}}var mh=function(){function n(e,t){El(this,n),Ze(this,"name",void 0),Ze(this,"style",void 0),Ze(this,"_keyframe",!0),this.name=e,this.style=t}return xl(n,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),n}();function HI(n){return n.notSplit=!0,n}HI(["borderTop","borderBottom"]),HI(["borderTop"]),HI(["borderBottom"]),HI(["borderLeft","borderRight"]),HI(["borderLeft"]),HI(["borderRight"]);var H5t=w.createContext({});const a_e=H5t;function Z_(n,e){for(var t=n,i=0;i<e.length;i+=1){if(t==null)return;t=t[e[i]]}return t}function OVe(n,e,t,i){if(!e.length)return t;var r=Q6e(e),o=r[0],s=r.slice(1),a;return!n&&typeof o=="number"?a=[]:Array.isArray(n)?a=Jr(n):a=ct({},n),i&&t===void 0&&s.length===1?delete a[o][s[0]]:a[o]=OVe(a[o],s,t,i),a}function I_(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&i&&t===void 0&&!Z_(n,e.slice(0,-1))?n:OVe(n,e,t,i)}function W5t(n){return Qr(n)==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype}function vIe(n){return Array.isArray(n)?[]:{}}var z5t=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function q2(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=vIe(e[0]);return e.forEach(function(r){function o(s,a){var l=new Set(a),c=Z_(r,s),u=Array.isArray(c);if(u||W5t(c)){if(!l.has(c)){l.add(c);var d=Z_(i,s);u?i=I_(i,s,[]):(!d||Qr(d)!=="object")&&(i=I_(i,s,vIe(c))),z5t(c).forEach(function(h){o([].concat(Jr(s),[h]),l)})}}else i=I_(i,s,c)}o([])}),i}const U5t=w.createContext({}),j5t=w.createContext(void 0),q5t={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"};var K5t={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};const G5t={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},PVe=G5t,Y5t={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},K5t),timePickerLocale:Object.assign({},PVe)},UH=Y5t,wp="${label} is not a valid ${type}",Q5t={locale:"en",Pagination:q5t,DatePicker:UH,TimePicker:PVe,Calendar:UH,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:wp,method:wp,array:wp,object:wp,number:wp,date:wp,boolean:wp,integer:wp,float:wp,regexp:wp,email:wp,url:wp,hex:wp},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh"},ColorPicker:{presetEmpty:"Empty"}},JD=Q5t;Object.assign({},JD.Modal);let C$=[];const bIe=()=>C$.reduce((n,e)=>Object.assign(Object.assign({},n),e),JD.Modal);function X5t(n){if(n){const e=Object.assign({},n);return C$.push(e),bIe(),()=>{C$=C$.filter(t=>t!==e),bIe()}}Object.assign({},JD.Modal)}const Z5t=w.createContext(void 0),l_e=Z5t,J5t=(n,e)=>{const t=w.useContext(l_e),i=w.useMemo(()=>{var o;const s=e||JD[n],a=(o=t==null?void 0:t[n])!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[n,e,t]),r=w.useMemo(()=>{const o=t==null?void 0:t.locale;return t!=null&&t.exist&&!o?JD.locale:o},[t]);return[i,r]},MVe=J5t,eFt="internalMark",tFt=n=>{const{locale:e={},children:t,_ANT_MARK__:i}=n;w.useEffect(()=>X5t(e&&e.Modal),[e]);const r=w.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return w.createElement(l_e.Provider,{value:r},t)},nFt=tFt;function Rd(n,e){iFt(n)&&(n="100%");var t=rFt(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function I8(n){return Math.min(1,Math.max(0,n))}function iFt(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function rFt(n){return typeof n=="string"&&n.indexOf("%")!==-1}function FVe(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function L8(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Bx(n){return n.length===1?"0"+n:String(n)}function oFt(n,e,t){return{r:Rd(n,255)*255,g:Rd(e,255)*255,b:Rd(t,255)*255}}function yIe(n,e,t){n=Rd(n,255),e=Rd(e,255),t=Rd(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),o=0,s=0,a=(i+r)/2;if(i===r)s=0,o=0;else{var l=i-r;switch(s=a>.5?l/(2-i-r):l/(i+r),i){case n:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-n)/l+2;break;case t:o=(n-e)/l+4;break}o/=6}return{h:o,s,l:a}}function rJ(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function sFt(n,e,t){var i,r,o;if(n=Rd(n,360),e=Rd(e,100),t=Rd(t,100),e===0)r=t,o=t,i=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;i=rJ(a,s,n+1/3),r=rJ(a,s,n),o=rJ(a,s,n-1/3)}return{r:i*255,g:r*255,b:o*255}}function Ooe(n,e,t){n=Rd(n,255),e=Rd(e,255),t=Rd(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),o=0,s=i,a=i-r,l=i===0?0:a/i;if(i===r)o=0;else{switch(i){case n:o=(e-t)/a+(e<t?6:0);break;case e:o=(t-n)/a+2;break;case t:o=(n-e)/a+4;break}o/=6}return{h:o,s:l,v:s}}function aFt(n,e,t){n=Rd(n,360)*6,e=Rd(e,100),t=Rd(t,100);var i=Math.floor(n),r=n-i,o=t*(1-e),s=t*(1-r*e),a=t*(1-(1-r)*e),l=i%6,c=[t,s,o,o,a,t][l],u=[a,t,t,s,o,o][l],d=[o,o,a,t,t,s][l];return{r:c*255,g:u*255,b:d*255}}function Poe(n,e,t,i){var r=[Bx(Math.round(n).toString(16)),Bx(Math.round(e).toString(16)),Bx(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function lFt(n,e,t,i,r){var o=[Bx(Math.round(n).toString(16)),Bx(Math.round(e).toString(16)),Bx(Math.round(t).toString(16)),Bx(cFt(i))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function cFt(n){return Math.round(parseFloat(n)*255).toString(16)}function CIe(n){return kp(n)/255}function kp(n){return parseInt(n,16)}function uFt(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var Moe={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function y2(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,o=null,s=!1,a=!1;return typeof n=="string"&&(n=fFt(n)),typeof n=="object"&&(q0(n.r)&&q0(n.g)&&q0(n.b)?(e=oFt(n.r,n.g,n.b),s=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):q0(n.h)&&q0(n.s)&&q0(n.v)?(i=L8(n.s),r=L8(n.v),e=aFt(n.h,i,r),s=!0,a="hsv"):q0(n.h)&&q0(n.s)&&q0(n.l)&&(i=L8(n.s),o=L8(n.l),e=sFt(n.h,i,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=FVe(t),{ok:s,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var dFt="[-\\+]?\\d+%?",hFt="[-\\+]?\\d*\\.\\d+%?",GC="(?:".concat(hFt,")|(?:").concat(dFt,")"),oJ="[\\s|\\(]+(".concat(GC,")[,|\\s]+(").concat(GC,")[,|\\s]+(").concat(GC,")\\s*\\)?"),sJ="[\\s|\\(]+(".concat(GC,")[,|\\s]+(").concat(GC,")[,|\\s]+(").concat(GC,")[,|\\s]+(").concat(GC,")\\s*\\)?"),m_={CSS_UNIT:new RegExp(GC),rgb:new RegExp("rgb"+oJ),rgba:new RegExp("rgba"+sJ),hsl:new RegExp("hsl"+oJ),hsla:new RegExp("hsla"+sJ),hsv:new RegExp("hsv"+oJ),hsva:new RegExp("hsva"+sJ),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function fFt(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(Moe[n])n=Moe[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=m_.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=m_.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=m_.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=m_.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=m_.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=m_.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=m_.hex8.exec(n),t?{r:kp(t[1]),g:kp(t[2]),b:kp(t[3]),a:CIe(t[4]),format:e?"name":"hex8"}:(t=m_.hex6.exec(n),t?{r:kp(t[1]),g:kp(t[2]),b:kp(t[3]),format:e?"name":"hex"}:(t=m_.hex4.exec(n),t?{r:kp(t[1]+t[1]),g:kp(t[2]+t[2]),b:kp(t[3]+t[3]),a:CIe(t[4]+t[4]),format:e?"name":"hex8"}:(t=m_.hex3.exec(n),t?{r:kp(t[1]+t[1]),g:kp(t[2]+t[2]),b:kp(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function q0(n){return!!m_.CSS_UNIT.exec(String(n))}var Sd=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=uFt(e)),this.originalInput=e;var r=y2(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,o=e.r/255,s=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=FVe(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Ooe(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Ooe(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=yIe(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=yIe(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),Poe(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),lFt(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Rd(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Rd(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+Poe(this.r,this.g,this.b,!1),t=0,i=Object.entries(Moe);t<i.length;t++){var r=i[t],o=r[0],s=r[1];if(e===s)return o}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,o=!t&&r&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=I8(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=I8(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=I8(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=I8(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),o=t/100,s={r:(r.r-i.r)*o+i.r,g:(r.g-i.g)*o+i.g,b:(r.b-i.b)*o+i.b,a:(r.a-i.a)*o+i.a};return new n(s)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,o=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,o.push(new n(i));return o},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,o=t.v,s=[],a=1/e;e--;)s.push(new n({h:i,s:r,v:o})),o=(o+a)%1;return s},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],o=360/e,s=1;s<e;s++)r.push(new n({h:(i+s*o)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}(),D8=2,wIe=.16,pFt=.05,gFt=.05,mFt=.15,BVe=5,$Ve=4,_Ft=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function SIe(n){var e=n.r,t=n.g,i=n.b,r=Ooe(e,t,i);return{h:r.h*360,s:r.s,v:r.v}}function A8(n){var e=n.r,t=n.g,i=n.b;return"#".concat(Poe(e,t,i,!1))}function vFt(n,e,t){var i=t/100,r={r:(e.r-n.r)*i+n.r,g:(e.g-n.g)*i+n.g,b:(e.b-n.b)*i+n.b};return r}function EIe(n,e,t){var i;return Math.round(n.h)>=60&&Math.round(n.h)<=240?i=t?Math.round(n.h)-D8*e:Math.round(n.h)+D8*e:i=t?Math.round(n.h)+D8*e:Math.round(n.h)-D8*e,i<0?i+=360:i>=360&&(i-=360),i}function xIe(n,e,t){if(n.h===0&&n.s===0)return n.s;var i;return t?i=n.s-wIe*e:e===$Ve?i=n.s+wIe:i=n.s+pFt*e,i>1&&(i=1),t&&e===BVe&&i>.1&&(i=.1),i<.06&&(i=.06),Number(i.toFixed(2))}function TIe(n,e,t){var i;return t?i=n.v+gFt*e:i=n.v-mFt*e,i>1&&(i=1),Number(i.toFixed(2))}function MT(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],i=y2(n),r=BVe;r>0;r-=1){var o=SIe(i),s=A8(y2({h:EIe(o,r,!0),s:xIe(o,r,!0),v:TIe(o,r,!0)}));t.push(s)}t.push(A8(i));for(var a=1;a<=$Ve;a+=1){var l=SIe(i),c=A8(y2({h:EIe(l,a),s:xIe(l,a),v:TIe(l,a)}));t.push(c)}return e.theme==="dark"?_Ft.map(function(u){var d=u.index,h=u.opacity,f=A8(vFt(y2(e.backgroundColor||"#141414"),y2(t[d]),h*100));return f}):t}var aJ={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},w$={},lJ={};Object.keys(aJ).forEach(function(n){w$[n]=MT(aJ[n]),w$[n].primary=w$[n][5],lJ[n]=MT(aJ[n],{theme:"dark",backgroundColor:"#141414"}),lJ[n].primary=lJ[n][5]});var bFt=w$.blue;const yFt=n=>{const{controlHeight:e}=n;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}},CFt=yFt;function wFt(n){const{sizeUnit:e,sizeStep:t}=n;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const VVe={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},SFt=Object.assign(Object.assign({},VVe),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),V4=SFt;function EFt(n,e){let{generateColorPalettes:t,generateNeutralColorPalettes:i}=e;const{colorSuccess:r,colorWarning:o,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=n,d=t(l),h=t(r),f=t(o),g=t(s),m=t(a),v=i(c,u),_=n.colorLink||n.colorInfo,b=t(_);return Object.assign(Object.assign({},v),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:m[1],colorInfoBgHover:m[2],colorInfoBorder:m[3],colorInfoBorderHover:m[4],colorInfoHover:m[4],colorInfo:m[6],colorInfoActive:m[7],colorInfoTextHover:m[8],colorInfoText:m[9],colorInfoTextActive:m[10],colorLinkHover:b[4],colorLink:b[6],colorLinkActive:b[7],colorBgMask:new Sd("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const xFt=n=>{let e=n,t=n,i=n,r=n;return n<6&&n>=5?e=n+1:n<16&&n>=6?e=n+2:n>=16&&(e=16),n<7&&n>=5?t=4:n<8&&n>=7?t=5:n<14&&n>=8?t=6:n<16&&n>=14?t=7:n>=16&&(t=8),n<6&&n>=2?i=1:n>=6&&(i=2),n>4&&n<8?r=4:n>=8&&(r=6),{borderRadius:n,borderRadiusXS:i,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:r}},TFt=xFt;function kFt(n){const{motionUnit:e,motionBase:t,borderRadius:i,lineWidth:r}=n;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:r+1},TFt(i))}const K0=(n,e)=>new Sd(n).setAlpha(e).toRgbString(),oO=(n,e)=>new Sd(n).darken(e).toHexString(),IFt=n=>{const e=MT(n);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},LFt=(n,e)=>{const t=n||"#fff",i=e||"#000";return{colorBgBase:t,colorTextBase:i,colorText:K0(i,.88),colorTextSecondary:K0(i,.65),colorTextTertiary:K0(i,.45),colorTextQuaternary:K0(i,.25),colorFill:K0(i,.15),colorFillSecondary:K0(i,.06),colorFillTertiary:K0(i,.04),colorFillQuaternary:K0(i,.02),colorBgLayout:oO(t,4),colorBgContainer:oO(t,0),colorBgElevated:oO(t,0),colorBgSpotlight:K0(i,.85),colorBgBlur:"transparent",colorBorder:oO(t,15),colorBorderSecondary:oO(t,6)}};function DFt(n){const e=new Array(10).fill(null).map((t,i)=>{const r=i-1,o=n*Math.pow(2.71828,r/5),s=i>1?Math.floor(o):Math.ceil(o);return Math.floor(s/2)*2});return e[1]=n,e.map(t=>{const i=t+8;return{size:t,lineHeight:i/t}})}const AFt=n=>{const e=DFt(n),t=e.map(r=>r.size),i=e.map(r=>r.lineHeight);return{fontSizeSM:t[0],fontSize:t[1],fontSizeLG:t[2],fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:i[1],lineHeightLG:i[2],lineHeightSM:i[0],lineHeightHeading1:i[6],lineHeightHeading2:i[5],lineHeightHeading3:i[4],lineHeightHeading4:i[3],lineHeightHeading5:i[2]}},NFt=AFt;function RFt(n){const e=Object.keys(VVe).map(t=>{const i=MT(n[t]);return new Array(10).fill(1).reduce((r,o,s)=>(r[`${t}-${s+1}`]=i[s],r[`${t}${s+1}`]=i[s],r),{})}).reduce((t,i)=>(t=Object.assign(Object.assign({},t),i),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),e),EFt(n,{generateColorPalettes:IFt,generateNeutralColorPalettes:LFt})),NFt(n.fontSize)),wFt(n)),CFt(n)),kFt(n))}const HVe=Noe(RFt),WVe={token:V4,override:{override:V4},hashed:!0},zVe=ae.createContext(WVe),UVe="anticon",OFt=(n,e)=>e||(n?`ant-${n}`:"ant"),Gm=w.createContext({getPrefixCls:OFt,iconPrefixCls:UVe}),PFt=`-ant-${Date.now()}-${Math.random()}`;function MFt(n,e){const t={},i=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(s,a)=>{const l=new Sd(s),c=MT(l.toRgbString());t[`${a}-color`]=i(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const s=new Sd(e.primaryColor),a=MT(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=i(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=i(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=i(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=i(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=i(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new Sd(a[0]);t["primary-color-active-deprecated-f-30"]=i(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=i(l,c=>c.darken(2))}return e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info"),` :root { ${Object.keys(t).map(s=>`--${n}-${s}: ${t[s]};`).join(` `)} } `.trim()}function FFt(n,e){const t=MFt(n,e);Xf()&&ZD(t,`${PFt}-dynamic-theme`)}const Foe=w.createContext(!1),BFt=n=>{let{children:e,disabled:t}=n;const i=w.useContext(Foe);return w.createElement(Foe.Provider,{value:t??i},e)},Oq=Foe,Boe=w.createContext(void 0),$Ft=n=>{let{children:e,size:t}=n;const i=w.useContext(Boe);return w.createElement(Boe.Provider,{value:t||i},e)},Pq=Boe;function VFt(){const n=w.useContext(Oq),e=w.useContext(Pq);return{componentDisabled:n,componentSize:e}}const HFt="5.10.3";function cJ(n){return n>=0&&n<=255}function N8(n,e){const{r:t,g:i,b:r,a:o}=new Sd(n).toRgb();if(o<1)return n;const{r:s,g:a,b:l}=new Sd(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-s*(1-c))/c),d=Math.round((i-a*(1-c))/c),h=Math.round((r-l*(1-c))/c);if(cJ(u)&&cJ(d)&&cJ(h))return new Sd({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new Sd({r:t,g:i,b:r,a:1}).toRgbString()}var WFt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function jVe(n){const{override:e}=n,t=WFt(n,["override"]),i=Object.assign({},e);Object.keys(V4).forEach(h=>{delete i[h]});const r=Object.assign(Object.assign({},t),i),o=480,s=576,a=768,l=992,c=1200,u=1600;if(r.motion===!1){const h="0s";r.motionDurationFast=h,r.motionDurationMid=h,r.motionDurationSlow=h}return Object.assign(Object.assign(Object.assign({},r),{colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:N8(r.colorBorderSecondary,r.colorBgContainer),colorTextPlaceholder:r.colorTextQuaternary,colorTextDisabled:r.colorTextQuaternary,colorTextHeading:r.colorText,colorTextLabel:r.colorTextSecondary,colorTextDescription:r.colorTextTertiary,colorTextLightSolid:r.colorWhite,colorHighlight:r.colorError,colorBgTextHover:r.colorFillSecondary,colorBgTextActive:r.colorFill,colorIcon:r.colorTextTertiary,colorIconHover:r.colorText,colorErrorOutline:N8(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:N8(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*4,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:N8(r.colorPrimaryBg,r.colorBgContainer),lineType:r.lineType,borderRadius:r.borderRadius,borderRadiusXS:r.borderRadiusXS,borderRadiusSM:r.borderRadiusSM,borderRadiusLG:r.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:r.sizeXXS,paddingXS:r.sizeXS,paddingSM:r.sizeSM,padding:r.size,paddingMD:r.sizeMD,paddingLG:r.sizeLG,paddingXL:r.sizeXL,paddingContentHorizontalLG:r.sizeLG,paddingContentVerticalLG:r.sizeMS,paddingContentHorizontal:r.sizeMS,paddingContentVertical:r.sizeSM,paddingContentHorizontalSM:r.size,paddingContentVerticalSM:r.sizeXS,marginXXS:r.sizeXXS,marginXS:r.sizeXS,marginSM:r.sizeSM,margin:r.size,marginMD:r.sizeMD,marginLG:r.sizeLG,marginXL:r.sizeXL,marginXXL:r.sizeXXL,boxShadow:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowSecondary:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowTertiary:` 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02) `,screenXS:o,screenXSMin:o,screenXSMax:s-1,screenSM:s,screenSMMin:s,screenSMMax:a-1,screenMD:a,screenMDMin:a,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:` 0 1px 2px -2px ${new Sd("rgba(0, 0, 0, 0.16)").toRgbString()}, 0 3px 6px 0 ${new Sd("rgba(0, 0, 0, 0.12)").toRgbString()}, 0 5px 12px 4px ${new Sd("rgba(0, 0, 0, 0.09)").toRgbString()} `,boxShadowDrawerRight:` -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerLeft:` 6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12), 9px 0 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerUp:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerDown:` 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),i)}var kIe=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const qVe=(n,e,t)=>{const i=t.getDerivativeToken(n),{override:r}=e,o=kIe(e,["override"]);let s=Object.assign(Object.assign({},i),{override:r});return s=jVe(s),o&&Object.entries(o).forEach(a=>{let[l,c]=a;const{theme:u}=c,d=kIe(c,["theme"]);let h=d;u&&(h=qVe(Object.assign(Object.assign({},s),d),{override:d},u)),s[l]=h}),s};function MF(){const{token:n,hashed:e,theme:t,override:i}=ae.useContext(zVe),r=`${HFt}-${e||""}`,o=t||HVe,[s,a]=D5t(o,[V4,n],{salt:r,override:i,getComputedToken:qVe,formatToken:jVe});return[o,s,e?a:""]}function M_(n){var e=w.useRef();e.current=n;var t=w.useCallback(function(){for(var i,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return(i=e.current)===null||i===void 0?void 0:i.call.apply(i,[e].concat(o))},[]);return t}function VL(n){var e=w.useRef(!1),t=w.useState(n),i=ln(t,2),r=i[0],o=i[1];w.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function s(a,l){l&&e.current||o(a)}return[r,s]}function uJ(n){return n!==void 0}function Em(n,e){var t=e||{},i=t.defaultValue,r=t.value,o=t.onChange,s=t.postState,a=VL(function(){return uJ(r)?r:uJ(i)?typeof i=="function"?i():i:typeof n=="function"?n():n}),l=ln(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,h=s?s(d):d,f=M_(o),g=VL([d]),m=ln(g,2),v=m[0],_=m[1];fIe(function(){var y=v[0];c!==y&&f(c,y)},[v]),fIe(function(){uJ(r)||u(r)},[r]);var b=M_(function(y,C){u(y,C),_([d],C)});return[h,b]}const zFt=(n,e,t,i,r)=>{const o=n/2,s=0,a=o,l=t*1/Math.sqrt(2),c=o-t*(1-1/Math.sqrt(2)),u=o-e*(1/Math.sqrt(2)),d=t*(Math.sqrt(2)-1)+e*(1/Math.sqrt(2)),h=2*o-u,f=d,g=2*o-l,m=c,v=2*o-s,_=a,b=o*Math.sqrt(2)+t*(Math.sqrt(2)-2),y=t*(Math.sqrt(2)-1);return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:n/2,background:i,clipPath:{_multi_value_:!0,value:[`polygon(${y}px 100%, 50% ${y}px, ${2*o-y}px 100%, ${y}px 100%)`,`path('M ${s} ${a} A ${t} ${t} 0 0 0 ${l} ${c} L ${u} ${d} A ${e} ${e} 0 0 1 ${h} ${f} L ${g} ${m} A ${t} ${t} 0 0 0 ${v} ${_} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:b,height:b,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${e}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},UFt={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},H4=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:n.colorText,fontSize:n.fontSize,lineHeight:n.lineHeight,listStyle:"none",fontFamily:e?"inherit":n.fontFamily}},jFt=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),qFt=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),KFt=n=>({a:{color:n.colorLink,textDecoration:n.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${n.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:n.colorLinkHover},"&:active":{color:n.colorLinkActive},"&:active,\n &:hover":{textDecoration:n.linkHoverDecoration,outline:0},"&:focus":{textDecoration:n.linkFocusDecoration,outline:0},"&[disabled]":{color:n.colorTextDisabled,cursor:"not-allowed"}}}),GFt=(n,e)=>{const{fontFamily:t,fontSize:i}=n,r=`[class^="${e}"], [class*=" ${e}"]`;return{[r]:{fontFamily:t,fontSize:i,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},YFt=n=>({outline:`${n.lineWidthFocus}px solid ${n.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),QFt=n=>({"&:focus-visible":Object.assign({},YFt(n))}),KVe=typeof CSSINJS_STATISTIC<"u";let $oe=!0;function Gh(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];if(!KVe)return Object.assign.apply(Object,[{}].concat(e));$oe=!1;const i={};return e.forEach(r=>{Object.keys(r).forEach(s=>{Object.defineProperty(i,s,{configurable:!0,enumerable:!0,get:()=>r[s]})})}),$oe=!0,i}const IIe={};function XFt(){}function ZFt(n){let e,t=n,i=XFt;return KVe&&(e=new Set,t=new Proxy(n,{get(r,o){return $oe&&e.add(o),r[o]}}),i=(r,o)=>{var s;IIe[r]={global:Array.from(e),component:Object.assign(Object.assign({},(s=IIe[r])===null||s===void 0?void 0:s.component),o)}}),{token:t,keys:e,flush:i}}const JFt=(n,e)=>{const[t,i]=MF();return Roe({theme:t,token:i,hashId:"",path:["ant-design-icons",n],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${n}`]:Object.assign(Object.assign({},jFt()),{[`.${n} .${n}-icon`]:{display:"block"}})}])},GVe=JFt;function AN(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=Array.isArray(n)?n:[n,n],[o]=r,s=r.join("-");return a=>{const[l,c,u]=MF(),{getPrefixCls:d,iconPrefixCls:h,csp:f}=w.useContext(Gm),g=d(),m={theme:l,token:c,hashId:u,nonce:()=>f==null?void 0:f.nonce,clientOnly:i.clientOnly,order:i.order||-999};return Roe(Object.assign(Object.assign({},m),{clientOnly:!1,path:["Shared",g]}),()=>[{"&":KFt(c)}]),GVe(h,f),[Roe(Object.assign(Object.assign({},m),{path:[s,a,h]}),()=>{const{token:v,flush:_}=ZFt(c),b=Object.assign({},c[o]);if(i.deprecatedTokens){const{deprecatedTokens:L}=i;L.forEach(D=>{let[A,O]=D;var P;(b!=null&&b[A]||b!=null&&b[O])&&((P=b[O])!==null&&P!==void 0||(b[O]=b==null?void 0:b[A]))})}const y=typeof t=="function"?t(Gh(v,b??{})):t,C=Object.assign(Object.assign({},y),b),x=`.${a}`,E=Gh(v,{componentCls:x,prefixCls:a,iconCls:`.${h}`,antCls:`.${g}`},C),k=e(E,{hashId:u,prefixCls:a,rootPrefixCls:g,iconPrefixCls:h,overrideComponentToken:b});return _(o,C),[i.resetStyle===!1?null:GFt(c,a),k]}),u]}}const e6t=(n,e,t,i)=>{const r=AN(n,e,t,Object.assign({resetStyle:!1,order:-998},i));return s=>{let{prefixCls:a}=s;return r(a),null}};function t6t(n,e){const t=n||{},i=t.inherit===!1||!e?WVe:e;return OF(()=>{if(!n)return e;const r=Object.assign({},i.components);return Object.keys(n.components||{}).forEach(o=>{r[o]=Object.assign(Object.assign({},r[o]),n.components[o])}),Object.assign(Object.assign(Object.assign({},i),t),{token:Object.assign(Object.assign({},i.token),t.token),components:r})},[t,i],(r,o)=>r.some((s,a)=>{const l=o[a];return!HH(s,l,!0)}))}var n6t=["children"],YVe=w.createContext({});function i6t(n){var e=n.children,t=Qu(n,n6t);return w.createElement(YVe.Provider,{value:t},e)}var r6t=function(n){xv(t,n);var e=Ok(t);function t(){return El(this,t),e.apply(this,arguments)}return xl(t,[{key:"render",value:function(){return this.props.children}}]),t}(w.Component),ex="none",R8="appear",O8="enter",P8="leave",LIe="none",L_="prepare",K2="start",G2="active",c_e="end",QVe="prepared";function DIe(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(n)]="webkit".concat(e),t["Moz".concat(n)]="moz".concat(e),t["ms".concat(n)]="MS".concat(e),t["O".concat(n)]="o".concat(e.toLowerCase()),t}function o6t(n,e){var t={animationend:DIe("Animation","AnimationEnd"),transitionend:DIe("Transition","TransitionEnd")};return n&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var s6t=o6t(Xf(),typeof window<"u"?window:{}),XVe={};if(Xf()){var a6t=document.createElement("div");XVe=a6t.style}var M8={};function ZVe(n){if(M8[n])return M8[n];var e=s6t[n];if(e)for(var t=Object.keys(e),i=t.length,r=0;r<i;r+=1){var o=t[r];if(Object.prototype.hasOwnProperty.call(e,o)&&o in XVe)return M8[n]=e[o],M8[n]}return""}var JVe=ZVe("animationend"),eHe=ZVe("transitionend"),tHe=!!(JVe&&eHe),AIe=JVe||"animationend",NIe=eHe||"transitionend";function RIe(n,e){if(!n)return null;if(Qr(n)==="object"){var t=e.replace(/-\w/g,function(i){return i[1].toUpperCase()});return n[t]}return"".concat(n,"-").concat(e)}const l6t=function(n){var e=w.useRef(),t=w.useRef(n);t.current=n;var i=w.useCallback(function(s){t.current(s)},[]);function r(s){s&&(s.removeEventListener(NIe,i),s.removeEventListener(AIe,i))}function o(s){e.current&&e.current!==s&&r(e.current),s&&s!==e.current&&(s.addEventListener(NIe,i),s.addEventListener(AIe,i),e.current=s)}return w.useEffect(function(){return function(){r(e.current)}},[]),[o,r]};var nHe=Xf()?w.useLayoutEffect:w.useEffect;const c6t=function(){var n=w.useRef(null);function e(){Qf.cancel(n.current)}function t(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var o=Qf(function(){r<=1?i({isCanceled:function(){return o!==n.current}}):t(i,r-1)});n.current=o}return w.useEffect(function(){return function(){e()}},[]),[t,e]};var u6t=[L_,K2,G2,c_e],d6t=[L_,QVe],iHe=!1,h6t=!0;function rHe(n){return n===G2||n===c_e}const f6t=function(n,e,t){var i=VL(LIe),r=ln(i,2),o=r[0],s=r[1],a=c6t(),l=ln(a,2),c=l[0],u=l[1];function d(){s(L_,!0)}var h=e?d6t:u6t;return nHe(function(){if(o!==LIe&&o!==c_e){var f=h.indexOf(o),g=h[f+1],m=t(o);m===iHe?s(g,!0):g&&c(function(v){function _(){v.isCanceled()||s(g,!0)}m===!0?_():Promise.resolve(m).then(_)})}},[n,o]),w.useEffect(function(){return function(){u()}},[]),[d,o]};function p6t(n,e,t,i){var r=i.motionEnter,o=r===void 0?!0:r,s=i.motionAppear,a=s===void 0?!0:s,l=i.motionLeave,c=l===void 0?!0:l,u=i.motionDeadline,d=i.motionLeaveImmediately,h=i.onAppearPrepare,f=i.onEnterPrepare,g=i.onLeavePrepare,m=i.onAppearStart,v=i.onEnterStart,_=i.onLeaveStart,b=i.onAppearActive,y=i.onEnterActive,C=i.onLeaveActive,x=i.onAppearEnd,E=i.onEnterEnd,k=i.onLeaveEnd,L=i.onVisibleChanged,D=VL(),A=ln(D,2),O=A[0],P=A[1],F=VL(ex),B=ln(F,2),M=B[0],V=B[1],U=VL(null),W=ln(U,2),q=W[0],H=W[1],ie=w.useRef(!1),se=w.useRef(null);function Q(){return t()}var Ee=w.useRef(!1);function Fe(){V(ex,!0),H(null,!0)}function He(ot){var we=Q();if(!(ot&&!ot.deadline&&ot.target!==we)){var Se=Ee.current,re;M===R8&&Se?re=x==null?void 0:x(we,ot):M===O8&&Se?re=E==null?void 0:E(we,ot):M===P8&&Se&&(re=k==null?void 0:k(we,ot)),M!==ex&&Se&&re!==!1&&Fe()}}var ke=l6t(He),Me=ln(ke,1),je=Me[0],qe=function(we){var Se,re,Y;switch(we){case R8:return Se={},Ze(Se,L_,h),Ze(Se,K2,m),Ze(Se,G2,b),Se;case O8:return re={},Ze(re,L_,f),Ze(re,K2,v),Ze(re,G2,y),re;case P8:return Y={},Ze(Y,L_,g),Ze(Y,K2,_),Ze(Y,G2,C),Y;default:return{}}},Be=w.useMemo(function(){return qe(M)},[M]),_t=f6t(M,!n,function(ot){if(ot===L_){var we=Be[L_];return we?we(Q()):iHe}if(rn in Be){var Se;H(((Se=Be[rn])===null||Se===void 0?void 0:Se.call(Be,Q(),null))||null)}return rn===G2&&(je(Q()),u>0&&(clearTimeout(se.current),se.current=setTimeout(function(){He({deadline:!0})},u))),rn===QVe&&Fe(),h6t}),Wt=ln(_t,2),Tt=Wt[0],rn=Wt[1],_n=rHe(rn);Ee.current=_n,nHe(function(){P(e);var ot=ie.current;ie.current=!0;var we;!ot&&e&&a&&(we=R8),ot&&e&&o&&(we=O8),(ot&&!e&&c||!ot&&d&&!e&&c)&&(we=P8);var Se=qe(we);we&&(n||Se[L_])?(V(we),Tt()):V(ex)},[e]),w.useEffect(function(){(M===R8&&!a||M===O8&&!o||M===P8&&!c)&&V(ex)},[a,o,c]),w.useEffect(function(){return function(){ie.current=!1,clearTimeout(se.current)}},[]);var wt=w.useRef(!1);w.useEffect(function(){O&&(wt.current=!0),O!==void 0&&M===ex&&((wt.current||O)&&(L==null||L(O)),wt.current=!0)},[O,M]);var pt=q;return Be[L_]&&rn===K2&&(pt=ct({transition:"none"},pt)),[M,rn,pt,O??e]}function g6t(n){var e=n;Qr(n)==="object"&&(e=n.transitionSupport);function t(r,o){return!!(r.motionName&&e&&o!==!1)}var i=w.forwardRef(function(r,o){var s=r.visible,a=s===void 0?!0:s,l=r.removeOnLeave,c=l===void 0?!0:l,u=r.forceRender,d=r.children,h=r.motionName,f=r.leavedClassName,g=r.eventProps,m=w.useContext(YVe),v=m.motion,_=t(r,v),b=w.useRef(),y=w.useRef();function C(){try{return b.current instanceof HTMLElement?b.current:y$(y.current)}catch{return null}}var x=p6t(_,a,C,r),E=ln(x,4),k=E[0],L=E[1],D=E[2],A=E[3],O=w.useRef(A);A&&(O.current=!0);var P=w.useCallback(function(H){b.current=H,e_e(o,H)},[o]),F,B=ct(ct({},g),{},{visible:a});if(!d)F=null;else if(k===ex)A?F=d(ct({},B),P):!c&&O.current&&f?F=d(ct(ct({},B),{},{className:f}),P):u||!c&&!f?F=d(ct(ct({},B),{},{style:{display:"none"}}),P):F=null;else{var M,V;L===L_?V="prepare":rHe(L)?V="active":L===K2&&(V="start");var U=RIe(h,"".concat(k,"-").concat(V));F=d(ct(ct({},B),{},{className:Nt(RIe(h,k),(M={},Ze(M,U,U&&V),Ze(M,h,typeof h=="string"),M)),style:D}),P)}if(w.isValidElement(F)&&PF(F)){var W=F,q=W.ref;q||(F=w.cloneElement(F,{ref:P}))}return w.createElement(r6t,{ref:y},F)});return i.displayName="CSSMotion",i}const FF=g6t(tHe);var Voe="add",Hoe="keep",Woe="remove",dJ="removed";function m6t(n){var e;return n&&Qr(n)==="object"&&"key"in n?e=n:e={key:n},ct(ct({},e),{},{key:String(e.key)})}function zoe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return n.map(m6t)}function _6t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],i=0,r=e.length,o=zoe(n),s=zoe(e);o.forEach(function(c){for(var u=!1,d=i;d<r;d+=1){var h=s[d];if(h.key===c.key){i<d&&(t=t.concat(s.slice(i,d).map(function(f){return ct(ct({},f),{},{status:Voe})})),i=d),t.push(ct(ct({},h),{},{status:Hoe})),i+=1,u=!0;break}}u||t.push(ct(ct({},c),{},{status:Woe}))}),i<r&&(t=t.concat(s.slice(i).map(function(c){return ct(ct({},c),{},{status:Voe})})));var a={};t.forEach(function(c){var u=c.key;a[u]=(a[u]||0)+1});var l=Object.keys(a).filter(function(c){return a[c]>1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==Woe}),t.forEach(function(u){u.key===c&&(u.status=Hoe)})}),t}var v6t=["component","children","onVisibleChanged","onAllRemoved"],b6t=["status"],y6t=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function C6t(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:FF,t=function(i){xv(o,i);var r=Ok(o);function o(){var s;El(this,o);for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return s=r.call.apply(r,[this].concat(l)),Ze(Yr(s),"state",{keyEntities:[]}),Ze(Yr(s),"removeKey",function(u){var d=s.state.keyEntities,h=d.map(function(f){return f.key!==u?f:ct(ct({},f),{},{status:dJ})});return s.setState({keyEntities:h}),h.filter(function(f){var g=f.status;return g!==dJ}).length}),s}return xl(o,[{key:"render",value:function(){var a=this,l=this.state.keyEntities,c=this.props,u=c.component,d=c.children,h=c.onVisibleChanged,f=c.onAllRemoved,g=Qu(c,v6t),m=u||w.Fragment,v={};return y6t.forEach(function(_){v[_]=g[_],delete g[_]}),delete g.keys,w.createElement(m,g,l.map(function(_,b){var y=_.status,C=Qu(_,b6t),x=y===Voe||y===Hoe;return w.createElement(e,Ct({},v,{key:C.key,visible:x,eventProps:C,onVisibleChanged:function(k){if(h==null||h(k,{key:C.key}),!k){var L=a.removeKey(C.key);L===0&&f&&f()}}}),function(E,k){return d(ct(ct({},E),{},{index:b}),k)})}))}}],[{key:"getDerivedStateFromProps",value:function(a,l){var c=a.keys,u=l.keyEntities,d=zoe(c),h=_6t(u,d);return{keyEntities:h.filter(function(f){var g=u.find(function(m){var v=m.key;return f.key===v});return!(g&&g.status===dJ&&f.status===Woe)})}}}]),o}(w.Component);return Ze(t,"defaultProps",{component:"div"}),t}C6t(tHe);function w6t(n){const{children:e}=n,[,t]=MF(),{motion:i}=t,r=w.useRef(!1);return r.current=r.current||i===!1,r.current?w.createElement(i6t,{motion:i},e):e}const S6t=()=>null;var E6t=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const x6t=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form","select","button"],T6t="ant";let oHe;function k6t(){return oHe||T6t}function I6t(n){return Object.keys(n).some(e=>e.endsWith("Color"))}const L6t=n=>{let{prefixCls:e,iconPrefixCls:t,theme:i}=n;e!==void 0&&(oHe=e),i&&I6t(i)&&FFt(k6t(),i)},D6t=n=>{const{children:e,csp:t,autoInsertSpaceInButton:i,alert:r,anchor:o,form:s,locale:a,componentSize:l,direction:c,space:u,virtual:d,dropdownMatchSelectWidth:h,popupMatchSelectWidth:f,popupOverflow:g,legacyLocale:m,parentContext:v,iconPrefixCls:_,theme:b,componentDisabled:y,segmented:C,statistic:x,spin:E,calendar:k,carousel:L,cascader:D,collapse:A,typography:O,checkbox:P,descriptions:F,divider:B,drawer:M,skeleton:V,steps:U,image:W,layout:q,list:H,mentions:ie,modal:se,progress:Q,result:Ee,slider:Fe,breadcrumb:He,menu:ke,pagination:Me,input:je,empty:qe,badge:Be,radio:_t,rate:Wt,switch:Tt,transfer:rn,avatar:_n,message:wt,tag:pt,table:ot,card:we,tabs:Se,timeline:re,timePicker:Y,upload:Z,notification:le,tree:te,colorPicker:me,datePicker:Oe,flex:et,wave:Et,warning:Qe}=n,At=w.useCallback((zn,Tn)=>{const{prefixCls:pi}=n;if(Tn)return Tn;const Ei=pi||v.getPrefixCls("");return zn?`${Ei}-${zn}`:Ei},[v.getPrefixCls,n.prefixCls]),Ut=_||v.iconPrefixCls||UVe,fe=t||v.csp;GVe(Ut,fe);const Re=t6t(b,v.theme),Je={csp:fe,autoInsertSpaceInButton:i,alert:r,anchor:o,locale:a||m,direction:c,space:u,virtual:d,popupMatchSelectWidth:f??h,popupOverflow:g,getPrefixCls:At,iconPrefixCls:Ut,theme:Re,segmented:C,statistic:x,spin:E,calendar:k,carousel:L,cascader:D,collapse:A,typography:O,checkbox:P,descriptions:F,divider:B,drawer:M,skeleton:V,steps:U,image:W,input:je,layout:q,list:H,mentions:ie,modal:se,progress:Q,result:Ee,slider:Fe,breadcrumb:He,menu:ke,pagination:Me,empty:qe,badge:Be,radio:_t,rate:Wt,switch:Tt,transfer:rn,avatar:_n,message:wt,tag:pt,table:ot,card:we,tabs:Se,timeline:re,timePicker:Y,upload:Z,notification:le,tree:te,colorPicker:me,datePicker:Oe,flex:et,wave:Et,warning:Qe},Ot=Object.assign({},v);Object.keys(Je).forEach(zn=>{Je[zn]!==void 0&&(Ot[zn]=Je[zn])}),x6t.forEach(zn=>{const Tn=n[zn];Tn&&(Ot[zn]=Tn)});const Ft=OF(()=>Ot,Ot,(zn,Tn)=>{const pi=Object.keys(zn),Ei=Object.keys(Tn);return pi.length!==Ei.length||pi.some($i=>zn[$i]!==Tn[$i])}),jt=w.useMemo(()=>({prefixCls:Ut,csp:fe}),[Ut,fe]);let Jt=w.createElement(w.Fragment,null,w.createElement(S6t,{dropdownMatchSelectWidth:h}),e);const ei=w.useMemo(()=>{var zn,Tn,pi,Ei;return q2(((zn=JD.Form)===null||zn===void 0?void 0:zn.defaultValidateMessages)||{},((pi=(Tn=Ft.locale)===null||Tn===void 0?void 0:Tn.Form)===null||pi===void 0?void 0:pi.defaultValidateMessages)||{},((Ei=Ft.form)===null||Ei===void 0?void 0:Ei.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[Ft,s==null?void 0:s.validateMessages]);Object.keys(ei).length>0&&(Jt=w.createElement(j5t.Provider,{value:ei},Jt)),a&&(Jt=w.createElement(nFt,{locale:a,_ANT_MARK__:eFt},Jt)),(Ut||fe)&&(Jt=w.createElement(a_e.Provider,{value:jt},Jt)),l&&(Jt=w.createElement($Ft,{size:l},Jt)),Jt=w.createElement(w6t,null,Jt);const sr=w.useMemo(()=>{const zn=Re||{},{algorithm:Tn,token:pi,components:Ei}=zn,$i=E6t(zn,["algorithm","token","components"]),Pr=Tn&&(!Array.isArray(Tn)||Tn.length>0)?Noe(Tn):HVe,ro={};Object.entries(Ei||{}).forEach(oo=>{let[ta,Mr]=oo;const er=Object.assign({},Mr);"algorithm"in er&&(er.algorithm===!0?er.theme=Pr:(Array.isArray(er.algorithm)||typeof er.algorithm=="function")&&(er.theme=Noe(er.algorithm)),delete er.algorithm),ro[ta]=er});const Vo=Object.assign(Object.assign({},V4),pi);return Object.assign(Object.assign({},$i),{theme:Pr,token:Vo,components:ro,override:Object.assign({override:Vo},ro)})},[Re]);return b&&(Jt=w.createElement(zVe.Provider,{value:sr},Jt)),Ft.warning&&(Jt=w.createElement(U5t.Provider,{value:Ft.warning},Jt)),y!==void 0&&(Jt=w.createElement(BFt,{disabled:y},Jt)),w.createElement(Gm.Provider,{value:Ft},Jt)},NN=n=>{const e=w.useContext(Gm),t=w.useContext(l_e);return w.createElement(D6t,Object.assign({parentContext:e,legacyLocale:t},n))};NN.ConfigContext=Gm;NN.SizeContext=Pq;NN.config=L6t;NN.useConfig=VFt;Object.defineProperty(NN,"SizeContext",{get:()=>Pq});const u_e=NN;function sHe(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}function A6t(n){return sHe(n)instanceof ShadowRoot}function jH(n){return A6t(n)?sHe(n):null}function N6t(n){return n.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function R6t(n,e){Nd(n,"[@ant-design/icons] ".concat(e))}function OIe(n){return Qr(n)==="object"&&typeof n.name=="string"&&typeof n.theme=="string"&&(Qr(n.icon)==="object"||typeof n.icon=="function")}function PIe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(n).reduce(function(e,t){var i=n[t];switch(t){case"class":e.className=i,delete e.class;break;default:delete e[t],e[N6t(t)]=i}return e},{})}function Uoe(n,e,t){return t?ae.createElement(n.tag,ct(ct({key:e},PIe(n.attrs)),t),(n.children||[]).map(function(i,r){return Uoe(i,"".concat(e,"-").concat(n.tag,"-").concat(r))})):ae.createElement(n.tag,ct({key:e},PIe(n.attrs)),(n.children||[]).map(function(i,r){return Uoe(i,"".concat(e,"-").concat(n.tag,"-").concat(r))}))}function aHe(n){return MT(n)[0]}function lHe(n){return n?Array.isArray(n)?n:[n]:[]}var O6t=` .anticon { display: inline-block; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,P6t=function(e){var t=w.useContext(a_e),i=t.csp,r=t.prefixCls,o=O6t;r&&(o=o.replace(/anticon/g,r)),w.useEffect(function(){var s=e.current,a=jH(s);ZD(o,"@ant-design-icons",{prepend:!0,csp:i,attachTo:a})},[])},M6t=["icon","className","onClick","style","primaryColor","secondaryColor"],JP={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function F6t(n){var e=n.primaryColor,t=n.secondaryColor;JP.primaryColor=e,JP.secondaryColor=t||aHe(e),JP.calculated=!!t}function B6t(){return ct({},JP)}var Mq=function(e){var t=e.icon,i=e.className,r=e.onClick,o=e.style,s=e.primaryColor,a=e.secondaryColor,l=Qu(e,M6t),c=w.useRef(),u=JP;if(s&&(u={primaryColor:s,secondaryColor:a||aHe(s)}),P6t(c),R6t(OIe(t),"icon should be icon definiton, but got ".concat(t)),!OIe(t))return null;var d=t;return d&&typeof d.icon=="function"&&(d=ct(ct({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),Uoe(d.icon,"svg-".concat(d.name),ct(ct({className:i,onClick:r,style:o,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};Mq.displayName="IconReact";Mq.getTwoToneColors=B6t;Mq.setTwoToneColors=F6t;const d_e=Mq;function cHe(n){var e=lHe(n),t=ln(e,2),i=t[0],r=t[1];return d_e.setTwoToneColors({primaryColor:i,secondaryColor:r})}function $6t(){var n=d_e.getTwoToneColors();return n.calculated?[n.primaryColor,n.secondaryColor]:n.primaryColor}var V6t=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];cHe(bFt.primary);var Fq=w.forwardRef(function(n,e){var t,i=n.className,r=n.icon,o=n.spin,s=n.rotate,a=n.tabIndex,l=n.onClick,c=n.twoToneColor,u=Qu(n,V6t),d=w.useContext(a_e),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,m=Nt(g,f,(t={},Ze(t,"".concat(f,"-").concat(r.name),!!r.name),Ze(t,"".concat(f,"-spin"),!!o||r.name==="loading"),t),i),v=a;v===void 0&&l&&(v=-1);var _=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,b=lHe(c),y=ln(b,2),C=y[0],x=y[1];return w.createElement("span",Ct({role:"img","aria-label":r.name},u,{ref:e,tabIndex:v,onClick:l,className:m}),w.createElement(d_e,{icon:r,primaryColor:C,secondaryColor:x,style:_}))});Fq.displayName="AntdIcon";Fq.getTwoToneColor=$6t;Fq.setTwoToneColor=cHe;const BF=Fq;var H6t={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"};const W6t=H6t;var z6t=function(e,t){return w.createElement(BF,Ct({},e,{ref:t,icon:W6t}))};const uHe=w.forwardRef(z6t);var U6t=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name noValidate nonce open optimum pattern placeholder poster preload radioGroup readOnly rel required reversed role rowSpan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap`,j6t=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,q6t="".concat(U6t," ").concat(j6t).split(/[\s\n]+/),K6t="aria-",G6t="data-";function MIe(n,e){return n.indexOf(e)===0}function dHe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=ct({},e);var i={};return Object.keys(n).forEach(function(r){(t.aria&&(r==="role"||MIe(r,K6t))||t.data&&MIe(r,G6t)||t.attr&&q6t.includes(r))&&(i[r]=n[r])}),i}const{isValidElement:hHe}=Am;function Y6t(n){return n&&hHe(n)&&n.type===w.Fragment}function Q6t(n,e,t){return hHe(n)?w.cloneElement(n,typeof t=="function"?t(n.props||{}):t):e}function fHe(n,e){return Q6t(n,n,e)}var Jn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=Jn.F1&&t<=Jn.F12)return!1;switch(t){case Jn.ALT:case Jn.CAPS_LOCK:case Jn.CONTEXT_MENU:case Jn.CTRL:case Jn.DOWN:case Jn.END:case Jn.ESC:case Jn.HOME:case Jn.INSERT:case Jn.LEFT:case Jn.MAC_FF_META:case Jn.META:case Jn.NUMLOCK:case Jn.NUM_CENTER:case Jn.PAGE_DOWN:case Jn.PAGE_UP:case Jn.PAUSE:case Jn.PRINT_SCREEN:case Jn.RIGHT:case Jn.SHIFT:case Jn.UP:case Jn.WIN_KEY:case Jn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=Jn.ZERO&&e<=Jn.NINE||e>=Jn.NUM_ZERO&&e<=Jn.NUM_MULTIPLY||e>=Jn.A&&e<=Jn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case Jn.SPACE:case Jn.QUESTION_MARK:case Jn.NUM_PLUS:case Jn.NUM_MINUS:case Jn.NUM_PERIOD:case Jn.NUM_DIVISION:case Jn.SEMICOLON:case Jn.DASH:case Jn.EQUALS:case Jn.COMMA:case Jn.PERIOD:case Jn.SLASH:case Jn.APOSTROPHE:case Jn.SINGLE_QUOTE:case Jn.OPEN_SQUARE_BRACKET:case Jn.BACKSLASH:case Jn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},X6t={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const Z6t=X6t;var J6t=function(e,t){return w.createElement(BF,Ct({},e,{ref:t,icon:Z6t}))};const eBt=w.forwardRef(J6t);function Yh(){Yh=function(){return e};var n,e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(V,U,W){V[U]=W.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(V,U,W){return Object.defineProperty(V,U,{value:W,enumerable:!0,configurable:!0,writable:!0}),V[U]}try{c({},"")}catch{c=function(W,q,H){return W[q]=H}}function u(V,U,W,q){var H=U&&U.prototype instanceof _?U:_,ie=Object.create(H.prototype),se=new B(q||[]);return r(ie,"_invoke",{value:A(V,W,se)}),ie}function d(V,U,W){try{return{type:"normal",arg:V.call(U,W)}}catch(q){return{type:"throw",arg:q}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function _(){}function b(){}function y(){}var C={};c(C,s,function(){return this});var x=Object.getPrototypeOf,E=x&&x(x(M([])));E&&E!==t&&i.call(E,s)&&(C=E);var k=y.prototype=_.prototype=Object.create(C);function L(V){["next","throw","return"].forEach(function(U){c(V,U,function(W){return this._invoke(U,W)})})}function D(V,U){function W(H,ie,se,Q){var Ee=d(V[H],V,ie);if(Ee.type!=="throw"){var Fe=Ee.arg,He=Fe.value;return He&&Qr(He)=="object"&&i.call(He,"__await")?U.resolve(He.__await).then(function(ke){W("next",ke,se,Q)},function(ke){W("throw",ke,se,Q)}):U.resolve(He).then(function(ke){Fe.value=ke,se(Fe)},function(ke){return W("throw",ke,se,Q)})}Q(Ee.arg)}var q;r(this,"_invoke",{value:function(ie,se){function Q(){return new U(function(Ee,Fe){W(ie,se,Ee,Fe)})}return q=q?q.then(Q,Q):Q()}})}function A(V,U,W){var q=h;return function(H,ie){if(q===g)throw new Error("Generator is already running");if(q===m){if(H==="throw")throw ie;return{value:n,done:!0}}for(W.method=H,W.arg=ie;;){var se=W.delegate;if(se){var Q=O(se,W);if(Q){if(Q===v)continue;return Q}}if(W.method==="next")W.sent=W._sent=W.arg;else if(W.method==="throw"){if(q===h)throw q=m,W.arg;W.dispatchException(W.arg)}else W.method==="return"&&W.abrupt("return",W.arg);q=g;var Ee=d(V,U,W);if(Ee.type==="normal"){if(q=W.done?m:f,Ee.arg===v)continue;return{value:Ee.arg,done:W.done}}Ee.type==="throw"&&(q=m,W.method="throw",W.arg=Ee.arg)}}}function O(V,U){var W=U.method,q=V.iterator[W];if(q===n)return U.delegate=null,W==="throw"&&V.iterator.return&&(U.method="return",U.arg=n,O(V,U),U.method==="throw")||W!=="return"&&(U.method="throw",U.arg=new TypeError("The iterator does not provide a '"+W+"' method")),v;var H=d(q,V.iterator,U.arg);if(H.type==="throw")return U.method="throw",U.arg=H.arg,U.delegate=null,v;var ie=H.arg;return ie?ie.done?(U[V.resultName]=ie.value,U.next=V.nextLoc,U.method!=="return"&&(U.method="next",U.arg=n),U.delegate=null,v):ie:(U.method="throw",U.arg=new TypeError("iterator result is not an object"),U.delegate=null,v)}function P(V){var U={tryLoc:V[0]};1 in V&&(U.catchLoc=V[1]),2 in V&&(U.finallyLoc=V[2],U.afterLoc=V[3]),this.tryEntries.push(U)}function F(V){var U=V.completion||{};U.type="normal",delete U.arg,V.completion=U}function B(V){this.tryEntries=[{tryLoc:"root"}],V.forEach(P,this),this.reset(!0)}function M(V){if(V||V===""){var U=V[s];if(U)return U.call(V);if(typeof V.next=="function")return V;if(!isNaN(V.length)){var W=-1,q=function H(){for(;++W<V.length;)if(i.call(V,W))return H.value=V[W],H.done=!1,H;return H.value=n,H.done=!0,H};return q.next=q}}throw new TypeError(Qr(V)+" is not iterable")}return b.prototype=y,r(k,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:b,configurable:!0}),b.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(V){var U=typeof V=="function"&&V.constructor;return!!U&&(U===b||(U.displayName||U.name)==="GeneratorFunction")},e.mark=function(V){return Object.setPrototypeOf?Object.setPrototypeOf(V,y):(V.__proto__=y,c(V,l,"GeneratorFunction")),V.prototype=Object.create(k),V},e.awrap=function(V){return{__await:V}},L(D.prototype),c(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(V,U,W,q,H){H===void 0&&(H=Promise);var ie=new D(u(V,U,W,q),H);return e.isGeneratorFunction(U)?ie:ie.next().then(function(se){return se.done?se.value:ie.next()})},L(k),c(k,l,"Generator"),c(k,s,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(V){var U=Object(V),W=[];for(var q in U)W.push(q);return W.reverse(),function H(){for(;W.length;){var ie=W.pop();if(ie in U)return H.value=ie,H.done=!1,H}return H.done=!0,H}},e.values=M,B.prototype={constructor:B,reset:function(U){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(F),!U)for(var W in this)W.charAt(0)==="t"&&i.call(this,W)&&!isNaN(+W.slice(1))&&(this[W]=n)},stop:function(){this.done=!0;var U=this.tryEntries[0].completion;if(U.type==="throw")throw U.arg;return this.rval},dispatchException:function(U){if(this.done)throw U;var W=this;function q(Fe,He){return se.type="throw",se.arg=U,W.next=Fe,He&&(W.method="next",W.arg=n),!!He}for(var H=this.tryEntries.length-1;H>=0;--H){var ie=this.tryEntries[H],se=ie.completion;if(ie.tryLoc==="root")return q("end");if(ie.tryLoc<=this.prev){var Q=i.call(ie,"catchLoc"),Ee=i.call(ie,"finallyLoc");if(Q&&Ee){if(this.prev<ie.catchLoc)return q(ie.catchLoc,!0);if(this.prev<ie.finallyLoc)return q(ie.finallyLoc)}else if(Q){if(this.prev<ie.catchLoc)return q(ie.catchLoc,!0)}else{if(!Ee)throw new Error("try statement without catch or finally");if(this.prev<ie.finallyLoc)return q(ie.finallyLoc)}}}},abrupt:function(U,W){for(var q=this.tryEntries.length-1;q>=0;--q){var H=this.tryEntries[q];if(H.tryLoc<=this.prev&&i.call(H,"finallyLoc")&&this.prev<H.finallyLoc){var ie=H;break}}ie&&(U==="break"||U==="continue")&&ie.tryLoc<=W&&W<=ie.finallyLoc&&(ie=null);var se=ie?ie.completion:{};return se.type=U,se.arg=W,ie?(this.method="next",this.next=ie.finallyLoc,v):this.complete(se)},complete:function(U,W){if(U.type==="throw")throw U.arg;return U.type==="break"||U.type==="continue"?this.next=U.arg:U.type==="return"?(this.rval=this.arg=U.arg,this.method="return",this.next="end"):U.type==="normal"&&W&&(this.next=W),v},finish:function(U){for(var W=this.tryEntries.length-1;W>=0;--W){var q=this.tryEntries[W];if(q.finallyLoc===U)return this.complete(q.completion,q.afterLoc),F(q),v}},catch:function(U){for(var W=this.tryEntries.length-1;W>=0;--W){var q=this.tryEntries[W];if(q.tryLoc===U){var H=q.completion;if(H.type==="throw"){var ie=H.arg;F(q)}return ie}}throw new Error("illegal catch attempt")},delegateYield:function(U,W,q){return this.delegate={iterator:M(U),resultName:W,nextLoc:q},this.method==="next"&&(this.arg=n),v}},e}function FIe(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(i,r)}function Uk(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){FIe(o,i,r,s,a,"next",l)}function a(l){FIe(o,i,r,s,a,"throw",l)}s(void 0)})}}var $F=ct({},cgt),tBt=$F.version,nBt=$F.render,iBt=$F.unmountComponentAtNode,Bq;try{var rBt=Number((tBt||"").split(".")[0]);rBt>=18&&(Bq=$F.createRoot)}catch{}function BIe(n){var e=$F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Qr(e)==="object"&&(e.usingClientEntryPoint=n)}var qH="__rc_react_root__";function oBt(n,e){BIe(!0);var t=e[qH]||Bq(e);BIe(!1),t.render(n),e[qH]=t}function sBt(n,e){nBt(n,e)}function aBt(n,e){if(Bq){oBt(n,e);return}sBt(n,e)}function lBt(n){return joe.apply(this,arguments)}function joe(){return joe=Uk(Yh().mark(function n(e){return Yh().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.resolve().then(function(){var r;(r=e[qH])===null||r===void 0||r.unmount(),delete e[qH]}));case 1:case"end":return i.stop()}},n)})),joe.apply(this,arguments)}function cBt(n){iBt(n)}function uBt(n){return qoe.apply(this,arguments)}function qoe(){return qoe=Uk(Yh().mark(function n(e){return Yh().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(Bq===void 0){i.next=2;break}return i.abrupt("return",lBt(e));case 2:cBt(e);case 3:case"end":return i.stop()}},n)})),qoe.apply(this,arguments)}const h_e=function(n){if(!n)return!1;if(n instanceof Element){if(n.offsetParent)return!0;if(n.getBBox){var e=n.getBBox(),t=e.width,i=e.height;if(t||i)return!0}if(n.getBoundingClientRect){var r=n.getBoundingClientRect(),o=r.width,s=r.height;if(o||s)return!0}}return!1},dBt=n=>{const{componentCls:e,colorPrimary:t}=n;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${n.motionEaseOutCirc}`,`opacity 2s ${n.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow 0.3s ${n.motionEaseInOut}`,`opacity 0.35s ${n.motionEaseInOut}`].join(",")}}}}},hBt=AN("Wave",n=>[dBt(n)]);function fBt(n){const e=(n||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function hJ(n){return n&&n!=="#fff"&&n!=="#ffffff"&&n!=="rgb(255, 255, 255)"&&n!=="rgba(255, 255, 255, 1)"&&fBt(n)&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&n!=="transparent"}function pBt(n){const{borderTopColor:e,borderColor:t,backgroundColor:i}=getComputedStyle(n);return hJ(e)?e:hJ(t)?t:hJ(i)?i:null}const pHe="ant-wave-target";function fJ(n){return Number.isNaN(n)?0:n}const gBt=n=>{const{className:e,target:t,component:i}=n,r=w.useRef(null),[o,s]=w.useState(null),[a,l]=w.useState([]),[c,u]=w.useState(0),[d,h]=w.useState(0),[f,g]=w.useState(0),[m,v]=w.useState(0),[_,b]=w.useState(!1),y={left:c,top:d,width:f,height:m,borderRadius:a.map(E=>`${E}px`).join(" ")};o&&(y["--wave-color"]=o);function C(){const E=getComputedStyle(t);s(pBt(t));const k=E.position==="static",{borderLeftWidth:L,borderTopWidth:D}=E;u(k?t.offsetLeft:fJ(-parseFloat(L))),h(k?t.offsetTop:fJ(-parseFloat(D))),g(t.offsetWidth),v(t.offsetHeight);const{borderTopLeftRadius:A,borderTopRightRadius:O,borderBottomLeftRadius:P,borderBottomRightRadius:F}=E;l([A,O,F,P].map(B=>fJ(parseFloat(B))))}if(w.useEffect(()=>{if(t){const E=Qf(()=>{C(),b(!0)});let k;return typeof ResizeObserver<"u"&&(k=new ResizeObserver(C),k.observe(t)),()=>{Qf.cancel(E),k==null||k.disconnect()}}},[]),!_)return null;const x=(i==="Checkbox"||i==="Radio")&&(t==null?void 0:t.classList.contains(pHe));return w.createElement(FF,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(E,k)=>{var L;if(k.deadline||k.propertyName==="opacity"){const D=(L=r.current)===null||L===void 0?void 0:L.parentElement;uBt(D).then(()=>{D==null||D.remove()})}return!1}},E=>{let{className:k}=E;return w.createElement("div",{ref:r,className:Nt(e,{"wave-quick":x},k),style:y})})},mBt=(n,e)=>{var t;const{component:i}=e;if(i==="Checkbox"&&!(!((t=n.querySelector("input"))===null||t===void 0)&&t.checked))return;const r=document.createElement("div");r.style.position="absolute",r.style.left="0px",r.style.top="0px",n==null||n.insertBefore(r,n==null?void 0:n.firstChild),aBt(w.createElement(gBt,Object.assign({},e,{target:n})),r)},_Bt=mBt;function vBt(n,e,t){const{wave:i}=w.useContext(Gm),[,r,o]=MF(),s=M_(c=>{const u=n.current;if(i!=null&&i.disabled||!u)return;const d=u.querySelector(`.${pHe}`)||u,{showEffect:h}=i||{};(h||_Bt)(d,{className:e,token:r,component:t,event:c,hashId:o})}),a=w.useRef();return c=>{Qf.cancel(a.current),a.current=Qf(()=>{s(c)})}}const bBt=n=>{const{children:e,disabled:t,component:i}=n,{getPrefixCls:r}=w.useContext(Gm),o=w.useRef(null),s=r("wave"),[,a]=hBt(s),l=vBt(o,Nt(s,a),i);if(ae.useEffect(()=>{const u=o.current;if(!u||u.nodeType!==1||t)return;const d=h=>{!h_e(h.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||l(h)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[t]),!ae.isValidElement(e))return e??null;const c=PF(e)?Aq(e.ref,o):o;return fHe(e,{ref:c})},yBt=bBt,CBt=n=>{const e=ae.useContext(Pq);return ae.useMemo(()=>n?typeof n=="string"?n??e:n instanceof Function?n(e):e:e,[n,e])},f_e=CBt;globalThis&&globalThis.__rest;const wBt=w.createContext(null),p_e=(n,e)=>{const t=w.useContext(wBt),i=w.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:o,isLastItem:s}=t,a=r==="vertical"?"-vertical-":"-";return Nt(`${n}-compact${a}item`,{[`${n}-compact${a}first-item`]:o,[`${n}-compact${a}last-item`]:s,[`${n}-compact${a}item-rtl`]:e==="rtl"})},[n,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:i}};var SBt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const gHe=w.createContext(void 0),EBt=n=>{const{getPrefixCls:e,direction:t}=w.useContext(Gm),{prefixCls:i,size:r,className:o}=n,s=SBt(n,["prefixCls","size","className"]),a=e("btn-group",i),[,,l]=MF();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=Nt(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},o,l);return w.createElement(gHe.Provider,{value:r},w.createElement("div",Object.assign({},s,{className:u})))},xBt=EBt,$Ie=/^[\u4e00-\u9fa5]{2}$/,Koe=$Ie.test.bind($Ie);function VIe(n){return typeof n=="string"}function pJ(n){return n==="text"||n==="link"}function TBt(n,e){if(n==null)return;const t=e?" ":"";return typeof n!="string"&&typeof n!="number"&&VIe(n.type)&&Koe(n.props.children)?fHe(n,{children:n.props.children.split("").join(t)}):VIe(n)?Koe(n)?ae.createElement("span",null,n.split("").join(t)):ae.createElement("span",null,n):Y6t(n)?ae.createElement("span",null,n):n}function kBt(n,e){let t=!1;const i=[];return ae.Children.forEach(n,r=>{const o=typeof r,s=o==="string"||o==="number";if(t&&s){const a=i.length-1,l=i[a];i[a]=`${l}${r}`}else i.push(r);t=s}),ae.Children.map(i,r=>TBt(r,e))}const IBt=w.forwardRef((n,e)=>{const{className:t,style:i,children:r,prefixCls:o}=n,s=Nt(`${o}-icon`,t);return ae.createElement("span",{ref:e,className:s,style:i},r)}),mHe=IBt,HIe=w.forwardRef((n,e)=>{let{prefixCls:t,className:i,style:r,iconClassName:o}=n;const s=Nt(`${t}-loading-icon`,i);return ae.createElement(mHe,{prefixCls:t,className:s,style:r,ref:e},ae.createElement(eBt,{className:o}))}),gJ=()=>({width:0,opacity:0,transform:"scale(0)"}),mJ=n=>({width:n.scrollWidth,opacity:1,transform:"scale(1)"}),LBt=n=>{const{prefixCls:e,loading:t,existIcon:i,className:r,style:o}=n,s=!!t;return i?ae.createElement(HIe,{prefixCls:e,className:r,style:o}):ae.createElement(FF,{visible:s,motionName:`${e}-loading-icon-motion`,motionLeave:s,removeOnLeave:!0,onAppearStart:gJ,onAppearActive:mJ,onEnterStart:gJ,onEnterActive:mJ,onLeaveStart:mJ,onLeaveActive:gJ},(a,l)=>{let{className:c,style:u}=a;return ae.createElement(HIe,{prefixCls:e,className:r,style:Object.assign(Object.assign({},o),u),ref:l,iconClassName:c})})},DBt=LBt,WIe=(n,e)=>({[`> span, > ${n}`]:{"&:not(:last-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),ABt=n=>{const{componentCls:e,fontSize:t,lineWidth:i,groupBorderColor:r,colorErrorHover:o}=n;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-i,[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,"&:hover,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},WIe(`${e}-primary`,r),WIe(`${e}-danger`,o)]}},NBt=ABt,RBt=n=>{const{componentCls:e,iconCls:t,fontWeight:i}=n;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:i,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",backgroundColor:"transparent",border:`${n.lineWidth}px ${n.lineType} transparent`,cursor:"pointer",transition:`all ${n.motionDurationMid} ${n.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",lineHeight:n.lineHeight,color:n.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:n.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:n.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},QFt(n)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${t})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"},[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-n.lineWidth,insetInlineStart:-n.lineWidth,display:"inline-block",width:n.lineWidth,height:`calc(100% + ${n.lineWidth*2}px)`,backgroundColor:n.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-n.lineWidth,insetInlineStart:-n.lineWidth,display:"inline-block",width:`calc(100% + ${n.lineWidth*2}px)`,height:n.lineWidth,backgroundColor:n.colorPrimaryHover,content:'""'}}}}}}},m1=(n,e,t)=>({[`&:not(:disabled):not(${n}-disabled)`]:{"&:hover":e,"&:active":t}}),OBt=n=>({minWidth:n.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),PBt=n=>({borderRadius:n.controlHeight,paddingInlineStart:n.controlHeight/2,paddingInlineEnd:n.controlHeight/2}),MBt=n=>({cursor:"not-allowed",borderColor:n.borderColorDisabled,color:n.colorTextDisabled,backgroundColor:n.colorBgContainerDisabled,boxShadow:"none"}),W4=(n,e,t,i,r,o,s,a)=>({[`&${n}-background-ghost`]:Object.assign(Object.assign({color:t||void 0,backgroundColor:e,borderColor:i||void 0,boxShadow:"none"},m1(n,Object.assign({backgroundColor:e},s),Object.assign({backgroundColor:e},a))),{"&:disabled":{cursor:"not-allowed",color:r||void 0,borderColor:o||void 0}})}),g_e=n=>({[`&:disabled, &${n.componentCls}-disabled`]:Object.assign({},MBt(n))}),_He=n=>Object.assign({},g_e(n)),KH=n=>({[`&:disabled, &${n.componentCls}-disabled`]:{cursor:"not-allowed",color:n.colorTextDisabled}}),vHe=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_He(n)),{backgroundColor:n.defaultBg,borderColor:n.defaultBorderColor,color:n.defaultColor,boxShadow:n.defaultShadow}),m1(n.componentCls,{color:n.colorPrimaryHover,borderColor:n.colorPrimaryHover},{color:n.colorPrimaryActive,borderColor:n.colorPrimaryActive})),W4(n.componentCls,n.ghostBg,n.defaultGhostColor,n.defaultGhostBorderColor,n.colorTextDisabled,n.colorBorder)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:n.colorError,borderColor:n.colorError},m1(n.componentCls,{color:n.colorErrorHover,borderColor:n.colorErrorBorderHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),W4(n.componentCls,n.ghostBg,n.colorError,n.colorError,n.colorTextDisabled,n.colorBorder)),g_e(n))}),FBt=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_He(n)),{color:n.primaryColor,backgroundColor:n.colorPrimary,boxShadow:n.primaryShadow}),m1(n.componentCls,{color:n.colorTextLightSolid,backgroundColor:n.colorPrimaryHover},{color:n.colorTextLightSolid,backgroundColor:n.colorPrimaryActive})),W4(n.componentCls,n.ghostBg,n.colorPrimary,n.colorPrimary,n.colorTextDisabled,n.colorBorder,{color:n.colorPrimaryHover,borderColor:n.colorPrimaryHover},{color:n.colorPrimaryActive,borderColor:n.colorPrimaryActive})),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({backgroundColor:n.colorError,boxShadow:n.dangerShadow,color:n.dangerColor},m1(n.componentCls,{backgroundColor:n.colorErrorHover},{backgroundColor:n.colorErrorActive})),W4(n.componentCls,n.ghostBg,n.colorError,n.colorError,n.colorTextDisabled,n.colorBorder,{color:n.colorErrorHover,borderColor:n.colorErrorHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),g_e(n))}),BBt=n=>Object.assign(Object.assign({},vHe(n)),{borderStyle:"dashed"}),$Bt=n=>Object.assign(Object.assign(Object.assign({color:n.colorLink},m1(n.componentCls,{color:n.colorLinkHover,backgroundColor:n.linkHoverBg},{color:n.colorLinkActive})),KH(n)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign({color:n.colorError},m1(n.componentCls,{color:n.colorErrorHover},{color:n.colorErrorActive})),KH(n))}),VBt=n=>Object.assign(Object.assign(Object.assign({},m1(n.componentCls,{color:n.colorText,backgroundColor:n.textHoverBg},{color:n.colorText,backgroundColor:n.colorBgTextActive})),KH(n)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign({color:n.colorError},KH(n)),m1(n.componentCls,{color:n.colorErrorHover,backgroundColor:n.colorErrorBg},{color:n.colorErrorHover,backgroundColor:n.colorErrorBg}))}),HBt=n=>{const{componentCls:e}=n;return{[`${e}-default`]:vHe(n),[`${e}-primary`]:FBt(n),[`${e}-dashed`]:BBt(n),[`${e}-link`]:$Bt(n),[`${e}-text`]:VBt(n),[`${e}-ghost`]:W4(n.componentCls,n.ghostBg,n.colorBgContainer,n.colorBgContainer,n.colorTextDisabled,n.colorBorder)}},m_e=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,controlHeight:i,fontSize:r,lineHeight:o,lineWidth:s,borderRadius:a,buttonPaddingHorizontal:l,iconCls:c}=n,u=Math.max(0,(i-r*o)/2-s),d=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:r,height:i,padding:`${u}px ${l}px`,borderRadius:a,[`&${d}`]:{width:i,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},[c]:{fontSize:n.buttonIconOnlyFontSize}},[`&${t}-loading`]:{opacity:n.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${n.motionDurationSlow} ${n.motionEaseInOut}, opacity ${n.motionDurationSlow} ${n.motionEaseInOut}`}}},{[`${t}${t}-circle${e}`]:OBt(n)},{[`${t}${t}-round${e}`]:PBt(n)}]},WBt=n=>m_e(Gh(n,{fontSize:n.contentFontSize})),zBt=n=>{const e=Gh(n,{controlHeight:n.controlHeightSM,fontSize:n.contentFontSizeSM,padding:n.paddingXS,buttonPaddingHorizontal:n.paddingInlineSM,borderRadius:n.borderRadiusSM,buttonIconOnlyFontSize:n.onlyIconSizeSM});return m_e(e,`${n.componentCls}-sm`)},UBt=n=>{const e=Gh(n,{controlHeight:n.controlHeightLG,fontSize:n.contentFontSizeLG,buttonPaddingHorizontal:n.paddingInlineLG,borderRadius:n.borderRadiusLG,buttonIconOnlyFontSize:n.onlyIconSizeLG});return m_e(e,`${n.componentCls}-lg`)},jBt=n=>{const{componentCls:e}=n;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},bHe=n=>{const{paddingInline:e,onlyIconSize:t}=n;return Gh(n,{buttonPaddingHorizontal:e,buttonIconOnlyFontSize:t})},yHe=n=>({fontWeight:400,defaultShadow:`0 ${n.controlOutlineWidth}px 0 ${n.controlTmpOutline}`,primaryShadow:`0 ${n.controlOutlineWidth}px 0 ${n.controlOutline}`,dangerShadow:`0 ${n.controlOutlineWidth}px 0 ${n.colorErrorOutline}`,primaryColor:n.colorTextLightSolid,dangerColor:n.colorTextLightSolid,borderColorDisabled:n.colorBorder,defaultGhostColor:n.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:n.colorBgContainer,paddingInline:n.paddingContentHorizontal-n.lineWidth,paddingInlineLG:n.paddingContentHorizontal-n.lineWidth,paddingInlineSM:8-n.lineWidth,onlyIconSize:n.fontSizeLG,onlyIconSizeSM:n.fontSizeLG-2,onlyIconSizeLG:n.fontSizeLG+2,groupBorderColor:n.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:n.colorBgTextHover,defaultColor:n.colorText,defaultBg:n.colorBgContainer,defaultBorderColor:n.colorBorder,defaultBorderColorDisabled:n.colorBorder,contentFontSize:n.fontSize,contentFontSizeSM:n.fontSize,contentFontSizeLG:n.fontSizeLG}),qBt=AN("Button",n=>{const e=bHe(n);return[RBt(e),zBt(e),WBt(e),UBt(e),jBt(e),HBt(e),NBt(e)]},yHe);function KBt(n,e,t){const{focusElCls:i,focus:r,borderElCls:o}=t,s=o?"> *":"",a=["hover",r?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:-n.lineWidth},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},i?{[`&${i}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function GBt(n,e,t){const{borderElCls:i}=t,r=i?`> ${i}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${n}-sm ${r}, &${n}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${n}-sm ${r}, &${n}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function __e(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=n,i=`${t}-compact`;return{[i]:Object.assign(Object.assign({},KBt(n,i,e)),GBt(t,i,e))}}function YBt(n,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:-n.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function QBt(n,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function XBt(n){const e=`${n.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},YBt(n,e)),QBt(n.componentCls,e))}}const ZBt=e6t(["Button","compact"],n=>{const e=bHe(n);return[__e(e),XBt(e)]},yHe);var JBt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function e8t(n){if(typeof n=="object"&&n){let e=n==null?void 0:n.delay;return e=!Number.isNaN(e)&&typeof e=="number"?e:0,{loading:e<=0,delay:e}}return{loading:!!n,delay:0}}const t8t=(n,e)=>{var t,i;const{loading:r=!1,prefixCls:o,type:s="default",danger:a,shape:l="default",size:c,styles:u,disabled:d,className:h,rootClassName:f,children:g,icon:m,ghost:v=!1,block:_=!1,htmlType:b="button",classNames:y,style:C={}}=n,x=JBt(n,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:E,autoInsertSpaceInButton:k,direction:L,button:D}=w.useContext(Gm),A=E("btn",o),[O,P]=qBt(A),F=w.useContext(Oq),B=d??F,M=w.useContext(gHe),V=w.useMemo(()=>e8t(r),[r]),[U,W]=w.useState(V.loading),[q,H]=w.useState(!1),se=Aq(e,w.createRef()),Q=w.Children.count(g)===1&&!m&&!pJ(s);w.useEffect(()=>{let we=null;V.delay>0?we=setTimeout(()=>{we=null,W(!0)},V.delay):W(V.loading);function Se(){we&&(clearTimeout(we),we=null)}return Se},[V]),w.useEffect(()=>{if(!se||!se.current||k===!1)return;const we=se.current.textContent;Q&&Koe(we)?q||H(!0):q&&H(!1)},[se]);const Ee=we=>{const{onClick:Se}=n;if(U||B){we.preventDefault();return}Se==null||Se(we)},Fe=k!==!1,{compactSize:He,compactItemClassnames:ke}=p_e(A,L),Me={large:"lg",small:"sm",middle:void 0},je=f_e(we=>{var Se,re;return(re=(Se=c??He)!==null&&Se!==void 0?Se:M)!==null&&re!==void 0?re:we}),qe=je&&Me[je]||"",Be=U?"loading":m,_t=n5t(x,["navigate"]),Wt=Nt(A,P,{[`${A}-${l}`]:l!=="default"&&l,[`${A}-${s}`]:s,[`${A}-${qe}`]:qe,[`${A}-icon-only`]:!g&&g!==0&&!!Be,[`${A}-background-ghost`]:v&&!pJ(s),[`${A}-loading`]:U,[`${A}-two-chinese-chars`]:q&&Fe&&!U,[`${A}-block`]:_,[`${A}-dangerous`]:!!a,[`${A}-rtl`]:L==="rtl"},ke,h,f,D==null?void 0:D.className),Tt=Object.assign(Object.assign({},D==null?void 0:D.style),C),rn=Nt(y==null?void 0:y.icon,(t=D==null?void 0:D.classNames)===null||t===void 0?void 0:t.icon),_n=Object.assign(Object.assign({},(u==null?void 0:u.icon)||{}),((i=D==null?void 0:D.styles)===null||i===void 0?void 0:i.icon)||{}),wt=m&&!U?ae.createElement(mHe,{prefixCls:A,className:rn,style:_n},m):ae.createElement(DBt,{existIcon:!!m,prefixCls:A,loading:!!U}),pt=g||g===0?kBt(g,Q&&Fe):null;if(_t.href!==void 0)return O(ae.createElement("a",Object.assign({},_t,{className:Nt(Wt,{[`${A}-disabled`]:B}),style:Tt,onClick:Ee,ref:se}),wt,pt));let ot=ae.createElement("button",Object.assign({},x,{type:b,className:Wt,style:Tt,onClick:Ee,disabled:B,ref:se}),wt,pt,ke&&ae.createElement(ZBt,{key:"compact",prefixCls:A}));return pJ(s)||(ot=ae.createElement(yBt,{component:"Button",disabled:!!U},ot)),O(ot)},v_e=w.forwardRef(t8t);v_e.Group=xBt;v_e.__ANT_BUTTON=!0;const n8t=v_e;var CHe=w.createContext(null),zIe=[];function i8t(n,e){var t=w.useState(function(){if(!Xf())return null;var g=document.createElement("div");return g}),i=ln(t,1),r=i[0],o=w.useRef(!1),s=w.useContext(CHe),a=w.useState(zIe),l=ln(a,2),c=l[0],u=l[1],d=s||(o.current?void 0:function(g){u(function(m){var v=[g].concat(Jr(m));return v})});function h(){r.parentElement||document.body.appendChild(r),o.current=!0}function f(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),o.current=!1}return oh(function(){return n?s?s(h):h():f(),f},[n]),oh(function(){c.length&&(c.forEach(function(g){return g()}),u(zIe))},[c]),[r,d]}var _J;function r8t(n){if(typeof document>"u")return 0;if(n||_J===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),i=t.style;i.position="absolute",i.top="0",i.left="0",i.pointerEvents="none",i.visibility="hidden",i.width="200px",i.height="150px",i.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var r=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;r===o&&(o=t.clientWidth),document.body.removeChild(t),_J=r-o}return _J}function UIe(n){var e=n.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?r8t():t}function o8t(n){if(typeof document>"u"||!n||!(n instanceof Element))return{width:0,height:0};var e=getComputedStyle(n,"::-webkit-scrollbar"),t=e.width,i=e.height;return{width:UIe(t),height:UIe(i)}}function s8t(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var a8t="rc-util-locker-".concat(Date.now()),jIe=0;function l8t(n){var e=!!n,t=w.useState(function(){return jIe+=1,"".concat(a8t,"_").concat(jIe)}),i=ln(t,1),r=i[0];oh(function(){if(e){var o=o8t(document.body).width,s=s8t();ZD(` html body { overflow-y: hidden; `.concat(s?"width: calc(100% - ".concat(o,"px);"):"",` }`),r)}else WH(r);return function(){WH(r)}},[e,r])}var qIe=!1;function c8t(n){return typeof n=="boolean"&&(qIe=n),qIe}var KIe=function(e){return e===!1?!1:!Xf()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},wHe=w.forwardRef(function(n,e){var t=n.open,i=n.autoLock,r=n.getContainer;n.debug;var o=n.autoDestroy,s=o===void 0?!0:o,a=n.children,l=w.useState(t),c=ln(l,2),u=c[0],d=c[1],h=u||t;w.useEffect(function(){(s||t)&&d(t)},[t,s]);var f=w.useState(function(){return KIe(r)}),g=ln(f,2),m=g[0],v=g[1];w.useEffect(function(){var O=KIe(r);v(O??null)});var _=i8t(h&&!m),b=ln(_,2),y=b[0],C=b[1],x=m??y;l8t(i&&t&&Xf()&&(x===y||x===document.body));var E=null;if(a&&PF(a)&&e){var k=a;E=k.ref}var L=t_e(E,e);if(!h||!Xf()||m===void 0)return null;var D=x===!1||c8t(),A=a;return e&&(A=w.cloneElement(a,{ref:L})),w.createElement(CHe.Provider,{value:C},D?A:sp.createPortal(A,x))});function u8t(){var n=ct({},Am);return n.useId}var GIe=0,YIe=u8t();const d8t=YIe?function(e){var t=YIe();return e||t}:function(e){var t=w.useState("ssr-id"),i=ln(t,2),r=i[0],o=i[1];return w.useEffect(function(){var s=GIe;GIe+=1,o("rc_unique_".concat(s))},[]),e||r};var $x="RC_FORM_INTERNAL_HOOKS",ya=function(){Nd(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},eA=w.createContext({getFieldValue:ya,getFieldsValue:ya,getFieldError:ya,getFieldWarning:ya,getFieldsError:ya,isFieldsTouched:ya,isFieldTouched:ya,isFieldValidating:ya,isFieldsValidating:ya,resetFields:ya,setFields:ya,setFieldValue:ya,setFieldsValue:ya,validateFields:ya,submit:ya,getInternalHooks:function(){return ya(),{dispatch:ya,initEntityValue:ya,registerField:ya,useSubscribe:ya,setInitialValues:ya,destroyForm:ya,setCallbacks:ya,registerWatch:ya,getFields:ya,setValidateMessages:ya,setPreserve:ya,getInitialValue:ya}}}),GH=w.createContext(null);function Goe(n){return n==null?[]:Array.isArray(n)?n:[n]}function h8t(n){return n&&!!n._init}function Vx(){return Vx=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Vx.apply(this,arguments)}function f8t(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,z4(n,e)}function Yoe(n){return Yoe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yoe(n)}function z4(n,e){return z4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},z4(n,e)}function p8t(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function S$(n,e,t){return p8t()?S$=Reflect.construct.bind():S$=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),c=new l;return s&&z4(c,s.prototype),c},S$.apply(null,arguments)}function g8t(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function Qoe(n){var e=typeof Map=="function"?new Map:void 0;return Qoe=function(i){if(i===null||!g8t(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,r)}function r(){return S$(i,arguments,Yoe(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),z4(r,i)},Qoe(n)}var m8t=/%[sdj%]/g,_8t=function(){};typeof process<"u"&&process.env;function Xoe(n){if(!n||!n.length)return null;var e={};return n.forEach(function(t){var i=t.field;e[i]=e[i]||[],e[i].push(t)}),e}function Kp(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var r=0,o=t.length;if(typeof n=="function")return n.apply(null,t);if(typeof n=="string"){var s=n.replace(m8t,function(a){if(a==="%%")return"%";if(r>=o)return a;switch(a){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch{return"[Circular]"}break;default:return a}});return s}return n}function v8t(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function Su(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||v8t(e)&&typeof n=="string"&&!n)}function b8t(n,e,t){var i=[],r=0,o=n.length;function s(a){i.push.apply(i,a||[]),r++,r===o&&t(i)}n.forEach(function(a){e(a,s)})}function QIe(n,e,t){var i=0,r=n.length;function o(s){if(s&&s.length){t(s);return}var a=i;i=i+1,a<r?e(n[a],o):t([])}o([])}function y8t(n){var e=[];return Object.keys(n).forEach(function(t){e.push.apply(e,n[t]||[])}),e}var XIe=function(n){f8t(e,n);function e(t,i){var r;return r=n.call(this,"Async Validation Error")||this,r.errors=t,r.fields=i,r}return e}(Qoe(Error));function C8t(n,e,t,i,r){if(e.first){var o=new Promise(function(h,f){var g=function(_){return i(_),_.length?f(new XIe(_,Xoe(_))):h(r)},m=y8t(n);QIe(m,t,g)});return o.catch(function(h){return h}),o}var s=e.firstFields===!0?Object.keys(n):e.firstFields||[],a=Object.keys(n),l=a.length,c=0,u=[],d=new Promise(function(h,f){var g=function(v){if(u.push.apply(u,v),c++,c===l)return i(u),u.length?f(new XIe(u,Xoe(u))):h(r)};a.length||(i(u),h(r)),a.forEach(function(m){var v=n[m];s.indexOf(m)!==-1?QIe(v,t,g):b8t(v,t,g)})});return d.catch(function(h){return h}),d}function w8t(n){return!!(n&&n.message!==void 0)}function S8t(n,e){for(var t=n,i=0;i<e.length;i++){if(t==null)return t;t=t[e[i]]}return t}function ZIe(n,e){return function(t){var i;return n.fullFields?i=S8t(e,n.fullFields):i=e[t.field||n.fullField],w8t(t)?(t.field=t.field||n.fullField,t.fieldValue=i,t):{message:typeof t=="function"?t():t,fieldValue:i,field:t.field||n.fullField}}}function JIe(n,e){if(e){for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];typeof i=="object"&&typeof n[t]=="object"?n[t]=Vx({},n[t],i):n[t]=i}}return n}var SHe=function(e,t,i,r,o,s){e.required&&(!i.hasOwnProperty(e.field)||Su(t,s||e.type))&&r.push(Kp(o.messages.required,e.fullField))},E8t=function(e,t,i,r,o){(/^\s+$/.test(t)||t==="")&&r.push(Kp(o.messages.whitespace,e.fullField))},F8,x8t=function(){if(F8)return F8;var n="[a-fA-F\\d:]",e=function(C){return C&&C.includeBoundaries?"(?:(?<=\\s|^)(?="+n+")|(?<="+n+")(?=\\s|$))":""},t="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",r=(` (?: (?:`+i+":){7}(?:"+i+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 (?:`+i+":){6}(?:"+t+"|:"+i+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 (?:`+i+":){5}(?::"+t+"|(?::"+i+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 (?:`+i+":){4}(?:(?::"+i+"){0,1}:"+t+"|(?::"+i+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 (?:`+i+":){3}(?:(?::"+i+"){0,2}:"+t+"|(?::"+i+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 (?:`+i+":){2}(?:(?::"+i+"){0,3}:"+t+"|(?::"+i+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 (?:`+i+":){1}(?:(?::"+i+"){0,4}:"+t+"|(?::"+i+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 (?::(?:(?::`+i+"){0,5}:"+t+"|(?::"+i+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+t+"$)|(?:^"+r+"$)"),s=new RegExp("^"+t+"$"),a=new RegExp("^"+r+"$"),l=function(C){return C&&C.exact?o:new RegExp("(?:"+e(C)+t+e(C)+")|(?:"+e(C)+r+e(C)+")","g")};l.v4=function(y){return y&&y.exact?s:new RegExp(""+e(y)+t+e(y),"g")},l.v6=function(y){return y&&y.exact?a:new RegExp(""+e(y)+r+e(y),"g")};var c="(?:(?:[a-z]+:)?//)",u="(?:\\S+(?::\\S*)?@)?",d=l.v4().source,h=l.v6().source,f="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",g="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",v="(?::\\d{2,5})?",_='(?:[/?#][^\\s"]*)?',b="(?:"+c+"|www\\.)"+u+"(?:localhost|"+d+"|"+h+"|"+f+g+m+")"+v+_;return F8=new RegExp("(?:^"+b+"$)","i"),F8},e2e={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},oP={integer:function(e){return oP.number(e)&&parseInt(e,10)===e},float:function(e){return oP.number(e)&&!oP.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!oP.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(e2e.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(x8t())},hex:function(e){return typeof e=="string"&&!!e.match(e2e.hex)}},T8t=function(e,t,i,r,o){if(e.required&&t===void 0){SHe(e,t,i,r,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?oP[a](t)||r.push(Kp(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(Kp(o.messages.types[a],e.fullField,e.type))},k8t=function(e,t,i,r,o){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&r.push(Kp(o.messages[d].len,e.fullField,e.len)):a&&!l&&u<e.min?r.push(Kp(o.messages[d].min,e.fullField,e.min)):l&&!a&&u>e.max?r.push(Kp(o.messages[d].max,e.fullField,e.max)):a&&l&&(u<e.min||u>e.max)&&r.push(Kp(o.messages[d].range,e.fullField,e.min,e.max))},WI="enum",I8t=function(e,t,i,r,o){e[WI]=Array.isArray(e[WI])?e[WI]:[],e[WI].indexOf(t)===-1&&r.push(Kp(o.messages[WI],e.fullField,e[WI].join(", ")))},L8t=function(e,t,i,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Kp(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||r.push(Kp(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},es={required:SHe,whitespace:E8t,type:T8t,range:k8t,enum:I8t,pattern:L8t},D8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t,"string")&&!e.required)return i();es.required(e,t,r,s,o,"string"),Su(t,"string")||(es.type(e,t,r,s,o),es.range(e,t,r,s,o),es.pattern(e,t,r,s,o),e.whitespace===!0&&es.whitespace(e,t,r,s,o))}i(s)},A8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o),t!==void 0&&es.type(e,t,r,s,o)}i(s)},N8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Su(t)&&!e.required)return i();es.required(e,t,r,s,o),t!==void 0&&(es.type(e,t,r,s,o),es.range(e,t,r,s,o))}i(s)},R8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o),t!==void 0&&es.type(e,t,r,s,o)}i(s)},O8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o),Su(t)||es.type(e,t,r,s,o)}i(s)},P8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o),t!==void 0&&(es.type(e,t,r,s,o),es.range(e,t,r,s,o))}i(s)},M8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o),t!==void 0&&(es.type(e,t,r,s,o),es.range(e,t,r,s,o))}i(s)},F8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return i();es.required(e,t,r,s,o,"array"),t!=null&&(es.type(e,t,r,s,o),es.range(e,t,r,s,o))}i(s)},B8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o),t!==void 0&&es.type(e,t,r,s,o)}i(s)},$8t="enum",V8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o),t!==void 0&&es[$8t](e,t,r,s,o)}i(s)},H8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t,"string")&&!e.required)return i();es.required(e,t,r,s,o),Su(t,"string")||es.pattern(e,t,r,s,o)}i(s)},W8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t,"date")&&!e.required)return i();if(es.required(e,t,r,s,o),!Su(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),es.type(e,l,r,s,o),l&&es.range(e,l.getTime(),r,s,o)}}i(s)},z8t=function(e,t,i,r,o){var s=[],a=Array.isArray(t)?"array":typeof t;es.required(e,t,r,s,o,a),i(s)},vJ=function(e,t,i,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(Su(t,s)&&!e.required)return i();es.required(e,t,r,a,o,s),Su(t,s)||es.type(e,t,r,a,o)}i(a)},U8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Su(t)&&!e.required)return i();es.required(e,t,r,s,o)}i(s)},eM={string:D8t,method:A8t,number:N8t,boolean:R8t,regexp:O8t,integer:P8t,float:M8t,array:F8t,object:B8t,enum:V8t,pattern:H8t,date:W8t,url:vJ,hex:vJ,email:vJ,required:z8t,any:U8t};function Zoe(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Joe=Zoe(),VF=function(){function n(t){this.rules=null,this._messages=Joe,this.define(t)}var e=n.prototype;return e.define=function(i){var r=this;if(!i)throw new Error("Cannot configure a schema with no rules");if(typeof i!="object"||Array.isArray(i))throw new Error("Rules must be an object");this.rules={},Object.keys(i).forEach(function(o){var s=i[o];r.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(i){return i&&(this._messages=JIe(Zoe(),i)),this._messages},e.validate=function(i,r,o){var s=this;r===void 0&&(r={}),o===void 0&&(o=function(){});var a=i,l=r,c=o;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(m){var v=[],_={};function b(C){if(Array.isArray(C)){var x;v=(x=v).concat.apply(x,C)}else v.push(C)}for(var y=0;y<m.length;y++)b(m[y]);v.length?(_=Xoe(v),c(v,_)):c(null,a)}if(l.messages){var d=this.messages();d===Joe&&(d=Zoe()),JIe(d,l.messages),l.messages=d}else l.messages=this.messages();var h={},f=l.keys||Object.keys(this.rules);f.forEach(function(m){var v=s.rules[m],_=a[m];v.forEach(function(b){var y=b;typeof y.transform=="function"&&(a===i&&(a=Vx({},a)),_=a[m]=y.transform(_)),typeof y=="function"?y={validator:y}:y=Vx({},y),y.validator=s.getValidationMethod(y),y.validator&&(y.field=m,y.fullField=y.fullField||m,y.type=s.getType(y),h[m]=h[m]||[],h[m].push({rule:y,value:_,source:a,field:m}))})});var g={};return C8t(h,l,function(m,v){var _=m.rule,b=(_.type==="object"||_.type==="array")&&(typeof _.fields=="object"||typeof _.defaultField=="object");b=b&&(_.required||!_.required&&m.value),_.field=m.field;function y(E,k){return Vx({},k,{fullField:_.fullField+"."+E,fullFields:_.fullFields?[].concat(_.fullFields,[E]):[E]})}function C(E){E===void 0&&(E=[]);var k=Array.isArray(E)?E:[E];!l.suppressWarning&&k.length&&n.warning("async-validator:",k),k.length&&_.message!==void 0&&(k=[].concat(_.message));var L=k.map(ZIe(_,a));if(l.first&&L.length)return g[_.field]=1,v(L);if(!b)v(L);else{if(_.required&&!m.value)return _.message!==void 0?L=[].concat(_.message).map(ZIe(_,a)):l.error&&(L=[l.error(_,Kp(l.messages.required,_.field))]),v(L);var D={};_.defaultField&&Object.keys(m.value).map(function(P){D[P]=_.defaultField}),D=Vx({},D,m.rule.fields);var A={};Object.keys(D).forEach(function(P){var F=D[P],B=Array.isArray(F)?F:[F];A[P]=B.map(y.bind(null,P))});var O=new n(A);O.messages(l.messages),m.rule.options&&(m.rule.options.messages=l.messages,m.rule.options.error=l.error),O.validate(m.value,m.rule.options||l,function(P){var F=[];L&&L.length&&F.push.apply(F,L),P&&P.length&&F.push.apply(F,P),v(F.length?F:null)})}}var x;if(_.asyncValidator)x=_.asyncValidator(_,m.value,C,m.source,l);else if(_.validator){try{x=_.validator(_,m.value,C,m.source,l)}catch(E){console.error==null||console.error(E),l.suppressValidatorError||setTimeout(function(){throw E},0),C(E.message)}x===!0?C():x===!1?C(typeof _.message=="function"?_.message(_.fullField||_.field):_.message||(_.fullField||_.field)+" fails"):x instanceof Array?C(x):x instanceof Error&&C(x.message)}x&&x.then&&x.then(function(){return C()},function(E){return C(E)})},function(m){u(m)},a)},e.getType=function(i){if(i.type===void 0&&i.pattern instanceof RegExp&&(i.type="pattern"),typeof i.validator!="function"&&i.type&&!eM.hasOwnProperty(i.type))throw new Error(Kp("Unknown rule type %s",i.type));return i.type||"string"},e.getValidationMethod=function(i){if(typeof i.validator=="function")return i.validator;var r=Object.keys(i),o=r.indexOf("message");return o!==-1&&r.splice(o,1),r.length===1&&r[0]==="required"?eM.required:eM[this.getType(i)]||void 0},n}();VF.register=function(e,t){if(typeof t!="function")throw new Error("Cannot register a validator by type, validator is not a function");eM[e]=t};VF.warning=_8t;VF.messages=Joe;VF.validators=eM;var Sp="'${name}' is not a valid ${type}",EHe={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:Sp,method:Sp,array:Sp,object:Sp,number:Sp,date:Sp,boolean:Sp,integer:Sp,float:Sp,regexp:Sp,email:Sp,url:Sp,hex:Sp},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},t2e=VF;function j8t(n,e){return n.replace(/\$\{\w+\}/g,function(t){var i=t.slice(2,-1);return e[i]})}var n2e="CODE_LOGIC_ERROR";function ese(n,e,t,i,r){return tse.apply(this,arguments)}function tse(){return tse=Uk(Yh().mark(function n(e,t,i,r,o){var s,a,l,c,u,d,h,f,g;return Yh().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s=ct({},i),delete s.ruleIndex,t2e.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(_){return console.error(_),Promise.reject(n2e)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new t2e(Ze({},e,[s])),u=q2(EHe,r.validateMessages),c.messages(u),d=[],v.prev=10,v.next=13,Promise.resolve(c.validate(Ze({},e,t),ct({},r)));case 13:v.next=18;break;case 15:v.prev=15,v.t0=v.catch(10),v.t0.errors&&(d=v.t0.errors.map(function(_,b){var y=_.message,C=y===n2e?u.default:y;return w.isValidElement(C)?w.cloneElement(C,{key:"error_".concat(b)}):C}));case 18:if(!(!d.length&&l)){v.next=23;break}return v.next=21,Promise.all(t.map(function(_,b){return ese("".concat(e,".").concat(b),_,l,r,o)}));case 21:return h=v.sent,v.abrupt("return",h.reduce(function(_,b){return[].concat(Jr(_),Jr(b))},[]));case 23:return f=ct(ct({},i),{},{name:e,enum:(i.enum||[]).join(", ")},o),g=d.map(function(_){return typeof _=="string"?j8t(_,f):_}),v.abrupt("return",g);case 26:case"end":return v.stop()}},n,null,[[10,15]])})),tse.apply(this,arguments)}function q8t(n,e,t,i,r,o){var s=n.join("."),a=t.map(function(u,d){var h=u.validator,f=ct(ct({},u),{},{ruleIndex:d});return h&&(f.validator=function(g,m,v){var _=!1,b=function(){for(var x=arguments.length,E=new Array(x),k=0;k<x;k++)E[k]=arguments[k];Promise.resolve().then(function(){Nd(!_,"Your validator function has already return a promise. `callback` will be ignored."),_||v.apply(void 0,E)})},y=h(g,m,b);_=y&&typeof y.then=="function"&&typeof y.catch=="function",Nd(_,"`callback` is deprecated. Please return a promise instead."),_&&y.then(function(){v()}).catch(function(C){v(C||" ")})}),f}).sort(function(u,d){var h=u.warningOnly,f=u.ruleIndex,g=d.warningOnly,m=d.ruleIndex;return!!h==!!g?f-m:h?1:-1}),l;if(r===!0)l=new Promise(function(){var u=Uk(Yh().mark(function d(h,f){var g,m,v;return Yh().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:g=0;case 1:if(!(g<a.length)){b.next=12;break}return m=a[g],b.next=5,ese(s,e,m,i,o);case 5:if(v=b.sent,!v.length){b.next=9;break}return f([{errors:v,rule:m}]),b.abrupt("return");case 9:g+=1,b.next=1;break;case 12:h([]);case 13:case"end":return b.stop()}},d)}));return function(d,h){return u.apply(this,arguments)}}());else{var c=a.map(function(u){return ese(s,e,u,i,o).then(function(d){return{errors:d,rule:u}})});l=(r?G8t(c):K8t(c)).then(function(u){return Promise.reject(u)})}return l.catch(function(u){return u}),l}function K8t(n){return nse.apply(this,arguments)}function nse(){return nse=Uk(Yh().mark(function n(e){return Yh().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.all(e).then(function(r){var o,s=(o=[]).concat.apply(o,Jr(r));return s}));case 1:case"end":return i.stop()}},n)})),nse.apply(this,arguments)}function G8t(n){return ise.apply(this,arguments)}function ise(){return ise=Uk(Yh().mark(function n(e){var t;return Yh().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=0,r.abrupt("return",new Promise(function(o){e.forEach(function(s){s.then(function(a){a.errors.length&&o([a]),t+=1,t===e.length&&o([])})})}));case 2:case"end":return r.stop()}},n)})),ise.apply(this,arguments)}function pc(n){return Goe(n)}function i2e(n,e){var t={};return e.forEach(function(i){var r=Z_(n,i);t=I_(t,i,r)}),t}function HL(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return n&&n.some(function(i){return xHe(e,i,t)})}function xHe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!n||!e||!t&&n.length!==e.length?!1:e.every(function(i,r){return n[r]===i})}function Y8t(n,e){if(n===e)return!0;if(!n&&e||n&&!e||!n||!e||Qr(n)!=="object"||Qr(e)!=="object")return!1;var t=Object.keys(n),i=Object.keys(e),r=new Set([].concat(t,i));return Jr(r).every(function(o){var s=n[o],a=e[o];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function Q8t(n){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&Qr(e.target)==="object"&&n in e.target?e.target[n]:e}function r2e(n,e,t){var i=n.length;if(e<0||e>=i||t<0||t>=i)return n;var r=n[e],o=e-t;return o>0?[].concat(Jr(n.slice(0,t)),[r],Jr(n.slice(t,e)),Jr(n.slice(e+1,i))):o<0?[].concat(Jr(n.slice(0,e)),Jr(n.slice(e+1,t+1)),[r],Jr(n.slice(t+1,i))):n}var X8t=["name"],Qg=[];function o2e(n,e,t,i,r,o){return typeof n=="function"?n(e,t,"source"in o?{source:o.source}:{}):i!==r}var b_e=function(n){xv(t,n);var e=Ok(t);function t(i){var r;if(El(this,t),r=e.call(this,i),Ze(Yr(r),"state",{resetCount:0}),Ze(Yr(r),"cancelRegisterFunc",null),Ze(Yr(r),"mounted",!1),Ze(Yr(r),"touched",!1),Ze(Yr(r),"dirty",!1),Ze(Yr(r),"validatePromise",void 0),Ze(Yr(r),"prevValidating",void 0),Ze(Yr(r),"errors",Qg),Ze(Yr(r),"warnings",Qg),Ze(Yr(r),"cancelRegister",function(){var l=r.props,c=l.preserve,u=l.isListField,d=l.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(u,c,pc(d)),r.cancelRegisterFunc=null}),Ze(Yr(r),"getNamePath",function(){var l=r.props,c=l.name,u=l.fieldContext,d=u.prefixName,h=d===void 0?[]:d;return c!==void 0?[].concat(Jr(h),Jr(c)):[]}),Ze(Yr(r),"getRules",function(){var l=r.props,c=l.rules,u=c===void 0?[]:c,d=l.fieldContext;return u.map(function(h){return typeof h=="function"?h(d):h})}),Ze(Yr(r),"refresh",function(){r.mounted&&r.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),Ze(Yr(r),"metaCache",null),Ze(Yr(r),"triggerMetaEvent",function(l){var c=r.props.onMetaChange;if(c){var u=ct(ct({},r.getMeta()),{},{destroy:l});HH(r.metaCache,u)||c(u),r.metaCache=u}else r.metaCache=null}),Ze(Yr(r),"onStoreChange",function(l,c,u){var d=r.props,h=d.shouldUpdate,f=d.dependencies,g=f===void 0?[]:f,m=d.onReset,v=u.store,_=r.getNamePath(),b=r.getValue(l),y=r.getValue(v),C=c&&HL(c,_);switch(u.type==="valueUpdate"&&u.source==="external"&&b!==y&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=Qg,r.warnings=Qg,r.triggerMetaEvent()),u.type){case"reset":if(!c||C){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=Qg,r.warnings=Qg,r.triggerMetaEvent(),m==null||m(),r.refresh();return}break;case"remove":{if(h){r.reRender();return}break}case"setField":{var x=u.data;if(C){"touched"in x&&(r.touched=x.touched),"validating"in x&&!("originRCField"in x)&&(r.validatePromise=x.validating?Promise.resolve([]):null),"errors"in x&&(r.errors=x.errors||Qg),"warnings"in x&&(r.warnings=x.warnings||Qg),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}else if("value"in x&&HL(c,_,!0)){r.reRender();return}if(h&&!_.length&&o2e(h,l,v,b,y,u)){r.reRender();return}break}case"dependenciesUpdate":{var E=g.map(pc);if(E.some(function(k){return HL(u.relatedFields,k)})){r.reRender();return}break}default:if(C||(!g.length||_.length||h)&&o2e(h,l,v,b,y,u)){r.reRender();return}break}h===!0&&r.reRender()}),Ze(Yr(r),"validateRules",function(l){var c=r.getNamePath(),u=r.getValue(),d=l||{},h=d.triggerName,f=d.validateOnly,g=f===void 0?!1:f,m=Promise.resolve().then(Uk(Yh().mark(function v(){var _,b,y,C,x,E,k;return Yh().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(r.mounted){D.next=2;break}return D.abrupt("return",[]);case 2:if(_=r.props,b=_.validateFirst,y=b===void 0?!1:b,C=_.messageVariables,x=_.validateDebounce,E=r.getRules(),h&&(E=E.filter(function(A){return A}).filter(function(A){var O=A.validateTrigger;if(!O)return!0;var P=Goe(O);return P.includes(h)})),!(x&&h)){D.next=10;break}return D.next=8,new Promise(function(A){setTimeout(A,x)});case 8:if(r.validatePromise===m){D.next=10;break}return D.abrupt("return",[]);case 10:return k=q8t(c,u,E,l,y,C),k.catch(function(A){return A}).then(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qg;if(r.validatePromise===m){var O;r.validatePromise=null;var P=[],F=[];(O=A.forEach)===null||O===void 0||O.call(A,function(B){var M=B.rule.warningOnly,V=B.errors,U=V===void 0?Qg:V;M?F.push.apply(F,Jr(U)):P.push.apply(P,Jr(U))}),r.errors=P,r.warnings=F,r.triggerMetaEvent(),r.reRender()}}),D.abrupt("return",k);case 13:case"end":return D.stop()}},v)})));return g||(r.validatePromise=m,r.dirty=!0,r.errors=Qg,r.warnings=Qg,r.triggerMetaEvent(),r.reRender()),m}),Ze(Yr(r),"isFieldValidating",function(){return!!r.validatePromise}),Ze(Yr(r),"isFieldTouched",function(){return r.touched}),Ze(Yr(r),"isFieldDirty",function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks($x),u=c.getInitialValue;return u(r.getNamePath())!==void 0}),Ze(Yr(r),"getErrors",function(){return r.errors}),Ze(Yr(r),"getWarnings",function(){return r.warnings}),Ze(Yr(r),"isListField",function(){return r.props.isListField}),Ze(Yr(r),"isList",function(){return r.props.isList}),Ze(Yr(r),"isPreserve",function(){return r.props.preserve}),Ze(Yr(r),"getMeta",function(){r.prevValidating=r.isFieldValidating();var l={touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:r.validatePromise===null};return l}),Ze(Yr(r),"getOnlyChild",function(l){if(typeof l=="function"){var c=r.getMeta();return ct(ct({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=FH(l);return u.length!==1||!w.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),Ze(Yr(r),"getValue",function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return Z_(l||c(!0),u)}),Ze(Yr(r),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,m=c.getValueProps,v=c.fieldContext,_=d!==void 0?d:v.validateTrigger,b=r.getNamePath(),y=v.getInternalHooks,C=v.getFieldsValue,x=y($x),E=x.dispatch,k=r.getValue(),L=m||function(P){return Ze({},g,P)},D=l[u],A=ct(ct({},l),L(k));A[u]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var P,F=arguments.length,B=new Array(F),M=0;M<F;M++)B[M]=arguments[M];h?P=h.apply(void 0,B):P=Q8t.apply(void 0,[g].concat(B)),f&&(P=f(P,k,C(!0))),E({type:"updateValue",namePath:b,value:P}),D&&D.apply(void 0,B)};var O=Goe(_||[]);return O.forEach(function(P){var F=A[P];A[P]=function(){F&&F.apply(void 0,arguments);var B=r.props.rules;B&&B.length&&E({type:"validateField",namePath:b,triggerName:P})}}),A}),i.fieldContext){var o=i.fieldContext.getInternalHooks,s=o($x),a=s.initEntityValue;a(Yr(r))}return r}return xl(t,[{key:"componentDidMount",value:function(){var r=this.props,o=r.shouldUpdate,s=r.fieldContext;if(this.mounted=!0,s){var a=s.getInternalHooks,l=a($x),c=l.registerField;this.cancelRegisterFunc=c(this)}o===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var r=this.state.resetCount,o=this.props.children,s=this.getOnlyChild(o),a=s.child,l=s.isFunction,c;return l?c=a:w.isValidElement(a)?c=w.cloneElement(a,this.getControlled(a.props)):(Nd(!a,"`children` of Field is not validate ReactElement."),c=a),w.createElement(w.Fragment,{key:r},c)}}]),t}(w.Component);Ze(b_e,"contextType",eA);Ze(b_e,"defaultProps",{trigger:"onChange",valuePropName:"value"});function THe(n){var e=n.name,t=Qu(n,X8t),i=w.useContext(eA),r=w.useContext(GH),o=e!==void 0?pc(e):void 0,s="keep";return t.isListField||(s="_".concat((o||[]).join("_"))),w.createElement(b_e,Ct({key:s,name:o,isListField:!!r},t,{fieldContext:i}))}function Z8t(n){var e=n.name,t=n.initialValue,i=n.children,r=n.rules,o=n.validateTrigger,s=n.isListField,a=w.useContext(eA),l=w.useContext(GH),c=w.useRef({keys:[],id:0}),u=c.current,d=w.useMemo(function(){var m=pc(a.prefixName)||[];return[].concat(Jr(m),Jr(pc(e)))},[a.prefixName,e]),h=w.useMemo(function(){return ct(ct({},a),{},{prefixName:d})},[a,d]),f=w.useMemo(function(){return{getKey:function(v){var _=d.length,b=v[_];return[u.keys[b],v.slice(_+1)]}}},[d]);if(typeof i!="function")return Nd(!1,"Form.List only accepts function as children."),null;var g=function(v,_,b){var y=b.source;return y==="internal"?!1:v!==_};return w.createElement(GH.Provider,{value:f},w.createElement(eA.Provider,{value:h},w.createElement(THe,{name:[],shouldUpdate:g,rules:r,validateTrigger:o,initialValue:t,isList:!0,isListField:s??!!l},function(m,v){var _=m.value,b=_===void 0?[]:_,y=m.onChange,C=a.getFieldValue,x=function(){var D=C(d||[]);return D||[]},E={add:function(D,A){var O=x();A>=0&&A<=O.length?(u.keys=[].concat(Jr(u.keys.slice(0,A)),[u.id],Jr(u.keys.slice(A))),y([].concat(Jr(O.slice(0,A)),[D],Jr(O.slice(A))))):(u.keys=[].concat(Jr(u.keys),[u.id]),y([].concat(Jr(O),[D]))),u.id+=1},remove:function(D){var A=x(),O=new Set(Array.isArray(D)?D:[D]);O.size<=0||(u.keys=u.keys.filter(function(P,F){return!O.has(F)}),y(A.filter(function(P,F){return!O.has(F)})))},move:function(D,A){if(D!==A){var O=x();D<0||D>=O.length||A<0||A>=O.length||(u.keys=r2e(u.keys,D,A),y(r2e(O,D,A)))}}},k=b||[];return Array.isArray(k)||(k=[]),i(k.map(function(L,D){var A=u.keys[D];return A===void 0&&(u.keys[D]=u.id,A=u.keys[D],u.id+=1),{name:D,key:A,isListField:!0}}),E,v)})))}function J8t(n){var e=!1,t=n.length,i=[];return n.length?new Promise(function(r,o){n.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,i[a]=l,!(t>0)&&(e&&o(i),r(i))})})}):Promise.resolve([])}var kHe="__@field_split__";function bJ(n){return n.map(function(e){return"".concat(Qr(e),":").concat(e)}).join(kHe)}var zI=function(){function n(){El(this,n),Ze(this,"kvs",new Map)}return xl(n,[{key:"set",value:function(t,i){this.kvs.set(bJ(t),i)}},{key:"get",value:function(t){return this.kvs.get(bJ(t))}},{key:"update",value:function(t,i){var r=this.get(t),o=i(r);o?this.set(t,o):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(bJ(t))}},{key:"map",value:function(t){return Jr(this.kvs.entries()).map(function(i){var r=ln(i,2),o=r[0],s=r[1],a=o.split(kHe);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=ln(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(i){var r=i.key,o=i.value;return t[r.join(".")]=o,null}),t}}]),n}(),e9t=["name"],t9t=xl(function n(e){var t=this;El(this,n),Ze(this,"formHooked",!1),Ze(this,"forceRootUpdate",void 0),Ze(this,"subscribable",!0),Ze(this,"store",{}),Ze(this,"fieldEntities",[]),Ze(this,"initialValues",{}),Ze(this,"callbacks",{}),Ze(this,"validateMessages",null),Ze(this,"preserve",null),Ze(this,"lastValidatePromise",null),Ze(this,"getForm",function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}}),Ze(this,"getInternalHooks",function(i){return i===$x?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(Nd(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),Ze(this,"useSubscribe",function(i){t.subscribable=i}),Ze(this,"prevWithoutPreserves",null),Ze(this,"setInitialValues",function(i,r){if(t.initialValues=i||{},r){var o,s=q2(i,t.store);(o=t.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=I_(s,l,Z_(i,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}}),Ze(this,"destroyForm",function(){var i=new zI;t.getFieldEntities(!0).forEach(function(r){t.isMergedPreserve(r.isPreserve())||i.set(r.getNamePath(),!0)}),t.prevWithoutPreserves=i}),Ze(this,"getInitialValue",function(i){var r=Z_(t.initialValues,i);return i.length?q2(r):r}),Ze(this,"setCallbacks",function(i){t.callbacks=i}),Ze(this,"setValidateMessages",function(i){t.validateMessages=i}),Ze(this,"setPreserve",function(i){t.preserve=i}),Ze(this,"watchList",[]),Ze(this,"registerWatch",function(i){return t.watchList.push(i),function(){t.watchList=t.watchList.filter(function(r){return r!==i})}}),Ze(this,"notifyWatch",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var r=t.getFieldsValue(),o=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(r,o,i)})}}),Ze(this,"timeoutId",null),Ze(this,"warningUnhooked",function(){}),Ze(this,"updateStore",function(i){t.store=i}),Ze(this,"getFieldEntities",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return i?t.fieldEntities.filter(function(r){return r.getNamePath().length}):t.fieldEntities}),Ze(this,"getFieldsMap",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new zI;return t.getFieldEntities(i).forEach(function(o){var s=o.getNamePath();r.set(s,o)}),r}),Ze(this,"getFieldEntitiesForNamePathList",function(i){if(!i)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return i.map(function(o){var s=pc(o);return r.get(s)||{INVALIDATE_NAME_PATH:pc(o)}})}),Ze(this,"getFieldsValue",function(i,r){t.warningUnhooked();var o,s,a;if(i===!0||Array.isArray(i)?(o=i,s=r):i&&Qr(i)==="object"&&(a=i.strict,s=i.filter),o===!0&&!s)return t.store;var l=t.getFieldEntitiesForNamePathList(Array.isArray(o)?o:null),c=[];return l.forEach(function(u){var d,h,f="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(a){var g,m;if((g=(m=u).isList)!==null&&g!==void 0&&g.call(m))return}else if(!o&&(d=(h=u).isListField)!==null&&d!==void 0&&d.call(h))return;if(!s)c.push(f);else{var v="getMeta"in u?u.getMeta():null;s(v)&&c.push(f)}}),i2e(t.store,c.map(pc))}),Ze(this,"getFieldValue",function(i){t.warningUnhooked();var r=pc(i);return Z_(t.store,r)}),Ze(this,"getFieldsError",function(i){t.warningUnhooked();var r=t.getFieldEntitiesForNamePathList(i);return r.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:pc(i[s]),errors:[],warnings:[]}})}),Ze(this,"getFieldError",function(i){t.warningUnhooked();var r=pc(i),o=t.getFieldsError([r])[0];return o.errors}),Ze(this,"getFieldWarning",function(i){t.warningUnhooked();var r=pc(i),o=t.getFieldsError([r])[0];return o.warnings}),Ze(this,"isFieldsTouched",function(){t.warningUnhooked();for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var s=r[0],a=r[1],l,c=!1;r.length===0?l=null:r.length===1?Array.isArray(s)?(l=s.map(pc),c=!1):(l=null,c=s):(l=s.map(pc),c=a);var u=t.getFieldEntities(!0),d=function(v){return v.isFieldTouched()};if(!l)return c?u.every(d):u.some(d);var h=new zI;l.forEach(function(m){h.set(m,[])}),u.forEach(function(m){var v=m.getNamePath();l.forEach(function(_){_.every(function(b,y){return v[y]===b})&&h.update(_,function(b){return[].concat(Jr(b),[m])})})});var f=function(v){return v.some(d)},g=h.map(function(m){var v=m.value;return v});return c?g.every(f):g.some(f)}),Ze(this,"isFieldTouched",function(i){return t.warningUnhooked(),t.isFieldsTouched([i])}),Ze(this,"isFieldsValidating",function(i){t.warningUnhooked();var r=t.getFieldEntities();if(!i)return r.some(function(s){return s.isFieldValidating()});var o=i.map(pc);return r.some(function(s){var a=s.getNamePath();return HL(o,a)&&s.isFieldValidating()})}),Ze(this,"isFieldValidating",function(i){return t.warningUnhooked(),t.isFieldsValidating([i])}),Ze(this,"resetWithFieldInitialValue",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new zI,o=t.getFieldEntities(!0);o.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:l,value:c}),r.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)Nd(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=r.get(h);if(g&&g.size>1)Nd(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var m=t.getFieldValue(h),v=u.isListField();!v&&(!i.skipExist||m===void 0)&&t.updateStore(I_(t.store,h,Jr(g)[0].value))}}}})},a;i.entities?a=i.entities:i.namePathList?(a=[],i.namePathList.forEach(function(l){var c=r.get(l);if(c){var u;(u=a).push.apply(u,Jr(Jr(c).map(function(d){return d.entity})))}})):a=o,s(a)}),Ze(this,"resetFields",function(i){t.warningUnhooked();var r=t.store;if(!i){t.updateStore(q2(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var o=i.map(pc);o.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(I_(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:o}),t.notifyObservers(r,o,{type:"reset"}),t.notifyWatch(o)}),Ze(this,"setFields",function(i){t.warningUnhooked();var r=t.store,o=[];i.forEach(function(s){var a=s.name,l=Qu(s,e9t),c=pc(a);o.push(c),"value"in l&&t.updateStore(I_(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:s})}),t.notifyWatch(o)}),Ze(this,"getFields",function(){var i=t.getFieldEntities(!0),r=i.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=ct(ct({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r}),Ze(this,"initEntityValue",function(i){var r=i.props.initialValue;if(r!==void 0){var o=i.getNamePath(),s=Z_(t.store,o);s===void 0&&t.updateStore(I_(t.store,o,r))}}),Ze(this,"isMergedPreserve",function(i){var r=i!==void 0?i:t.preserve;return r??!0}),Ze(this,"registerField",function(i){t.fieldEntities.push(i);var r=i.getNamePath();if(t.notifyWatch([r]),i.props.initialValue!==void 0){var o=t.store;t.resetWithFieldInitialValue({entities:[i],skipExist:!0}),t.notifyObservers(o,[i.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==i}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(r);if(r.length&&t.getFieldValue(r)!==c&&t.fieldEntities.every(function(d){return!xHe(d.getNamePath(),r)})){var u=t.store;t.updateStore(I_(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}}),Ze(this,"dispatch",function(i){switch(i.type){case"updateValue":{var r=i.namePath,o=i.value;t.updateValue(r,o);break}case"validateField":{var s=i.namePath,a=i.triggerName;t.validateFields([s],{triggerName:a});break}}}),Ze(this,"notifyObservers",function(i,r,o){if(t.subscribable){var s=ct(ct({},o),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(i,r,s)})}else t.forceRootUpdate()}),Ze(this,"triggerDependenciesUpdate",function(i,r){var o=t.getDependencyChildrenFields(r);return o.length&&t.validateFields(o),t.notifyObservers(i,o,{type:"dependenciesUpdate",relatedFields:[r].concat(Jr(o))}),o}),Ze(this,"updateValue",function(i,r){var o=pc(i),s=t.store;t.updateStore(I_(t.store,o,r)),t.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),t.notifyWatch([o]);var a=t.triggerDependenciesUpdate(s,o),l=t.callbacks.onValuesChange;if(l){var c=i2e(t.store,[o]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([o].concat(Jr(a)))}),Ze(this,"setFieldsValue",function(i){t.warningUnhooked();var r=t.store;if(i){var o=q2(t.store,i);t.updateStore(o)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),Ze(this,"setFieldValue",function(i,r){t.setFields([{name:i,value:r}])}),Ze(this,"getDependencyChildrenFields",function(i){var r=new Set,o=[],s=new zI;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=pc(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(o.push(h),l(h))}})};return a(i),o}),Ze(this,"triggerOnFieldsChange",function(i,r){var o=t.callbacks.onFieldsChange;if(o){var s=t.getFields();if(r){var a=new zI;r.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return HL(i,u)});l.length&&o(l,s)}}),Ze(this,"validateFields",function(i,r){var o;t.warningUnhooked();var s,a;Array.isArray(i)||typeof i=="string"||typeof r=="string"?(s=i,a=r):a=i;var l=!!s,c=l?s.map(pc):[],u=[],d=String(Date.now()),h=new Set,f=(o=a)===null||o===void 0?void 0:o.recursive;t.getFieldEntities(!0).forEach(function(_){if(l||c.push(_.getNamePath()),!(!_.props.rules||!_.props.rules.length)){var b=_.getNamePath();if(h.add(b.join(d)),!l||HL(c,b,f)){var y=_.validateRules(ct({validateMessages:ct(ct({},EHe),t.validateMessages)},a));u.push(y.then(function(){return{name:b,errors:[],warnings:[]}}).catch(function(C){var x,E=[],k=[];return(x=C.forEach)===null||x===void 0||x.call(C,function(L){var D=L.rule.warningOnly,A=L.errors;D?k.push.apply(k,Jr(A)):E.push.apply(E,Jr(A))}),E.length?Promise.reject({name:b,errors:E,warnings:k}):{name:b,errors:E,warnings:k}}))}}});var g=J8t(u);t.lastValidatePromise=g,g.catch(function(_){return _}).then(function(_){var b=_.map(function(y){var C=y.name;return C});t.notifyObservers(t.store,b,{type:"validateFinish"}),t.triggerOnFieldsChange(b,_)});var m=g.then(function(){return t.lastValidatePromise===g?Promise.resolve(t.getFieldsValue(c)):Promise.reject([])}).catch(function(_){var b=_.filter(function(y){return y&&y.errors.length});return Promise.reject({values:t.getFieldsValue(c),errorFields:b,outOfDate:t.lastValidatePromise!==g})});m.catch(function(_){return _});var v=c.filter(function(_){return h.has(_.join(d))});return t.triggerOnFieldsChange(v),m}),Ze(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(i){var r=t.callbacks.onFinish;if(r)try{r(i)}catch(o){console.error(o)}}).catch(function(i){var r=t.callbacks.onFinishFailed;r&&r(i)})}),this.forceRootUpdate=e});function IHe(n){var e=w.useRef(),t=w.useState({}),i=ln(t,2),r=i[1];if(!e.current)if(n)e.current=n;else{var o=function(){r({})},s=new t9t(o);e.current=s.getForm()}return[e.current]}var rse=w.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),n9t=function(e){var t=e.validateMessages,i=e.onFormChange,r=e.onFormFinish,o=e.children,s=w.useContext(rse),a=w.useRef({});return w.createElement(rse.Provider,{value:ct(ct({},s),{},{validateMessages:ct(ct({},s.validateMessages),t),triggerFormChange:function(c,u){i&&i(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=ct(ct({},a.current),{},Ze({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=ct({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},i9t=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],r9t=function(e,t){var i=e.name,r=e.initialValues,o=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,m=e.onFieldsChange,v=e.onFinish,_=e.onFinishFailed,b=Qu(e,i9t),y=w.useContext(rse),C=IHe(s),x=ln(C,1),E=x[0],k=E.getInternalHooks($x),L=k.useSubscribe,D=k.setInitialValues,A=k.setCallbacks,O=k.setValidateMessages,P=k.setPreserve,F=k.destroyForm;w.useImperativeHandle(t,function(){return E}),w.useEffect(function(){return y.registerForm(i,E),function(){y.unregisterForm(i)}},[y,E,i]),O(ct(ct({},y.validateMessages),d)),A({onValuesChange:g,onFieldsChange:function(se){if(y.triggerFormChange(i,se),m){for(var Q=arguments.length,Ee=new Array(Q>1?Q-1:0),Fe=1;Fe<Q;Fe++)Ee[Fe-1]=arguments[Fe];m.apply(void 0,[se].concat(Ee))}},onFinish:function(se){y.triggerFormFinish(i,se),v&&v(se)},onFinishFailed:_}),P(a);var B=w.useRef(null);D(r,!B.current),B.current||(B.current=!0),w.useEffect(function(){return F},[]);var M,V=typeof l=="function";if(V){var U=E.getFieldsValue(!0);M=l(U,E)}else M=l;L(!V);var W=w.useRef();w.useEffect(function(){Y8t(W.current||[],o||[])||E.setFields(o||[]),W.current=o},[o,E]);var q=w.useMemo(function(){return ct(ct({},E),{},{validateTrigger:f})},[E,f]),H=w.createElement(GH.Provider,{value:null},w.createElement(eA.Provider,{value:q},M));return u===!1?H:w.createElement(u,Ct({},b,{onSubmit:function(se){se.preventDefault(),se.stopPropagation(),E.submit()},onReset:function(se){var Q;se.preventDefault(),E.resetFields(),(Q=b.onReset)===null||Q===void 0||Q.call(b,se)}}),H)};function s2e(n){try{return JSON.stringify(n)}catch{return Math.random()}}function o9t(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=e[0],r=i===void 0?[]:i,o=e[1],s=o===void 0?{}:o,a=h8t(s)?{form:s}:s,l=a.form,c=w.useState(),u=ln(c,2),d=u[0],h=u[1],f=w.useMemo(function(){return s2e(d)},[d]),g=w.useRef(f);g.current=f;var m=w.useContext(eA),v=l||m,_=v&&v._init,b=pc(r),y=w.useRef(b);return y.current=b,w.useEffect(function(){if(_){var C=v.getFieldsValue,x=v.getInternalHooks,E=x($x),k=E.registerWatch,L=k(function(A,O){var P=Z_(a.preserve?O:A,y.current),F=s2e(P);g.current!==F&&(g.current=F,h(P))}),D=Z_(a.preserve?C(!0):C(),y.current);return d!==D&&h(D),L}},[_]),d}var s9t=w.forwardRef(r9t),HF=s9t;HF.FormProvider=n9t;HF.Field=THe;HF.List=Z8t;HF.useForm=IHe;HF.useWatch=o9t;const LHe=w.createContext({}),a9t=n=>({animationDuration:n,animationFillMode:"both"}),l9t=n=>({animationDuration:n,animationFillMode:"both"}),DHe=function(n,e,t,i){const o=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` ${o}${n}-enter, ${o}${n}-appear `]:Object.assign(Object.assign({},a9t(i)),{animationPlayState:"paused"}),[`${o}${n}-leave`]:Object.assign(Object.assign({},l9t(i)),{animationPlayState:"paused"}),[` ${o}${n}-enter${n}-enter-active, ${o}${n}-appear${n}-appear-active `]:{animationName:e,animationPlayState:"running"},[`${o}${n}-leave${n}-leave-active`]:{animationName:t,animationPlayState:"running",pointerEvents:"none"}}},c9t=new mh("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),u9t=new mh("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),d9t=new mh("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),h9t=new mh("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),f9t=new mh("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),p9t=new mh("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),g9t=new mh("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),m9t=new mh("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),_9t={"move-up":{inKeyframes:g9t,outKeyframes:m9t},"move-down":{inKeyframes:c9t,outKeyframes:u9t},"move-left":{inKeyframes:d9t,outKeyframes:h9t},"move-right":{inKeyframes:f9t,outKeyframes:p9t}},a2e=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:o}=_9t[e];return[DHe(i,r,o,n.motionDurationMid),{[` ${i}-enter, ${i}-appear `]:{opacity:0,animationTimingFunction:n.motionEaseOutCirc},[`${i}-leave`]:{animationTimingFunction:n.motionEaseInOutCirc}}]},AHe=new mh("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),NHe=new mh("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),RHe=new mh("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),OHe=new mh("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),v9t=new mh("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),b9t=new mh("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),y9t=new mh("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),C9t=new mh("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),w9t={"slide-up":{inKeyframes:AHe,outKeyframes:NHe},"slide-down":{inKeyframes:RHe,outKeyframes:OHe},"slide-left":{inKeyframes:v9t,outKeyframes:b9t},"slide-right":{inKeyframes:y9t,outKeyframes:C9t}},l2e=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:o}=w9t[e];return[DHe(i,r,o,n.motionDurationMid),{[` ${i}-enter, ${i}-appear `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:n.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${i}-leave`]:{animationTimingFunction:n.motionEaseInQuint}}]};function S9t(n){return function(t){return w.createElement(u_e,{theme:{token:{motion:!1,zIndexPopupBase:0}}},w.createElement(n,Object.assign({},t)))}}function PHe(n,e,t,i){function r(o){const{prefixCls:s,style:a}=o,l=w.useRef(null),[c,u]=w.useState(0),[d,h]=w.useState(0),[f,g]=Em(!1,{value:o.open}),{getPrefixCls:m}=w.useContext(Gm),v=m(e||"select",s);w.useEffect(()=>{if(g(!0),typeof ResizeObserver<"u"){const b=new ResizeObserver(C=>{const x=C[0].target;u(x.offsetHeight+8),h(x.offsetWidth)}),y=setInterval(()=>{var C;const x=t?`.${t(v)}`:`.${v}-dropdown`,E=(C=l.current)===null||C===void 0?void 0:C.querySelector(x);E&&(clearInterval(y),b.observe(E))},10);return()=>{clearInterval(y),b.disconnect()}}},[]);let _=Object.assign(Object.assign({},o),{style:Object.assign(Object.assign({},a),{margin:0}),open:f,visible:f,getPopupContainer:()=>l.current});return i&&(_=i(_)),w.createElement("div",{ref:l,style:{paddingBottom:c,position:"relative",minWidth:d}},w.createElement(n,Object.assign({},_)))}return S9t(r)}const E9t=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var n=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(n==null?void 0:n.substr(0,4))};function x9t(n){var e=n.prefixCls,t=n.align,i=n.arrow,r=n.arrowPos,o=i||{},s=o.className,a=o.content,l=r.x,c=l===void 0?0:l,u=r.y,d=u===void 0?0:u,h=w.useRef();if(!t||!t.points)return null;var f={position:"absolute"};if(t.autoArrow!==!1){var g=t.points[0],m=t.points[1],v=g[0],_=g[1],b=m[0],y=m[1];v===b||!["t","b"].includes(v)?f.top=d:v==="t"?f.top=0:f.bottom=0,_===y||!["l","r"].includes(_)?f.left=c:_==="l"?f.left=0:f.right=0}return w.createElement("div",{ref:h,className:Nt("".concat(e,"-arrow"),s),style:f},a)}function T9t(n){var e=n.prefixCls,t=n.open,i=n.zIndex,r=n.mask,o=n.motion;return r?w.createElement(FF,Ct({},o,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return w.createElement("div",{style:{zIndex:i},className:Nt("".concat(e,"-mask"),a)})}):null}var k9t=w.memo(function(n){var e=n.children;return e},function(n,e){return e.cache}),I9t=w.forwardRef(function(n,e){var t=n.popup,i=n.className,r=n.prefixCls,o=n.style,s=n.target,a=n.onVisibleChanged,l=n.open,c=n.keepDom,u=n.fresh,d=n.onClick,h=n.mask,f=n.arrow,g=n.arrowPos,m=n.align,v=n.motion,_=n.maskMotion,b=n.forceRender,y=n.getPopupContainer,C=n.autoDestroy,x=n.portal,E=n.zIndex,k=n.onMouseEnter,L=n.onMouseLeave,D=n.onPointerEnter,A=n.ready,O=n.offsetX,P=n.offsetY,F=n.offsetR,B=n.offsetB,M=n.onAlign,V=n.onPrepare,U=n.stretch,W=n.targetWidth,q=n.targetHeight,H=typeof t=="function"?t():t,ie=l||c,se=(y==null?void 0:y.length)>0,Q=w.useState(!y||!se),Ee=ln(Q,2),Fe=Ee[0],He=Ee[1];if(oh(function(){!Fe&&se&&s&&He(!0)},[Fe,se,s]),!Fe)return null;var ke="auto",Me={left:"-1000vw",top:"-1000vh",right:ke,bottom:ke};if(A||!l){var je,qe=m.points,Be=m.dynamicInset||((je=m._experimental)===null||je===void 0?void 0:je.dynamicInset),_t=Be&&qe[0][1]==="r",Wt=Be&&qe[0][0]==="b";_t?(Me.right=F,Me.left=ke):(Me.left=O,Me.right=ke),Wt?(Me.bottom=B,Me.top=ke):(Me.top=P,Me.bottom=ke)}var Tt={};return U&&(U.includes("height")&&q?Tt.height=q:U.includes("minHeight")&&q&&(Tt.minHeight=q),U.includes("width")&&W?Tt.width=W:U.includes("minWidth")&&W&&(Tt.minWidth=W)),l||(Tt.pointerEvents="none"),w.createElement(x,{open:b||ie,getContainer:y&&function(){return y(s)},autoDestroy:C},w.createElement(T9t,{prefixCls:r,open:l,zIndex:E,mask:h,motion:_}),w.createElement(n_e,{onResize:M,disabled:!l},function(rn){return w.createElement(FF,Ct({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(r,"-hidden")},v,{onAppearPrepare:V,onEnterPrepare:V,visible:l,onVisibleChanged:function(wt){var pt;v==null||(pt=v.onVisibleChanged)===null||pt===void 0||pt.call(v,wt),a(wt)}}),function(_n,wt){var pt=_n.className,ot=_n.style,we=Nt(r,pt,i);return w.createElement("div",{ref:Aq(rn,e,wt),className:we,style:ct(ct(ct(ct({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},Me),Tt),ot),{},{boxSizing:"border-box",zIndex:E},o),onMouseEnter:k,onMouseLeave:L,onPointerEnter:D,onClick:d},f&&w.createElement(x9t,{prefixCls:r,arrow:f,arrowPos:g,align:m}),w.createElement(k9t,{cache:!l&&!u},H))})}))}),L9t=w.forwardRef(function(n,e){var t=n.children,i=n.getTriggerDOMNode,r=PF(t),o=w.useCallback(function(a){e_e(e,i?i(a):a)},[i]),s=t_e(o,t.ref);return r?w.cloneElement(t,{ref:s}):t}),c2e=w.createContext(null);function u2e(n){return n?Array.isArray(n)?n:[n]:[]}function D9t(n,e,t,i){return w.useMemo(function(){var r=u2e(t??e),o=u2e(i??e),s=new Set(r),a=new Set(o);return n&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[n,e,t,i])}function A9t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?n[0]===e[0]:n[0]===e[0]&&n[1]===e[1]}function N9t(n,e,t,i){for(var r=t.points,o=Object.keys(n),s=0;s<o.length;s+=1){var a,l=o[s];if(A9t((a=n[l])===null||a===void 0?void 0:a.points,r,i))return"".concat(e,"-placement-").concat(l)}return""}function d2e(n,e,t,i){return e||(t?{motionName:"".concat(n,"-").concat(t)}:i?{motionName:i}:null)}function WF(n){return n.ownerDocument.defaultView}function ose(n){for(var e=[],t=n==null?void 0:n.parentElement,i=["hidden","scroll","clip","auto"];t;){var r=WF(t).getComputedStyle(t),o=r.overflowX,s=r.overflowY,a=r.overflow;[o,s,a].some(function(l){return i.includes(l)})&&e.push(t),t=t.parentElement}return e}function U4(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(n)?e:n}function sO(n){return U4(parseFloat(n),0)}function h2e(n,e){var t=ct({},n);return(e||[]).forEach(function(i){if(!(i instanceof HTMLBodyElement||i instanceof HTMLHtmlElement)){var r=WF(i).getComputedStyle(i),o=r.overflow,s=r.overflowClipMargin,a=r.borderTopWidth,l=r.borderBottomWidth,c=r.borderLeftWidth,u=r.borderRightWidth,d=i.getBoundingClientRect(),h=i.offsetHeight,f=i.clientHeight,g=i.offsetWidth,m=i.clientWidth,v=sO(a),_=sO(l),b=sO(c),y=sO(u),C=U4(Math.round(d.width/g*1e3)/1e3),x=U4(Math.round(d.height/h*1e3)/1e3),E=(g-m-b-y)*C,k=(h-f-v-_)*x,L=v*x,D=_*x,A=b*C,O=y*C,P=0,F=0;if(o==="clip"){var B=sO(s);P=B*C,F=B*x}var M=d.x+A-P,V=d.y+L-F,U=M+d.width+2*P-A-O-E,W=V+d.height+2*F-L-D-k;t.left=Math.max(t.left,M),t.top=Math.max(t.top,V),t.right=Math.min(t.right,U),t.bottom=Math.min(t.bottom,W)}}),t}function f2e(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t="".concat(e),i=t.match(/^(.*)\%$/);return i?n*(parseFloat(i[1])/100):parseFloat(t)}function p2e(n,e){var t=e||[],i=ln(t,2),r=i[0],o=i[1];return[f2e(n.width,r),f2e(n.height,o)]}function g2e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[n[0],n[1]]}function UI(n,e){var t=e[0],i=e[1],r,o;return t==="t"?o=n.y:t==="b"?o=n.y+n.height:o=n.y+n.height/2,i==="l"?r=n.x:i==="r"?r=n.x+n.width:r=n.x+n.width/2,{x:r,y:o}}function Z1(n,e){var t={t:"b",b:"t",l:"r",r:"l"};return n.map(function(i,r){return r===e?t[i]||"c":i}).join("")}function R9t(n,e,t,i,r,o,s){var a=w.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[i]||{}}),l=ln(a,2),c=l[0],u=l[1],d=w.useRef(0),h=w.useMemo(function(){return e?ose(e):[]},[e]),f=w.useRef({}),g=function(){f.current={}};n||g();var m=M_(function(){if(e&&t&&n){let Tr=function(so,qi){var Xn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ot,bi=q.x+so,qn=q.y+qi,oi=bi+Me,Si=qn+ke,Ki=Math.max(bi,Xn.left),Sn=Math.max(qn,Xn.top),wn=Math.min(oi,Xn.right),Kn=Math.min(Si,Xn.bottom);return Math.max(0,(wn-Ki)*(Kn-Sn))},Fr=function(){to=q.y+Tn,Ge=to+ke,xt=q.x+zn,qt=xt+Me};var b,y,C=e,x=C.ownerDocument,E=WF(C),k=E.getComputedStyle(C),L=k.width,D=k.height,A=k.position,O=C.style.left,P=C.style.top,F=C.style.right,B=C.style.bottom,M=ct(ct({},r[i]),o),V=x.createElement("div");(b=C.parentElement)===null||b===void 0||b.appendChild(V),V.style.left="".concat(C.offsetLeft,"px"),V.style.top="".concat(C.offsetTop,"px"),V.style.position=A,V.style.height="".concat(C.offsetHeight,"px"),V.style.width="".concat(C.offsetWidth,"px"),C.style.left="0",C.style.top="0",C.style.right="auto",C.style.bottom="auto";var U;if(Array.isArray(t))U={x:t[0],y:t[1],width:0,height:0};else{var W=t.getBoundingClientRect();U={x:W.x,y:W.y,width:W.width,height:W.height}}var q=C.getBoundingClientRect(),H=x.documentElement,ie=H.clientWidth,se=H.clientHeight,Q=H.scrollWidth,Ee=H.scrollHeight,Fe=H.scrollTop,He=H.scrollLeft,ke=q.height,Me=q.width,je=U.height,qe=U.width,Be={left:0,top:0,right:ie,bottom:se},_t={left:-He,top:-Fe,right:Q-He,bottom:Ee-Fe},Wt=M.htmlRegion,Tt="visible",rn="visibleFirst";Wt!=="scroll"&&Wt!==rn&&(Wt=Tt);var _n=Wt===rn,wt=h2e(_t,h),pt=h2e(Be,h),ot=Wt===Tt?pt:wt,we=_n?pt:ot;C.style.left="auto",C.style.top="auto",C.style.right="0",C.style.bottom="0";var Se=C.getBoundingClientRect();C.style.left=O,C.style.top=P,C.style.right=F,C.style.bottom=B,(y=C.parentElement)===null||y===void 0||y.removeChild(V);var re=U4(Math.round(Me/parseFloat(L)*1e3)/1e3),Y=U4(Math.round(ke/parseFloat(D)*1e3)/1e3);if(re===0||Y===0||BH(t)&&!h_e(t))return;var Z=M.offset,le=M.targetOffset,te=p2e(q,Z),me=ln(te,2),Oe=me[0],et=me[1],Et=p2e(U,le),Qe=ln(Et,2),At=Qe[0],Ut=Qe[1];U.x-=At,U.y-=Ut;var fe=M.points||[],Re=ln(fe,2),Je=Re[0],Ot=Re[1],Ft=g2e(Ot),jt=g2e(Je),Jt=UI(U,Ft),ei=UI(q,jt),sr=ct({},M),zn=Jt.x-ei.x+Oe,Tn=Jt.y-ei.y+et,pi=Tr(zn,Tn),Ei=Tr(zn,Tn,pt),$i=UI(U,["t","l"]),Pr=UI(q,["t","l"]),ro=UI(U,["b","r"]),Vo=UI(q,["b","r"]),oo=M.overflow||{},ta=oo.adjustX,Mr=oo.adjustY,er=oo.shiftX,on=oo.shiftY,hi=function(qi){return typeof qi=="boolean"?qi:qi>=0},to,Ge,xt,qt;Fr();var hn=hi(Mr),ut=jt[0]===Ft[0];if(hn&&jt[0]==="t"&&(Ge>we.bottom||f.current.bt)){var Ie=Tn;ut?Ie-=ke-je:Ie=$i.y-Vo.y-et;var nt=Tr(zn,Ie),Ve=Tr(zn,Ie,pt);nt>pi||nt===pi&&(!_n||Ve>=Ei)?(f.current.bt=!0,Tn=Ie,et=-et,sr.points=[Z1(jt,0),Z1(Ft,0)]):f.current.bt=!1}if(hn&&jt[0]==="b"&&(to<we.top||f.current.tb)){var ye=Tn;ut?ye+=ke-je:ye=ro.y-Pr.y-et;var Xe=Tr(zn,ye),yt=Tr(zn,ye,pt);Xe>pi||Xe===pi&&(!_n||yt>=Ei)?(f.current.tb=!0,Tn=ye,et=-et,sr.points=[Z1(jt,0),Z1(Ft,0)]):f.current.tb=!1}var it=hi(ta),fn=jt[1]===Ft[1];if(it&&jt[1]==="l"&&(qt>we.right||f.current.rl)){var In=zn;fn?In-=Me-qe:In=$i.x-Vo.x-Oe;var ti=Tr(In,Tn),gi=Tr(In,Tn,pt);ti>pi||ti===pi&&(!_n||gi>=Ei)?(f.current.rl=!0,zn=In,Oe=-Oe,sr.points=[Z1(jt,1),Z1(Ft,1)]):f.current.rl=!1}if(it&&jt[1]==="r"&&(xt<we.left||f.current.lr)){var Vi=zn;fn?Vi+=Me-qe:Vi=ro.x-Pr.x-Oe;var Hn=Tr(Vi,Tn),pn=Tr(Vi,Tn,pt);Hn>pi||Hn===pi&&(!_n||pn>=Ei)?(f.current.lr=!0,zn=Vi,Oe=-Oe,sr.points=[Z1(jt,1),Z1(Ft,1)]):f.current.lr=!1}Fr();var ii=er===!0?0:er;typeof ii=="number"&&(xt<pt.left&&(zn-=xt-pt.left-Oe,U.x+qe<pt.left+ii&&(zn+=U.x-pt.left+qe-ii)),qt>pt.right&&(zn-=qt-pt.right-Oe,U.x>pt.right-ii&&(zn+=U.x-pt.right+ii)));var lr=on===!0?0:on;typeof lr=="number"&&(to<pt.top&&(Tn-=to-pt.top-et,U.y+je<pt.top+lr&&(Tn+=U.y-pt.top+je-lr)),Ge>pt.bottom&&(Tn-=Ge-pt.bottom-et,U.y>pt.bottom-lr&&(Tn+=U.y-pt.bottom+lr)));var hr=q.x+zn,na=hr+Me,va=q.y+Tn,Ua=va+ke,os=U.x,gs=os+qe,Ho=U.y,kl=Ho+je,cc=Math.max(hr,os),xi=Math.min(na,gs),co=(cc+xi)/2,bo=co-hr,Ws=Math.max(va,Ho),Wo=Math.min(Ua,kl),zs=(Ws+Wo)/2,Mo=zs-va;s==null||s(e,sr);var Kr=Se.right-q.x-(zn+q.width),uo=Se.bottom-q.y-(Tn+q.height);u({ready:!0,offsetX:zn/re,offsetY:Tn/Y,offsetR:Kr/re,offsetB:uo/Y,arrowX:bo/re,arrowY:Mo/Y,scaleX:re,scaleY:Y,align:sr})}}),v=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&m()})},_=function(){u(function(y){return ct(ct({},y),{},{ready:!1})})};return oh(_,[i]),oh(function(){n||_()},[n]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function O9t(n,e,t,i,r){oh(function(){if(n&&e&&t){let d=function(){i(),r()};var o=e,s=t,a=ose(o),l=ose(s),c=WF(s),u=new Set([c].concat(Jr(a),Jr(l)));return u.forEach(function(h){h.addEventListener("scroll",d,{passive:!0})}),c.addEventListener("resize",d,{passive:!0}),i(),function(){u.forEach(function(h){h.removeEventListener("scroll",d),c.removeEventListener("resize",d)})}}},[n,e,t])}function P9t(n,e,t,i,r,o,s,a){var l=w.useRef(n),c=w.useRef(!1);l.current!==n&&(c.current=!0,l.current=n),w.useEffect(function(){var u=Qf(function(){c.current=!1});return function(){Qf.cancel(u)}},[n]),w.useEffect(function(){if(e&&i&&(!r||o)){var u=function(){var E=!1,k=function(A){var O=A.target;E=s(O)},L=function(A){var O=A.target;!c.current&&l.current&&!E&&!s(O)&&a(!1)};return[k,L]},d=u(),h=ln(d,2),f=h[0],g=h[1],m=u(),v=ln(m,2),_=v[0],b=v[1],y=WF(i);y.addEventListener("mousedown",f,!0),y.addEventListener("click",g,!0),y.addEventListener("contextmenu",g,!0);var C=jH(t);return C&&(C.addEventListener("mousedown",_,!0),C.addEventListener("click",b,!0),C.addEventListener("contextmenu",b,!0)),function(){y.removeEventListener("mousedown",f,!0),y.removeEventListener("click",g,!0),y.removeEventListener("contextmenu",g,!0),C&&(C.removeEventListener("mousedown",_,!0),C.removeEventListener("click",b,!0),C.removeEventListener("contextmenu",b,!0))}}},[e,t,i,r,o])}var M9t=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function F9t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wHe,e=w.forwardRef(function(t,i){var r=t.prefixCls,o=r===void 0?"rc-trigger-popup":r,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,m=t.mouseEnterDelay,v=t.mouseLeaveDelay,_=v===void 0?.1:v,b=t.focusDelay,y=t.blurDelay,C=t.mask,x=t.maskClosable,E=x===void 0?!0:x,k=t.getPopupContainer,L=t.forceRender,D=t.autoDestroy,A=t.destroyPopupOnHide,O=t.popup,P=t.popupClassName,F=t.popupStyle,B=t.popupPlacement,M=t.builtinPlacements,V=M===void 0?{}:M,U=t.popupAlign,W=t.zIndex,q=t.stretch,H=t.getPopupClassNameFromAlign,ie=t.fresh,se=t.alignPoint,Q=t.onPopupClick,Ee=t.onPopupAlign,Fe=t.arrow,He=t.popupMotion,ke=t.maskMotion,Me=t.popupTransitionName,je=t.popupAnimation,qe=t.maskTransitionName,Be=t.maskAnimation,_t=t.className,Wt=t.getTriggerDOMNode,Tt=Qu(t,M9t),rn=D||A||!1,_n=w.useState(!1),wt=ln(_n,2),pt=wt[0],ot=wt[1];oh(function(){ot(E9t())},[]);var we=w.useRef({}),Se=w.useContext(c2e),re=w.useMemo(function(){return{registerSubPopup:function(Pt,vn){we.current[Pt]=vn,Se==null||Se.registerSubPopup(Pt,vn)}}},[Se]),Y=d8t(),Z=w.useState(null),le=ln(Z,2),te=le[0],me=le[1],Oe=M_(function(gt){BH(gt)&&te!==gt&&me(gt),Se==null||Se.registerSubPopup(Y,gt)}),et=w.useState(null),Et=ln(et,2),Qe=Et[0],At=Et[1],Ut=w.useRef(null),fe=M_(function(gt){BH(gt)&&Qe!==gt&&(At(gt),Ut.current=gt)}),Re=w.Children.only(s),Je=(Re==null?void 0:Re.props)||{},Ot={},Ft=M_(function(gt){var Pt,vn,Zn=Qe;return(Zn==null?void 0:Zn.contains(gt))||((Pt=jH(Zn))===null||Pt===void 0?void 0:Pt.host)===gt||gt===Zn||(te==null?void 0:te.contains(gt))||((vn=jH(te))===null||vn===void 0?void 0:vn.host)===gt||gt===te||Object.values(we.current).some(function(Wn){return(Wn==null?void 0:Wn.contains(gt))||gt===Wn})}),jt=d2e(o,He,je,Me),Jt=d2e(o,ke,Be,qe),ei=w.useState(h||!1),sr=ln(ei,2),zn=sr[0],Tn=sr[1],pi=d??zn,Ei=M_(function(gt){d===void 0&&Tn(gt)});oh(function(){Tn(d||!1)},[d]);var $i=w.useRef(pi);$i.current=pi;var Pr=M_(function(gt){sp.flushSync(function(){pi!==gt&&(Ei(gt),f==null||f(gt))})}),ro=w.useRef(),Vo=function(){clearTimeout(ro.current)},oo=function(Pt){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Vo(),vn===0?Pr(Pt):ro.current=setTimeout(function(){Pr(Pt)},vn*1e3)};w.useEffect(function(){return Vo},[]);var ta=w.useState(!1),Mr=ln(ta,2),er=Mr[0],on=Mr[1];oh(function(gt){(!gt||pi)&&on(!0)},[pi]);var hi=w.useState(null),to=ln(hi,2),Ge=to[0],xt=to[1],qt=w.useState([0,0]),hn=ln(qt,2),ut=hn[0],Ie=hn[1],nt=function(Pt){Ie([Pt.clientX,Pt.clientY])},Ve=R9t(pi,te,se?ut:Qe,B,V,U,Ee),ye=ln(Ve,11),Xe=ye[0],yt=ye[1],it=ye[2],fn=ye[3],In=ye[4],ti=ye[5],gi=ye[6],Vi=ye[7],Hn=ye[8],pn=ye[9],ii=ye[10],lr=D9t(pt,l,c,u),hr=ln(lr,2),na=hr[0],va=hr[1],Ua=na.has("click"),os=va.has("click")||va.has("contextMenu"),gs=M_(function(){er||ii()}),Ho=function(){$i.current&&se&&os&&oo(!1)};O9t(pi,Qe,te,gs,Ho),oh(function(){gs()},[ut,B]),oh(function(){pi&&!(V!=null&&V[B])&&gs()},[JSON.stringify(U)]);var kl=w.useMemo(function(){var gt=N9t(V,o,pn,se);return Nt(gt,H==null?void 0:H(pn))},[pn,H,V,o,se]);w.useImperativeHandle(i,function(){return{nativeElement:Ut.current,forceAlign:gs}});var cc=w.useState(0),xi=ln(cc,2),co=xi[0],bo=xi[1],Ws=w.useState(0),Wo=ln(Ws,2),zs=Wo[0],Mo=Wo[1],Kr=function(){if(q&&Qe){var Pt=Qe.getBoundingClientRect();bo(Pt.width),Mo(Pt.height)}},uo=function(){Kr(),gs()},Tr=function(Pt){on(!1),ii(),g==null||g(Pt)},Fr=function(){return new Promise(function(Pt){Kr(),xt(function(){return Pt})})};oh(function(){Ge&&(ii(),Ge(),xt(null))},[Ge]);function so(gt,Pt,vn,Zn){Ot[gt]=function(Wn){var ui;Zn==null||Zn(Wn),oo(Pt,vn);for(var Br=arguments.length,ho=new Array(Br>1?Br-1:0),Xr=1;Xr<Br;Xr++)ho[Xr-1]=arguments[Xr];(ui=Je[gt])===null||ui===void 0||ui.call.apply(ui,[Je,Wn].concat(ho))}}(Ua||os)&&(Ot.onClick=function(gt){var Pt;$i.current&&os?oo(!1):!$i.current&&Ua&&(nt(gt),oo(!0));for(var vn=arguments.length,Zn=new Array(vn>1?vn-1:0),Wn=1;Wn<vn;Wn++)Zn[Wn-1]=arguments[Wn];(Pt=Je.onClick)===null||Pt===void 0||Pt.call.apply(Pt,[Je,gt].concat(Zn))}),P9t(pi,os,Qe,te,C,E,Ft,oo);var qi=na.has("hover"),Xn=va.has("hover"),bi,qn;qi&&(so("onMouseEnter",!0,m,function(gt){nt(gt)}),so("onPointerEnter",!0,m,function(gt){nt(gt)}),bi=function(){(pi||er)&&oo(!0,m)},se&&(Ot.onMouseMove=function(gt){var Pt;(Pt=Je.onMouseMove)===null||Pt===void 0||Pt.call(Je,gt)})),Xn&&(so("onMouseLeave",!1,_),so("onPointerLeave",!1,_),qn=function(){oo(!1,_)}),na.has("focus")&&so("onFocus",!0,b),va.has("focus")&&so("onBlur",!1,y),na.has("contextMenu")&&(Ot.onContextMenu=function(gt){var Pt;$i.current&&va.has("contextMenu")?oo(!1):(nt(gt),oo(!0)),gt.preventDefault();for(var vn=arguments.length,Zn=new Array(vn>1?vn-1:0),Wn=1;Wn<vn;Wn++)Zn[Wn-1]=arguments[Wn];(Pt=Je.onContextMenu)===null||Pt===void 0||Pt.call.apply(Pt,[Je,gt].concat(Zn))}),_t&&(Ot.className=Nt(Je.className,_t));var oi=ct(ct({},Je),Ot),Si={},Ki=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ki.forEach(function(gt){Tt[gt]&&(Si[gt]=function(){for(var Pt,vn=arguments.length,Zn=new Array(vn),Wn=0;Wn<vn;Wn++)Zn[Wn]=arguments[Wn];(Pt=oi[gt])===null||Pt===void 0||Pt.call.apply(Pt,[oi].concat(Zn)),Tt[gt].apply(Tt,Zn)})});var Sn=w.cloneElement(Re,ct(ct({},oi),Si)),wn={x:ti,y:gi},Kn=Fe?ct({},Fe!==!0?Fe:{}):null;return w.createElement(w.Fragment,null,w.createElement(n_e,{disabled:!pi,ref:fe,onResize:uo},w.createElement(L9t,{getTriggerDOMNode:Wt},Sn)),w.createElement(c2e.Provider,{value:re},w.createElement(I9t,{portal:n,ref:Oe,prefixCls:o,popup:O,className:Nt(P,kl),style:F,target:Qe,onMouseEnter:bi,onMouseLeave:qn,onPointerEnter:bi,zIndex:W,open:pi,keepDom:er,fresh:ie,onClick:Q,mask:C,motion:jt,maskMotion:Jt,onVisibleChanged:Tr,onPrepare:Fr,forceRender:L,autoDestroy:rn,getPopupContainer:k,align:pn,arrow:Kn,arrowPos:wn,ready:Xe,offsetX:yt,offsetY:it,offsetR:fn,offsetB:In,onAlign:gs,stretch:q,targetWidth:co/Vi,targetHeight:zs/Hn})))});return e}const B9t=F9t(wHe);function MHe(n,e,t){return Nt({[`${n}-status-success`]:e==="success",[`${n}-status-warning`]:e==="warning",[`${n}-status-error`]:e==="error",[`${n}-status-validating`]:e==="validating",[`${n}-has-feedback`]:t})}const FHe=(n,e)=>e||n;var BHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){return function(t,i){i.prototype.weekday=function(r){var o=this.$locale().weekStart||0,s=this.$W,a=(s<o?s+7:s)-o;return this.$utils().u(r)?a:this.subtract(a,"day").add(r,"day")}}})})(BHe);var $9t=BHe.exports;const V9t=nl($9t);var $He={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){return function(t,i,r){var o=i.prototype,s=function(d){return d&&(d.indexOf?d:d.s)},a=function(d,h,f,g,m){var v=d.name?d:d.$locale(),_=s(v[h]),b=s(v[f]),y=_||b.map(function(x){return x.slice(0,g)});if(!m)return y;var C=v.weekStart;return y.map(function(x,E){return y[(E+(C||0))%7]})},l=function(){return r.Ls[r.locale()]},c=function(d,h){return d.formats[h]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,m,v){return m||v.slice(1)})}(d.formats[h.toUpperCase()])},u=function(){var d=this;return{months:function(h){return h?h.format("MMMM"):a(d,"months")},monthsShort:function(h){return h?h.format("MMM"):a(d,"monthsShort","months",3)},firstDayOfWeek:function(){return d.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):a(d,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):a(d,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):a(d,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return c(d.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return u.bind(this)()},r.localeData=function(){var d=l();return{firstDayOfWeek:function(){return d.weekStart||0},weekdays:function(){return r.weekdays()},weekdaysShort:function(){return r.weekdaysShort()},weekdaysMin:function(){return r.weekdaysMin()},months:function(){return r.months()},monthsShort:function(){return r.monthsShort()},longDateFormat:function(h){return c(d,h)},meridiem:d.meridiem,ordinal:d.ordinal}},r.months=function(){return a(l(),"months")},r.monthsShort=function(){return a(l(),"monthsShort","months",3)},r.weekdays=function(d){return a(l(),"weekdays",null,null,d)},r.weekdaysShort=function(d){return a(l(),"weekdaysShort","weekdays",3,d)},r.weekdaysMin=function(d){return a(l(),"weekdaysMin","weekdays",2,d)}}})})($He);var H9t=$He.exports;const W9t=nl(H9t);var VHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){var t="week",i="year";return function(r,o,s){var a=o.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=s(this).startOf(i).add(1,i).date(c),d=s(this).endOf(t);if(u.isBefore(d))return 1}var h=s(this).startOf(i).date(c).startOf(t).subtract(1,"millisecond"),f=this.diff(h,t,!0);return f<0?s(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(VHe);var z9t=VHe.exports;const U9t=nl(z9t);var HHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){return function(t,i){i.prototype.weekYear=function(){var r=this.month(),o=this.week(),s=this.year();return o===1&&r===11?s+1:r===0&&o>=52?s-1:s}}})})(HHe);var j9t=HHe.exports;const q9t=nl(j9t);var WHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){return function(t,i){var r=i.prototype,o=r.format;r.format=function(s){var a=this,l=this.$locale();if(!this.isValid())return o.bind(this)(s);var c=this.$utils(),u=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return c.s(a.week(),d==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),d==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return d}});return o.bind(this)(u)}}})})(WHe);var K9t=WHe.exports;const G9t=nl(K9t);var zHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,o=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,a={},l=function(m){return(m=+m)+(m>68?1900:2e3)},c=function(m){return function(v){this[m]=+v}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(v){if(!v||v==="Z")return 0;var _=v.match(/([+-]|\d\d)/g),b=60*_[1]+(+_[2]||0);return b===0?0:_[0]==="+"?-b:b}(m)}],d=function(m){var v=a[m];return v&&(v.indexOf?v:v.s.concat(v.f))},h=function(m,v){var _,b=a.meridiem;if(b){for(var y=1;y<=24;y+=1)if(m.indexOf(b(y,0,v))>-1){_=y>12;break}}else _=m===(v?"pm":"PM");return _},f={A:[s,function(m){this.afternoon=h(m,!1)}],a:[s,function(m){this.afternoon=h(m,!0)}],S:[/\d/,function(m){this.milliseconds=100*+m}],SS:[r,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[r,c("day")],Do:[s,function(m){var v=a.ordinal,_=m.match(/\d+/);if(this.day=_[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===m&&(this.day=b)}],M:[o,c("month")],MM:[r,c("month")],MMM:[s,function(m){var v=d("months"),_=(d("monthsShort")||v.map(function(b){return b.slice(0,3)})).indexOf(m)+1;if(_<1)throw new Error;this.month=_%12||_}],MMMM:[s,function(m){var v=d("months").indexOf(m)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(m){this.year=l(m)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(m){var v,_;v=m,_=a&&a.formats;for(var b=(m=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,A,O){var P=O&&O.toUpperCase();return A||_[O]||t[O]||_[P].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(F,B,M){return B||M.slice(1)})})).match(i),y=b.length,C=0;C<y;C+=1){var x=b[C],E=f[x],k=E&&E[0],L=E&&E[1];b[C]=L?{regex:k,parser:L}:x.replace(/^\[|\]$/g,"")}return function(D){for(var A={},O=0,P=0;O<y;O+=1){var F=b[O];if(typeof F=="string")P+=F.length;else{var B=F.regex,M=F.parser,V=D.slice(P),U=B.exec(V)[0];M.call(A,U),D=D.replace(U,"")}}return function(W){var q=W.afternoon;if(q!==void 0){var H=W.hours;q?H<12&&(W.hours+=12):H===12&&(W.hours=0),delete W.afternoon}}(A),A}}return function(m,v,_){_.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(l=m.parseTwoDigitYear);var b=v.prototype,y=b.parse;b.parse=function(C){var x=C.date,E=C.utc,k=C.args;this.$u=E;var L=k[1];if(typeof L=="string"){var D=k[2]===!0,A=k[3]===!0,O=D||A,P=k[2];A&&(P=k[2]),a=this.$locale(),!D&&P&&(a=_.Ls[P]),this.$d=function(V,U,W){try{if(["x","X"].indexOf(U)>-1)return new Date((U==="X"?1e3:1)*V);var q=g(U)(V),H=q.year,ie=q.month,se=q.day,Q=q.hours,Ee=q.minutes,Fe=q.seconds,He=q.milliseconds,ke=q.zone,Me=new Date,je=se||(H||ie?1:Me.getDate()),qe=H||Me.getFullYear(),Be=0;H&&!ie||(Be=ie>0?ie-1:Me.getMonth());var _t=Q||0,Wt=Ee||0,Tt=Fe||0,rn=He||0;return ke?new Date(Date.UTC(qe,Be,je,_t,Wt,Tt,rn+60*ke.offset*1e3)):W?new Date(Date.UTC(qe,Be,je,_t,Wt,Tt,rn)):new Date(qe,Be,je,_t,Wt,Tt,rn)}catch{return new Date("")}}(x,L,E),this.init(),P&&P!==!0&&(this.$L=this.locale(P).$L),O&&x!=this.format(L)&&(this.$d=new Date("")),a={}}else if(L instanceof Array)for(var F=L.length,B=1;B<=F;B+=1){k[1]=L[B-1];var M=_.apply(this,k);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}B===F&&(this.$d=new Date(""))}else y.call(this,C)}}})})(zHe);var Y9t=zHe.exports;const y_e=nl(Y9t);Un.extend(y_e);Un.extend(G9t);Un.extend(V9t);Un.extend(W9t);Un.extend(U9t);Un.extend(q9t);Un.extend(function(n,e){var t=e.prototype,i=t.format;t.format=function(o){var s=(o||"").replace("Wo","wo");return i.bind(this)(s)}});var Q9t={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},OE=function(e){var t=Q9t[e];return t||e.split("_")[0]},m2e=function(){pVe(!1,"Not match any format. Please help to fire a issue about this.")},X9t={getNow:function(){return Un()},getFixedDate:function(e){return Un(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return Un().locale(OE(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(OE(e)).weekday(0)},getWeek:function(e,t){return t.locale(OE(e)).week()},getShortWeekDays:function(e){return Un().locale(OE(e)).localeData().weekdaysMin()},getShortMonths:function(e){return Un().locale(OE(e)).localeData().monthsShort()},format:function(e,t,i){return t.locale(OE(e)).format(i)},parse:function(e,t,i){for(var r=OE(e),o=0;o<i.length;o+=1){var s=i[o],a=t;if(s.includes("wo")||s.includes("Wo")){for(var l=a.split("-")[0],c=a.split("-")[1],u=Un(l,"YYYY").startOf("year").locale(r),d=0;d<=52;d+=1){var h=u.add(d,"week");if(h.format("Wo")===c)return h}return m2e(),null}var f=Un(a,s,!0).locale(r);if(f.isValid())return f}return t&&m2e(),null}}},U_=10,Ay=U_*10,tM=7;function jk(n,e){if(!n&&!e)return!0;if(!n||!e)return!1}function Z9t(n,e,t){var i=jk(e,t);if(typeof i=="boolean")return i;var r=Math.floor(n.getYear(e)/10),o=Math.floor(n.getYear(t)/10);return r===o}function zF(n,e,t){var i=jk(e,t);return typeof i=="boolean"?i:n.getYear(e)===n.getYear(t)}function sse(n,e){var t=Math.floor(n.getMonth(e)/3);return t+1}function UHe(n,e,t){var i=jk(e,t);return typeof i=="boolean"?i:zF(n,e,t)&&sse(n,e)===sse(n,t)}function C_e(n,e,t){var i=jk(e,t);return typeof i=="boolean"?i:zF(n,e,t)&&n.getMonth(e)===n.getMonth(t)}function Ny(n,e,t){var i=jk(e,t);return typeof i=="boolean"?i:n.getYear(e)===n.getYear(t)&&n.getMonth(e)===n.getMonth(t)&&n.getDate(e)===n.getDate(t)}function J9t(n,e,t){var i=jk(e,t);return typeof i=="boolean"?i:n.getHour(e)===n.getHour(t)&&n.getMinute(e)===n.getMinute(t)&&n.getSecond(e)===n.getSecond(t)}function E$(n,e,t,i){var r=jk(t,i);return typeof r=="boolean"?r:zF(n,t,i)&&n.locale.getWeek(e,t)===n.locale.getWeek(e,i)}function tA(n,e,t){return Ny(n,e,t)&&J9t(n,e,t)}function sP(n,e,t,i){return!e||!t||!i?!1:!Ny(n,e,i)&&!Ny(n,t,i)&&n.isAfter(i,e)&&n.isAfter(t,i)}function e7t(n,e,t){var i=e.locale.getWeekFirstDay(n),r=e.setDate(t,1),o=e.getWeekDay(r),s=e.addDate(r,i-o);return e.getMonth(s)===e.getMonth(t)&&e.getDate(s)>1&&(s=e.addDate(s,-7)),s}function nM(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(e){case"year":return t.addYear(n,i*10);case"quarter":case"month":return t.addYear(n,i);default:return t.addMonth(n,i)}}function ch(n,e){var t=e.generateConfig,i=e.locale,r=e.format;return typeof r=="function"?r(n):t.locale.format(i.locale,n,r)}function jHe(n,e){var t=e.generateConfig,i=e.locale,r=e.formatList;return!n||typeof r[0]=="function"?null:t.locale.parse(i.locale,n,r)}function YH(n){var e=n.cellDate,t=n.mode,i=n.disabledDate,r=n.generateConfig;if(!i)return!1;var o=function(g,m,v){for(var _=m;_<=v;){var b=void 0;switch(g){case"date":{if(b=r.setDate(e,_),!i(b))return!1;break}case"month":{if(b=r.setMonth(e,_),!YH({cellDate:b,mode:"month",generateConfig:r,disabledDate:i}))return!1;break}case"year":{if(b=r.setYear(e,_),!YH({cellDate:b,mode:"year",generateConfig:r,disabledDate:i}))return!1;break}}_+=1}return!0};switch(t){case"date":case"week":return i(e);case"month":{var s=1,a=r.getDate(r.getEndDate(e));return o("date",s,a)}case"quarter":{var l=Math.floor(r.getMonth(e)/3)*3,c=l+2;return o("month",l,c)}case"year":return o("month",0,11);case"decade":{var u=r.getYear(e),d=Math.floor(u/U_)*U_,h=d+U_-1;return o("year",d,h)}}}function QH(n,e){var t=e.formatList,i=e.generateConfig,r=e.locale,o=OF(function(){if(!n)return[[""],""];for(var c="",u=[],d=0;d<t.length;d+=1){var h=t[d],f=ch(n,{generateConfig:i,locale:r,format:h});u.push(f),d===0&&(c=f)}return[u,c]},[n,t,r],function(c,u){return!tA(i,c[0],u[0])||!HH(c[1],u[1],!0)||!HH(c[2],u[2],!0)}),s=ln(o,2),a=s[0],l=s[1];return w.useMemo(function(){return[a,l]},[a.join(""),l])}function ase(n,e){var t=e.formatList,i=e.generateConfig,r=e.locale,o=w.useState(null),s=ln(o,2),a=s[0],l=s[1],c=w.useRef(null);function u(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(c.current),_){l(v);return}c.current=requestAnimationFrame(function(){l(v)})}var d=QH(a,{formatList:t,generateConfig:i,locale:r}),h=ln(d,2),f=h[1];function g(v){u(v)}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u(null,v)}return w.useEffect(function(){m(!0)},[n]),w.useEffect(function(){return function(){return cancelAnimationFrame(c.current)}},[]),[f,g,m]}var B8=new Map;function t7t(n,e){var t;function i(){h_e(n)?e():t=Qf(function(){i()})}return i(),function(){Qf.cancel(t)}}function lse(n,e,t){if(B8.get(n)&&cancelAnimationFrame(B8.get(n)),t<=0){B8.set(n,requestAnimationFrame(function(){n.scrollTop=e}));return}var i=e-n.scrollTop,r=i/t*10;B8.set(n,requestAnimationFrame(function(){n.scrollTop+=r,n.scrollTop!==e&&lse(n,e,t-10)}))}function RN(n,e){var t=e.onLeftRight,i=e.onCtrlLeftRight,r=e.onUpDown,o=e.onPageUpDown,s=e.onEnter,a=n.which,l=n.ctrlKey,c=n.metaKey;switch(a){case Jn.LEFT:if(l||c){if(i)return i(-1),!0}else if(t)return t(-1),!0;break;case Jn.RIGHT:if(l||c){if(i)return i(1),!0}else if(t)return t(1),!0;break;case Jn.UP:if(r)return r(-1),!0;break;case Jn.DOWN:if(r)return r(1),!0;break;case Jn.PAGE_UP:if(o)return o(-1),!0;break;case Jn.PAGE_DOWN:if(o)return o(1),!0;break;case Jn.ENTER:if(s)return s(),!0;break}return!1}function qHe(n,e,t,i){var r=n;if(!r)switch(e){case"time":r=i?"hh:mm:ss a":"HH:mm:ss";break;case"week":r="gggg-wo";break;case"month":r="YYYY-MM";break;case"quarter":r="YYYY-[Q]Q";break;case"year":r="YYYY";break;default:r=t?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return r}function KHe(n,e,t){var i=n==="time"?8:10,r=typeof e=="function"?e(t.getNow()).length:e.length;return Math.max(i,r)+2}var aO=null,$8=new Set;function n7t(n){return!aO&&typeof window<"u"&&window.addEventListener&&(aO=function(t){Jr($8).forEach(function(i){i(t)})},window.addEventListener("mousedown",aO)),$8.add(n),function(){$8.delete(n),$8.size===0&&(window.removeEventListener("mousedown",aO),aO=null)}}function i7t(n){var e=n.target;if(n.composed&&e.shadowRoot){var t;return((t=n.composedPath)===null||t===void 0?void 0:t.call(n)[0])||e}return e}var r7t=function(e){return e==="month"||e==="date"?"year":e},o7t=function(e){return e==="date"?"month":e},s7t=function(e){return e==="month"||e==="date"?"quarter":e},a7t=function(e){return e==="date"?"week":e},l7t={year:r7t,month:o7t,quarter:s7t,week:a7t,time:null,date:null};function GHe(n,e){return n.some(function(t){return t&&t.contains(e)})}function cse(n){var e=n.open,t=n.value,i=n.isClickOutside,r=n.triggerOpen,o=n.forwardKeyDown,s=n.onKeyDown,a=n.blurToCancel,l=n.changeOnBlur,c=n.onSubmit,u=n.onCancel,d=n.onFocus,h=n.onBlur,f=w.useState(!1),g=ln(f,2),m=g[0],v=g[1],_=w.useState(!1),b=ln(_,2),y=b[0],C=b[1],x=w.useRef(!1),E=w.useRef(!1),k=w.useRef(!1),L={onMouseDown:function(){v(!0),r(!0)},onKeyDown:function(A){var O=function(){k.current=!0};if(s(A,O),!k.current){switch(A.which){case Jn.ENTER:{e?c()!==!1&&v(!0):r(!0),A.preventDefault();return}case Jn.TAB:{m&&e&&!A.shiftKey?(v(!1),A.preventDefault()):!m&&e&&!o(A)&&A.shiftKey&&(v(!0),A.preventDefault());return}case Jn.ESC:{v(!0),u();return}}!e&&![Jn.SHIFT].includes(A.which)?r(!0):m||o(A)}},onFocus:function(A){v(!0),C(!0),d&&d(A)},onBlur:function(A){if(x.current||!i(document.activeElement)){x.current=!1;return}a?setTimeout(function(){for(var O=document,P=O.activeElement;P&&P.shadowRoot;)P=P.shadowRoot.activeElement;i(P)&&u()},0):e&&(r(!1),E.current&&c()),C(!1),h==null||h(A)}};return w.useEffect(function(){E.current=!1},[e]),w.useEffect(function(){E.current=!0},[t]),w.useEffect(function(){return n7t(function(D){var A=i7t(D),O=i(A);e&&(O?!l&&!a&&(!y||O)&&r(!1):(x.current=!0,Qf(function(){x.current=!1})))})}),[L,{focused:y,typing:m}]}function YHe(n,e){return w.useMemo(function(){return n||(e?(Nd(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(e).map(function(t){var i=ln(t,2),r=i[0],o=i[1];return{label:r,value:o}})):[])},[n,e])}function use(n){var e=n.valueTexts,t=n.onTextChange,i=w.useState(""),r=ln(i,2),o=r[0],s=r[1],a=w.useRef([]);a.current=e;function l(u){s(u),t(u)}function c(){s(a.current[0])}return oh(function(){e.every(function(u){return u!==o})&&c()},[e.join("||")]),[o,l,c]}var Zf=w.createContext({});function QHe(n){var e=n.cellRender,t=n.monthCellRender,i=n.dateRender,r=ae.useMemo(function(){if(e)return e;if(!(!t&&!i))return function(o,s){var a=o;return i&&s.type==="date"?i(a,s.today):t&&s.type==="month"?t(a,s.locale):s.originNode}},[e,t,i]);return r}function XHe(n,e){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",i=String(n);i.length<e;)i="".concat(t).concat(n);return i}var c7t=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t};function ZHe(n){return n==null?[]:Array.isArray(n)?n:[n]}function Do(n,e){return n?n[e]:null}function am(n,e,t){var i=[Do(n,0),Do(n,1)];return i[t]=typeof e=="function"?e(i[t]):e,!i[0]&&!i[1]?null:i}function _2e(n){return typeof n=="function"?n():n}function $q(n){var e=n.cellPrefixCls,t=n.generateConfig,i=n.rangedValue,r=n.hoverRangedValue,o=n.isInView,s=n.isSameCell,a=n.offsetCell,l=n.today,c=n.value;function u(d){var h,f=a(d,-1),g=a(d,1),m=Do(i,0),v=Do(i,1),_=Do(r,0),b=Do(r,1),y=sP(t,_,b,d);function C(A){return s(m,A)}function x(A){return s(v,A)}var E=s(_,d),k=s(b,d),L=(y||k)&&(!o(f)||x(f)),D=(y||E)&&(!o(g)||C(g));return h={},Ze(h,"".concat(e,"-in-view"),o(d)),Ze(h,"".concat(e,"-in-range"),sP(t,m,v,d)),Ze(h,"".concat(e,"-range-start"),C(d)),Ze(h,"".concat(e,"-range-end"),x(d)),Ze(h,"".concat(e,"-range-start-single"),C(d)&&!v),Ze(h,"".concat(e,"-range-end-single"),x(d)&&!m),Ze(h,"".concat(e,"-range-start-near-hover"),C(d)&&(s(f,_)||sP(t,_,b,f))),Ze(h,"".concat(e,"-range-end-near-hover"),x(d)&&(s(g,b)||sP(t,_,b,g))),Ze(h,"".concat(e,"-range-hover"),y),Ze(h,"".concat(e,"-range-hover-start"),E),Ze(h,"".concat(e,"-range-hover-end"),k),Ze(h,"".concat(e,"-range-hover-edge-start"),L),Ze(h,"".concat(e,"-range-hover-edge-end"),D),Ze(h,"".concat(e,"-range-hover-edge-start-near-range"),L&&s(f,v)),Ze(h,"".concat(e,"-range-hover-edge-end-near-range"),D&&s(g,m)),Ze(h,"".concat(e,"-today"),s(l,d)),Ze(h,"".concat(e,"-selected"),s(c,d)),h}return u}var qk=w.createContext({});function JHe(n,e,t,i,r){var o=n.setHour(e,t);return o=n.setMinute(o,i),o=n.setSecond(o,r),o}function eWe(n,e,t){if(!t)return e;var i=e;return i=n.setHour(i,n.getHour(t)),i=n.setMinute(i,n.getMinute(t)),i=n.setSecond(i,n.getSecond(t)),i}function u7t(n,e,t,i,r,o){var s=Math.floor(n/i)*i;if(s<n)return[s,60-r,60-o];var a=Math.floor(e/r)*r;if(a<e)return[s,a,60-o];var l=Math.floor(t/o)*o;return[s,a,l]}function d7t(n,e){var t=n.getYear(e),i=n.getMonth(e)+1,r=n.getEndDate(n.getFixedDate("".concat(t,"-").concat(i,"-01"))),o=n.getDate(r),s=i<10?"0".concat(i):"".concat(i);return"".concat(t,"-").concat(s,"-").concat(o)}function UF(n){for(var e=n.prefixCls,t=n.disabledDate,i=n.onSelect,r=n.picker,o=n.rowNum,s=n.colNum,a=n.prefixColumn,l=n.rowClassName,c=n.baseDate,u=n.getCellClassName,d=n.getCellText,h=n.getCellNode,f=n.getCellDate,g=n.generateConfig,m=n.titleCell,v=n.headerCells,_=w.useContext(Zf),b=_.onDateMouseEnter,y=_.onDateMouseLeave,C=_.mode,x="".concat(e,"-cell"),E=[],k=0;k<o;k+=1){for(var L=[],D=void 0,A=function(){var F,B=k*s+O,M=f(c,B),V=YH({cellDate:M,mode:C,disabledDate:t,generateConfig:g});O===0&&(D=M,a&&L.push(a(D)));var U=m&&m(M),W=w.createElement("div",{className:"".concat(x,"-inner")},d(M));L.push(w.createElement("td",{key:O,title:U,className:Nt(x,ct((F={},Ze(F,"".concat(x,"-disabled"),V),Ze(F,"".concat(x,"-start"),d(M)===1||r==="year"&&Number(U)%10===0),Ze(F,"".concat(x,"-end"),U===d7t(g,M)||r==="year"&&Number(U)%10===9),F),u(M))),onClick:function(){V||i(M)},onMouseEnter:function(){!V&&b&&b(M)},onMouseLeave:function(){!V&&y&&y(M)}},h?h(M,W):W))},O=0;O<s;O+=1)A();E.push(w.createElement("tr",{key:k,className:l&&l(D)},L))}return w.createElement("div",{className:"".concat(e,"-body")},w.createElement("table",{className:"".concat(e,"-content")},v&&w.createElement("thead",null,w.createElement("tr",null,v)),w.createElement("tbody",null,E)))}function h7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.prefixColumn,r=n.locale,o=n.rowCount,s=n.viewDate,a=n.value,l=n.cellRender,c=n.isSameCell,u=w.useContext(qk),d=u.rangedValue,h=u.hoverRangedValue,f=e7t(r.locale,t,s),g="".concat(e,"-cell"),m=t.locale.getWeekFirstDay(r.locale),v=t.getNow(),_=[],b=r.shortWeekDays||(t.locale.getShortWeekDays?t.locale.getShortWeekDays(r.locale):[]);i&&_.push(w.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var y=0;y<tM;y+=1)_.push(w.createElement("th",{key:y},b[(y+m)%tM]));var C=$q({cellPrefixCls:g,today:v,value:a,generateConfig:t,rangedValue:i?null:d,hoverRangedValue:i?null:h,isSameCell:c||function(E,k){return Ny(t,E,k)},isInView:function(k){return C_e(t,k,s)},offsetCell:function(k,L){return t.addDate(k,L)}}),x=l?function(E,k){return l(E,{originNode:k,today:v,type:"date",locale:r})}:void 0;return w.createElement(UF,Ct({},n,{rowNum:o,colNum:tM,baseDate:f,getCellNode:x,getCellText:t.getDate,getCellClassName:C,getCellDate:t.addDate,titleCell:function(k){return ch(k,{locale:r,format:"YYYY-MM-DD",generateConfig:t})},headerCells:_}))}var V8={visibility:"hidden"};function ON(n){var e=n.prefixCls,t=n.prevIcon,i=t===void 0?"‹":t,r=n.nextIcon,o=r===void 0?"›":r,s=n.superPrevIcon,a=s===void 0?"«":s,l=n.superNextIcon,c=l===void 0?"»":l,u=n.onSuperPrev,d=n.onSuperNext,h=n.onPrev,f=n.onNext,g=n.children,m=w.useContext(Zf),v=m.hideNextBtn,_=m.hidePrevBtn;return w.createElement("div",{className:e},u&&w.createElement("button",{type:"button",onClick:u,tabIndex:-1,className:"".concat(e,"-super-prev-btn"),style:_?V8:{}},a),h&&w.createElement("button",{type:"button",onClick:h,tabIndex:-1,className:"".concat(e,"-prev-btn"),style:_?V8:{}},i),w.createElement("div",{className:"".concat(e,"-view")},g),f&&w.createElement("button",{type:"button",onClick:f,tabIndex:-1,className:"".concat(e,"-next-btn"),style:v?V8:{}},o),d&&w.createElement("button",{type:"button",onClick:d,tabIndex:-1,className:"".concat(e,"-super-next-btn"),style:v?V8:{}},c))}function f7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.viewDate,o=n.onNextMonth,s=n.onPrevMonth,a=n.onNextYear,l=n.onPrevYear,c=n.onYearClick,u=n.onMonthClick,d=w.useContext(Zf),h=d.hideHeader;if(h)return null;var f="".concat(e,"-header"),g=i.shortMonths||(t.locale.getShortMonths?t.locale.getShortMonths(i.locale):[]),m=t.getMonth(r),v=w.createElement("button",{type:"button",key:"year",onClick:c,tabIndex:-1,className:"".concat(e,"-year-btn")},ch(r,{locale:i,format:i.yearFormat,generateConfig:t})),_=w.createElement("button",{type:"button",key:"month",onClick:u,tabIndex:-1,className:"".concat(e,"-month-btn")},i.monthFormat?ch(r,{locale:i,format:i.monthFormat,generateConfig:t}):g[m]),b=i.monthBeforeYear?[_,v]:[v,_];return w.createElement(ON,Ct({},n,{prefixCls:f,onSuperPrev:l,onPrev:s,onNext:o,onSuperNext:a}),b)}var p7t=6;function w_e(n){var e=n.prefixCls,t=n.panelName,i=t===void 0?"date":t,r=n.keyboardConfig,o=n.active,s=n.operationRef,a=n.generateConfig,l=n.value,c=n.viewDate,u=n.onViewDateChange,d=n.onPanelChange,h=n.onSelect,f="".concat(e,"-").concat(i,"-panel");s.current={onKeyDown:function(_){return RN(_,ct({onLeftRight:function(y){h(a.addDate(l||c,y),"key")},onCtrlLeftRight:function(y){h(a.addYear(l||c,y),"key")},onUpDown:function(y){h(a.addDate(l||c,y*tM),"key")},onPageUpDown:function(y){h(a.addMonth(l||c,y),"key")}},r))}};var g=function(_){var b=a.addYear(c,_);u(b),d(null,b)},m=function(_){var b=a.addMonth(c,_);u(b),d(null,b)};return w.createElement("div",{className:Nt(f,Ze({},"".concat(f,"-active"),o))},w.createElement(f7t,Ct({},n,{prefixCls:e,value:l,viewDate:c,onPrevYear:function(){g(-1)},onNextYear:function(){g(1)},onPrevMonth:function(){m(-1)},onNextMonth:function(){m(1)},onMonthClick:function(){d("month",c)},onYearClick:function(){d("year",c)}})),w.createElement(h7t,Ct({},n,{onSelect:function(_){return h(_,"mouse")},prefixCls:e,value:l,viewDate:c,rowCount:p7t})))}function g7t(n){var e=n.value,t=n.generateConfig,i=n.disabledMinutes,r=n.disabledSeconds,o=n.minutes,s=n.seconds,a=n.use12Hours,l=function(u,d,h,f){var g=t.getNow(),m=e||g,v=!a||!u?d:d+12,_=d<0?t.getHour(g):v,b=h<0?t.getMinute(g):h,y=f<0?t.getSecond(g):f,C=i&&i(_);if(C!=null&&C.includes(b)){var x=o.find(function(L){return!C.includes(L.value)});if(x)b=x.value;else return null}var E=r&&r(_,b);if(E!=null&&E.includes(y)){var k=s.find(function(L){return!E.includes(L.value)});if(k)y=k.value;else return null}return m=JHe(t,m,_,b,y),m};return l}function H8(n){var e=n.prefixCls,t=n.units,i=n.onSelect,r=n.value,o=n.active,s=n.hideDisabledOptions,a=n.info,l=n.type,c="".concat(e,"-cell"),u=w.useContext(Zf),d=u.open,h=w.useRef(null),f=w.useRef(new Map),g=w.useRef();return w.useLayoutEffect(function(){var m=f.current.get(r);m&&d!==!1&&lse(h.current,m.offsetTop,120)},[r]),w.useLayoutEffect(function(){if(d){var m=f.current.get(r);m&&(g.current=t7t(m,function(){lse(h.current,m.offsetTop,0)}))}return function(){var v;(v=g.current)===null||v===void 0||v.call(g)}},[d]),w.createElement("ul",{className:Nt("".concat(e,"-column"),Ze({},"".concat(e,"-column-active"),o)),ref:h,style:{position:"relative"}},t.map(function(m){var v;return s&&m.disabled?null:w.createElement("li",{key:m.value,ref:function(b){f.current.set(m.value,b)},className:Nt(c,(v={},Ze(v,"".concat(c,"-disabled"),m.disabled),Ze(v,"".concat(c,"-selected"),r===m.value),v)),onClick:function(){m.disabled||i(m.value)}},a.cellRender?a.cellRender(m.value,{today:a.today,locale:a.locale,originNode:w.createElement("div",{className:"".concat(c,"-inner")},m.label),type:"time",subType:l}):w.createElement("div",{className:"".concat(c,"-inner")},m.label))}))}function m7t(n,e){if(n.length!==e.length)return!0;for(var t=0;t<n.length;t+=1)if(n[t].disabled!==e[t].disabled)return!0;return!1}function yJ(n,e,t,i){for(var r=[],o=t>=1?t|0:1,s=n;s<=e;s+=o)r.push({label:XHe(s,2),value:s,disabled:(i||[]).includes(s)});return r}function _7t(n){var e=n.generateConfig,t=n.prefixCls,i=n.operationRef,r=n.activeColumnIndex,o=n.value,s=n.showHour,a=n.showMinute,l=n.showSecond,c=n.use12Hours,u=n.hourStep,d=u===void 0?1:u,h=n.minuteStep,f=h===void 0?1:h,g=n.secondStep,m=g===void 0?1:g,v=n.disabledHours,_=n.disabledMinutes,b=n.disabledSeconds,y=n.disabledTime,C=n.hideDisabledOptions,x=n.onSelect,E=n.cellRender,k=n.locale,L=[],D="".concat(t,"-content"),A="".concat(t,"-time-panel"),O,P=o?e.getHour(o):-1,F=P,B=o?e.getMinute(o):-1,M=o?e.getSecond(o):-1,V=e.getNow(),U=w.useMemo(function(){if(y){var Tt=y(V);return[Tt.disabledHours,Tt.disabledMinutes,Tt.disabledSeconds]}return[v,_,b]},[v,_,b,y,V]),W=ln(U,3),q=W[0],H=W[1],ie=W[2],se=yJ(0,23,d,q&&q()),Q=OF(function(){return se},se,m7t);c&&(O=F>=12,F%=12);var Ee=w.useMemo(function(){if(!c)return[!1,!1];var Tt=[!0,!0];return Q.forEach(function(rn){var _n=rn.disabled,wt=rn.value;_n||(wt>=12?Tt[1]=!1:Tt[0]=!1)}),Tt},[c,Q]),Fe=ln(Ee,2),He=Fe[0],ke=Fe[1],Me=w.useMemo(function(){return c?Q.filter(O?function(Tt){return Tt.value>=12}:function(Tt){return Tt.value<12}).map(function(Tt){var rn=Tt.value%12,_n=rn===0?"12":XHe(rn,2);return ct(ct({},Tt),{},{label:_n,value:rn})}):Q},[c,O,Q]),je=yJ(0,59,f,H&&H(P)),qe=yJ(0,59,m,ie&&ie(P,B)),Be=g7t({value:o,generateConfig:e,disabledMinutes:H,disabledSeconds:ie,minutes:je,seconds:qe,use12Hours:c});i.current={onUpDown:function(rn){var _n=L[r];if(_n)for(var wt=_n.units.findIndex(function(Se){return Se.value===_n.value}),pt=_n.units.length,ot=1;ot<pt;ot+=1){var we=_n.units[(wt+rn*ot+pt)%pt];if(we.disabled!==!0){_n.onSelect(we.value);break}}}};function _t(Tt,rn,_n,wt,pt){Tt!==!1&&L.push({node:w.cloneElement(rn,{prefixCls:A,value:_n,active:r===L.length,onSelect:pt,units:wt,hideDisabledOptions:C}),onSelect:pt,value:_n,units:wt})}_t(s,w.createElement(H8,{key:"hour",type:"hour",info:{today:V,locale:k,cellRender:E}}),F,Me,function(Tt){x(Be(O,Tt,B,M),"mouse")}),_t(a,w.createElement(H8,{key:"minute",type:"minute",info:{today:V,locale:k,cellRender:E}}),B,je,function(Tt){x(Be(O,F,Tt,M),"mouse")}),_t(l,w.createElement(H8,{key:"second",type:"second",info:{today:V,locale:k,cellRender:E}}),M,qe,function(Tt){x(Be(O,F,B,Tt),"mouse")});var Wt=-1;return typeof O=="boolean"&&(Wt=O?1:0),_t(c===!0,w.createElement(H8,{key:"meridiem",type:"meridiem",info:{today:V,locale:k,cellRender:E}}),Wt,[{label:"AM",value:0,disabled:He},{label:"PM",value:1,disabled:ke}],function(Tt){x(Be(!!Tt,F,B,M),"mouse")}),w.createElement("div",{className:D},L.map(function(Tt){var rn=Tt.node;return rn}))}function v7t(n){var e=w.useContext(Zf),t=e.hideHeader;if(t)return null;var i=n.prefixCls,r=n.generateConfig,o=n.locale,s=n.value,a=n.format,l="".concat(i,"-header");return w.createElement(ON,{prefixCls:l},s?ch(s,{locale:o,format:a,generateConfig:r}):" ")}var b7t=function(e){return e.filter(function(t){return t!==!1}).length};function tWe(n){var e=n.generateConfig,t=n.format,i=t===void 0?"HH:mm:ss":t,r=n.prefixCls,o=n.active,s=n.operationRef,a=n.showHour,l=n.showMinute,c=n.showSecond,u=n.use12Hours,d=u===void 0?!1:u,h=n.onSelect,f=n.value,g="".concat(r,"-time-panel"),m=w.useRef(),v=w.useState(-1),_=ln(v,2),b=_[0],y=_[1],C=b7t([a,l,c,d]);return s.current={onKeyDown:function(E){return RN(E,{onLeftRight:function(L){y((b+L+C)%C)},onUpDown:function(L){b===-1?y(0):m.current&&m.current.onUpDown(L)},onEnter:function(){h(f||e.getNow(),"key"),y(-1)}})},onBlur:function(){y(-1)}},w.createElement("div",{className:Nt(g,Ze({},"".concat(g,"-active"),o))},w.createElement(v7t,Ct({},n,{format:i,prefixCls:r})),w.createElement(_7t,Ct({},n,{prefixCls:r,activeColumnIndex:b,operationRef:m})))}var v2e=c7t("date","time"),CJ=function(e,t,i){var r=new Set(t);if(r.has(e)){for(var o=0;o<=i;o++)if(!r.has(o)&&o>=e)return o}return e};function y7t(n){var e=n.prefixCls,t=n.operationRef,i=n.generateConfig,r=n.value,o=n.defaultValue,s=n.disabledTime,a=n.showTime,l=n.onSelect,c=n.cellRender,u="".concat(e,"-datetime-panel"),d=w.useState(null),h=ln(d,2),f=h[0],g=h[1],m=w.useRef({}),v=w.useRef({}),_=Qr(a)==="object"?ct({},a):{};function b(E){var k=v2e.indexOf(f)+E,L=v2e[k]||null;return L}var y=function(k){v.current.onBlur&&v.current.onBlur(k),g(null)};t.current={onKeyDown:function(k){if(k.which===Jn.TAB){var L=b(k.shiftKey?-1:1);return g(L),L&&k.preventDefault(),!0}if(f){var D=f==="date"?m:v;return D.current&&D.current.onKeyDown&&D.current.onKeyDown(k),!0}return[Jn.LEFT,Jn.RIGHT,Jn.UP,Jn.DOWN].includes(k.which)?(g("date"),!0):!1},onBlur:y,onClose:y};var C=function(k,L){var D=k;if(L==="date"){var A,O,P,F=(s==null?void 0:s(r||_.defaultValue))||{},B=CJ(i.getHour(D),((A=F.disabledHours)===null||A===void 0?void 0:A.call(F))||[-1],23),M=CJ(i.getMinute(D),((O=F.disabledMinutes)===null||O===void 0?void 0:O.call(F,B))||[-1],59),V=CJ(i.getSecond(D),((P=F.disabledSeconds)===null||P===void 0?void 0:P.call(F,B,M))||[-1],59);D=i.setHour(D,B),D=i.setMinute(D,M),D=i.setSecond(D,V)}else L==="time"&&!r&&o&&(D=i.setYear(D,i.getYear(o)),D=i.setMonth(D,i.getMonth(o)),D=i.setDate(D,i.getDate(o)));l&&l(D,"mouse")},x=s?s(r||null):{};return w.createElement("div",{className:Nt(u,Ze({},"".concat(u,"-active"),f))},w.createElement(w_e,Ct({},n,{cellRender:c,operationRef:m,active:f==="date",onSelect:function(k){C(eWe(i,k,!r&&Qr(a)==="object"?a.defaultValue:null),"date")}})),w.createElement(tWe,Ct({},n,{cellRender:c?function(E,k){return c(E,ct(ct({},k),{},{type:"time"}))}:void 0,format:void 0},_,x,{disabledTime:null,defaultValue:void 0,operationRef:v,active:f==="time",onSelect:function(k){C(k,"time")}})))}function C7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.viewDate,r=n.onPrevDecades,o=n.onNextDecades,s=w.useContext(Zf),a=s.hideHeader;if(a)return null;var l="".concat(e,"-header"),c=t.getYear(i),u=Math.floor(c/Ay)*Ay,d=u+Ay-1;return w.createElement(ON,Ct({},n,{prefixCls:l,onSuperPrev:r,onSuperNext:o}),u,"-",d)}var dse=3,b2e=4;function w7t(n){var e=U_-1,t=n.prefixCls,i=n.viewDate,r=n.generateConfig,o=n.cellRender,s=n.locale,a="".concat(t,"-cell"),l=r.getYear(i),c=Math.floor(l/U_)*U_,u=Math.floor(l/Ay)*Ay,d=u+Ay-1,h=r.setYear(i,u-Math.ceil((dse*b2e*U_-Ay)/2)),f=function(v){var _,b=r.getYear(v),y=b+e;return _={},Ze(_,"".concat(a,"-in-view"),u<=b&&y<=d),Ze(_,"".concat(a,"-selected"),b===c),_},g=o?function(m,v){return o(m,{originNode:v,today:r.getNow(),type:"decade",locale:s})}:void 0;return w.createElement(UF,Ct({},n,{rowNum:b2e,colNum:dse,baseDate:h,getCellNode:g,getCellText:function(v){var _=r.getYear(v);return"".concat(_,"-").concat(_+e)},getCellClassName:f,getCellDate:function(v,_){return r.addYear(v,_*U_)}}))}function S7t(n){var e=n.prefixCls,t=n.onViewDateChange,i=n.generateConfig,r=n.viewDate,o=n.operationRef,s=n.onSelect,a=n.onPanelChange,l="".concat(e,"-decade-panel");o.current={onKeyDown:function(h){return RN(h,{onLeftRight:function(g){s(i.addYear(r,g*U_),"key")},onCtrlLeftRight:function(g){s(i.addYear(r,g*Ay),"key")},onUpDown:function(g){s(i.addYear(r,g*U_*dse),"key")},onEnter:function(){a("year",r)}})}};var c=function(h){var f=i.addYear(r,h*Ay);t(f),a(null,f)},u=function(h){s(h,"mouse"),a("year",h)};return w.createElement("div",{className:l},w.createElement(C7t,Ct({},n,{prefixCls:e,onPrevDecades:function(){c(-1)},onNextDecades:function(){c(1)}})),w.createElement(w7t,Ct({},n,{prefixCls:e,onSelect:u})))}function E7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.viewDate,o=n.onNextYear,s=n.onPrevYear,a=n.onYearClick,l=w.useContext(Zf),c=l.hideHeader;if(c)return null;var u="".concat(e,"-header");return w.createElement(ON,Ct({},n,{prefixCls:u,onSuperPrev:s,onSuperNext:o}),w.createElement("button",{type:"button",onClick:a,className:"".concat(e,"-year-btn")},ch(r,{locale:i,format:i.yearFormat,generateConfig:t})))}var S_e=3,x7t=4;function T7t(n){var e=n.prefixCls,t=n.locale,i=n.value,r=n.viewDate,o=n.generateConfig,s=n.cellRender,a=w.useContext(qk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=$q({cellPrefixCls:u,value:i,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(v,_){return C_e(o,v,_)},isInView:function(){return!0},offsetCell:function(v,_){return o.addMonth(v,_)}}),h=t.shortMonths||(o.locale.getShortMonths?o.locale.getShortMonths(t.locale):[]),f=o.setMonth(r,0),g=s?function(m,v){return s(m,{originNode:v,locale:t,today:o.getNow(),type:"month"})}:void 0;return w.createElement(UF,Ct({},n,{rowNum:x7t,colNum:S_e,baseDate:f,getCellNode:g,getCellText:function(v){return t.monthFormat?ch(v,{locale:t,format:t.monthFormat,generateConfig:o}):h[o.getMonth(v)]},getCellClassName:d,getCellDate:o.addMonth,titleCell:function(v){return ch(v,{locale:t,format:"YYYY-MM",generateConfig:o})}}))}function k7t(n){var e=n.prefixCls,t=n.operationRef,i=n.onViewDateChange,r=n.generateConfig,o=n.value,s=n.viewDate,a=n.onPanelChange,l=n.onSelect,c="".concat(e,"-month-panel");t.current={onKeyDown:function(h){return RN(h,{onLeftRight:function(g){l(r.addMonth(o||s,g),"key")},onCtrlLeftRight:function(g){l(r.addYear(o||s,g),"key")},onUpDown:function(g){l(r.addMonth(o||s,g*S_e),"key")},onEnter:function(){a("date",o||s)}})}};var u=function(h){var f=r.addYear(s,h);i(f),a(null,f)};return w.createElement("div",{className:c},w.createElement(E7t,Ct({},n,{prefixCls:e,onPrevYear:function(){u(-1)},onNextYear:function(){u(1)},onYearClick:function(){a("year",s)}})),w.createElement(T7t,Ct({},n,{prefixCls:e,onSelect:function(h){l(h,"mouse"),a("date",h)}})))}function I7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.viewDate,o=n.onNextYear,s=n.onPrevYear,a=n.onYearClick,l=w.useContext(Zf),c=l.hideHeader;if(c)return null;var u="".concat(e,"-header");return w.createElement(ON,Ct({},n,{prefixCls:u,onSuperPrev:s,onSuperNext:o}),w.createElement("button",{type:"button",onClick:a,className:"".concat(e,"-year-btn")},ch(r,{locale:i,format:i.yearFormat,generateConfig:t})))}var L7t=4,D7t=1;function A7t(n){var e=n.prefixCls,t=n.locale,i=n.value,r=n.viewDate,o=n.generateConfig,s=n.cellRender,a=w.useContext(qk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=$q({cellPrefixCls:u,value:i,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(m,v){return UHe(o,m,v)},isInView:function(){return!0},offsetCell:function(m,v){return o.addMonth(m,v*3)}}),h=o.setDate(o.setMonth(r,0),1),f=s?function(g,m){return s(g,{originNode:m,locale:t,today:o.getNow(),type:"quarter"})}:void 0;return w.createElement(UF,Ct({},n,{rowNum:D7t,colNum:L7t,baseDate:h,getCellNode:f,getCellText:function(m){return ch(m,{locale:t,format:t.quarterFormat||"[Q]Q",generateConfig:o})},getCellClassName:d,getCellDate:function(m,v){return o.addMonth(m,v*3)},titleCell:function(m){return ch(m,{locale:t,format:"YYYY-[Q]Q",generateConfig:o})}}))}function N7t(n){var e=n.prefixCls,t=n.operationRef,i=n.onViewDateChange,r=n.generateConfig,o=n.value,s=n.viewDate,a=n.onPanelChange,l=n.onSelect,c="".concat(e,"-quarter-panel");t.current={onKeyDown:function(h){return RN(h,{onLeftRight:function(g){l(r.addMonth(o||s,g*3),"key")},onCtrlLeftRight:function(g){l(r.addYear(o||s,g),"key")},onUpDown:function(g){l(r.addYear(o||s,g),"key")}})}};var u=function(h){var f=r.addYear(s,h);i(f),a(null,f)};return w.createElement("div",{className:c},w.createElement(I7t,Ct({},n,{prefixCls:e,onPrevYear:function(){u(-1)},onNextYear:function(){u(1)},onYearClick:function(){a("year",s)}})),w.createElement(A7t,Ct({},n,{prefixCls:e,onSelect:function(h){l(h,"mouse")}})))}function R7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.value,o=n.disabledDate,s=n.onSelect,a=w.useContext(qk),l=a.rangedValue,c=a.hoverRangedValue,u=w.useContext(Zf),d=u.onDateMouseEnter,h=u.onDateMouseLeave,f=(c==null?void 0:c[0])||(l==null?void 0:l[0]),g=(c==null?void 0:c[1])||(l==null?void 0:l[1]),m="".concat(e,"-cell"),v=function(C){var x=YH({cellDate:C,mode:"week",disabledDate:o,generateConfig:t});return w.createElement("td",{key:"week",className:Nt(m,"".concat(m,"-week")),onClick:function(){x||s(C,"mouse")},onMouseEnter:function(){!x&&d&&d(C)},onMouseLeave:function(){!x&&h&&h(C)}},w.createElement("div",{className:"".concat(m,"-inner")},t.locale.getWeek(i.locale,C)))},_="".concat(e,"-week-panel-row"),b=function(C){var x,E=E$(t,i.locale,f,C),k=E$(t,i.locale,g,C);return Nt(_,(x={},Ze(x,"".concat(_,"-selected"),!l&&E$(t,i.locale,r,C)),Ze(x,"".concat(_,"-range-start"),E),Ze(x,"".concat(_,"-range-end"),k),Ze(x,"".concat(_,"-range-hover"),!E&&!k&&sP(t,f,g,C)),x))};return w.createElement(w_e,Ct({},n,{panelName:"week",prefixColumn:v,rowClassName:b,keyboardConfig:{onLeftRight:null},isSameCell:function(){return!1}}))}var YC=10;function O7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.viewDate,r=n.onPrevDecade,o=n.onNextDecade,s=n.onDecadeClick,a=w.useContext(Zf),l=a.hideHeader;if(l)return null;var c="".concat(e,"-header"),u=t.getYear(i),d=Math.floor(u/YC)*YC,h=d+YC-1;return w.createElement(ON,Ct({},n,{prefixCls:c,onSuperPrev:r,onSuperNext:o}),w.createElement("button",{type:"button",onClick:s,className:"".concat(e,"-decade-btn")},d,"-",h))}var hse=3,y2e=4;function P7t(n){var e=n.prefixCls,t=n.value,i=n.viewDate,r=n.locale,o=n.generateConfig,s=n.cellRender,a=w.useContext(qk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=o.getYear(i),h=Math.floor(d/YC)*YC,f=h+YC-1,g=o.setYear(i,h-Math.ceil((hse*y2e-YC)/2)),m=o.getNow(),v=function(C){var x=o.getYear(C);return h<=x&&x<=f},_=$q({cellPrefixCls:u,value:t,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(C,x){return zF(o,C,x)},isInView:v,offsetCell:function(C,x){return o.addYear(C,x)}}),b=s?function(y,C){return s(y,{originNode:C,today:m,type:"year",locale:r})}:void 0;return w.createElement(UF,Ct({},n,{rowNum:y2e,colNum:hse,baseDate:g,getCellNode:b,getCellText:o.getYear,getCellClassName:_,getCellDate:o.addYear,titleCell:function(C){return ch(C,{locale:r,format:"YYYY",generateConfig:o})}}))}function M7t(n){var e=n.prefixCls,t=n.operationRef,i=n.onViewDateChange,r=n.generateConfig,o=n.value,s=n.viewDate,a=n.sourceMode,l=n.onSelect,c=n.onPanelChange,u="".concat(e,"-year-panel");t.current={onKeyDown:function(f){return RN(f,{onLeftRight:function(m){l(r.addYear(o||s,m),"key")},onCtrlLeftRight:function(m){l(r.addYear(o||s,m*YC),"key")},onUpDown:function(m){l(r.addYear(o||s,m*hse),"key")},onEnter:function(){c(a==="date"?"date":"month",o||s)}})}};var d=function(f){var g=r.addYear(s,f*10);i(g),c(null,g)};return w.createElement("div",{className:u},w.createElement(O7t,Ct({},n,{prefixCls:e,onPrevDecade:function(){d(-1)},onNextDecade:function(){d(1)},onDecadeClick:function(){c("decade",s)}})),w.createElement(P7t,Ct({},n,{prefixCls:e,onSelect:function(f){c(a==="date"?"date":"month",f),l(f,"mouse")}})))}function nWe(n,e,t){return t?w.createElement("div",{className:"".concat(n,"-footer-extra")},t(e)):null}function iWe(n){var e=n.prefixCls,t=n.components,i=t===void 0?{}:t,r=n.needConfirmButton,o=n.onNow,s=n.onOk,a=n.okDisabled,l=n.showNow,c=n.locale,u,d;if(r){var h=i.button||"button";o&&l!==!1&&(u=w.createElement("li",{className:"".concat(e,"-now")},w.createElement("a",{className:"".concat(e,"-now-btn"),onClick:o},c.now))),d=r&&w.createElement("li",{className:"".concat(e,"-ok")},w.createElement(h,{disabled:a,onClick:s},c.ok))}return!u&&!d?null:w.createElement("ul",{className:"".concat(e,"-ranges")},u,d)}var F7t=["date","month"];function rWe(n){var e,t=n,i=t.prefixCls,r=i===void 0?"rc-picker":i,o=t.className,s=t.style,a=t.locale,l=t.generateConfig,c=t.value,u=t.defaultValue,d=t.pickerValue,h=t.defaultPickerValue,f=t.disabledDate,g=t.mode,m=t.picker,v=m===void 0?"date":m,_=t.tabIndex,b=_===void 0?0:_,y=t.showNow,C=t.showTime,x=t.showToday,E=t.renderExtraFooter,k=t.hideHeader,L=t.onSelect,D=t.onChange,A=t.onPanelChange,O=t.onMouseDown,P=t.onPickerValueChange,F=t.onOk,B=t.components,M=t.direction,V=t.hourStep,U=V===void 0?1:V,W=t.minuteStep,q=W===void 0?1:W,H=t.secondStep,ie=H===void 0?1:H,se=t.dateRender,Q=t.monthCellRender,Ee=t.cellRender,Fe=v==="date"&&!!C||v==="time",He=24%U===0,ke=60%q===0,Me=60%ie===0,je=w.useContext(Zf),qe=je.operationRef,Be=je.onSelect,_t=je.hideRanges,Wt=je.defaultOpenValue,Tt=w.useContext(qk),rn=Tt.inRange,_n=Tt.panelPosition,wt=Tt.rangedValue,pt=Tt.hoverRangedValue,ot=w.useRef({}),we=w.useRef(!0),Se=Em(null,{value:c,defaultValue:u,postState:function(on){return!on&&Wt&&v==="time"?Wt:on}}),re=ln(Se,2),Y=re[0],Z=re[1],le=Em(null,{value:d,defaultValue:h||Y,postState:function(on){var hi=l.getNow();if(!on)return hi;if(!Y&&C){var to=Qr(C)==="object"?C.defaultValue:u;return eWe(l,Array.isArray(on)?on[0]:on,to||hi)}return Array.isArray(on)?on[0]:on}}),te=ln(le,2),me=te[0],Oe=te[1],et=function(on){Oe(on),P&&P(on)},Et=function(on){var hi=l7t[v];return hi?hi(on):on},Qe=Em(function(){return v==="time"?"time":Et("date")},{value:g}),At=ln(Qe,2),Ut=At[0],fe=At[1];w.useEffect(function(){fe(v)},[v]);var Re=w.useState(function(){return Ut}),Je=ln(Re,2),Ot=Je[0],Ft=Je[1],jt=function(on,hi){var to=Et(on||Ut);Ft(Ut),fe(to),A&&(Ut!==to||tA(l,me,me))&&A(hi,to)},Jt=function(on,hi){var to=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Ut===v||to)&&(Z(on),L&&L(on),Be&&Be(on,hi),D&&!tA(l,on,Y)&&!(f!=null&&f(on))&&D(on))},ei=function(on){if(F7t.includes(Ut)){var hi,to,Ge=Ut==="date";switch(on===Jn.PAGE_UP||on===Jn.PAGE_DOWN?to=Ge?l.addMonth:l.addYear:to=Ge?l.addDate:l.addMonth,on){case Jn.LEFT:case Jn.PAGE_UP:hi=to(me,-1);break;case Jn.RIGHT:case Jn.PAGE_DOWN:hi=to(me,1);break;case Jn.UP:case Jn.DOWN:hi=to(me,Number("".concat(on===Jn.UP?"-":"").concat(Ge?tM:S_e)));break}if(hi)return!(f!=null&&f(hi))}return!0},sr=function(on){if(ot.current&&ot.current.onKeyDown){var hi=!0,to=on.which;if([Jn.LEFT,Jn.RIGHT,Jn.UP,Jn.DOWN,Jn.PAGE_UP,Jn.PAGE_DOWN,Jn.ENTER].includes(to)&&(on.preventDefault(),to!==Jn.ENTER&&b===0&&(hi=ei(to))),hi)return ot.current.onKeyDown(on)}return Nd(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1},zn=function(on){ot.current&&ot.current.onBlur&&ot.current.onBlur(on)};qe&&_n!=="right"&&(qe.current={onKeyDown:sr,onClose:function(){ot.current&&ot.current.onClose&&ot.current.onClose()}}),w.useEffect(function(){c&&!we.current&&Oe(c)},[c]),w.useEffect(function(){we.current=!1},[]);var Tn,pi=QHe({cellRender:Ee,monthCellRender:Q,dateRender:se}),Ei=ct(ct({},n),{},{cellRender:pi,operationRef:ot,prefixCls:r,viewDate:me,value:Y,onViewDateChange:et,sourceMode:Ot,onPanelChange:jt,disabledDate:f});switch(delete Ei.onChange,delete Ei.onSelect,Ut){case"decade":Tn=w.createElement(S7t,Ct({},Ei,{onSelect:function(on,hi){et(on),Jt(on,hi)}}));break;case"year":Tn=w.createElement(M7t,Ct({},Ei,{onSelect:function(on,hi){et(on),Jt(on,hi)}}));break;case"month":Tn=w.createElement(k7t,Ct({},Ei,{onSelect:function(on,hi){et(on),Jt(on,hi)}}));break;case"quarter":Tn=w.createElement(N7t,Ct({},Ei,{onSelect:function(on,hi){et(on),Jt(on,hi)}}));break;case"week":Tn=w.createElement(R7t,Ct({},Ei,{onSelect:function(on,hi){et(on),Jt(on,hi)}}));break;case"time":delete Ei.showTime,Tn=w.createElement(tWe,Ct({},Ei,Qr(C)==="object"?C:null,{onSelect:function(on,hi){et(on),Jt(on,hi)}}));break;default:C?Tn=w.createElement(y7t,Ct({},Ei,{onSelect:function(on,hi){et(on),Jt(on,hi)}})):Tn=w.createElement(w_e,Ct({},Ei,{onSelect:function(on,hi){et(on),Jt(on,hi)}}))}var $i,Pr,ro=function(){var on=l.getNow(),hi=u7t(l.getHour(on),l.getMinute(on),l.getSecond(on),He?U:1,ke?q:1,Me?ie:1),to=JHe(l,on,hi[0],hi[1],hi[2]);Jt(to,"submit")};_t||($i=nWe(r,Ut,E),C&&Ut!=="date"?Pr=null:Pr=iWe({prefixCls:r,components:B,needConfirmButton:Fe,okDisabled:!Y||f&&f(Y),locale:a,showNow:y,onNow:Fe&&ro,onOk:function(){Y&&(Jt(Y,"submit",!0),F&&F(Y))}}));var Vo;if(x&&Ut==="date"&&v==="date"&&!C){var oo=l.getNow(),ta="".concat(r,"-today-btn"),Mr=f&&f(oo);Vo=w.createElement("a",{className:Nt(ta,Mr&&"".concat(ta,"-disabled")),"aria-disabled":Mr,onClick:function(){Mr||Jt(oo,"mouse",!0)}},a.today)}return w.createElement(Zf.Provider,{value:ct(ct({},je),{},{mode:Ut,hideHeader:"hideHeader"in n?k:je.hideHeader,hidePrevBtn:rn&&_n==="right",hideNextBtn:rn&&_n==="left"})},w.createElement("div",{tabIndex:b,className:Nt("".concat(r,"-panel"),o,(e={},Ze(e,"".concat(r,"-panel-has-range"),wt&&wt[0]&&wt[1]),Ze(e,"".concat(r,"-panel-has-range-hover"),pt&&pt[0]&&pt[1]),Ze(e,"".concat(r,"-panel-rtl"),M==="rtl"),e)),style:s,onKeyDown:sr,onBlur:zn,onMouseDown:O},Tn,$i||Pr||Vo?w.createElement("div",{className:"".concat(r,"-footer")},$i,Pr,Vo):null))}var B7t={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function oWe(n){var e,t=n.prefixCls,i=n.popupElement,r=n.popupStyle,o=n.visible,s=n.dropdownClassName,a=n.dropdownAlign,l=n.transitionName,c=n.getPopupContainer,u=n.children,d=n.range,h=n.popupPlacement,f=n.direction,g="".concat(t,"-dropdown"),m=function(){return h!==void 0?h:f==="rtl"?"bottomRight":"bottomLeft"};return w.createElement(B9t,{showAction:[],hideAction:[],popupPlacement:m(),builtinPlacements:B7t,prefixCls:g,popupTransitionName:l,popup:i,popupAlign:a,popupVisible:o,popupClassName:Nt(s,(e={},Ze(e,"".concat(g,"-range"),d),Ze(e,"".concat(g,"-rtl"),f==="rtl"),e)),popupStyle:r,getPopupContainer:c},u)}function sWe(n){var e=n.prefixCls,t=n.presets,i=n.onClick,r=n.onHover;return t.length?w.createElement("div",{className:"".concat(e,"-presets")},w.createElement("ul",null,t.map(function(o,s){var a=o.label,l=o.value;return w.createElement("li",{key:s,onClick:function(){return i==null?void 0:i(_2e(l))},onMouseEnter:function(){return r==null?void 0:r(_2e(l))},onMouseLeave:function(){return r==null?void 0:r(null)}},a)}))):null}function aWe(n,e,t){var i=Qr(e)==="object"?e.clearIcon:t;return i||ae.createElement("span",{className:"".concat(n,"-clear-btn")})}function $7t(n){var e,t=n,i=t.prefixCls,r=i===void 0?"rc-picker":i,o=t.id,s=t.name,a=t.tabIndex,l=t.style,c=t.className,u=t.dropdownClassName,d=t.dropdownAlign,h=t.popupStyle,f=t.transitionName,g=t.generateConfig,m=t.locale,v=t.inputReadOnly,_=t.allowClear,b=t.autoFocus,y=t.showTime,C=t.picker,x=C===void 0?"date":C,E=t.format,k=t.use12Hours,L=t.value,D=t.defaultValue,A=t.presets,O=t.open,P=t.defaultOpen,F=t.defaultOpenValue,B=t.suffixIcon,M=t.clearIcon,V=t.disabled,U=t.disabledDate,W=t.placeholder,q=t.getPopupContainer,H=t.pickerRef,ie=t.panelRender,se=t.onChange,Q=t.onOpenChange,Ee=t.onFocus,Fe=t.onBlur,He=t.onMouseDown,ke=t.onMouseUp,Me=t.onMouseEnter,je=t.onMouseLeave,qe=t.onContextMenu,Be=t.onClick,_t=t.onKeyDown,Wt=t.onSelect,Tt=t.direction,rn=t.autoComplete,_n=rn===void 0?"off":rn,wt=t.inputRender,pt=t.changeOnBlur,ot=w.useRef(null),we=x==="date"&&!!y||x==="time",Se=YHe(A),re=ZHe(qHe(E,x,y,k)),Y=w.useRef(null),Z=w.useRef(null),le=w.useRef(null),te=Em(null,{value:L,defaultValue:D}),me=ln(te,2),Oe=me[0],et=me[1],Et=w.useState(Oe),Qe=ln(Et,2),At=Qe[0],Ut=Qe[1],fe=w.useRef(null),Re=Em(!1,{value:O,defaultValue:P,postState:function(pn){return V?!1:pn},onChange:function(pn){Q&&Q(pn),!pn&&fe.current&&fe.current.onClose&&fe.current.onClose()}}),Je=ln(Re,2),Ot=Je[0],Ft=Je[1],jt=QH(At,{formatList:re,generateConfig:g,locale:m}),Jt=ln(jt,2),ei=Jt[0],sr=Jt[1],zn=use({valueTexts:ei,onTextChange:function(pn){var ii=jHe(pn,{locale:m,formatList:re,generateConfig:g});ii&&(!U||!U(ii))&&Ut(ii)}}),Tn=ln(zn,3),pi=Tn[0],Ei=Tn[1],$i=Tn[2],Pr=function(pn){Ut(pn),et(pn),se&&!tA(g,Oe,pn)&&se(pn,pn?ch(pn,{generateConfig:g,locale:m,format:re[0]}):"")},ro=function(pn){V&&pn||Ft(pn)},Vo=function(pn){return Ot&&fe.current&&fe.current.onKeyDown?fe.current.onKeyDown(pn):(Nd(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},oo=function(){for(var pn=arguments.length,ii=new Array(pn),lr=0;lr<pn;lr++)ii[lr]=arguments[lr];Be==null||Be.apply(void 0,ii),ot.current&&(ot.current.focus(),ro(!0))},ta=function(pn){pt&&Pr(At),Fe==null||Fe(pn)},Mr=cse({blurToCancel:we,changeOnBlur:pt,open:Ot,value:pi,triggerOpen:ro,forwardKeyDown:Vo,isClickOutside:function(pn){return!GHe([Y.current,Z.current,le.current],pn)},onSubmit:function(){return!At||U&&U(At)?!1:(Pr(At),ro(!1),$i(),!0)},onCancel:function(){ro(!1),Ut(Oe),$i()},onKeyDown:function(pn,ii){_t==null||_t(pn,ii)},onFocus:Ee,onBlur:ta}),er=ln(Mr,2),on=er[0],hi=er[1],to=hi.focused,Ge=hi.typing;w.useEffect(function(){Ot||(Ut(Oe),!ei.length||ei[0]===""?Ei(""):sr!==pi&&$i())},[Ot,ei]),w.useEffect(function(){Ot||$i()},[x]),w.useEffect(function(){Ut(Oe)},[Oe]),H&&(H.current={focus:function(){var pn;(pn=ot.current)===null||pn===void 0||pn.focus()},blur:function(){var pn;(pn=ot.current)===null||pn===void 0||pn.blur()}});var xt=ase(pi,{formatList:re,generateConfig:g,locale:m}),qt=ln(xt,3),hn=qt[0],ut=qt[1],Ie=qt[2],nt=ct(ct({},n),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0,onChange:null}),Ve=w.createElement("div",{className:"".concat(r,"-panel-layout")},w.createElement(sWe,{prefixCls:r,presets:Se,onClick:function(pn){Pr(pn),ro(!1)}}),w.createElement(rWe,Ct({},nt,{generateConfig:g,className:Nt(Ze({},"".concat(r,"-panel-focused"),!Ge)),value:At,locale:m,tabIndex:-1,onSelect:function(pn){Wt==null||Wt(pn),Ut(pn)},direction:Tt,onPanelChange:function(pn,ii){var lr=n.onPanelChange;Ie(!0),lr==null||lr(pn,ii)}})));ie&&(Ve=ie(Ve));var ye=w.createElement("div",{className:"".concat(r,"-panel-container"),ref:Y,onMouseDown:function(pn){pn.preventDefault()}},Ve),Xe;B&&(Xe=w.createElement("span",{className:"".concat(r,"-suffix"),onMouseDown:function(pn){pn.preventDefault()}},B));var yt=aWe(r,_,M),it=w.createElement("span",{onMouseDown:function(pn){pn.preventDefault(),pn.stopPropagation()},onMouseUp:function(pn){pn.preventDefault(),pn.stopPropagation(),Pr(null),ro(!1)},className:"".concat(r,"-clear"),role:"button"},yt),fn=!!_&&Oe&&!V,In=ct(ct(ct({id:o,tabIndex:a,disabled:V,readOnly:v||typeof re[0]=="function"||!Ge,value:hn||pi,onChange:function(pn){Ei(pn.target.value)},autoFocus:b,placeholder:W,ref:ot,title:pi},on),{},{size:KHe(x,re[0],g),name:s},dHe(n,{aria:!0,data:!0})),{},{autoComplete:_n}),ti=wt?wt(In):w.createElement("input",In),gi=function(pn,ii){(ii==="submit"||ii!=="key"&&!we)&&(Pr(pn),ro(!1))},Vi=Tt==="rtl"?"bottomRight":"bottomLeft";return w.createElement(Zf.Provider,{value:{operationRef:fe,hideHeader:x==="time",onSelect:gi,open:Ot,defaultOpenValue:F,onDateMouseEnter:ut,onDateMouseLeave:Ie}},w.createElement(oWe,{visible:Ot,popupElement:ye,popupStyle:h,prefixCls:r,dropdownClassName:u,dropdownAlign:d,getPopupContainer:q,transitionName:f,popupPlacement:Vi,direction:Tt},w.createElement("div",{ref:le,className:Nt(r,c,(e={},Ze(e,"".concat(r,"-disabled"),V),Ze(e,"".concat(r,"-focused"),to),Ze(e,"".concat(r,"-rtl"),Tt==="rtl"),e)),style:l,onMouseDown:He,onMouseUp:ke,onMouseEnter:Me,onMouseLeave:je,onContextMenu:qe,onClick:oo},w.createElement("div",{className:Nt("".concat(r,"-input"),Ze({},"".concat(r,"-input-placeholder"),!!hn)),ref:Z},ti,Xe,fn&&it))))}var V7t=function(n){xv(t,n);var e=Ok(t);function t(){var i;El(this,t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return i=e.call.apply(e,[this].concat(o)),Ze(Yr(i),"pickerRef",w.createRef()),Ze(Yr(i),"focus",function(){i.pickerRef.current&&i.pickerRef.current.focus()}),Ze(Yr(i),"blur",function(){i.pickerRef.current&&i.pickerRef.current.blur()}),i}return xl(t,[{key:"render",value:function(){return w.createElement($7t,Ct({},this.props,{pickerRef:this.pickerRef}))}}]),t}(w.Component);function H7t(n,e){var t=n.picker,i=n.locale,r=n.selectedValue,o=n.disabledDate,s=n.disabled,a=n.generateConfig,l=Do(r,0),c=Do(r,1);function u(m){return a.locale.getWeekFirstDate(i.locale,m)}function d(m){var v=a.getYear(m),_=a.getMonth(m);return v*100+_}function h(m){var v=a.getYear(m),_=sse(a,m);return v*10+_}var f=w.useCallback(function(m){if(s[0]||o&&o(m))return!0;if(s[1]&&c)return!Ny(a,m,c)&&a.isAfter(m,c);if(!e&&c)switch(t){case"quarter":return h(m)>h(c);case"month":return d(m)>d(c);case"week":return u(m)>u(c);default:return!Ny(a,m,c)&&a.isAfter(m,c)}return!1},[o,s[1],c,e]),g=w.useCallback(function(m){if(s[1]||o&&o(m))return!0;if(s[0]&&l)return!Ny(a,m,c)&&a.isAfter(l,m);if(!e&&l)switch(t){case"quarter":return h(m)<h(l);case"month":return d(m)<d(l);case"week":return u(m)<u(l);default:return!Ny(a,m,l)&&a.isAfter(l,m)}return!1},[o,s[0],l,e]);return[f,g]}function W7t(n,e,t,i,r,o,s,a,l,c,u){var d=w.useState(!1),h=ln(d,2),f=h[0],g=h[1],m=Em(n||!1,{value:e}),v=ln(m,2),_=v[0],b=v[1],y=Em(n||!1,{value:e,onChange:function(W){u==null||u(W)}}),C=ln(y,2),x=C[0],E=C[1],k=Em(0,{value:t}),L=ln(k,2),D=L[0],A=L[1],O=w.useState(null),P=ln(O,2),F=P[0],B=P[1];w.useEffect(function(){x&&g(!0)},[x]);var M=function(W){return W===0?1:0},V=M_(function(U,W,q){if(W===!1)E(U);else if(U){A(W),E(U);var H=M(W);!x||![a,l][H]?B(H):(g(!1),F!==null&&B(null))}else if(q==="confirm"||q==="blur"&&i){var ie=_&&!r?M(W):F;ie!==null&&(g(!1),A(ie)),B(null),ie!==null&&!c[ie]?Qf(function(){var se,Q=[o,s][ie];(se=Q.current)===null||se===void 0||se.focus()}):E(!1)}else E(!1),b(!1)});return[x,D,f,V]}function z7t(n,e,t,i){var r=nM(n,t,i,1);function o(s){return s(n,e)?"same":s(r,e)?"closing":"far"}switch(t){case"year":return o(function(s,a){return Z9t(i,s,a)});case"quarter":case"month":return o(function(s,a){return zF(i,s,a)});default:return o(function(s,a){return C_e(i,s,a)})}}function U7t(n,e,t,i){var r=Do(n,0),o=Do(n,1);if(e===0)return r;if(r&&o){var s=z7t(r,o,t,i);switch(s){case"same":return r;case"closing":return r;default:return nM(o,t,i,-1)}}return r}function j7t(n){var e=n.values,t=n.picker,i=n.defaultDates,r=n.generateConfig,o=w.useState(function(){return[Do(i,0),Do(i,1)]}),s=ln(o,2),a=s[0],l=s[1],c=w.useState(null),u=ln(c,2),d=u[0],h=u[1],f=Do(e,0),g=Do(e,1);function m(_){return a[_]?a[_]:Do(d,_)||U7t(e,_,t,r)||f||g||r.getNow()}function v(_,b){if(_){var y=am(d,_,b);l(am(a,null,b)||[null,null]);var C=(b+1)%2;Do(e,C)||(y=am(y,_,C)),h(y)}else(f||g)&&h(null)}return[m,v]}function C2e(n,e){return n&&n[0]&&n[1]&&e.isAfter(n[0],n[1])?[n[1],n[0]]:n}function w2e(n,e,t,i){return!!(n||i&&i[e]||t[(e+1)%2])}function q7t(n){var e,t,i,r=n,o=r.prefixCls,s=o===void 0?"rc-picker":o,a=r.id,l=r.style,c=r.className,u=r.popupStyle,d=r.dropdownClassName,h=r.transitionName,f=r.dropdownAlign,g=r.getPopupContainer,m=r.generateConfig,v=r.locale,_=r.placeholder,b=r.autoFocus,y=r.disabled,C=r.format,x=r.picker,E=x===void 0?"date":x,k=r.showTime,L=r.use12Hours,D=r.separator,A=D===void 0?"~":D,O=r.value,P=r.defaultValue,F=r.defaultPickerValue,B=r.open,M=r.defaultOpen,V=r.disabledDate,U=r.disabledTime,W=r.dateRender,q=r.monthCellRender,H=r.cellRender,ie=r.panelRender,se=r.presets,Q=r.ranges,Ee=r.allowEmpty,Fe=r.allowClear,He=r.suffixIcon,ke=r.clearIcon,Me=r.pickerRef,je=r.inputReadOnly,qe=r.mode,Be=r.renderExtraFooter,_t=r.onChange,Wt=r.onOpenChange,Tt=r.onPanelChange,rn=r.onCalendarChange,_n=r.onFocus,wt=r.onBlur,pt=r.onMouseDown,ot=r.onMouseUp,we=r.onMouseEnter,Se=r.onMouseLeave,re=r.onClick,Y=r.onOk,Z=r.onKeyDown,le=r.components,te=r.order,me=r.direction,Oe=r.activePickerIndex,et=r.autoComplete,Et=et===void 0?"off":et,Qe=r.changeOnBlur,At=E==="date"&&!!k||E==="time",Ut=w.useRef(null),fe=w.useRef(null),Re=w.useRef(null),Je=w.useRef(null),Ot=w.useRef(null),Ft=w.useRef(null),jt=w.useRef(null),Jt=w.useRef(null),ei=ZHe(qHe(C,E,k,L)),sr=function(An,Rr){return An&&An[Rr]?ch(An[Rr],{generateConfig:m,locale:v,format:ei[0]}):""},zn=w.useRef(null),Tn=w.useMemo(function(){return Array.isArray(y)?y:[y||!1,y||!1]},[y]),pi=Em(null,{value:O,defaultValue:P,postState:function(An){return E==="time"&&!te?An:C2e(An,m)}}),Ei=ln(pi,2),$i=Ei[0],Pr=Ei[1],ro=j7t({values:$i,picker:E,defaultDates:F,generateConfig:m}),Vo=ln(ro,2),oo=Vo[0],ta=Vo[1],Mr=Em($i,{postState:function(An){var Rr=An;if(Tn[0]&&Tn[1])return Rr;for(var Hr=0;Hr<2;Hr+=1)Tn[Hr]&&!Rr&&!Do(Rr,Hr)&&!Do(Ee,Hr)&&(Rr=am(Rr,m.getNow(),Hr));return Rr}}),er=ln(Mr,2),on=er[0],hi=er[1],to=Em([E,E],{value:qe}),Ge=ln(to,2),xt=Ge[0],qt=Ge[1];w.useEffect(function(){qt([E,E])},[E]);var hn=function(An,Rr){qt(An),Tt&&Tt(Rr,An)},ut=W7t(M,B,Oe,Qe,At,Ft,jt,Do(on,0),Do(on,1),Tn,Wt),Ie=ln(ut,4),nt=Ie[0],Ve=Ie[1],ye=Ie[2],Xe=Ie[3],yt=nt&&Ve===0,it=nt&&Ve===1,fn=H7t({picker:E,selectedValue:on,locale:v,disabled:Tn,disabledDate:V,generateConfig:m},!nt||ye),In=ln(fn,2),ti=In[0],gi=In[1],Vi=w.useState(0),Hn=ln(Vi,2),pn=Hn[0],ii=Hn[1];w.useEffect(function(){!nt&&Ut.current&&ii(Ut.current.offsetWidth)},[nt]);function lr(yi){Xe(!0,yi,"open"),Qf(function(){var An,Rr=[Ft,jt][yi];(An=Rr.current)===null||An===void 0||An.focus()},0)}function hr(yi,An,Rr){var Hr=yi,_s=Do(Hr,0),Mc=Do(Hr,1);_s&&Mc&&m.isAfter(_s,Mc)&&(E==="week"&&!E$(m,v.locale,_s,Mc)||E==="quarter"&&!UHe(m,_s,Mc)||E!=="week"&&E!=="quarter"&&E!=="time"&&!Ny(m,_s,Mc)?An===0?(Hr=[_s,null],Mc=null):(_s=null,Hr=[null,Mc]):(E!=="time"||te!==!1)&&(Hr=C2e(Hr,m))),hi(Hr);var rd=sr(Hr,0),ol=sr(Hr,1);if(rn){var wh={range:An===0?"start":"end"};rn(Hr,[rd,ol],wh)}if(!Rr){var gp=w2e(_s,0,Tn,Ee),Hg=w2e(Mc,1,Tn,Ee),ou=Hr===null||gp&&Hg;ou&&(Pr(Hr),_t&&(!tA(m,Do($i,0),_s)||!tA(m,Do($i,1),Mc))&&_t(Hr,[rd,ol]))}}var na=function(An){return nt&&zn.current&&zn.current.onKeyDown?zn.current.onKeyDown(An):(Nd(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},va={formatList:ei,generateConfig:m,locale:v},Ua=QH(Do(on,0),va),os=ln(Ua,2),gs=os[0],Ho=os[1],kl=QH(Do(on,1),va),cc=ln(kl,2),xi=cc[0],co=cc[1],bo=function(An,Rr){var Hr=jHe(An,{locale:v,formatList:ei,generateConfig:m}),_s=Rr===0?ti:gi;Hr&&!_s(Hr)&&(hi(am(on,Hr,Rr)),ta(Hr,Rr))},Ws=use({valueTexts:gs,onTextChange:function(An){return bo(An,0)}}),Wo=ln(Ws,3),zs=Wo[0],Mo=Wo[1],Kr=Wo[2],uo=use({valueTexts:xi,onTextChange:function(An){return bo(An,1)}}),Tr=ln(uo,3),Fr=Tr[0],so=Tr[1],qi=Tr[2],Xn=w.useState(null),bi=ln(Xn,2),qn=bi[0],oi=bi[1],Si=w.useState(null),Ki=ln(Si,2),Sn=Ki[0],wn=Ki[1],Kn=ase(zs,{formatList:ei,generateConfig:m,locale:v}),gt=ln(Kn,3),Pt=gt[0],vn=gt[1],Zn=gt[2],Wn=ase(Fr,{formatList:ei,generateConfig:m,locale:v}),ui=ln(Wn,3),Br=ui[0],ho=ui[1],Xr=ui[2],ja=function(An){wn(am(on,An,Ve)),Ve===0?vn(An):ho(An)},kr=function(){wn(am(on,null,Ve)),Ve===0?Zn():Xr()},Dn=w.useState(nt),Ts=ln(Dn,2),Il=Ts[0],nu=Ts[1];w.useEffect(function(){nu(nt)},[nt]);var ms=function(An){if(Il){if(At){var Rr=Ve?0:1,Hr=Do(on,Rr);Hr&&hr(on,Rr,!0)}else if(Qe){var _s=Do(on,Ve);_s&&hr(on,Ve)}}return wt==null?void 0:wt(An)},Wl=function(An,Rr){return{blurToCancel:!Qe&&At,changeOnBlur:Qe,forwardKeyDown:na,onBlur:ms,isClickOutside:function(_s){var Mc=[Re.current,Je.current,Ut.current];return!GHe([].concat(Jr(At?[Mc[Ve]]:Mc),[fe.current]),_s)},onFocus:function(_s){_n&&_n(_s)},triggerOpen:function(_s){_s?Xe(_s,An,"open"):Xe(_s,Do(on,An)?An:!1,"blur")},onSubmit:function(){if(!on||V&&V(on[An]))return!1;hr(on,An),Rr(),Xe(!1,Ve,"confirm")},onCancel:function(){Xe(!1,An,"cancel"),hi($i),Rr()}}},zl={onKeyDown:function(An,Rr){Z==null||Z(An,Rr)}},Fg=cse(ct(ct({},Wl(0,Kr)),{},{open:yt,value:zs},zl)),R0=ln(Fg,2),_l=R0[0],o_=R0[1],yh=o_.focused,Bg=o_.typing,Iu=cse(ct(ct({},Wl(1,qi)),{},{open:it,value:Fr},zl)),iu=ln(Iu,2),O0=iu[0],$g=iu[1],Vg=$g.focused,of=$g.typing,vI=function(An){re&&re(An),!nt&&!Ft.current.contains(An.target)&&!jt.current.contains(An.target)&&(Tn[0]?Tn[1]||lr(1):lr(0))},bI=function(An){pt&&pt(An),nt&&(yh||Vg)&&!Ft.current.contains(An.target)&&!jt.current.contains(An.target)&&An.preventDefault()},id=$i&&$i[0]?ch($i[0],{locale:v,format:"YYYYMMDDHHmmss",generateConfig:m}):"",wR=$i&&$i[1]?ch($i[1],{locale:v,format:"YYYYMMDDHHmmss",generateConfig:m}):"";w.useEffect(function(){nt||(hi($i),!gs.length||gs[0]===""?Mo(""):Ho!==zs&&Kr(),!xi.length||xi[0]===""?so(""):co!==Fr&&qi())},[nt,gs,xi]),w.useEffect(function(){hi($i)},[id,wR]);var ru=QHe({cellRender:H,monthCellRender:q,dateRender:W}),SR=w.useMemo(function(){if(ru)return function(yi,An){return ru(yi,ct(ct({},An),{},{range:Ve?"end":"start"}))}},[Ve,ru]);Me&&(Me.current={focus:function(){Ft.current&&Ft.current.focus()},blur:function(){Ft.current&&Ft.current.blur(),jt.current&&jt.current.blur()}});var yI=YHe(se,Q);function sf(){var yi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,An=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rr=null;nt&&Sn&&Sn[0]&&Sn[1]&&m.isAfter(Sn[1],Sn[0])&&(Rr=Sn);var Hr=k;if(k&&Qr(k)==="object"&&k.defaultValue){var _s=k.defaultValue;Hr=ct(ct({},k),{},{defaultValue:Do(_s,Ve)||void 0})}return w.createElement(qk.Provider,{value:{inRange:!0,panelPosition:yi,rangedValue:qn||on,hoverRangedValue:Rr}},w.createElement(rWe,Ct({},n,An,{cellRender:SR,showTime:Hr,mode:xt[Ve],generateConfig:m,style:void 0,direction:me,disabledDate:Ve===0?ti:gi,disabledTime:function(rd){return U?U(rd,Ve===0?"start":"end"):!1},className:Nt(Ze({},"".concat(s,"-panel-focused"),Ve===0?!Bg:!of)),value:Do(on,Ve),locale:v,tabIndex:-1,onPanelChange:function(rd,ol){Ve===0&&Zn(!0),Ve===1&&Xr(!0),hn(am(xt,ol,Ve),am(on,rd,Ve));var wh=rd;yi==="right"&&xt[Ve]===ol&&(wh=nM(wh,ol,m,-1)),ta(wh,Ve)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:Ve===0?Do(on,1):Do(on,0)})))}var Ch=0,V1=0;if(Ve&&Re.current&&Ot.current&&fe.current&&Jt.current){Ch=Re.current.offsetWidth+Ot.current.offsetWidth;var ba=Jt.current.offsetLeft>Ch?Jt.current.offsetLeft-Ch:Jt.current.offsetLeft,pp=fe.current.offsetWidth,vl=Jt.current.offsetWidth;pp&&vl&&Ch>pp-vl-(me==="rtl"?0:ba)&&(V1=Ch)}var wE=me==="rtl"?{right:Ch}:{left:Ch};function SE(){var yi,An=nWe(s,xt[Ve],Be),Rr=iWe({prefixCls:s,components:le,needConfirmButton:At,okDisabled:!Do(on,Ve)||V&&V(on[Ve]),locale:v,onOk:function(){var ou=Do(on,Ve);ou&&(hr(on,Ve),Y==null||Y(on),Xe(!1,Ve,"confirm"))}});if(E!=="time"&&!k){var Hr=oo(Ve),_s=nM(Hr,E,m),Mc=xt[Ve],rd=Mc===E,ol=sf(rd?"left":!1,{pickerValue:Hr,onPickerValueChange:function(ou){ta(ou,Ve)}}),wh=sf("right",{pickerValue:_s,onPickerValueChange:function(ou){ta(nM(ou,E,m,-1),Ve)}});me==="rtl"?yi=w.createElement(w.Fragment,null,wh,rd&&ol):yi=w.createElement(w.Fragment,null,ol,rd&&wh)}else yi=sf();var gp=w.createElement("div",{className:"".concat(s,"-panel-layout")},w.createElement(sWe,{prefixCls:s,presets:yI,onClick:function(ou){hr(ou,null),Xe(!1,Ve,"preset")},onHover:function(ou){oi(ou)}}),w.createElement("div",null,w.createElement("div",{className:"".concat(s,"-panels")},yi),(An||Rr)&&w.createElement("div",{className:"".concat(s,"-footer")},An,Rr)));return ie&&(gp=ie(gp)),w.createElement("div",{className:"".concat(s,"-panel-container"),style:{marginLeft:V1},ref:fe,onMouseDown:function(ou){ou.preventDefault()}},gp)}var ee=w.createElement("div",{className:Nt("".concat(s,"-range-wrapper"),"".concat(s,"-").concat(E,"-range-wrapper")),style:{minWidth:pn}},w.createElement("div",{ref:Jt,className:"".concat(s,"-range-arrow"),style:wE}),SE()),z;He&&(z=w.createElement("span",{className:"".concat(s,"-suffix"),onMouseDown:function(An){An.preventDefault()}},He));var X=aWe(s,Fe,ke),Ce=w.createElement("span",{onMouseDown:function(An){An.preventDefault(),An.stopPropagation()},onMouseUp:function(An){An.preventDefault(),An.stopPropagation();var Rr=$i;Tn[0]||(Rr=am(Rr,null,0)),Tn[1]||(Rr=am(Rr,null,1)),hr(Rr,null),Xe(!1,Ve,"clear")},className:"".concat(s,"-clear"),role:"button"},X),Ne=Fe&&(Do($i,0)&&!Tn[0]||Do($i,1)&&!Tn[1]),Kt={size:KHe(E,ei[0],m)},Fn=0,ki=0;Re.current&&Je.current&&Ot.current&&(Ve===0?ki=Re.current.offsetWidth:(Fn=Ch,ki=Je.current.offsetWidth));var $r=me==="rtl"?{right:Fn}:{left:Fn},Fo=function(An,Rr){var Hr=am(on,An,Ve);if(Rr==="submit"||Rr!=="key"&&!At){hr(Hr,Ve),Ve===0?Zn():Xr();var _s=Ve===0?1:0;Tn[_s]?Xe(!1,!1,"confirm"):Xe(!1,Ve,"confirm")}else hi(Hr)};return w.createElement(Zf.Provider,{value:{operationRef:zn,hideHeader:E==="time",onDateMouseEnter:ja,onDateMouseLeave:kr,hideRanges:!0,onSelect:Fo,open:nt}},w.createElement(oWe,{visible:nt,popupElement:ee,popupStyle:u,prefixCls:s,dropdownClassName:d,dropdownAlign:f,getPopupContainer:g,transitionName:h,range:!0,direction:me},w.createElement("div",Ct({ref:Ut,className:Nt(s,"".concat(s,"-range"),c,(e={},Ze(e,"".concat(s,"-disabled"),Tn[0]&&Tn[1]),Ze(e,"".concat(s,"-focused"),Ve===0?yh:Vg),Ze(e,"".concat(s,"-rtl"),me==="rtl"),e)),style:l,onClick:vI,onMouseEnter:we,onMouseLeave:Se,onMouseDown:bI,onMouseUp:ot},dHe(n,{aria:!0,data:!0})),w.createElement("div",{className:Nt("".concat(s,"-input"),(t={},Ze(t,"".concat(s,"-input-active"),Ve===0),Ze(t,"".concat(s,"-input-placeholder"),!!Pt),t)),ref:Re},w.createElement("input",Ct({id:a,disabled:Tn[0],readOnly:je||typeof ei[0]=="function"||!Bg,value:Pt||zs,onChange:function(An){Mo(An.target.value)},autoFocus:b,placeholder:Do(_,0)||"",ref:Ft},_l,Kt,{autoComplete:Et}))),w.createElement("div",{className:"".concat(s,"-range-separator"),ref:Ot},A),w.createElement("div",{className:Nt("".concat(s,"-input"),(i={},Ze(i,"".concat(s,"-input-active"),Ve===1),Ze(i,"".concat(s,"-input-placeholder"),!!Br),i)),ref:Je},w.createElement("input",Ct({disabled:Tn[1],readOnly:je||typeof ei[0]=="function"||!of,value:Br||Fr,onChange:function(An){so(An.target.value)},placeholder:Do(_,1)||"",ref:jt},O0,Kt,{autoComplete:Et}))),w.createElement("div",{className:"".concat(s,"-active-bar"),style:ct(ct({},$r),{},{width:ki,position:"absolute"})}),z,Ne&&Ce)))}var K7t=function(n){xv(t,n);var e=Ok(t);function t(){var i;El(this,t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return i=e.call.apply(e,[this].concat(o)),Ze(Yr(i),"pickerRef",w.createRef()),Ze(Yr(i),"focus",function(){i.pickerRef.current&&i.pickerRef.current.focus()}),Ze(Yr(i),"blur",function(){i.pickerRef.current&&i.pickerRef.current.blur()}),i}return xl(t,[{key:"render",value:function(){return w.createElement(q7t,Ct({},this.props,{pickerRef:this.pickerRef}))}}]),t}(w.Component);const G7t=n=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:n,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),E_e=n=>({borderColor:n.hoverBorderColor,backgroundColor:n.hoverBg}),nA=n=>({borderColor:n.activeBorderColor,boxShadow:n.activeShadow,outline:0,backgroundColor:n.activeBg}),lWe=n=>({color:n.colorTextDisabled,backgroundColor:n.colorBgContainerDisabled,borderColor:n.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},E_e(Gh(n,{hoverBorderColor:n.colorBorder,hoverBg:n.colorBgContainerDisabled})))}),cWe=n=>{const{paddingBlockLG:e,fontSizeLG:t,lineHeightLG:i,borderRadiusLG:r,paddingInlineLG:o}=n;return{padding:`${e}px ${o}px`,fontSize:t,lineHeight:i,borderRadius:r}},uWe=n=>({padding:`${n.paddingBlockSM}px ${n.paddingInlineSM}px`,borderRadius:n.borderRadiusSM}),dWe=(n,e)=>{const{componentCls:t,colorError:i,colorWarning:r,errorActiveShadow:o,warningActiveShadow:s,colorErrorBorderHover:a,colorWarningBorderHover:l}=n;return{[`&-status-error:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:i,"&:hover":{borderColor:a},"&:focus, &:focus-within":Object.assign({},nA(Gh(n,{activeBorderColor:i,activeShadow:o}))),[`${t}-prefix, ${t}-suffix`]:{color:i}},[`&-status-warning:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:r,"&:hover":{borderColor:l},"&:focus, &:focus-within":Object.assign({},nA(Gh(n,{activeBorderColor:r,activeShadow:s}))),[`${t}-prefix, ${t}-suffix`]:{color:r}}}},x_e=n=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${n.paddingBlock}px ${n.paddingInline}px`,color:n.colorText,fontSize:n.fontSize,lineHeight:n.lineHeight,backgroundColor:n.colorBgContainer,backgroundImage:"none",borderWidth:n.lineWidth,borderStyle:n.lineType,borderColor:n.colorBorder,borderRadius:n.borderRadius,transition:`all ${n.motionDurationMid}`},G7t(n.colorTextPlaceholder)),{"&:hover":Object.assign({},E_e(n)),"&:focus, &:focus-within":Object.assign({},nA(n)),"&-disabled, &[disabled]":Object.assign({},lWe(n)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:n.controlHeight,lineHeight:n.lineHeight,verticalAlign:"bottom",transition:`all ${n.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},cWe(n)),"&-sm":Object.assign({},uWe(n)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Y7t=n=>{const{componentCls:e,antCls:t}=n;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:n.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},cWe(n)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},uWe(n)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:n.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:n.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${n.paddingInline}px`,color:n.colorText,fontWeight:"normal",fontSize:n.fontSize,textAlign:"center",backgroundColor:n.addonBg,border:`${n.lineWidth}px ${n.lineType} ${n.colorBorder}`,borderRadius:n.borderRadius,transition:`all ${n.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`-${n.paddingBlock+1}px -${n.paddingInline}px`,[`&${t}-select-single:not(${t}-select-customize-input):not(${t}-pagination-size-changer)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${n.lineWidth}px ${n.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:n.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px -${n.paddingInline}px`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:n.borderRadius,borderEndStartRadius:n.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},qFt()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:n.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` & > ${e}-affix-wrapper, & > ${e}-number-affix-wrapper, & > ${t}-picker-range `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-n.lineWidth,borderInlineEndWidth:n.lineWidth},[`${e}`]:{float:"none"},[`& > ${t}-select > ${t}-select-selector, & > ${t}-select-auto-complete ${e}, & > ${t}-cascader-picker ${e}, & > ${e}-group-wrapper ${e}`]:{borderInlineEndWidth:n.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${t}-select-focused`]:{zIndex:1},[`& > ${t}-select > ${t}-select-arrow`]:{zIndex:1},[`& > *:first-child, & > ${t}-select:first-child > ${t}-select-selector, & > ${t}-select-auto-complete:first-child ${e}, & > ${t}-cascader-picker:first-child ${e}`]:{borderStartStartRadius:n.borderRadius,borderEndStartRadius:n.borderRadius},[`& > *:last-child, & > ${t}-select:last-child > ${t}-select-selector, & > ${t}-cascader-picker:last-child ${e}, & > ${t}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:n.lineWidth,borderStartEndRadius:n.borderRadius,borderEndEndRadius:n.borderRadius},[`& > ${t}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:-n.lineWidth,[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:n.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:n.borderRadius}}}})}},Q7t=n=>{const{componentCls:e,controlHeightSM:t,lineWidth:i}=n,r=16,o=(t-i*2-r)/2;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},H4(n)),x_e(n)),dWe(n,e)),{'&[type="color"]':{height:n.controlHeight,[`&${e}-lg`]:{height:n.controlHeightLG},[`&${e}-sm`]:{height:t,paddingTop:o,paddingBottom:o}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},X7t=n=>{const{componentCls:e}=n;return{[`${e}-clear-icon`]:{margin:0,color:n.colorTextQuaternary,fontSize:n.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${n.motionDurationSlow}`,"&:hover":{color:n.colorTextTertiary},"&:active":{color:n.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${n.inputAffixPadding}px`}}}},Z7t=n=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:i,motionDurationSlow:r,colorIcon:o,colorIconHover:s,iconCls:a}=n;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},x_e(n)),{display:"inline-flex",[`&:not(${e}-affix-wrapper-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> input${e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:n.paddingXS}},"&-show-count-suffix":{color:i},"&-show-count-has-suffix":{marginInlineEnd:n.paddingXXS},"&-prefix":{marginInlineEnd:t},"&-suffix":{marginInlineStart:t}}}),X7t(n)),{[`${a}${e}-password-icon`]:{color:o,cursor:"pointer",transition:`all ${r}`,"&:hover":{color:s}}}),dWe(n,`${e}-affix-wrapper`))}},J7t=n=>{const{componentCls:e,colorError:t,colorWarning:i,borderRadiusLG:r,borderRadiusSM:o}=n;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},H4(n)),Y7t(n)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:r,fontSize:n.fontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:o}},"&-status-error":{[`${e}-group-addon`]:{color:t,borderColor:t}},"&-status-warning":{[`${e}-group-addon`]:{color:i,borderColor:i}},"&-disabled":{[`${e}-group-addon`]:Object.assign({},lWe(n))},[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},e$t=n=>{const{componentCls:e,antCls:t}=n,i=`${e}-search`;return{[i]:{[`${e}`]:{"&:hover, &:focus":{borderColor:n.colorPrimaryHover,[`+ ${e}-group-addon ${i}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:n.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:n.lineHeightLG-2e-4},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${i}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:n.borderRadius,borderEndEndRadius:n.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${i}-button:not(${t}-btn-primary)`]:{color:n.colorTextDescription,"&:hover":{color:n.colorPrimaryHover},"&:active":{color:n.colorPrimaryActive},[`&${t}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${i}-button`]:{height:n.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${i}-button`]:{height:n.controlHeightLG},[`&-small ${i}-button`]:{height:n.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:-n.lineWidth,borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, > ${e}, ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},t$t=n=>{const{componentCls:e,paddingLG:t}=n,i=`${e}-textarea`;return{[i]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:-n.fontSize*n.lineHeight,insetInlineEnd:0,color:n.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${i}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:n.paddingXS,insetBlockStart:n.paddingXS},[`${i}-suffix`]:{position:"absolute",top:0,insetInlineEnd:n.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function hWe(n){return Gh(n,{inputAffixPadding:n.paddingXXS})}const fWe=n=>{const{controlHeight:e,fontSize:t,lineHeight:i,lineWidth:r,controlHeightSM:o,controlHeightLG:s,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:h,colorPrimaryHover:f,colorPrimary:g,controlOutlineWidth:m,controlOutline:v,colorErrorOutline:_,colorWarningOutline:b}=n;return{paddingBlock:Math.max(Math.round((e-t*i)/2*10)/10-r,0),paddingBlockSM:Math.max(Math.round((o-t*i)/2*10)/10-r,0),paddingBlockLG:Math.ceil((s-a*l)/2*10)/10-r,paddingInline:c-r,paddingInlineSM:u-r,paddingInlineLG:d-r,addonBg:h,activeBorderColor:g,hoverBorderColor:f,activeShadow:`0 0 0 ${m}px ${v}`,errorActiveShadow:`0 0 0 ${m}px ${_}`,warningActiveShadow:`0 0 0 ${m}px ${b}`,hoverBg:"",activeBg:""}};AN("Input",n=>{const e=Gh(n,hWe(n));return[Q7t(e),t$t(e),Z7t(e),J7t(e),e$t(e),__e(e)]},fWe);const wJ=(n,e,t,i)=>{const{lineHeight:r}=n,o=Math.floor(t*r)+2,s=Math.max((e-o)/2,0),a=Math.max(e-o-s,0);return{padding:`${s}px ${i}px ${a}px`}},n$t=n=>{const{componentCls:e,pickerCellCls:t,pickerCellInnerCls:i,cellHeight:r,motionDurationSlow:o,borderRadiusSM:s,motionDurationMid:a,cellHoverBg:l,lineWidth:c,lineType:u,colorPrimary:d,cellActiveWithRangeBg:h,colorTextLightSolid:f,controlHeightSM:g,cellRangeBorderColor:m,pickerCellBorderGap:v,cellHoverWithRangeBg:_,cellWidth:b,colorTextDisabled:y,cellBgDisabled:C}=n;return{"&::before":{position:"absolute",top:"50%",insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:r,transform:"translateY(-50%)",transition:`all ${o}`,content:'""'},[i]:{position:"relative",zIndex:2,display:"inline-block",minWidth:r,height:r,lineHeight:`${r}px`,borderRadius:s,transition:`background ${a}, border ${a}`},"&-range-hover-start, &-range-hover-end":{[i]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:hover:not(${t}-in-view), &:hover:not(${t}-selected):not(${t}-range-start):not(${t}-range-end):not(${t}-range-hover-start):not(${t}-range-hover-end)`]:{[i]:{background:l}},[`&-in-view${t}-today ${i}`]:{"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:1,border:`${c}px ${u} ${d}`,borderRadius:s,content:'""'}},[`&-in-view${t}-in-range`]:{position:"relative","&::before":{background:h}},[`&-in-view${t}-selected ${i}, &-in-view${t}-range-start ${i}, &-in-view${t}-range-end ${i}`]:{color:f,background:d},[`&-in-view${t}-range-start:not(${t}-range-start-single), &-in-view${t}-range-end:not(${t}-range-end-single)`]:{"&::before":{background:h}},[`&-in-view${t}-range-start::before`]:{insetInlineStart:"50%"},[`&-in-view${t}-range-end::before`]:{insetInlineEnd:"50%"},[`&-in-view${t}-range-hover-start:not(${t}-in-range):not(${t}-range-start):not(${t}-range-end), &-in-view${t}-range-hover-end:not(${t}-in-range):not(${t}-range-start):not(${t}-range-end), &-in-view${t}-range-hover-start${t}-range-start-single, &-in-view${t}-range-hover-start${t}-range-start${t}-range-end${t}-range-end-near-hover, &-in-view${t}-range-hover-end${t}-range-start${t}-range-end${t}-range-start-near-hover, &-in-view${t}-range-hover-end${t}-range-end-single, &-in-view${t}-range-hover:not(${t}-in-range)`]:{"&::after":{position:"absolute",top:"50%",zIndex:0,height:g,borderTop:`${c}px dashed ${m}`,borderBottom:`${c}px dashed ${m}`,transform:"translateY(-50%)",transition:`all ${o}`,content:'""'}},"&-range-hover-start::after,\n &-range-hover-end::after,\n &-range-hover::after":{insetInlineEnd:0,insetInlineStart:v},[`&-in-view${t}-in-range${t}-range-hover::before, &-in-view${t}-in-range${t}-range-hover-start::before, &-in-view${t}-in-range${t}-range-hover-end::before, &-in-view${t}-range-start${t}-range-hover::before, &-in-view${t}-range-end${t}-range-hover::before, &-in-view${t}-range-start:not(${t}-range-start-single)${t}-range-hover-start::before, &-in-view${t}-range-end:not(${t}-range-end-single)${t}-range-hover-end::before, ${e}-panel > :not(${e}-date-panel) &-in-view${t}-in-range${t}-range-hover-start::before, ${e}-panel > :not(${e}-date-panel) &-in-view${t}-in-range${t}-range-hover-end::before`]:{background:_},[`&-in-view${t}-range-start:not(${t}-range-start-single):not(${t}-range-end) ${i}`]:{borderStartStartRadius:s,borderEndStartRadius:s,borderStartEndRadius:0,borderEndEndRadius:0},[`&-in-view${t}-range-end:not(${t}-range-end-single):not(${t}-range-start) ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:s,borderEndEndRadius:s},[`&-range-hover${t}-range-end::after`]:{insetInlineStart:"50%"},[`tr > &-in-view${t}-range-hover:first-child::after, tr > &-in-view${t}-range-hover-end:first-child::after, &-in-view${t}-start${t}-range-hover-edge-start${t}-range-hover-edge-start-near-range::after, &-in-view${t}-range-hover-edge-start:not(${t}-range-hover-edge-start-near-range)::after, &-in-view${t}-range-hover-start::after`]:{insetInlineStart:(b-r)/2,borderInlineStart:`${c}px dashed ${m}`,borderStartStartRadius:s,borderEndStartRadius:s},[`tr > &-in-view${t}-range-hover:last-child::after, tr > &-in-view${t}-range-hover-start:last-child::after, &-in-view${t}-end${t}-range-hover-edge-end${t}-range-hover-edge-end-near-range::after, &-in-view${t}-range-hover-edge-end:not(${t}-range-hover-edge-end-near-range)::after, &-in-view${t}-range-hover-end::after`]:{insetInlineEnd:(b-r)/2,borderInlineEnd:`${c}px dashed ${m}`,borderStartEndRadius:s,borderEndEndRadius:s},"&-disabled":{color:y,pointerEvents:"none",[i]:{background:"transparent"},"&::before":{background:C}},[`&-disabled${t}-today ${i}::before`]:{borderColor:y}}},i$t=n=>{const{componentCls:e,pickerCellCls:t,pickerCellInnerCls:i,pickerYearMonthCellWidth:r,pickerControlIconSize:o,cellWidth:s,paddingSM:a,paddingXS:l,paddingXXS:c,colorBgContainer:u,lineWidth:d,lineType:h,borderRadiusLG:f,colorPrimary:g,colorTextHeading:m,colorSplit:v,pickerControlIconBorderWidth:_,colorIcon:b,textHeight:y,motionDurationMid:C,colorIconHover:x,fontWeightStrong:E,cellHeight:k,pickerCellPaddingVertical:L,colorTextDisabled:D,colorText:A,fontSize:O,cellHoverWithRangeBg:P,motionDurationSlow:F,withoutTimeCellHeight:B,pickerQuarterPanelContentHeight:M,colorLink:V,colorLinkActive:U,colorLinkHover:W,cellRangeBorderColor:q,borderRadiusSM:H,colorTextLightSolid:ie,cellHoverBg:se,timeColumnHeight:Q,timeColumnWidth:Ee,timeCellHeight:Fe,controlItemBgActive:He,marginXXS:ke,pickerDatePanelPaddingHorizontal:Me}=n,je=s*7+Me*2,qe=(je-l*2)/3-r-a,Be=(je-l*2)/4-r;return{[e]:{"&-panel":{display:"inline-flex",flexDirection:"column",textAlign:"center",background:u,border:`${d}px ${h} ${v}`,borderRadius:f,outline:"none","&-focused":{borderColor:g},"&-rtl":{direction:"rtl",[`${e}-prev-icon, ${e}-super-prev-icon`]:{transform:"rotate(45deg)"},[`${e}-next-icon, ${e}-super-next-icon`]:{transform:"rotate(-135deg)"}}},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel,\n &-week-panel,\n &-date-panel,\n &-time-panel":{display:"flex",flexDirection:"column",width:je},"&-header":{display:"flex",padding:`0 ${l}px`,color:m,borderBottom:`${d}px ${h} ${v}`,"> *":{flex:"none"},button:{padding:0,color:b,lineHeight:`${y}px`,background:"transparent",border:0,cursor:"pointer",transition:`color ${C}`,fontSize:"inherit"},"> button":{minWidth:"1.6em",fontSize:O,"&:hover":{color:x}},"&-view":{flex:"auto",fontWeight:E,lineHeight:`${y}px`,button:{color:"inherit",fontWeight:"inherit",verticalAlign:"top","&:not(:first-child)":{marginInlineStart:l},"&:hover":{color:g}}}},"&-prev-icon,\n &-next-icon,\n &-super-prev-icon,\n &-super-next-icon":{position:"relative",display:"inline-block",width:o,height:o,"&::before":{position:"absolute",top:0,insetInlineStart:0,display:"inline-block",width:o,height:o,border:"0 solid currentcolor",borderBlockStartWidth:_,borderBlockEndWidth:0,borderInlineStartWidth:_,borderInlineEndWidth:0,content:'""'}},"&-super-prev-icon,\n &-super-next-icon":{"&::after":{position:"absolute",top:Math.ceil(o/2),insetInlineStart:Math.ceil(o/2),display:"inline-block",width:o,height:o,border:"0 solid currentcolor",borderBlockStartWidth:_,borderBlockEndWidth:0,borderInlineStartWidth:_,borderInlineEndWidth:0,content:'""'}},"&-prev-icon,\n &-super-prev-icon":{transform:"rotate(-45deg)"},"&-next-icon,\n &-super-next-icon":{transform:"rotate(135deg)"},"&-content":{width:"100%",tableLayout:"fixed",borderCollapse:"collapse","th, td":{position:"relative",minWidth:k,fontWeight:"normal"},th:{height:k+L*2,color:A,verticalAlign:"middle"}},"&-cell":Object.assign({padding:`${L}px 0`,color:D,cursor:"pointer","&-in-view":{color:A}},n$t(n)),[`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start ${i}, &-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${i}`]:{"&::after":{position:"absolute",top:0,bottom:0,zIndex:-1,background:P,transition:`all ${F}`,content:'""'}},[`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start ${i}::after`]:{insetInlineEnd:-(s-k)/2,insetInlineStart:0},[`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${i}::after`]:{insetInlineEnd:0,insetInlineStart:-(s-k)/2},[`&-range-hover${e}-range-start::after`]:{insetInlineEnd:"50%"},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${e}-content`]:{height:B*4},[i]:{padding:`0 ${l}px`}},"&-quarter-panel":{[`${e}-content`]:{height:M},[`${e}-cell-range-hover-start::after`]:{insetInlineStart:Be,borderInlineStart:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineEnd:Be,borderInlineEnd:`${d}px dashed ${q}`}},[`${e}-cell-range-hover-end::after`]:{insetInlineEnd:Be,borderInlineEnd:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineStart:Be,borderInlineStart:`${d}px dashed ${q}`}}},[`&-panel ${e}-footer`]:{borderTop:`${d}px ${h} ${v}`},"&-footer":{width:"min-content",minWidth:"100%",lineHeight:`${y-2*d}px`,textAlign:"center","&-extra":{padding:`0 ${a}px`,lineHeight:`${y-2*d}px`,textAlign:"start","&:not(:last-child)":{borderBottom:`${d}px ${h} ${v}`}}},"&-now":{textAlign:"start"},"&-today-btn":{color:V,"&:hover":{color:W},"&:active":{color:U},[`&${e}-today-btn-disabled`]:{color:D,cursor:"not-allowed"}},"&-decade-panel":{[i]:{padding:`0 ${l/2}px`},[`${e}-cell::before`]:{display:"none"}},"&-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${e}-body`]:{padding:`0 ${l}px`},[i]:{width:r},[`${e}-cell-range-hover-start::after`]:{borderStartStartRadius:H,borderEndStartRadius:H,borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-panel-rtl &`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:H,borderEndEndRadius:H}},[`${e}-cell-range-hover-end::after`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:H,borderEndEndRadius:H,[`${e}-panel-rtl &`]:{borderStartStartRadius:H,borderEndStartRadius:H,borderStartEndRadius:0,borderEndEndRadius:0}}},"&-year-panel,\n &-month-panel":{[`${e}-cell-range-hover-start::after`]:{insetInlineStart:qe,borderInlineStart:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineEnd:qe,borderInlineEnd:`${d}px dashed ${q}`}},[`${e}-cell-range-hover-end::after`]:{insetInlineEnd:qe,borderInlineEnd:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineStart:qe,borderInlineStart:`${d}px dashed ${q}`}}},"&-week-panel":{[`${e}-body`]:{padding:`${l}px ${a}px`},[`${e}-cell`]:{[`&:hover ${i}, &-selected ${i}, ${i}`]:{background:"transparent !important"}},"&-row":{td:{"&:before":{transition:`background ${C}`},"&:first-child:before":{borderStartStartRadius:H,borderEndStartRadius:H},"&:last-child:before":{borderStartEndRadius:H,borderEndEndRadius:H}},"&:hover td":{"&:before":{background:se}},"&-range-start td,\n &-range-end td,\n &-selected td":{[`&${t}`]:{"&:before":{background:g},[`&${e}-cell-week`]:{color:new Sd(ie).setAlpha(.5).toHexString()},[i]:{color:ie}}},"&-range-hover td:before":{background:He}}},"&-date-panel":{[`${e}-body`]:{padding:`${l}px ${Me}px`},[`${e}-content`]:{width:s*7,th:{width:s,boxSizing:"border-box",padding:0}}},"&-datetime-panel":{display:"flex",[`${e}-time-panel`]:{borderInlineStart:`${d}px ${h} ${v}`},[`${e}-date-panel, ${e}-time-panel`]:{transition:`opacity ${F}`},"&-active":{[`${e}-date-panel, ${e}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:"auto",minWidth:"auto",direction:"ltr",[`${e}-content`]:{display:"flex",flex:"auto",height:Q},"&-column":{flex:"1 0 auto",width:Ee,margin:`${c}px 0`,padding:0,overflowY:"hidden",textAlign:"start",listStyle:"none",transition:`background ${C}`,overflowX:"hidden","&::-webkit-scrollbar":{width:8,backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:n.colorTextTertiary,borderRadius:4},"&":{scrollbarWidth:"thin",scrollbarColor:`${n.colorTextTertiary} transparent`},"&::after":{display:"block",height:Q-Fe,content:'""'},"&:not(:first-child)":{borderInlineStart:`${d}px ${h} ${v}`},"&-active":{background:new Sd(He).setAlpha(.2).toHexString()},"&:hover":{overflowY:"auto"},"> li":{margin:0,padding:0,[`&${e}-time-panel-cell`]:{marginInline:ke,[`${e}-time-panel-cell-inner`]:{display:"block",width:Ee-2*ke,height:Fe,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:(Ee-Fe)/2,color:A,lineHeight:`${Fe}px`,borderRadius:H,cursor:"pointer",transition:`background ${C}`,"&:hover":{background:se}},"&-selected":{[`${e}-time-panel-cell-inner`]:{background:He}},"&-disabled":{[`${e}-time-panel-cell-inner`]:{color:D,background:"transparent",cursor:"not-allowed"}}}}}},[`&-datetime-panel ${e}-time-panel-column:after`]:{height:Q-Fe+c*2}}}},r$t=n=>{const{componentCls:e,colorBgContainer:t,colorError:i,errorActiveShadow:r,colorWarning:o,warningActiveShadow:s,colorErrorHover:a,colorWarningHover:l}=n;return{[`${e}:not(${e}-disabled):not([disabled])`]:{[`&${e}-status-error`]:{backgroundColor:t,borderColor:i,"&:hover":{borderColor:a},[`&${e}-focused, &:focus`]:Object.assign({},nA(Gh(n,{activeBorderColor:i,activeShadow:r}))),[`${e}-active-bar`]:{background:i}},[`&${e}-status-warning`]:{backgroundColor:t,borderColor:o,"&:hover":{borderColor:l},[`&${e}-focused, &:focus`]:Object.assign({},nA(Gh(n,{activeBorderColor:o,activeShadow:s}))),[`${e}-active-bar`]:{background:o}}}}},o$t=n=>{const{componentCls:e,antCls:t,controlHeight:i,fontSize:r,paddingInline:o,colorBgContainer:s,lineWidth:a,lineType:l,colorBorder:c,borderRadius:u,motionDurationMid:d,colorBgContainerDisabled:h,colorTextDisabled:f,colorTextPlaceholder:g,controlHeightLG:m,fontSizeLG:v,controlHeightSM:_,paddingInlineSM:b,paddingXS:y,marginXS:C,colorTextDescription:x,lineWidthBold:E,lineHeight:k,colorPrimary:L,motionDurationSlow:D,zIndexPopup:A,paddingXXS:O,paddingSM:P,textHeight:F,cellActiveWithRangeBg:B,colorPrimaryBorder:M,sizePopupArrow:V,borderRadiusXS:U,borderRadiusOuter:W,colorBgElevated:q,borderRadiusLG:H,boxShadowSecondary:ie,borderRadiusSM:se,colorSplit:Q,cellHoverBg:Ee,presetsWidth:Fe,presetsMaxWidth:He,boxShadowPopoverArrow:ke,colorTextQuaternary:Me}=n;return[{[e]:Object.assign(Object.assign(Object.assign({},H4(n)),wJ(n,i,r,o)),{position:"relative",display:"inline-flex",alignItems:"center",background:s,lineHeight:1,border:`${a}px ${l} ${c}`,borderRadius:u,transition:`border ${d}, box-shadow ${d}`,"&:hover":Object.assign({},E_e(n)),[`&-focused${e}`]:Object.assign({},nA(n)),[`&${e}-disabled`]:{background:h,borderColor:c,cursor:"not-allowed",[`${e}-suffix`]:{color:Me}},[`&${e}-borderless`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`${e}-input`]:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%","> input":Object.assign(Object.assign({},x_e(n)),{flex:"auto",minWidth:1,height:"auto",padding:0,background:"transparent",border:0,borderRadius:0,fontFamily:"inherit","&:focus":{boxShadow:"none"},"&[disabled]":{background:"transparent"}}),"&:hover":{[`${e}-clear`]:{opacity:1}},"&-placeholder":{"> input":{color:g}}},"&-large":Object.assign(Object.assign({},wJ(n,m,v,o)),{[`${e}-input > input`]:{fontSize:v}}),"&-small":Object.assign({},wJ(n,_,r,b)),[`${e}-suffix`]:{display:"flex",flex:"none",alignSelf:"center",marginInlineStart:y/2,color:f,lineHeight:1,pointerEvents:"none","> *":{verticalAlign:"top","&:not(:last-child)":{marginInlineEnd:C}}},[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineEnd:0,color:f,lineHeight:1,background:s,transform:"translateY(-50%)",cursor:"pointer",opacity:0,transition:`opacity ${d}, color ${d}`,"> *":{verticalAlign:"top"},"&:hover":{color:x}},[`${e}-separator`]:{position:"relative",display:"inline-block",width:"1em",height:v,color:f,fontSize:v,verticalAlign:"top",cursor:"default",[`${e}-focused &`]:{color:x},[`${e}-range-separator &`]:{[`${e}-disabled &`]:{cursor:"not-allowed"}}},"&-range":{position:"relative",display:"inline-flex",[`${e}-clear`]:{insetInlineEnd:o},"&:hover":{[`${e}-clear`]:{opacity:1}},[`${e}-active-bar`]:{bottom:-a,height:E,marginInlineStart:o,background:L,opacity:0,transition:`all ${D} ease-out`,pointerEvents:"none"},[`&${e}-focused`]:{[`${e}-active-bar`]:{opacity:1}},[`${e}-range-separator`]:{alignItems:"center",padding:`0 ${y}px`,lineHeight:1},[`&${e}-small`]:{[`${e}-clear`]:{insetInlineEnd:b},[`${e}-active-bar`]:{marginInlineStart:b}}},"&-dropdown":Object.assign(Object.assign(Object.assign({},H4(n)),i$t(n)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:A,[`&${e}-dropdown-hidden`]:{display:"none"},[`&${e}-dropdown-placement-bottomLeft`]:{[`${e}-range-arrow`]:{top:0,display:"block",transform:"translateY(-100%)"}},[`&${e}-dropdown-placement-topLeft`]:{[`${e}-range-arrow`]:{bottom:0,display:"block",transform:"translateY(100%) rotate(180deg)"}},[`&${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-topLeft, &${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-topRight, &${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-topLeft, &${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-topRight`]:{animationName:RHe},[`&${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-bottomLeft, &${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-bottomRight, &${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-bottomLeft, &${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-bottomRight`]:{animationName:AHe},[`&${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-topLeft, &${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-topRight`]:{animationName:OHe},[`&${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-bottomLeft, &${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-bottomRight`]:{animationName:NHe},[`${e}-panel > ${e}-time-panel`]:{paddingTop:O},[`${e}-ranges`]:{marginBottom:0,padding:`${O}px ${P}px`,overflow:"hidden",lineHeight:`${F-2*a-y/2}px`,textAlign:"start",listStyle:"none",display:"flex",justifyContent:"space-between","> li":{display:"inline-block"},[`${e}-preset > ${t}-tag-blue`]:{color:L,background:B,borderColor:M,cursor:"pointer"},[`${e}-ok`]:{marginInlineStart:"auto"}},[`${e}-range-wrapper`]:{display:"flex",position:"relative"},[`${e}-range-arrow`]:Object.assign({position:"absolute",zIndex:1,display:"none",marginInlineStart:o*1.5,transition:`left ${D} ease-out`},zFt(V,U,W,q,ke)),[`${e}-panel-container`]:{overflow:"hidden",verticalAlign:"top",background:q,borderRadius:H,boxShadow:ie,transition:`margin ${D}`,[`${e}-panel-layout`]:{display:"flex",flexWrap:"nowrap",alignItems:"stretch"},[`${e}-presets`]:{display:"flex",flexDirection:"column",minWidth:Fe,maxWidth:He,ul:{height:0,flex:"auto",listStyle:"none",overflow:"auto",margin:0,padding:y,borderInlineEnd:`${a}px ${l} ${Q}`,li:Object.assign(Object.assign({},UFt),{borderRadius:se,paddingInline:y,paddingBlock:(_-Math.round(r*k))/2,cursor:"pointer",transition:`all ${D}`,"+ li":{marginTop:C},"&:hover":{background:Ee}})}},[`${e}-panels`]:{display:"inline-flex",flexWrap:"nowrap",direction:"ltr",[`${e}-panel`]:{borderWidth:`0 0 ${a}px`},"&:last-child":{[`${e}-panel`]:{borderWidth:0}}},[`${e}-panel`]:{verticalAlign:"top",background:"transparent",borderRadius:0,borderWidth:0,[`${e}-content, table`]:{textAlign:"center"},"&-focused":{borderColor:c}}}}),"&-dropdown-range":{padding:`${V*2/3}px 0`,"&-hidden":{display:"none"}},"&-rtl":{direction:"rtl",[`${e}-separator`]:{transform:"rotate(180deg)"},[`${e}-footer`]:{"&-extra":{direction:"rtl"}}}})},l2e(n,"slide-up"),l2e(n,"slide-down"),a2e(n,"move-up"),a2e(n,"move-down")]},s$t=n=>{const{componentCls:e,controlHeightLG:t,paddingXXS:i,padding:r}=n;return{pickerCellCls:`${e}-cell`,pickerCellInnerCls:`${e}-cell-inner`,pickerYearMonthCellWidth:t*1.5,pickerQuarterPanelContentHeight:t*1.4,pickerCellPaddingVertical:i+i/2,pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconBorderWidth:1.5,pickerDatePanelPaddingHorizontal:r+i/2}},a$t=n=>({cellHoverBg:n.controlItemBgHover,cellActiveWithRangeBg:n.controlItemBgActive,cellHoverWithRangeBg:new Sd(n.colorPrimary).lighten(35).toHexString(),cellRangeBorderColor:new Sd(n.colorPrimary).lighten(20).toHexString(),cellBgDisabled:n.colorBgContainerDisabled,timeColumnWidth:n.controlHeightLG*1.4,timeColumnHeight:28*8,timeCellHeight:28,cellWidth:n.controlHeightSM*1.5,cellHeight:n.controlHeightSM,textHeight:n.controlHeightLG,withoutTimeCellHeight:n.controlHeightLG*1.65}),pWe=AN("DatePicker",n=>{const e=Gh(hWe(n),s$t(n));return[o$t(e),r$t(e),__e(n,{focusElCls:`${n.componentCls}-focused`})]},n=>Object.assign(Object.assign(Object.assign({},fWe(n)),a$t(n)),{presetsWidth:120,presetsMaxWidth:200,zIndexPopup:n.zIndexPopupBase+50})),l$t=n=>{const{componentCls:e,sizePaddingEdgeHorizontal:t,colorSplit:i,lineWidth:r,textPaddingInline:o,orientationMargin:s,verticalMarginInline:a}=n;return{[e]:Object.assign(Object.assign({},H4(n)),{borderBlockStart:`${r}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:a,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${n.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${n.dividerHorizontalWithTextGutterMargin}px 0`,color:n.colorTextHeading,fontWeight:500,fontSize:n.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:`${s*100}%`},"&::after":{width:`${100-s*100}%`}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:`${100-s*100}%`},"&::after":{width:`${s*100}%`}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:o},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:n.colorText,fontWeight:"normal",fontSize:n.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:t}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:t}}})}},c$t=AN("Divider",n=>{const e=Gh(n,{dividerHorizontalWithTextGutterMargin:n.margin,dividerHorizontalGutterMargin:n.marginLG,sizePaddingEdgeHorizontal:0});return[l$t(e)]},n=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:n.marginXS}));var u$t=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const d$t=n=>{const{getPrefixCls:e,direction:t,divider:i}=w.useContext(Gm),{prefixCls:r,type:o="horizontal",orientation:s="center",orientationMargin:a,className:l,rootClassName:c,children:u,dashed:d,plain:h,style:f}=n,g=u$t(n,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),m=e("divider",r),[v,_]=c$t(m),b=s.length>0?`-${s}`:s,y=!!u,C=s==="left"&&a!=null,x=s==="right"&&a!=null,E=Nt(m,i==null?void 0:i.className,_,`${m}-${o}`,{[`${m}-with-text`]:y,[`${m}-with-text${b}`]:y,[`${m}-dashed`]:!!d,[`${m}-plain`]:!!h,[`${m}-rtl`]:t==="rtl",[`${m}-no-default-orientation-margin-left`]:C,[`${m}-no-default-orientation-margin-right`]:x},l,c),k=w.useMemo(()=>typeof a=="number"?a:/^\d+$/.test(a)?Number(a):a,[a]),L=Object.assign(Object.assign({},C&&{marginLeft:k}),x&&{marginRight:k});return v(w.createElement("div",Object.assign({className:E,style:Object.assign(Object.assign({},i==null?void 0:i.style),f)},g,{role:"separator"}),u&&o!=="vertical"&&w.createElement("span",{className:`${m}-inner-text`,style:L},u)))},h$t=d$t;var f$t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"};const p$t=f$t;var g$t=function(e,t){return w.createElement(BF,Ct({},e,{ref:t,icon:p$t}))};const gWe=w.forwardRef(g$t);var m$t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"};const _$t=m$t;var v$t=function(e,t){return w.createElement(BF,Ct({},e,{ref:t,icon:_$t}))};const mWe=w.forwardRef(v$t);var b$t={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"}}]},name:"swap-right",theme:"outlined"};const y$t=b$t;var C$t=function(e,t){return w.createElement(BF,Ct({},e,{ref:t,icon:y$t}))};const w$t=w.forwardRef(C$t);function S$t(n,e,t){return t!==void 0?t:e==="year"&&n.lang.yearPlaceholder?n.lang.yearPlaceholder:e==="quarter"&&n.lang.quarterPlaceholder?n.lang.quarterPlaceholder:e==="month"&&n.lang.monthPlaceholder?n.lang.monthPlaceholder:e==="week"&&n.lang.weekPlaceholder?n.lang.weekPlaceholder:e==="time"&&n.timePickerLocale.placeholder?n.timePickerLocale.placeholder:n.lang.placeholder}function E$t(n,e,t){return t!==void 0?t:e==="year"&&n.lang.yearPlaceholder?n.lang.rangeYearPlaceholder:e==="quarter"&&n.lang.quarterPlaceholder?n.lang.rangeQuarterPlaceholder:e==="month"&&n.lang.monthPlaceholder?n.lang.rangeMonthPlaceholder:e==="week"&&n.lang.weekPlaceholder?n.lang.rangeWeekPlaceholder:e==="time"&&n.timePickerLocale.placeholder?n.timePickerLocale.rangePlaceholder:n.lang.rangePlaceholder}function T_e(n,e){const t={adjustX:1,adjustY:1};switch(e){case"bottomLeft":return{points:["tl","bl"],offset:[0,4],overflow:t};case"bottomRight":return{points:["tr","br"],offset:[0,4],overflow:t};case"topLeft":return{points:["bl","tl"],offset:[0,-4],overflow:t};case"topRight":return{points:["br","tr"],offset:[0,-4],overflow:t};default:return{points:n==="rtl"?["tr","br"]:["tl","bl"],offset:[0,4],overflow:t}}}function x$t(n){return n?Array.isArray(n)?n:[n]:[]}function XH(n){const{format:e,picker:t,showHour:i,showMinute:r,showSecond:o,use12Hours:s}=n,a=x$t(e)[0],l=Object.assign({},n);return e&&Array.isArray(e)&&(l.format=a),a&&typeof a=="string"&&(!a.includes("s")&&o===void 0&&(l.showSecond=!1),!a.includes("m")&&r===void 0&&(l.showMinute=!1),!a.includes("H")&&!a.includes("h")&&!a.includes("K")&&!a.includes("k")&&i===void 0&&(l.showHour=!1),(a.includes("a")||a.includes("A"))&&s===void 0&&(l.use12Hours=!0)),t==="time"?l:(typeof a=="function"&&delete l.format,{showTime:l})}function _We(n,e,t){if(n===!1)return!1;const i={clearIcon:e??t};return typeof n=="object"?Object.assign(Object.assign({},i),n):i}function T$t(n){return w.createElement(n8t,Object.assign({size:"small",type:"primary"},n))}const k$t={button:T$t},vWe=k$t;var I$t=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function L$t(n){return w.forwardRef((t,i)=>{const{prefixCls:r,getPopupContainer:o,className:s,placement:a,size:l,disabled:c,bordered:u=!0,placeholder:d,popupClassName:h,dropdownClassName:f,status:g,clearIcon:m,allowClear:v,rootClassName:_}=t,b=I$t(t,["prefixCls","getPopupContainer","className","placement","size","disabled","bordered","placeholder","popupClassName","dropdownClassName","status","clearIcon","allowClear","rootClassName"]),y=w.useRef(null),{getPrefixCls:C,direction:x,getPopupContainer:E}=w.useContext(Gm),k=C("picker",r),{compactSize:L,compactItemClassnames:D}=p_e(k,x),{format:A,showTime:O,picker:P}=t,F=C(),[B,M]=pWe(k),V=Object.assign(Object.assign({},O?XH(Object.assign({format:A,picker:P},O)):{}),P==="time"?XH(Object.assign(Object.assign({format:A},t),{picker:P})):{}),U=f_e(ke=>{var Me;return(Me=l??L)!==null&&Me!==void 0?Me:ke}),W=w.useContext(Oq),q=c??W,H=w.useContext(LHe),{hasFeedback:ie,status:se,feedbackIcon:Q}=H,Ee=w.createElement(w.Fragment,null,P==="time"?w.createElement(mWe,null):w.createElement(gWe,null),ie&&Q);w.useImperativeHandle(i,()=>({focus:()=>{var ke;return(ke=y.current)===null||ke===void 0?void 0:ke.focus()},blur:()=>{var ke;return(ke=y.current)===null||ke===void 0?void 0:ke.blur()}}));const[Fe]=MVe("Calendar",UH),He=Object.assign(Object.assign({},Fe),t.locale);return B(w.createElement(K7t,Object.assign({separator:w.createElement("span",{"aria-label":"to",className:`${k}-separator`},w.createElement(w$t,null)),disabled:q,ref:y,dropdownAlign:T_e(x,a),placeholder:E$t(He,P,d),suffixIcon:Ee,prevIcon:w.createElement("span",{className:`${k}-prev-icon`}),nextIcon:w.createElement("span",{className:`${k}-next-icon`}),superPrevIcon:w.createElement("span",{className:`${k}-super-prev-icon`}),superNextIcon:w.createElement("span",{className:`${k}-super-next-icon`}),transitionName:`${F}-slide-up`},b,V,{className:Nt({[`${k}-${U}`]:U,[`${k}-borderless`]:!u},MHe(k,FHe(se,g),ie),M,D,s,_),locale:He.lang,prefixCls:k,getPopupContainer:o||E,generateConfig:n,components:vWe,direction:x,dropdownClassName:Nt(M,h||f,_),allowClear:_We(v,m,w.createElement(uHe,null))})))})}var D$t=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function A$t(n){function e(l,c){const u=c==="TimePicker"?"timePicker":"datePicker",d=w.forwardRef((h,f)=>{const{prefixCls:g,getPopupContainer:m,style:v,className:_,rootClassName:b,size:y,bordered:C=!0,placement:x,placeholder:E,popupClassName:k,dropdownClassName:L,disabled:D,status:A,clearIcon:O,allowClear:P}=h,F=D$t(h,["prefixCls","getPopupContainer","style","className","rootClassName","size","bordered","placement","placeholder","popupClassName","dropdownClassName","disabled","status","clearIcon","allowClear"]),{getPrefixCls:B,direction:M,getPopupContainer:V,[u]:U}=w.useContext(Gm),W=B("picker",g),{compactSize:q,compactItemClassnames:H}=p_e(W,M),ie=w.useRef(null),{format:se,showTime:Q}=h,[Ee,Fe]=pWe(W);w.useImperativeHandle(f,()=>({focus:()=>{var we;return(we=ie.current)===null||we===void 0?void 0:we.focus()},blur:()=>{var we;return(we=ie.current)===null||we===void 0?void 0:we.blur()}}));const He={showToday:!0};let ke={};l&&(ke.picker=l);const Me=l||h.picker;ke=Object.assign(Object.assign(Object.assign({},ke),Q?XH(Object.assign({format:se,picker:Me},Q)):{}),Me==="time"?XH(Object.assign(Object.assign({format:se},h),{picker:Me})):{});const je=B(),qe=f_e(we=>{var Se;return(Se=y??q)!==null&&Se!==void 0?Se:we}),Be=w.useContext(Oq),_t=D??Be,Wt=w.useContext(LHe),{hasFeedback:Tt,status:rn,feedbackIcon:_n}=Wt,wt=w.createElement(w.Fragment,null,Me==="time"?w.createElement(mWe,null):w.createElement(gWe,null),Tt&&_n),[pt]=MVe("DatePicker",UH),ot=Object.assign(Object.assign({},pt),h.locale);return Ee(w.createElement(V7t,Object.assign({ref:ie,placeholder:S$t(ot,Me,E),suffixIcon:wt,dropdownAlign:T_e(M,x),prevIcon:w.createElement("span",{className:`${W}-prev-icon`}),nextIcon:w.createElement("span",{className:`${W}-next-icon`}),superPrevIcon:w.createElement("span",{className:`${W}-super-prev-icon`}),superNextIcon:w.createElement("span",{className:`${W}-super-next-icon`}),transitionName:`${je}-slide-up`},He,F,ke,{locale:ot.lang,className:Nt({[`${W}-${qe}`]:qe,[`${W}-borderless`]:!C},MHe(W,FHe(rn,A),Tt),Fe,H,U==null?void 0:U.className,_,b),style:Object.assign(Object.assign({},U==null?void 0:U.style),v),prefixCls:W,getPopupContainer:m||V,generateConfig:n,components:vWe,direction:M,disabled:_t,dropdownClassName:Nt(Fe,b,k||L),allowClear:_We(P,O,w.createElement(uHe,null))})))});return c&&(d.displayName=c),d}const t=e(),i=e("week","WeekPicker"),r=e("month","MonthPicker"),o=e("year","YearPicker"),s=e("time","TimePicker"),a=e("quarter","QuarterPicker");return{DatePicker:t,WeekPicker:i,MonthPicker:r,YearPicker:o,TimePicker:s,QuarterPicker:a}}function bWe(n){const{DatePicker:e,WeekPicker:t,MonthPicker:i,YearPicker:r,TimePicker:o,QuarterPicker:s}=A$t(n),a=L$t(n),l=e;return l.WeekPicker=t,l.MonthPicker=i,l.YearPicker=r,l.RangePicker=a,l.TimePicker=o,l.QuarterPicker=s,l}const PN=bWe(X9t);function yWe(n){const e=T_e(n.direction,n.placement);return e.overflow.adjustY=!1,e.overflow.adjustX=!1,Object.assign(Object.assign({},n),{dropdownAlign:e})}const N$t=PHe(PN,"picker",null,yWe);PN._InternalPanelDoNotUseOrYouWillBeFired=N$t;const R$t=PHe(PN.RangePicker,"picker",null,yWe);PN._InternalRangePanelDoNotUseOrYouWillBeFired=R$t;PN.generatePicker=bWe;const CWe=PN;function O$t(){const[n]=pe(),e=Qi(),t=ji(),i=Ig(),[r,o]=w.useState(!0),s=(l,c)=>e(Go({object:"company",property:l,value:c})),a=()=>{ce.processing(),Ae("POST",Te(`/api/v1/companies/${t.id}/default`),{}).then(l=>{ce.success(l.data.message),o(!1)})};return N(Qt,{title:n("overview"),children:[p(K,{leftSide:n("activate_company"),leftSideHelp:n("activate_company_help"),children:p(ft,{checked:!(t!=null&&t.is_disabled),onChange:l=>s("is_disabled",!l)})}),p(K,{leftSide:n("enable_markdown"),leftSideHelp:n("enable_markdown_help"),children:p(ft,{checked:t==null?void 0:t.markdown_enabled,onChange:l=>s("markdown_enabled",l)})}),p(K,{leftSide:n("include_drafts"),leftSideHelp:n("include_drafts_help"),children:p(ft,{checked:t==null?void 0:t.report_include_drafts,onChange:l=>s("report_include_drafts",l)})}),i.default_company_id!==(t==null?void 0:t.id)&&r&&N(dt,{children:[p(h$t,{}),p(K,{leftSide:n("set_default_company"),children:p(Gt,{type:"minimal",behavior:"button",onClick:a,children:t==null?void 0:t.settings.name})})]})]})}function P$t(){const[n]=pe();pa();const e=Ig(),{dateFormat:t}=lc();return N(Qt,{title:n("plan"),children:[p(K,{className:"mb-3",leftSide:n("plan"),children:p("span",{children:n((e==null?void 0:e.plan_expires)!==""&&!Un(e.plan_expires).isBefore(Un())?"licensed":"plan_free_self_hosted")})}),(e==null?void 0:e.plan_expires)!==""&&p(K,{leftSide:n("expires_on"),children:Un(e.plan_expires).year()>2e3?go(e.plan_expires,t):n("forever_free")}),Ro(),!f1()&&p(w3t,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const $s=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function So(){const n=Qi();return(e,t)=>{n(Go({object:"company",property:e,value:t}))}}function M$t(){const[n]=pe(),e=ji(),t=Fi($s),i=wi(),r=So(),[o,s]=w.useState(!1),a=[{value:18e5,label:bt(n("count_minutes"),{count:"30"})},{value:72e5,label:bt(n("count_hours"),{count:"2"})},{value:288e5,label:bt(n("count_hours"),{count:"8"})},{value:864e5,label:bt(n("count_day"),{count:"1"})},{value:6048e5,label:bt(n("count_days"),{count:"7"})},{value:2592e6,label:bt(n("count_days"),{count:"30"})},{value:0,label:n("never")}],l=()=>{o||(s(!0),Ae("POST",Te("/api/v1/logout")).then(()=>{ce.success("success"),i("/logout")}).finally(()=>s(!1)))};return N(Qt,{title:n("security_settings"),children:[p(K,{leftSide:n("web_session_timeout"),children:p(Cn,{value:e==null?void 0:e.session_timeout,onValueChange:c=>r("session_timeout",c),errorMessage:t==null?void 0:t.errors.session_timeout,customSelector:!0,dismissable:!1,children:a.map(c=>p("option",{value:c.value,children:c.label},c.value))})}),p(K,{leftSide:n("end_all_sessions"),leftSideHelp:n("end_all_sessions_help"),children:p(Gt,{behavior:"button",type:"secondary",onClick:l,disabled:o,disableWithoutIcon:!0,children:n("logout")})})]})}function F$t(){const[n]=pe(),e=ci(),t=Oc(m=>m.companyUsers),[i,r]=w.useState(""),[o,s]=w.useState(""),[a,l]=w.useState(!1),[c,u]=w.useState(!1),[d,h]=w.useState(""),f=()=>{ce.processing(),Ae("POST",Te("/api/v1/companies/purge_save_settings/:id",{id:e.id}),{cancellation_message:o},{headers:{"X-Api-Password":i}}).then(()=>ce.success("purge_successful")).catch(m=>{var v;((v=m.response)==null?void 0:v.status)===412&&ce.error("password_error_incorrect")}).finally(()=>l(!1))},g=()=>{ce.processing(),Ae("DELETE",Te("/api/v1/companies/:id",{id:e.id}),{},{headers:{"X-Api-Password":i}}).then(()=>window.location.reload()).catch(m=>{var v;((v=m.response)==null?void 0:v.status)===412&&ce.error("password_error_incorrect")})};return N(dt,{children:[N(Ui,{title:n("purge_data"),text:n("purge_data_message"),visible:a,onClose:l,children:[p(We,{label:bt(n("please_type_to_confirm"),{value:"purge"}),id:"purge_data",onChange:m=>h(m.target.value),required:!0}),p(We,{type:"password",label:n("password"),id:"password",onChange:m=>r(m.target.value),required:!0}),d==="purge"&&p(Gt,{onClick:f,children:n("continue")})]}),N(Ui,{title:(t==null?void 0:t.api.length)>1?n("delete_company"):n("cancel_account"),text:(t==null?void 0:t.api.length)>1?`${n("delete_company_message")} (${e==null?void 0:e.settings.name})`:n("cancel_account_message"),visible:c,onClose:u,children:[p(We,{label:bt(n("please_type_to_confirm"),{value:"delete"}),id:"cancel_account",onChange:m=>h(m.target.value),required:!0}),p(We,{type:"text",label:n("reason_for_canceling"),id:"feedback",onChange:m=>s(m.target.value)}),p(We,{type:"password",label:n("password"),id:"password",onChange:m=>r(m.target.value),required:!0}),d==="delete"&&p(Gt,{onClick:g,children:n("continue")})]}),N(Qt,{title:n("danger_zone"),children:[p(wl,{onClick:()=>l(!0),className:"text-red-500 hover:text-red-600",children:n("purge_data")}),p(wl,{onClick:()=>u(!0),className:"text-red-500 hover:text-red-600",children:(t==null?void 0:t.api.length)>1?n("delete_company"):n("cancel_account")})]})]})}function Fl(n){const e=n.text||"",[t,i]=w.useState(!1),r=o=>{o.stopPropagation(),navigator.clipboard.writeText(e),ce.success("copied_to_clipboard",{value:""})};return N("div",{className:`inline-flex items-center space-x-2 ${n.className}`,children:[p("span",{children:n.secure&&!t?n.text.split("").map(()=>"*"):e}),e.length>0&&navigator.clipboard&&window.isSecureContext?p("button",{type:"button",onClick:r,children:p(M9e,{size:18})}):p(dt,{children:!!n.secure&&p("div",{className:"inline-flex items-center cursor-pointer",onClick:o=>{o.stopPropagation(),i(s=>!s)},children:t?p(vt,{element:T7e}):p(vt,{element:x7e})})})]})}function B$t(){var t,i,r;const[n]=pe(),e=pa();return N(Qt,{title:n("referral_program"),children:[p(K,{leftSide:n("referral_code"),children:p(Fl,{text:`https://app.invoicing.co/#/register?rc=${e==null?void 0:e.referral_code}`})}),p(K,{leftSide:n("free"),children:((t=e==null?void 0:e.referral_meta)==null?void 0:t.free)||0}),p(K,{leftSide:n("pro"),children:((i=e==null?void 0:e.referral_meta)==null?void 0:i.pro)||0}),p(K,{leftSide:n("enterprise"),children:((r=e==null?void 0:e.referral_meta)==null?void 0:r.enterprise)||0})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $$t(){return[{name:"income",icon:QEt,visible:!0},{name:"expense",icon:rxt,visible:!0},{name:"settings",icon:nxt,visible:Ro()}]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const tu=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function wWe(n){const{isAdmin:e}=Po(),{status:t}=n||{};return Ti(["/api/v1/company_gateways",n],()=>Ae("GET",Te("/api/v1/company_gateways?sort=id|desc&status=:status",{status:t||"active"})),{staleTime:1/0,enabled:e})}function V$t(n){const{isAdmin:e}=Po();return Ti(["/api/v1/company_gateways",n.id,n.queryParams],()=>Ae("GET",Te(`/api/v1/company_gateways/:id?${n.queryParams||""}`,{id:n.id})),{staleTime:1/0,enabled:(n.enabled??!0)&&e})}function H$t(){const{isAdmin:n}=Po();return Ti(["/api/v1/company_gateways/create"],()=>Ae("GET",Te("/api/v1/company_gateways/create")),{staleTime:1/0,enabled:n})}function SWe(){const n=_o(),e=Fi(tu);return async(t,i)=>(ce.processing(),Ae("POST",Te("/api/v1/company_gateways/bulk"),{action:i,ids:t}).then(()=>{ce.success(`${i}d_company_gateway`),En(["company_gateways"]),e&&n.invalidateQueries([e])}))}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function EWe(n){const{isAdmin:e,isOwner:t}=Po();return Ti(["/api/v1/bank_integrations",n.id],()=>Ae("GET",Te("/api/v1/bank_integrations/:id",{id:n.id})).then(i=>i.data.data),{enabled:(n.enabled??!0)&&(e||t),staleTime:1/0})}function W$t(n){const{perPage:e}=n||{};return Ti(["/api/v1/bank_integrations"],()=>Ae("GET",Te("/api/v1/bank_integrations?per_page=:perPage&status=active",{perPage:e??20})).then(t=>t.data.data),{staleTime:1/0})}function xWe(){const{isAdmin:n,isOwner:e}=Po();return Ti(["/api/v1/bank_integrations","create"],()=>Ae("GET",Te("/api/v1/bank_integrations/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function TWe(n){return Ti(["/api/v1/tax_rates",n],()=>Ae("GET",Te("/api/v1/tax_rates?per_page=:perPage&page=:currentPage&sort=:sort&status=:status",{perPage:n.perPage??1e3,currentPage:n.currentPage,sort:n.sort??"id|asc",status:n.status??"all"})),{staleTime:1/0})}function z$t(n){return Ti(["/api/v1/tax_rates",n.id],()=>Ae("GET",Te("/api/v1/tax_rates/:id",{id:n.id})),{staleTime:1/0})}function U$t(){const{isAdmin:n}=Po();return Ti(["/api/v1/tax_rates","create"],()=>Ae("GET",Te("/api/v1/tax_rates/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function j$t(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/tax_rates/bulk"),{action:e,ids:[n]}).then(()=>{ce.success(`${e}d_tax_rate`),En(["tax_rates"])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function xr(n){return()=>{var t,i,r;const e=!!(((r=(i=(t=GD.getState().companyUsers.api)==null?void 0:t[GD.getState().companyUsers.currentIndex])==null?void 0:i.company)==null?void 0:r.enabled_modules)&n);return new Promise(o=>o(e))}}function kWe(){const n=ci();return e=>!!((n==null?void 0:n.enabled_modules)&e)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function q$t(){const n=ci(),e=ps(),t=kWe(),{isAdmin:i,isOwner:r}=Po(),{data:o}=wWe(),{data:s}=W$t(),{data:a}=TWe({}),[l,c]=w.useState(),[u,d]=w.useState(),[h,f]=w.useState();return w.useEffect(()=>{o&&c(o.data.data),s&&d(s),a&&f(a.data.data)},[o,s,a]),[{key:"client",url:"/clients/create",section:"income",visible:e("create_client")},{key:"product",url:"/products/create",section:"income",visible:e("create_product")},{key:"invoice",url:"/invoices/create",section:"income",visible:e("create_invoice")&&t(Ci.Invoices)},{key:"recurring_invoice",url:"/recurring_invoices/create",section:"income",visible:e("create_recurring_invoice")&&t(Ci.RecurringInvoices)},{key:"quote",url:"/quotes/create",section:"income",visible:e("create_quote")&&t(Ci.Quotes)},{key:"credit",url:"/credits/create",section:"income",visible:e("create_credit")&&t(Ci.Credits)},{key:"payment",url:"/payments/create",section:"income",visible:e("create_payment")},{key:"subscription",url:"/settings/subscription/create",section:"income",visible:(Vm()||rc())&&(i||r)},{key:"expense",url:"/expenses/create",section:"expense",visible:e("create_expense")&&t(Ci.Expenses)},{key:"purchase_order",url:"/purchase_orders/create",section:"expense",visible:e("create_purchase_order")&&t(Ci.PurchaseOrders)},{key:"vendor",url:"/vendors/create",section:"expense",visible:e("create_vendor")&&t(Ci.Vendors)},{key:"transaction",url:"/transactions/create",section:"expense",visible:e("create_bank_transaction")&&t(Ci.Transactions)},{key:"add_stripe",url:"/settings/gateways/create",section:"settings",visible:!(l!=null&&l.length)&&(i||r)},{key:"add_bank_account",url:"/settings/bank_accounts/create",section:"settings",visible:rc()&&!(u!=null&&u.length)&&(i||r)},{key:"tax_settings",url:"/settings/tax_rates/create",section:"settings",visible:!(h!=null&&h.length)&&(i||r)},{key:"add_company_logo",url:"/settings/company_details/logo",section:"settings",visible:!(n!=null&&n.settings.company_logo)&&(i||r)},{key:"templates_and_reminders",url:"/settings/templates_and_reminders",section:"settings",visible:(Vm()||rc())&&(i||r)}]}const K$t=rl.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function G$t(){var l;const[n]=pe(),e=Mk(),t=ni(),i=vo(),r=q$t(),o=$$t(),s=T1(),a=!!((l=s==null?void 0:s.company_user)!=null&&l.react_settings.show_mini_sidebar);return p(FZ,{className:"relative mt-2",children:()=>N(dt,{children:[N(FZ.Button,{"data-cy":"quickPopoverButton",style:{backgroundColor:t.$1,color:t.$3},className:Nt("group inline-flex items-center rounded text-base font-medium focus:outline-none focus:ring-1 focus:ring-gray-200 focus:ring-offset-2"),children:[p(lke,{className:"cursor-pointer text-xl"}),p(JEt,{className:"cursor-pointer text-xl"})]}),p(Y_,{as:w.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:p(FZ.Panel,{className:Nt("absolute z-10 mt-3 w-screen max-w-md -translate-x-1/2 transform px-2",{"left-14 md:-left-12 md:max-w-2xl lg:max-w-3xl lg:left-full":Ro(),"left-14 md:left-52 md:max-w-2xl lg:max-w-3xl":Ro(),"left-14 md:left-8 lg:max-w-lg lg:left-full":!a,"left-14 md:left-8 lg:max-w-lg lg:left-20":a}),children:p("div",{style:{borderColor:t.$4},className:"border overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",children:p("div",{style:{backgroundColor:t.$1},className:Nt("relative grid gap-y-4 md:gap-y-0 px-2 py-4 grid-cols-2",{"md:grid-cols-3":Ro()}),children:o.map(c=>c.visible&&N("div",{className:"flex flex-col items-start rounded-lg transition duration-150 ease-in-out",children:[N("div",{className:"flex items-center pl-3",children:[p(c.icon,{className:"text-base",color:i}),p("p",{style:{color:t.$3},className:"uppercase text-sm tracking-wide font-medium ml-1 md:ml-2",children:n(c.name)})]}),p("div",{className:"flex flex-col w-full mt-2 space-y-2",children:r.map(u=>u.section===c.name&&u.visible&&N(K$t,{theme:{hoverColor:t.$2},className:"flex items-center pl-3 space-x-1 py-1 cursor-pointer rounded",onClick:()=>e({url:u.url,externalLink:u.externalLink}),children:[p(lke,{className:"text-base",style:{color:t.$3}}),p("span",{style:{color:t.$3},className:"text-sm text-gray-800",children:n(u.key)})]},u.key))})]},c.name))})})})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Y$t(){const n=Ig();return Po(),new Date(n==null?void 0:n.plan_expires)<new Date,Ro()}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Q$t(){const n=Ig(),{isAdmin:e,isOwner:t}=Po(),i=new Date(n==null?void 0:n.plan_expires)<new Date;return((n==null?void 0:n.plan)&&i||!(n!=null&&n.plan))&&(e||t)}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var iM=(n=>(n.Company="company",n.Group="group",n.Client="client",n))(iM||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function k_e(){const n=Oc(e=>e.settings.activeSettings);return{name:n.name,level:n.level}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ea(){const n=k_e(),e=iM.Company===n.level,t=iM.Group===n.level,i=iM.Client===n.level;return{isCompanySettingsActive:e,isGroupSettingsActive:t,isClientSettingsActive:i}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function X$t(){const[n]=pe(),e=Tl(),{isCompanySettingsActive:t}=ea(),{isOwner:i,isAdmin:r}=Po(),o=[{name:n("company_details"),href:"/settings/company_details",current:e.pathname.startsWith("/settings/company_details"),enabled:r||i||!1},{name:n("user_details"),href:"/settings/user_details",current:e.pathname.startsWith("/settings/user_details"),enabled:t},{name:n("localization"),href:"/settings/localization",current:e.pathname.startsWith("/settings/localization"),enabled:r||i||!1},{name:n("payment_settings"),href:"/settings/online_payments",current:e.pathname.startsWith("/settings/online_payments")||e.pathname.startsWith("/settings/gateways")||e.pathname.startsWith("/settings/payment_terms"),enabled:r||i||!1},{name:n("tax_settings"),href:"/settings/tax_settings",current:e.pathname.startsWith("/settings/tax_settings")||e.pathname.startsWith("/settings/tax_rates"),enabled:r||i||!1},{name:n("product_settings"),href:"/settings/product_settings",current:e.pathname.startsWith("/settings/product_settings"),enabled:(r||i)&&t||!1},{name:n("task_settings"),href:"/settings/task_settings",current:e.pathname.startsWith("/settings/task_settings")||e.pathname.startsWith("/settings/task_statuses"),enabled:r||i||!1},{name:n("expense_settings"),href:"/settings/expense_settings",current:e.pathname.startsWith("/settings/expense_settings")||e.pathname.startsWith("/settings/expense_categories"),enabled:(r||i)&&t||!1},{name:n("workflow_settings"),href:"/settings/workflow_settings",current:e.pathname.startsWith("/settings/workflow_settings"),enabled:r||i||!1},{name:n("account_management"),href:"/settings/account_management",current:e.pathname.startsWith("/settings/account_management"),enabled:(r||i)&&t||!1},{name:n("backup_restore"),href:"/settings/backup_restore",current:e.pathname.startsWith("/settings/backup_restore"),enabled:(r||i)&&t||!1},{name:n("import_export"),href:"/settings/import_export",current:e.pathname.startsWith("/settings/import_export"),enabled:(r||i)&&t||!1}],s=[{name:n("invoice_design"),href:"/settings/invoice_design",current:e.pathname.endsWith("/settings/invoice_design"),enabled:r||i||!1},{name:n("custom_fields"),href:"/settings/custom_fields",current:e.pathname.startsWith("/settings/custom_fields"),enabled:(r||i)&&t||!1},{name:n("generated_numbers"),href:"/settings/generated_numbers",current:e.pathname.startsWith("/settings/generated_numbers"),enabled:r||i||!1},{name:n("client_portal"),href:"/settings/client_portal",current:e.pathname.startsWith("/settings/client_portal"),enabled:r||i||!1},{name:n("e_invoice"),href:"/settings/e_invoice",current:e.pathname.startsWith("/settings/e_invoice"),enabled:r||i||!1},{name:n("email_settings"),href:"/settings/email_settings",current:e.pathname.startsWith("/settings/email_settings"),enabled:r||i||!1},{name:n("templates_and_reminders"),href:"/settings/templates_and_reminders",current:e.pathname.startsWith("/settings/templates_and_reminders"),enabled:r||i||!1},{name:n("bank_accounts"),href:"/settings/bank_accounts",current:e.pathname.startsWith("/settings/bank_accounts"),enabled:(r||i)&&t||!1},{name:n("group_settings"),href:"/settings/group_settings",current:e.pathname.startsWith("/settings/group_settings"),enabled:(r||i)&&t||!1},{name:n("payment_links"),href:"/settings/subscriptions",current:e.pathname.startsWith("/settings/subscriptions"),enabled:(r||i)&&t||!1},{name:n("schedules"),href:"/settings/schedules",current:e.pathname.startsWith("/settings/schedules"),enabled:(r||i)&&t||!1},{name:n("user_management"),href:"/settings/users",current:e.pathname.startsWith("/settings/users"),enabled:(r||i)&&t||!1},{name:n("system_logs"),href:"/settings/system_logs",current:e.pathname.startsWith("/settings/system_logs"),enabled:(r||i)&&t||!1}];return{basic:o,advanced:s}}const IWe=Oo(null);function X2r(n,e=[]){const[t,i]=Yo(IWe),{displayButton:r=!0}=n||{};return w.useEffect(()=>(n&&r&&i(n),n&&!r&&i(null),()=>{i(null)}),e),t}const Z$t=Oo(null);function J$t(n,e=[]){const[t,i]=Yo(Z$t);return w.useEffect(()=>(n&&i(n),()=>{i(null)}),e),t}function fse({variant:n,children:e,className:t,id:i,style:r}){return p("div",{id:i,className:Nt("flex justify-center items-center px-3 py-2 text-xs md:px-6 md:text-sm leading-6 text-gray-900",{"bg-orange-300":n==="orange","bg-red-300":n==="red"},t),style:r,children:e})}const pse="font-medium text-xs md:text-sm underline cursor-pointer";function eVt(){return pe(),pa(),null}function tVt(){const[n]=pe(),e=ci(),t=pa();return!e||!(t!=null&&t.email_verified_at)||e&&!e.is_disabled?null:p(fse,{variant:"orange",children:N("div",{className:"flex space-x-1",children:[N("span",{children:[n("company_disabled_warning"),"."]}),p(C0,{className:pse,to:"/settings/account_management/overview",children:n("activate_company")})]})})}var LWe={};/*! For license information please see index.js.LICENSE.txt */(function(n){(()=>{var e={184:(a,l)=>{var c;(function(){var u={}.hasOwnProperty;function d(){for(var h=[],f=0;f<arguments.length;f++){var g=arguments[f];if(g){var m=typeof g;if(m==="string"||m==="number")h.push(g);else if(Array.isArray(g)){if(g.length){var v=d.apply(null,g);v&&h.push(v)}}else if(m==="object"){if(g.toString!==Object.prototype.toString&&!g.toString.toString().includes("[native code]")){h.push(g.toString());continue}for(var _ in g)u.call(g,_)&&g[_]&&h.push(_)}}}return h.join(" ")}a.exports?(d.default=d,a.exports=d):(c=(function(){return d}).apply(l,[]))===void 0||(a.exports=c)})()},28:(a,l,c)=>{c.d(l,{Z:()=>g});var u=c(81),d=c.n(u),h=c(645),f=c.n(h)()(d());f.push([a.id,`/* :where() gives the styles specificity 0, which makes them overridable */ :where(.vi__wrapper) { position: relative; width: min-content; } .vi { top: 0; right: 0; bottom: 0; left: 0; box-sizing: border-box; position: absolute; color: transparent; background: transparent; caret-color: transparent; outline: none; border: 0 none transparent; } .vi::-ms-reveal, .vi::-ms-clear { display: none; } .vi::selection { background: transparent; } :where(.vi__container) { display: flex; gap: 8px; height: 50px; width: 300px; } :where(.vi__character) { height: 100%; flex-grow: 1; flex-basis: 0; text-align: center; font-size: 36px; line-height: 50px; color: black; background-color: white; border: 1px solid black; cursor: default; user-select: none; box-sizing: border-box; } :where(.vi__character--inactive) { color: dimgray; background-color: lightgray; } :where(.vi__character--selected) { outline: 2px solid cornflowerblue; color: cornflowerblue; } `,""]);const g=f},645:a=>{a.exports=function(l){var c=[];return c.toString=function(){return this.map(function(u){var d="",h=u[5]!==void 0;return u[4]&&(d+="@supports (".concat(u[4],") {")),u[2]&&(d+="@media ".concat(u[2]," {")),h&&(d+="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {")),d+=l(u),h&&(d+="}"),u[2]&&(d+="}"),u[4]&&(d+="}"),d}).join("")},c.i=function(u,d,h,f,g){typeof u=="string"&&(u=[[null,u,void 0]]);var m={};if(h)for(var v=0;v<this.length;v++){var _=this[v][0];_!=null&&(m[_]=!0)}for(var b=0;b<u.length;b++){var y=[].concat(u[b]);h&&m[y[0]]||(g!==void 0&&(y[5]===void 0||(y[1]="@layer".concat(y[5].length>0?" ".concat(y[5]):""," {").concat(y[1],"}")),y[5]=g),d&&(y[2]&&(y[1]="@media ".concat(y[2]," {").concat(y[1],"}")),y[2]=d),f&&(y[4]?(y[1]="@supports (".concat(y[4],") {").concat(y[1],"}"),y[4]=f):y[4]="".concat(f)),c.push(y))}},c}},81:a=>{a.exports=function(l){return l[1]}},703:(a,l,c)=>{var u=c(414);function d(){}function h(){}h.resetWarningCache=d,a.exports=function(){function f(v,_,b,y,C,x){if(x!==u){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}function g(){return f}f.isRequired=f;var m={array:f,bigint:f,bool:f,func:f,number:f,object:f,string:f,symbol:f,any:f,arrayOf:g,element:f,elementType:f,instanceOf:g,node:f,objectOf:g,oneOf:g,oneOfType:g,shape:g,exact:g,checkPropTypes:h,resetWarningCache:d};return m.PropTypes=m,m}},697:(a,l,c)=>{a.exports=c(703)()},414:a=>{a.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function i(a){var l=t[a];if(l!==void 0)return l.exports;var c=t[a]={id:a,exports:{}};return e[a](c,c.exports,i),c.exports}i.n=a=>{var l=a&&a.__esModule?()=>a.default:()=>a;return i.d(l,{a:l}),l},i.d=(a,l)=>{for(var c in l)i.o(l,c)&&!i.o(a,c)&&Object.defineProperty(a,c,{enumerable:!0,get:l[c]})},i.o=(a,l)=>Object.prototype.hasOwnProperty.call(a,l),i.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var r={};(()=>{i.r(r),i.d(r,{default:()=>L});const a=w;var l=i.n(a),c=i(184),u=i.n(c),d=i(697),h=i.n(d),f=i(28);function g(D){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},g(D)}var m=["className","type"],v=["className"];function _(D,A,O){return(A=function(P){var F=function(B,M){if(g(B)!=="object"||B===null)return B;var V=B[Symbol.toPrimitive];if(V!==void 0){var U=V.call(B,"string");if(g(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(B)}(P);return g(F)==="symbol"?F:String(F)}(A))in D?Object.defineProperty(D,A,{value:O,enumerable:!0,configurable:!0,writable:!0}):D[A]=O,D}function b(){return b=Object.assign?Object.assign.bind():function(D){for(var A=1;A<arguments.length;A++){var O=arguments[A];for(var P in O)Object.prototype.hasOwnProperty.call(O,P)&&(D[P]=O[P])}return D},b.apply(this,arguments)}function y(D,A){if(D==null)return{};var O,P,F=function(M,V){if(M==null)return{};var U,W,q={},H=Object.keys(M);for(W=0;W<H.length;W++)U=H[W],V.indexOf(U)>=0||(q[U]=M[U]);return q}(D,A);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(D);for(P=0;P<B.length;P++)O=B[P],A.indexOf(O)>=0||Object.prototype.propertyIsEnumerable.call(D,O)&&(F[O]=D[O])}return F}function C(D,A){return function(O){if(Array.isArray(O))return O}(D)||function(O,P){var F=O==null?null:typeof Symbol<"u"&&O[Symbol.iterator]||O["@@iterator"];if(F!=null){var B,M,V,U,W=[],q=!0,H=!1;try{if(V=(F=F.call(O)).next,P===0){if(Object(F)!==F)return;q=!1}else for(;!(q=(B=V.call(F)).done)&&(W.push(B.value),W.length!==P);q=!0);}catch(ie){H=!0,M=ie}finally{try{if(!q&&F.return!=null&&(U=F.return(),Object(U)!==U))return}finally{if(H)throw M}}return W}}(D,A)||x(D,A)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function x(D,A){if(D){if(typeof D=="string")return E(D,A);var O=Object.prototype.toString.call(D).slice(8,-1);return O==="Object"&&D.constructor&&(O=D.constructor.name),O==="Map"||O==="Set"?Array.from(D):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?E(D,A):void 0}}function E(D,A){(A==null||A>D.length)&&(A=D.length);for(var O=0,P=new Array(A);O<A;O++)P[O]=D[O];return P}var k=(0,a.forwardRef)(function(D,A){var O=D.value,P=D.length,F=D.validChars,B=D.placeholder,M=D.autoFocus,V=D.passwordMode,U=D.inputProps,W=D.containerProps,q=D.classNames,H=D.onChange,ie=D.onFocus,se=D.onBlur,Q=D.onComplete,Ee=C((0,a.useState)(""),2),Fe=Ee[0],He=Ee[1],ke=C((0,a.useState)(!1),2),Me=ke[0],je=ke[1],qe=(0,a.useRef)(null);(0,a.useEffect)(function(){M&&qe.current.focus()},[M]);var Be,_t=function(){qe.current.focus()},Wt=function(){return O??Fe},Tt=U.className,rn=U.type,_n=y(U,m),wt=W.className,pt=y(W,v);return l().createElement("div",{className:"vi__wrapper"},l().createElement("input",b({"aria-label":"verification input",spellCheck:!1,value:Wt(),onChange:function(ot){var we=ot.target.value.replace(/\s/g,"");RegExp("^[".concat(F,"]{0,").concat(P,"}$")).test(we)&&(H&&(H==null||H(we)),He(we),we.length===P&&(Q==null||Q(we)))},ref:function(ot){qe.current=ot,typeof A=="function"?A(ot):A&&(A.current=ot)},className:u()("vi",Tt),onKeyDown:function(ot){["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(ot.key)&&ot.preventDefault()},onFocus:function(){je(!0),ie==null||ie()},onBlur:function(){je(!1),se==null||se()},onSelect:function(ot){var we=ot.target.value;ot.target.setSelectionRange(we.length,we.length)},type:V?"password":rn},_n)),l().createElement("div",b({"data-testid":"container",className:u()("vi__container",q.container,wt),onClick:function(){return qe.current.focus()}},pt),(Be=Array(P),function(ot){if(Array.isArray(ot))return E(ot)}(Be)||function(ot){if(typeof Symbol<"u"&&ot[Symbol.iterator]!=null||ot["@@iterator"]!=null)return Array.from(ot)}(Be)||x(Be)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()).map(function(ot,we){var Se;return l().createElement("div",{className:u()("vi__character",q.character,(Se={"vi__character--selected":(Wt().length===we||Wt().length===we+1&&P===we+1)&&Me},_(Se,q.characterSelected,(Wt().length===we||Wt().length===we+1&&P===we+1)&&Me),_(Se,"vi__character--inactive",Wt().length<we),_(Se,q.characterInactive,Wt().length<we),Se)),onClick:_t,id:"field-".concat(we),"data-testid":"character-".concat(we),key:we},V&&Wt()[we]?"*":Wt()[we]||B)})),l().createElement("style",{dangerouslySetInnerHTML:{__html:f.Z}}))});k.displayName="VerificationInput",k.propTypes={value:h().string,length:h().number,validChars:h().string,placeholder:h().string,autoFocus:h().bool,passwordMode:h().bool,inputProps:h().object,containerProps:h().object,classNames:h().shape({container:h().string,character:h().string,characterInactive:h().string,characterSelected:h().string}),onChange:h().func,onFocus:h().func,onBlur:h().func,onComplete:h().func},k.defaultProps={length:6,validChars:"A-Za-z0-9",placeholder:"·",autoFocus:!1,inputProps:{},containerProps:{},classNames:{}};const L=k})();var o=n;for(var s in r)o[s]=r[s];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()})(LWe);const DWe=nl(LWe);function nVt(){pe(),w.useState(!1),pa();const n=Ig();return ci(),null}let W8;const iVt=new Uint8Array(16);function rVt(){if(!W8&&(W8=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!W8))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return W8(iVt)}const ad=[];for(let n=0;n<256;++n)ad.push((n+256).toString(16).slice(1));function oVt(n,e=0){return ad[n[e+0]]+ad[n[e+1]]+ad[n[e+2]]+ad[n[e+3]]+"-"+ad[n[e+4]]+ad[n[e+5]]+"-"+ad[n[e+6]]+ad[n[e+7]]+"-"+ad[n[e+8]]+ad[n[e+9]]+"-"+ad[n[e+10]]+ad[n[e+11]]+ad[n[e+12]]+ad[n[e+13]]+ad[n[e+14]]+ad[n[e+15]]}const sVt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),S2e={randomUUID:sVt};function Vq(n,e,t){if(S2e.randomUUID&&!e&&!n)return S2e.randomUUID();n=n||{};const i=n.random||(n.rng||rVt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let r=0;r<16;++r)e[t+r]=i[r];return e}return oVt(i)}var AWe={exports:{}},aVt=function(){var e=this,t=-1;return{next:function(){return t+=1,{value:e.items[t],done:t>=e.items.length}}}},lVt=function(){return this.items};function gse(n){"@babel/helpers - typeof";return gse=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gse(n)}var Vl={isArray:function(e){return Array.isArray(e)},isObject:function(e){return gse(e)==="object"&&Array.isArray(e)===!1&&e!==null},isFunction:function(e){return typeof e=="function"}},cVt=Vl,uVt=cVt.isFunction,NWe=function(e){return e===void 0?this.sum()/this.items.length:uVt(e)?new this.constructor(this.items).sum(e)/this.items.length:new this.constructor(this.items).pluck(e).sum()/this.items.length},dVt=NWe,hVt=dVt;function mse(n){"@babel/helpers - typeof";return mse=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mse(n)}var fVt=function(e){var t=this,i=[],r=0;if(Array.isArray(this.items))do{var o=this.items.slice(r,r+e),s=new this.constructor(o);i.push(s),r+=e}while(r<this.items.length);else if(mse(this.items)==="object"){var a=Object.keys(this.items),l=function(){var u=a.slice(r,r+e),d=new t.constructor({});u.forEach(function(h){return d.put(h,t.items[h])}),i.push(d),r+=e};do l();while(r<a.length)}else i.push(new this.constructor([this.items]));return new this.constructor(i)};function pVt(n){return vVt(n)||_Vt(n)||mVt(n)||gVt()}function gVt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mVt(n,e){if(n){if(typeof n=="string")return _se(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _se(n,e)}}function _Vt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function vVt(n){if(Array.isArray(n))return _se(n)}function _se(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var bVt=function(){var e;return new this.constructor((e=[]).concat.apply(e,pVt(this.items)))};function yVt(n,e){return EVt(n)||SVt(n,e)||wVt(n,e)||CVt()}function CVt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wVt(n,e){if(n){if(typeof n=="string")return E2e(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E2e(n,e)}}function E2e(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function SVt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function EVt(n){if(Array.isArray(n))return n}function ZH(n){"@babel/helpers - typeof";return ZH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ZH(n)}var xVt=function(e){var t=this,i=e;i instanceof this.constructor&&(i=e.all());var r={};if(Array.isArray(this.items)&&Array.isArray(i))this.items.forEach(function(a,l){r[a]=i[l]});else if(ZH(this.items)==="object"&&ZH(i)==="object")Object.keys(this.items).forEach(function(a,l){r[t.items[a]]=i[Object.keys(i)[l]]});else if(Array.isArray(this.items))r[this.items[0]]=i;else if(typeof this.items=="string"&&Array.isArray(i)){var o=i,s=yVt(o,1);r[this.items]=s[0]}else typeof this.items=="string"&&(r[this.items]=i);return new this.constructor(r)};function TVt(n){return DVt(n)||LVt(n)||IVt(n)||kVt()}function kVt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IVt(n,e){if(n){if(typeof n=="string")return vse(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return vse(n,e)}}function LVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function DVt(n){if(Array.isArray(n))return vse(n)}function vse(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var RWe=function(e){var t;if(Array.isArray(e)){var i;t=[],(i=t).push.apply(i,TVt(e))}else t={},Object.keys(e).forEach(function(r){t[r]=e[r]});return t};function JH(n){"@babel/helpers - typeof";return JH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JH(n)}var AVt=RWe,NVt=function(e){var t=e;e instanceof this.constructor?t=e.all():JH(e)==="object"&&(t=[],Object.keys(e).forEach(function(r){t.push(e[r])}));var i=AVt(this.items);return t.forEach(function(r){JH(r)==="object"?Object.keys(r).forEach(function(o){return i.push(r[o])}):i.push(r)}),new this.constructor(i)};function x2e(n){return MVt(n)||PVt(n)||OVt(n)||RVt()}function RVt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OVt(n,e){if(n){if(typeof n=="string")return bse(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bse(n,e)}}function PVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function MVt(n){if(Array.isArray(n))return bse(n)}function bse(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var T0=function(e){var t=[];return Array.isArray(e)?t.push.apply(t,x2e(e)):e.constructor.name==="Collection"?t.push.apply(t,x2e(e.all())):Object.keys(e).forEach(function(i){return t.push(e[i])}),t};function FVt(n){return HVt(n)||VVt(n)||$Vt(n)||BVt()}function BVt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Vt(n,e){if(n){if(typeof n=="string")return yse(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return yse(n,e)}}function VVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function HVt(n){if(Array.isArray(n))return yse(n)}function yse(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var WVt=T0,zVt=Vl,UVt=zVt.isFunction,OWe=function(e,t){if(t!==void 0)return Array.isArray(this.items)?this.items.filter(function(r){return r[e]!==void 0&&r[e]===t}).length>0:this.items[e]!==void 0&&this.items[e]===t;if(UVt(e))return this.items.filter(function(r,o){return e(r,o)}).length>0;if(Array.isArray(this.items))return this.items.indexOf(e)!==-1;var i=WVt(this.items);return i.push.apply(i,FVt(Object.keys(this.items))),i.indexOf(e)!==-1},jVt=function(){return this.count()===1},qVt=function(){var e=0;return Array.isArray(this.items)&&(e=this.items.length),Math.max(Object.keys(this.items).length,e)},KVt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(t){return t};return new this.constructor(this.items).groupBy(e).map(function(t){return t.count()})},GVt=function(){function e(o,s,a){var l=a[0];l instanceof s&&(l=l.all());for(var c=a.slice(1),u=!c.length,d=[],h=0;h<l.length;h+=1){var f=o.slice();f.push(l[h]),u?d.push(f):d=d.concat(e(f,s,c))}return d}for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return new this.constructor(e([],this.constructor,[].concat([this.items],i)))},YVt=function(){this.dump(),typeof process<"u"&&process.exit(1)},QVt=function(e){var t;e instanceof this.constructor?t=e.all():t=e;var i=this.items.filter(function(r){return t.indexOf(r)===-1});return new this.constructor(i)},XVt=function(e){var t=this,i=e;e instanceof this.constructor&&(i=e.all());var r={};return Object.keys(this.items).forEach(function(o){(i[o]===void 0||i[o]!==t.items[o])&&(r[o]=t.items[o])}),new this.constructor(r)},ZVt=function(e){var t;e instanceof this.constructor?t=e.all():t=e;var i=Object.keys(t),r=Object.keys(this.items).filter(function(o){return i.indexOf(o)===-1});return new this.constructor(this.items).only(r)},JVt=function(e,t){var i=this.items.filter(function(r){return!(e&&e.some(function(o){return t(r,o)===0}))});return new this.constructor(i)},eHt=function(e,t){return!this.contains(e,t)},tHt=function(){return console.log(this),this};function eW(n){"@babel/helpers - typeof";return eW=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eW(n)}var nHt=function(){var e=this,t=[],i={},r=function(s){return Array.isArray(s)||eW(s)==="object"?JSON.stringify(s):s};return Array.isArray(this.items)?this.items.forEach(function(o,s){var a=r(o);t.indexOf(a)===-1?t.push(a):i[s]=o}):eW(this.items)==="object"&&Object.keys(this.items).forEach(function(o){var s=r(e.items[o]);t.indexOf(s)===-1?t.push(s):i[o]=e.items[o]}),new this.constructor(i)},iHt=function(e){var t=!1;if(Array.isArray(this.items))for(var i=this.items.length,r=0;r<i&&!t;r+=1)t=e(this.items[r],r,this.items)===!1;else for(var o=Object.keys(this.items),s=o.length,a=0;a<s&&!t;a+=1){var l=o[a];t=e(this.items[l],l,this.items)===!1}return this};function rHt(n){return lHt(n)||aHt(n)||sHt(n)||oHt()}function oHt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sHt(n,e){if(n){if(typeof n=="string")return Cse(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cse(n,e)}}function aHt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function lHt(n){if(Array.isArray(n))return Cse(n)}function Cse(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var cHt=function(e){return this.each(function(t,i){e.apply(void 0,rHt(t).concat([i]))}),this},uHt=T0,dHt=function(e){var t=uHt(this.items);return t.every(e)},Hq=function(e){return Array.isArray(e[0])?e[0]:e},hHt=Hq,fHt=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=hHt(i);if(Array.isArray(this.items)){var s=this.items.filter(function(l){return o.indexOf(l)===-1});return new this.constructor(s)}var a={};return Object.keys(this.items).forEach(function(l){o.indexOf(l)===-1&&(a[l]=e.items[l])}),new this.constructor(a)};function wse(n){"@babel/helpers - typeof";return wse=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wse(n)}function PWe(n){if(Array.isArray(n)){if(n.length)return!1}else if(n!=null&&wse(n)==="object"){if(Object.keys(n).length)return!1}else if(n)return!1;return!0}function pHt(n,e){var t={};return Object.keys(e).forEach(function(i){n?n(e[i],i)&&(t[i]=e[i]):PWe(e[i])||(t[i]=e[i])}),t}function gHt(n,e){if(n)return e.filter(n);for(var t=[],i=0;i<e.length;i+=1){var r=e[i];PWe(r)||t.push(r)}return t}var mHt=function(e){var t=e||!1,i=null;return Array.isArray(this.items)?i=gHt(t,this.items):i=pHt(t,this.items),new this.constructor(i)},_Ht=Vl,SJ=_Ht.isFunction,vHt=function(e,t){if(SJ(e)){for(var i=Object.keys(this.items),r=0;r<i.length;r+=1){var o=i[r],s=this.items[o];if(e(s,o))return s}return SJ(t)?t():t}if(Array.isArray(this.items)&&this.items.length||Object.keys(this.items).length){if(Array.isArray(this.items))return this.items[0];var a=Object.keys(this.items)[0];return this.items[a]}return SJ(t)?t():t},bHt=Vl,yHt=bHt.isFunction,CHt=function(e,t,i){if(yHt(e))return this.first(e,function(){throw new Error("Item not found.")});var r=this.where(e,t,i);if(r.isEmpty())throw new Error("Item not found.");return r.first()},wHt=function(e,t,i){return this.where(e,t,i).first()||null},SHt=function(e){return this.map(e).collapse()},MWe=Vl,EJ=MWe.isArray,xJ=MWe.isObject,EHt=function(e){var t=e||1/0,i=!1,r=[],o=function(a){r=[],EJ(a)?a.forEach(function(l){EJ(l)?r=r.concat(l):xJ(l)?Object.keys(l).forEach(function(c){r=r.concat(l[c])}):r.push(l)}):Object.keys(a).forEach(function(l){EJ(a[l])?r=r.concat(a[l]):xJ(a[l])?Object.keys(a[l]).forEach(function(c){r=r.concat(a[l][c])}):r.push(a[l])}),i=r.filter(function(l){return xJ(l)}),i=i.length===0,t-=1};for(o(this.items);!i&&t>0;)o(r);return new this.constructor(r)},xHt=function(){var e=this,t={};return Array.isArray(this.items)?Object.keys(this.items).forEach(function(i){t[e.items[i]]=Number(i)}):Object.keys(this.items).forEach(function(i){t[e.items[i]]=i}),new this.constructor(t)},THt=function(e,t){var i=this,r={};return Array.isArray(this.items)?r=this.items.slice(e*t-t,e*t):Object.keys(this.items).slice(e*t-t,e*t).forEach(function(o){r[o]=i.items[o]}),new this.constructor(r)},kHt=function(e){return Array.isArray(this.items)?this.items.splice(e,1):delete this.items[e],this},IHt=Vl,LHt=IHt.isFunction,DHt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.items[e]!==void 0?this.items[e]:LHt(t)?t():t!==null?t:null},KS=function(e,t){try{return t.split(".").reduce(function(i,r){return i[r]},e)}catch{return e}},TJ=KS,AHt=Vl,NHt=AHt.isFunction,RHt=function(e){var t=this,i={};return this.items.forEach(function(r,o){var s;NHt(e)?s=e(r,o):TJ(r,e)||TJ(r,e)===0?s=TJ(r,e):s="",i[s]===void 0&&(i[s]=new t.constructor([])),i[s].push(r)}),new this.constructor(i)},OHt=Hq,PHt=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=OHt(i);return o.filter(function(s){return Object.hasOwnProperty.call(e.items,s)}).length===o.length},MHt=function(e,t){return t===void 0?this.items.join(e):new this.constructor(this.items).pluck(e).all().join(t)},FHt=function(e){var t=e;e instanceof this.constructor&&(t=e.all());var i=this.items.filter(function(r){return t.indexOf(r)!==-1});return new this.constructor(i)},BHt=function(e){var t=this,i=Object.keys(e);e instanceof this.constructor&&(i=Object.keys(e.all()));var r={};return Object.keys(this.items).forEach(function(o){i.indexOf(o)!==-1&&(r[o]=t.items[o])}),new this.constructor(r)},$Ht=function(){return Array.isArray(this.items)?!this.items.length:!Object.keys(this.items).length},VHt=function(){return!this.isEmpty()},HHt=function(e,t){var i=this.values();if(t===void 0)return i.implode(e);var r=i.count();if(r===0)return"";if(r===1)return i.last();var o=i.pop();return i.implode(e)+t+o},WHt=KS,zHt=Vl,UHt=zHt.isFunction,jHt=function(e){var t={};return UHt(e)?this.items.forEach(function(i){t[e(i)]=i}):this.items.forEach(function(i){var r=WHt(i,e);t[r||""]=i}),new this.constructor(t)},qHt=function(){var e=Object.keys(this.items);return Array.isArray(this.items)&&(e=e.map(Number)),new this.constructor(e)},KHt=Vl,T2e=KHt.isFunction,GHt=function(e,t){var i=this.items;if(T2e(e)&&(i=this.filter(e).all()),Array.isArray(i)&&!i.length||!Object.keys(i).length)return T2e(t)?t():t;if(Array.isArray(i))return i[i.length-1];var r=Object.keys(i);return i[r[r.length-1]]},YHt=function(e,t){this.constructor.prototype[e]=t},QHt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new this.constructor(e)},XHt=function(e){var t=this;if(Array.isArray(this.items))return new this.constructor(this.items.map(e));var i={};return Object.keys(this.items).forEach(function(r){i[r]=e(t.items[r],r)}),new this.constructor(i)};function ZHt(n){return nWt(n)||tWt(n)||eWt(n)||JHt()}function JHt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eWt(n,e){if(n){if(typeof n=="string")return Sse(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Sse(n,e)}}function tWt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function nWt(n){if(Array.isArray(n))return Sse(n)}function Sse(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var iWt=function(e){return this.map(function(t,i){return e.apply(void 0,ZHt(t).concat([i]))})};function rWt(n,e){return lWt(n)||aWt(n,e)||sWt(n,e)||oWt()}function oWt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sWt(n,e){if(n){if(typeof n=="string")return k2e(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return k2e(n,e)}}function k2e(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function aWt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function lWt(n){if(Array.isArray(n))return n}var cWt=function(e){var t={};return this.items.forEach(function(i,r){var o=e(i,r),s=rWt(o,2),a=s[0],l=s[1];t[a]===void 0?t[a]=[l]:t[a].push(l)}),new this.constructor(t)},uWt=function(e){return this.map(function(t,i){return new e(t,i)})};function dWt(n,e){return gWt(n)||pWt(n,e)||fWt(n,e)||hWt()}function hWt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fWt(n,e){if(n){if(typeof n=="string")return I2e(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return I2e(n,e)}}function I2e(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function pWt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function gWt(n){if(Array.isArray(n))return n}var mWt=function(e){var t={};return this.items.forEach(function(i,r){var o=e(i,r),s=dWt(o,2),a=s[0],l=s[1];t[a]===void 0?t[a]=[l]:t[a].push(l)}),new this.constructor(t)};function L2e(n,e){return yWt(n)||bWt(n,e)||vWt(n,e)||_Wt()}function _Wt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vWt(n,e){if(n){if(typeof n=="string")return D2e(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return D2e(n,e)}}function D2e(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function bWt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function yWt(n){if(Array.isArray(n))return n}var CWt=function(e){var t=this,i={};return Array.isArray(this.items)?this.items.forEach(function(r,o){var s=e(r,o),a=L2e(s,2),l=a[0],c=a[1];i[l]=c}):Object.keys(this.items).forEach(function(r){var o=e(t.items[r],r),s=L2e(o,2),a=s[0],l=s[1];i[a]=l}),new this.constructor(i)};function A2e(n){return xWt(n)||EWt(n)||SWt(n)||wWt()}function wWt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SWt(n,e){if(n){if(typeof n=="string")return Ese(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ese(n,e)}}function EWt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function xWt(n){if(Array.isArray(n))return Ese(n)}function Ese(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var TWt=function(e){if(typeof e=="string"){var t=this.items.filter(function(i){return i[e]!==void 0});return Math.max.apply(Math,A2e(t.map(function(i){return i[e]})))}return Math.max.apply(Math,A2e(this.items))},kWt=function(e){var t=this.items.length;return e===void 0?t%2===0?(this.items[t/2-1]+this.items[t/2])/2:this.items[Math.floor(t/2)]:t%2===0?(this.items[t/2-1][e]+this.items[t/2][e])/2:this.items[Math.floor(t/2)][e]},IWt=function(e){var t=e;if(typeof t=="string"&&(t=[t]),Array.isArray(this.items)&&Array.isArray(t))return new this.constructor(this.items.concat(t));var i=JSON.parse(JSON.stringify(this.items));return Object.keys(t).forEach(function(r){i[r]=t[r]}),new this.constructor(i)};function tW(n){"@babel/helpers - typeof";return tW=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tW(n)}function N2e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function R2e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?N2e(Object(t),!0).forEach(function(i){LWt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):N2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function LWt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var DWt=function(e){var t=function i(r,o){var s={},a=Object.keys(R2e(R2e({},r),o));return a.forEach(function(l){r[l]===void 0&&o[l]!==void 0?s[l]=o[l]:r[l]!==void 0&&o[l]===void 0?s[l]=r[l]:r[l]!==void 0&&o[l]!==void 0&&(r[l]===o[l]?s[l]=r[l]:!Array.isArray(r[l])&&tW(r[l])==="object"&&!Array.isArray(o[l])&&tW(o[l])==="object"?s[l]=i(r[l],o[l]):s[l]=[].concat(r[l],o[l]))}),s};return e?e.constructor.name==="Collection"?new this.constructor(t(this.items,e.all())):new this.constructor(t(this.items,e)):this};function O2e(n){return OWt(n)||RWt(n)||NWt(n)||AWt()}function AWt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NWt(n,e){if(n){if(typeof n=="string")return xse(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xse(n,e)}}function RWt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function OWt(n){if(Array.isArray(n))return xse(n)}function xse(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var PWt=function(e){if(e!==void 0){var t=this.items.filter(function(i){return i[e]!==void 0});return Math.min.apply(Math,O2e(t.map(function(i){return i[e]})))}return Math.min.apply(Math,O2e(this.items))},MWt=function(e){var t=[],i=1;return this.items.length?(this.items.forEach(function(r){var o=t.filter(function(a){return e!==void 0?a.key===r[e]:a.key===r});if(!o.length)e!==void 0?t.push({key:r[e],count:1}):t.push({key:r,count:1});else{o[0].count+=1;var s=o[0].count;s>i&&(i=s)}}),t.filter(function(r){return r.count===i}).map(function(r){return r.key})):null},FWt=T0,BWt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=FWt(this.items),r=i.slice(t).filter(function(o,s){return s%e===0});return new this.constructor(r)},$Wt=Hq,VWt=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=$Wt(i);if(Array.isArray(this.items)){var s=this.items.filter(function(l){return o.indexOf(l)!==-1});return new this.constructor(s)}var a={};return Object.keys(this.items).forEach(function(l){o.indexOf(l)!==-1&&(a[l]=e.items[l])}),new this.constructor(a)},HWt=RWe,WWt=function(e,t){var i=Math.abs(e),r=this.count();if(i<=r)return this;for(var o=i-r,s=HWt(this.items),a=Array.isArray(this.items),l=e<0,c=0;c<o;)a?l?s.unshift(t):s.push(t):s[c]!==void 0?o+=1:s[c]=t,c+=1;return new this.constructor(s)},zWt=function(e){var t=this,i;return Array.isArray(this.items)?(i=[new this.constructor([]),new this.constructor([])],this.items.forEach(function(r){e(r)===!0?i[0].push(r):i[1].push(r)})):(i=[new this.constructor({}),new this.constructor({})],Object.keys(this.items).forEach(function(r){var o=t.items[r];e(o)===!0?i[0].put(r,o):i[1].put(r,o)})),new this.constructor(i)},UWt=function(e){return e(this)},FWe=Vl,jWt=FWe.isArray,qWt=FWe.isObject,z8=KS,KWt=function(e){var t={};return e.forEach(function(i,r){function o(s,a){qWt(s)?Object.keys(s).forEach(function(l){o(s[l],"".concat(a,".").concat(l))}):jWt(s)&&s.forEach(function(l,c){o(l,"".concat(a,".").concat(c))}),t[a]=s}o(i,r)}),t},GWt=function(e,t){if(e.indexOf("*")!==-1){var i=KWt(this.items),r=[];if(t!==void 0){var o=new RegExp("0.".concat(t),"g"),s="0.".concat(t).split(".").length;Object.keys(i).forEach(function(h){var f=h.match(o);if(f){var g=f[0];g.split(".").length===s&&r.push(i[g])}})}var a=[],l=new RegExp("0.".concat(e),"g"),c="0.".concat(e).split(".").length;if(Object.keys(i).forEach(function(h){var f=h.match(l);if(f){var g=f[0];g.split(".").length===c&&a.push(i[g])}}),t!==void 0){var u={};return this.items.forEach(function(h,f){u[r[f]||""]=a}),new this.constructor(u)}return new this.constructor([a])}if(t!==void 0){var d={};return this.items.forEach(function(h){z8(h,e)!==void 0?d[h[t]||""]=z8(h,e):d[h[t]||""]=null}),new this.constructor(d)}return this.map(function(h){return z8(h,e)!==void 0?z8(h,e):null})},YWt=Hq,BWe=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];YWt(i).forEach(function(o){delete e[o]})},$We=Vl,QWt=$We.isArray,XWt=$We.isObject,P2e=BWe,ZWt=function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(QWt(this.items))return t===1?this.items.pop():new this.constructor(this.items.splice(-t));if(XWt(this.items)){var i=Object.keys(this.items);if(t===1){var r=i[i.length-1],o=this.items[r];return P2e(this.items,r),o}var s=i.slice(-t),a=s.reduce(function(l,c){return l[c]=e.items[c],l},{});return P2e(this.items,s),new this.constructor(a)}return null},JWt=function(e,t){return t!==void 0?this.put(t,e):(this.items.unshift(e),this)},ezt=Vl,tzt=ezt.isFunction,nzt=function(e,t){var i=this.items[e]||null;return!i&&t!==void 0&&(tzt(t)?i=t():i=t),delete this.items[e],i},izt=function(){var e;return(e=this.items).push.apply(e,arguments),this},rzt=function(e,t){return this.items[e]=t,this},ozt=T0,szt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=ozt(this.items),i=new this.constructor(t).shuffle();return e!==parseInt(e,10)?i.first():i.take(e)},azt=function(e,t){var i=this,r=null;return t!==void 0&&(r=t),Array.isArray(this.items)?this.items.forEach(function(o){r=e(r,o)}):Object.keys(this.items).forEach(function(o){r=e(r,i.items[o],o)}),r},lzt=function(e){return new this.constructor(this.items).filter(function(t){return!e(t)})};function M2e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function U8(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?M2e(Object(t),!0).forEach(function(i){czt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):M2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function czt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var uzt=function(e){if(!e)return this;if(Array.isArray(e)){var t=this.items.map(function(o,s){return e[s]||o});return new this.constructor(t)}if(e.constructor.name==="Collection"){var i=U8(U8({},this.items),e.all());return new this.constructor(i)}var r=U8(U8({},this.items),e);return new this.constructor(r)};function gx(n){"@babel/helpers - typeof";return gx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gx(n)}function F2e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function jI(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?F2e(Object(t),!0).forEach(function(i){dzt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):F2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function dzt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var hzt=function(e){var t=function i(r,o){var s=jI({},r),a=Object.keys(jI(jI({},r),o));return a.forEach(function(l){!Array.isArray(o[l])&&gx(o[l])==="object"?s[l]=i(r[l],o[l]):r[l]===void 0&&o[l]!==void 0?gx(r[l])==="object"?s[l]=jI({},o[l]):s[l]=o[l]:r[l]!==void 0&&o[l]===void 0?gx(r[l])==="object"?s[l]=jI({},r[l]):s[l]=r[l]:r[l]!==void 0&&o[l]!==void 0&&(gx(o[l])==="object"?s[l]=jI({},o[l]):s[l]=o[l])}),s};return e?!Array.isArray(e)&&gx(e)!=="object"?new this.constructor(t(this.items,[e])):e.constructor.name==="Collection"?new this.constructor(t(this.items,e.all())):new this.constructor(t(this.items,e)):this},fzt=function(){var e=[].concat(this.items).reverse();return new this.constructor(e)},I_e=Vl,pzt=I_e.isArray,gzt=I_e.isObject,mzt=I_e.isFunction,_zt=function(e,t){var i=this,r,o=function(a,l){return mzt(e)?e(i.items[l],l):t?i.items[l]===e:i.items[l]==e};return pzt(this.items)?r=this.items.findIndex(o):gzt(this.items)&&(r=Object.keys(this.items).find(function(s){return o(i.items[s],s)})),r===void 0||r<0?!1:r},VWe=Vl,vzt=VWe.isArray,bzt=VWe.isObject,yzt=BWe,Czt=function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(vzt(this.items))return t===1?this.items.shift():new this.constructor(this.items.splice(0,t));if(bzt(this.items)){if(t===1){var i=Object.keys(this.items)[0],r=this.items[i];return delete this.items[i],r}var o=Object.keys(this.items),s=o.slice(0,t),a=s.reduce(function(l,c){return l[c]=e.items[c],l},{});return yzt(this.items,s),new this.constructor(a)}return null},wzt=T0,Szt=function(){var e=wzt(this.items),t,i,r;for(r=e.length;r;r-=1)t=Math.floor(Math.random()*r),i=e[r-1],e[r-1]=e[t],e[t]=i;return this.items=e,this},Ezt=Vl,xzt=Ezt.isObject,Tzt=function(e){var t=this;return xzt(this.items)?new this.constructor(Object.keys(this.items).reduce(function(i,r,o){return o+1>e&&(i[r]=t.items[r]),i},{})):new this.constructor(this.items.slice(e))},L_e=Vl,kzt=L_e.isArray,Izt=L_e.isObject,Lzt=L_e.isFunction,Dzt=function(e){var t=this,i=null,r,o=function(a){return a===e};return Lzt(e)&&(o=e),kzt(this.items)&&(r=this.items.filter(function(s){return i!==!0&&(i=o(s)),i})),Izt(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!0&&(i=o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},D_e=Vl,Azt=D_e.isArray,Nzt=D_e.isObject,Rzt=D_e.isFunction,Ozt=function(e){var t=this,i=null,r,o=function(a){return a===e};return Rzt(e)&&(o=e),Azt(this.items)&&(r=this.items.filter(function(s){return i!==!0&&(i=!o(s)),i})),Nzt(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!0&&(i=!o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},Pzt=function(e,t){var i=this.items.slice(e);return t!==void 0&&(i=i.slice(0,t)),new this.constructor(i)},Mzt=Vl,Fzt=Mzt.isFunction,Bzt=function(e,t,i){var r;if(Fzt(e)?r=this.filter(e):r=this.where(e,t,i),r.isEmpty())throw new Error("Item not found.");if(r.count()>1)throw new Error("Multiple items found.");return r.first()},$zt=OWe,Vzt=$zt,Hzt=function(e){var t=[].concat(this.items);return e===void 0?this.every(function(i){return typeof i=="number"})?t.sort(function(i,r){return i-r}):t.sort():t.sort(e),new this.constructor(t)},Wzt=function(){return this.sort().reverse()},zzt=KS,Uzt=Vl,jzt=Uzt.isFunction,qzt=function(e){var t=[].concat(this.items),i=function(o){return jzt(e)?e(o):zzt(o,e)};return t.sort(function(r,o){var s=i(r),a=i(o);return s==null?1:a==null||s<a?-1:s>a?1:0}),new this.constructor(t)},Kzt=function(e){return this.sortBy(e).reverse()},Gzt=function(){var e=this,t={};return Object.keys(this.items).sort().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)},Yzt=function(){var e=this,t={};return Object.keys(this.items).sort().reverse().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)},Qzt=function(e,t,i){var r=this.slice(e,t);if(this.items=this.diff(r.all()).all(),Array.isArray(i))for(var o=0,s=i.length;o<s;o+=1)this.items.splice(e+o,0,i[o]);return r},Xzt=function(e){for(var t=Math.round(this.items.length/e),i=JSON.parse(JSON.stringify(this.items)),r=[],o=0;o<e;o+=1)r.push(new this.constructor(i.splice(0,t)));return new this.constructor(r)},Zzt=T0,Jzt=Vl,eUt=Jzt.isFunction,tUt=function(e){var t=Zzt(this.items),i=0;if(e===void 0)for(var r=0,o=t.length;r<o;r+=1)i+=parseFloat(t[r]);else if(eUt(e))for(var s=0,a=t.length;s<a;s+=1)i+=parseFloat(e(t[s]));else for(var l=0,c=t.length;l<c;l+=1)i+=parseFloat(t[l][e]);return parseFloat(i.toPrecision(12))};function Tse(n){"@babel/helpers - typeof";return Tse=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tse(n)}var nUt=function(e){var t=this;if(!Array.isArray(this.items)&&Tse(this.items)==="object"){var i=Object.keys(this.items),r;e<0?r=i.slice(e):r=i.slice(0,e);var o={};return i.forEach(function(s){r.indexOf(s)!==-1&&(o[s]=t.items[s])}),new this.constructor(o)}return e<0?new this.constructor(this.items.slice(e)):new this.constructor(this.items.slice(0,e))},A_e=Vl,iUt=A_e.isArray,rUt=A_e.isObject,oUt=A_e.isFunction,sUt=function(e){var t=this,i=null,r,o=function(a){return a===e};return oUt(e)&&(o=e),iUt(this.items)&&(r=this.items.filter(function(s){return i!==!1&&(i=!o(s)),i})),rUt(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!1&&(i=!o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},N_e=Vl,aUt=N_e.isArray,lUt=N_e.isObject,cUt=N_e.isFunction,uUt=function(e){var t=this,i=null,r,o=function(a){return a===e};return cUt(e)&&(o=e),aUt(this.items)&&(r=this.items.filter(function(s){return i!==!1&&(i=o(s)),i})),lUt(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!1&&(i=o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},dUt=function(e){return e(this),this},hUt=function(e,t){for(var i=1;i<=e;i+=1)this.items.push(t(i));return this},fUt=function(){var e=this.constructor;function t(r,o){var s=[];r instanceof e?(r.items.forEach(function(a){return t(a,s)}),o.push(s)):Array.isArray(r)?(r.forEach(function(a){return t(a,s)}),o.push(s)):o.push(r)}if(Array.isArray(this.items)){var i=[];return this.items.forEach(function(r){t(r,i)}),i}return this.values().all()};function kse(n){"@babel/helpers - typeof";return kse=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kse(n)}var pUt=function(){return kse(this.items)==="object"&&!Array.isArray(this.items)?JSON.stringify(this.all()):JSON.stringify(this.toArray())},gUt=function(e){var t=this;if(Array.isArray(this.items))this.items=this.items.map(e);else{var i={};Object.keys(this.items).forEach(function(r){i[r]=e(t.items[r],r)}),this.items=i}return this};function B2e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function $2e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B2e(Object(t),!0).forEach(function(i){mUt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):B2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function mUt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var _Ut=function(){var e=this;if(Array.isArray(this.items))return this;var t={};return Object.keys(this.items).forEach(function(i){if(i.indexOf(".")!==-1){var r=t;i.split(".").reduce(function(o,s,a,l){return o[s]||(o[s]={}),a===l.length-1&&(o[s]=e.items[i]),o[s]},r),t=$2e($2e({},t),r)}else t[i]=e.items[i]}),new this.constructor(t)},vUt=function(e,t,i){e?i(this):t(this)},V2e=function(e,t){if(Array.isArray(this.items)&&this.items.length)return e(this);if(Object.keys(this.items).length)return e(this);if(t!==void 0){if(Array.isArray(this.items)&&!this.items.length)return t(this);if(!Object.keys(this.items).length)return t(this)}return this},H2e=function(e,t){if(Array.isArray(this.items)&&!this.items.length)return e(this);if(!Object.keys(this.items).length)return e(this);if(t!==void 0){if(Array.isArray(this.items)&&this.items.length)return t(this);if(Object.keys(this.items).length)return t(this)}return this},bUt=function(e){var t=this,i=JSON.parse(JSON.stringify(this.items));return Object.keys(e).forEach(function(r){t.items[r]===void 0&&(i[r]=e[r])}),new this.constructor(i)},yUt=Vl,CUt=yUt.isFunction,wUt=function(e){var t;if(e===void 0)t=this.items.filter(function(a,l,c){return c.indexOf(a)===l});else{t=[];for(var i=[],r=0,o=this.items.length;r<o;r+=1){var s=void 0;CUt(e)?s=e(this.items[r]):s=this.items[r][e],i.indexOf(s)===-1&&(t.push(this.items[r]),i.push(s))}}return new this.constructor(t)},SUt=function(e){return e instanceof this.constructor?e.all():e},EUt=T0,xUt=function(){return new this.constructor(EUt(this.items))},TUt=function(e,t,i){return e?t(this,e):i?i(this,e):this},kUt=T0,Xg=KS,IUt=function(e,t,i){var r=t,o=i,s=kUt(this.items);if(t===void 0||t===!0)return new this.constructor(s.filter(function(l){return Xg(l,e)}));if(t===!1)return new this.constructor(s.filter(function(l){return!Xg(l,e)}));i===void 0&&(o=t,r="===");var a=s.filter(function(l){switch(r){case"==":return Xg(l,e)===Number(o)||Xg(l,e)===o.toString();default:case"===":return Xg(l,e)===o;case"!=":case"<>":return Xg(l,e)!==Number(o)&&Xg(l,e)!==o.toString();case"!==":return Xg(l,e)!==o;case"<":return Xg(l,e)<o;case"<=":return Xg(l,e)<=o;case">":return Xg(l,e)>o;case">=":return Xg(l,e)>=o}});return new this.constructor(a)},LUt=function(e,t){return this.where(e,">=",t[0]).where(e,"<=",t[t.length-1])},DUt=T0,AUt=KS,NUt=function(e,t){var i=DUt(t),r=this.items.filter(function(o){return i.indexOf(AUt(o,e))!==-1});return new this.constructor(r)},RUt=function(e){return this.filter(function(t){return t instanceof e})},W2e=KS,OUt=function(e,t){return this.filter(function(i){return W2e(i,e)<t[0]||W2e(i,e)>t[t.length-1]})},PUt=T0,MUt=KS,FUt=function(e,t){var i=PUt(t),r=this.items.filter(function(o){return i.indexOf(MUt(o,e))===-1});return new this.constructor(r)},BUt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"===",null)},$Ut=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"!==",null)};function Ise(n){"@babel/helpers - typeof";return Ise=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ise(n)}var VUt=function(e){return e instanceof this.constructor?e:Ise(e)==="object"?new this.constructor(e):new this.constructor([e])},HUt=function(e){var t=this,i=e;i instanceof this.constructor&&(i=i.all());var r=this.items.map(function(o,s){return new t.constructor([o,i[s]])});return new this.constructor(r)};(function(n){function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},e(o)}function t(o){o!==void 0&&!Array.isArray(o)&&e(o)!=="object"?this.items=[o]:o instanceof this.constructor?this.items=o.all():this.items=o||[]}var i=aVt;typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=i),t.prototype.toJSON=function(){return this.items},t.prototype.all=lVt,t.prototype.average=NWe,t.prototype.avg=hVt,t.prototype.chunk=fVt,t.prototype.collapse=bVt,t.prototype.combine=xVt,t.prototype.concat=NVt,t.prototype.contains=OWe,t.prototype.containsOneItem=jVt,t.prototype.count=qVt,t.prototype.countBy=KVt,t.prototype.crossJoin=GVt,t.prototype.dd=YVt,t.prototype.diff=QVt,t.prototype.diffAssoc=XVt,t.prototype.diffKeys=ZVt,t.prototype.diffUsing=JVt,t.prototype.doesntContain=eHt,t.prototype.dump=tHt,t.prototype.duplicates=nHt,t.prototype.each=iHt,t.prototype.eachSpread=cHt,t.prototype.every=dHt,t.prototype.except=fHt,t.prototype.filter=mHt,t.prototype.first=vHt,t.prototype.firstOrFail=CHt,t.prototype.firstWhere=wHt,t.prototype.flatMap=SHt,t.prototype.flatten=EHt,t.prototype.flip=xHt,t.prototype.forPage=THt,t.prototype.forget=kHt,t.prototype.get=DHt,t.prototype.groupBy=RHt,t.prototype.has=PHt,t.prototype.implode=MHt,t.prototype.intersect=FHt,t.prototype.intersectByKeys=BHt,t.prototype.isEmpty=$Ht,t.prototype.isNotEmpty=VHt,t.prototype.join=HHt,t.prototype.keyBy=jHt,t.prototype.keys=qHt,t.prototype.last=GHt,t.prototype.macro=YHt,t.prototype.make=QHt,t.prototype.map=XHt,t.prototype.mapSpread=iWt,t.prototype.mapToDictionary=cWt,t.prototype.mapInto=uWt,t.prototype.mapToGroups=mWt,t.prototype.mapWithKeys=CWt,t.prototype.max=TWt,t.prototype.median=kWt,t.prototype.merge=IWt,t.prototype.mergeRecursive=DWt,t.prototype.min=PWt,t.prototype.mode=MWt,t.prototype.nth=BWt,t.prototype.only=VWt,t.prototype.pad=WWt,t.prototype.partition=zWt,t.prototype.pipe=UWt,t.prototype.pluck=GWt,t.prototype.pop=ZWt,t.prototype.prepend=JWt,t.prototype.pull=nzt,t.prototype.push=izt,t.prototype.put=rzt,t.prototype.random=szt,t.prototype.reduce=azt,t.prototype.reject=lzt,t.prototype.replace=uzt,t.prototype.replaceRecursive=hzt,t.prototype.reverse=fzt,t.prototype.search=_zt,t.prototype.shift=Czt,t.prototype.shuffle=Szt,t.prototype.skip=Tzt,t.prototype.skipUntil=Dzt,t.prototype.skipWhile=Ozt,t.prototype.slice=Pzt,t.prototype.sole=Bzt,t.prototype.some=Vzt,t.prototype.sort=Hzt,t.prototype.sortDesc=Wzt,t.prototype.sortBy=qzt,t.prototype.sortByDesc=Kzt,t.prototype.sortKeys=Gzt,t.prototype.sortKeysDesc=Yzt,t.prototype.splice=Qzt,t.prototype.split=Xzt,t.prototype.sum=tUt,t.prototype.take=nUt,t.prototype.takeUntil=sUt,t.prototype.takeWhile=uUt,t.prototype.tap=dUt,t.prototype.times=hUt,t.prototype.toArray=fUt,t.prototype.toJson=pUt,t.prototype.transform=gUt,t.prototype.undot=_Ut,t.prototype.unless=vUt,t.prototype.unlessEmpty=V2e,t.prototype.unlessNotEmpty=H2e,t.prototype.union=bUt,t.prototype.unique=wUt,t.prototype.unwrap=SUt,t.prototype.values=xUt,t.prototype.when=TUt,t.prototype.whenEmpty=H2e,t.prototype.whenNotEmpty=V2e,t.prototype.where=IUt,t.prototype.whereBetween=LUt,t.prototype.whereIn=NUt,t.prototype.whereInstanceOf=RUt,t.prototype.whereNotBetween=OUt,t.prototype.whereNotIn=FUt,t.prototype.whereNull=BUt,t.prototype.whereNotNull=$Ut,t.prototype.wrap=VUt,t.prototype.zip=HUt;var r=function(s){return new t(s)};n.exports=r,n.exports.collect=r,n.exports.default=r,n.exports.Collection=t})(AWe);var WUt=AWe.exports;const el=nl(WUt);function zUt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21 16-4 4-4-4"}},{tag:"path",attr:{d:"M17 20V4"}},{tag:"path",attr:{d:"m3 8 4-4 4 4"}},{tag:"path",attr:{d:"M7 4v16"}}]})(n)}function UUt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 10 4 15 9 20"}},{tag:"path",attr:{d:"M20 4v7a4 4 0 0 1-4 4H4"}}]})(n)}const jUt=rl.div` color: ${n=>n.theme.color}; background-color: ${n=>n.theme.backgroundColor}; `;function qUt(){const[n]=pe(),e=wi(),t=Mk(),i=ni(),r=w.useRef(null),o=w.useRef(null),s=w.useRef(void 0),[a,l]=w.useState(""),[c,u]=w.useState(!1),[d,h]=w.useState(-1),[f,g]=w.useState(!1),m=Fi(tq),{data:v,refetch:_,isFetching:b}=Ti(["/api/v1/search"],()=>{const L=a.length===0?"/api/v1/search":`/api/v1/search?search=${a}`;return Ae("POST",Te(L)).then(D=>{const A=[];return Object.entries(D.data).forEach(([O,P])=>{P.forEach(F=>{A.push({id:Vq(),label:F.name,value:F.id,resource:F,searchable:`${n(O)}: ${F.name}`,eventType:"external"})})}),A})},{staleTime:1/0}),y=el(v).filter(L=>L.searchable.toLowerCase().includes(a.toLowerCase())||L.label.toLowerCase().includes(a.toLowerCase())||L.value.toString().toLowerCase().includes(a.toLowerCase())).take(100),C=y.count()===0?el(v):y,x=un.debounce(L=>l(L),500),E=L=>{var A,O,P;const D=(C==null?void 0:C.count())||0;switch(L.key){case"ArrowDown":L.preventDefault(),document.activeElement===r.current?(h(0),(A=r.current)==null||A.blur()):h(F=>F>=D-1?0:F+1);break;case"ArrowUp":L.preventDefault(),document.activeElement===r.current?(h(0),(O=r.current)==null||O.blur()):d===0?((P=r.current)==null||P.focus(),h(-1)):h(F=>F<=0?D-1:F-1);break;case"Enter":if(L.preventDefault(),d>=0&&C){const F=C.get(d);t({fn:()=>{F!=null&&F.resource&&(e(F.resource.path),u(!1))}})}break}},k=L=>{L.ctrlKey&&L.key==="k"&&(L.preventDefault(),u(D=>!D))};return w.useEffect(()=>(window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)),[]),w.useEffect(()=>{var D;const L=A=>{E(A)};if(c){if(window.addEventListener("keydown",L),d!==-1&&o.current){const O=o.current.children[d];O&&O.scrollIntoView({behavior:"smooth",block:"nearest"})}d!==-1&&((D=r.current)==null||D.blur())}return()=>window.removeEventListener("keydown",L)},[d,c]),w.useEffect(()=>{c||l("")},[c]),w.useEffect(()=>{a&&y.count()===0&&_(),h(-1)},[a]),N(dt,{children:[p(We,{className:"border-transparent focus:border-transparent focus:ring-0 border-0",onClick:()=>u(!0),placeholder:`${n("search_placeholder")}. (Ctrl+K)`,style:{backgroundColor:i.$1,color:i.$3,width:"21rem"}}),p(Ui,{visible:c,onClose:()=>u(!1),disableClosing:!0,enableCloseOnClickAway:!m,withoutPadding:!0,size:"regular",children:N("div",{className:"flex flex-col pt-3",style:{backgroundColor:i.$1},children:[N("div",{className:"flex flex-col space-y-5 px-3 pb-3",children:[N("div",{className:"flex items-center space-x-3",children:[p("div",{className:"flex-1",children:p(We,{className:"focus:ring-0",innerRef:r,value:a,onValueChange:L=>x(L),onClick:()=>h(-1),placeholder:`${n("search")}...`,changeOverride:!0,style:{backgroundColor:i.$1,color:i.$3}})}),b&&p(ns,{})]}),p("div",{ref:o,className:"overflow-y-auto h-96",onMouseLeave:()=>d!==-1&&h(-1),onScroll:()=>{g(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{g(!1)},50)},children:C==null?void 0:C.map((L,D)=>{var A;return p(jUt,{theme:{backgroundColor:D===d?i.$5:"transparent",color:i.$3},className:"cursor-pointer pl-2 py-2.5 active:font-semibold search-option",onClick:()=>{L.resource&&t({fn:()=>{L.resource&&(e(L.resource.path),u(!1))}})},onMouseMove:()=>{!f&&d!==D&&setTimeout(()=>h(D),20)},children:p("span",{children:N("div",{children:[p("p",{className:"text-xs font-semibold",children:(A=L.resource)==null?void 0:A.heading}),p("p",{children:L.label})]})})},L.id)})})]}),N("div",{className:"flex items-center py-2 space-x-4 px-3",style:{backgroundColor:i.$5},children:[N("div",{className:"flex items-center space-x-2 text-sm",children:[p("div",{children:p(vt,{element:zUt,color:i.$3})}),p("span",{className:"mb-0.5",style:{color:i.$3},children:n("navigate")})]}),N("div",{className:"flex items-center space-x-2 text-sm px-3",children:[p("div",{children:p(vt,{element:UUt,color:i.$3})}),p("span",{className:"mb-0.5",style:{color:i.$3},children:n("select")})]})]})]})})]})}const KUt=w.memo(qUt);function iA({children:n,className:e}){return p("div",{className:Nt("inline-flex items-center space-x-2",e),children:n})}function GUt(n){const e=ni();return p(Y_.Root,{show:n.visible,as:w.Fragment,children:p(aT,{as:"div",className:"relative z-10",onClose:n.onClose,children:p("div",{className:"pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16",children:p(Y_.Child,{as:w.Fragment,enter:"transform transition ease-in-out duration-300",enterFrom:"translate-x-full",enterTo:"translate-x-0",leave:"transform transition ease-in-out duration-200",leaveFrom:"translate-x-0",leaveTo:"translate-x-full",children:p(aT.Panel,{className:Nt("pointer-events-auto","w-screen",{"max-w-xl":n.size==="large","max-w-sm":n.size==="small","max-w-md":n.size==="regular","max-w-xs":n.size==="extraSmall","max-w-4xl":n.size==="extraLarge"}),children:N("form",{onSubmit:t=>t.preventDefault(),className:"border flex h-full flex-col divide-y divide-gray-200 shadow-xl",style:{backgroundColor:e.$1,borderColor:e.$4},children:[N("div",{className:"flex flex-col flex-1 h-0 overflow-y-auto",children:[p("div",{className:"py-6 px-4 sm:px-6 border-b",style:{borderColor:e.$4},children:N("div",{className:"flex items-center justify-between gap-3",children:[p("span",{className:"text-lg font-medium max-w-sm truncate",style:{color:e.$3},children:n.title}),N(iA,{children:[n.topRight,p(t0,{fontSize:20,className:"cursor-pointer",onClick:()=>n.onClose(),color:e.$3})]})]})}),p("div",{className:"flex flex-1 flex-col justify-between items-center",children:p("div",{className:Nt("flex flex-col flex-1 divide-y divide-gray-200 w-full",{"p-4":n.withContainer}),children:n.children})})]}),n.actionChildren&&p("div",{className:Nt("flex justify-center",{"p-4":!n.withoutActionContainer}),children:n.actionChildren})]})})})})})})}const YUt=rl.div` color: ${n=>n.theme.color}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Lse(n){const{padding:e="regular",className:t,style:i}=n,r=ni();return p(YUt,{style:{...i},theme:{hoverColor:r.$2,color:r.$3},className:Nt(`w-full text-left block hover:bg-gray-50 text-sm ${t}`,{"px-4 sm:px-6 py-4":e=="regular","px-4 py-2":e=="small"}),children:n.children})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function MN(){const n=ci();let e=12,t="hh:mm:ss A";return n&&n.settings.military_time&&(e=24,t="HH:mm:ss"),{timeFormatId:e,timeFormat:t}}const QUt=hF("notifications",[]);function XUt(){const{t:n}=pe(),{timeFormat:e}=MN(),[t,i]=w.useState(!1),[r,o]=Yo(QUt),s=xF();u8e({on:["App\\Events\\Invoice\\InvoiceWasPaid","App\\Events\\Invoice\\InvoiceWasViewed","App\\Events\\Credit\\CreditWasCreated","App\\Events\\Credit\\CreditWasUpdated","App\\Events\\Payment\\PaymentWasUpdated"],callback:({event:u,data:d})=>{var h;if(u==="App\\Events\\Invoice\\InvoiceWasPaid"){const f=d,g={label:`${f.number}: ${n("invoice_paid")}`,date:new Date().toString(),link:bt("/invoices/:id/edit",{id:f.id}),readAt:null};if(r.some(m=>m.label===g.label)||r.some(m=>m.link===g.link))return;o(m=>[...m,g])}if(u==="App\\Events\\Invoice\\InvoiceWasViewed"){if(!(s!=null&&s.notifications.email.includes("invoice_viewed"))||!(s!=null&&s.notifications.email.includes("invoice_viewed_user")))return;const f=d,g={label:Ms("notification_invoice_viewed_subject",{invoice:f.number,client:(h=f.client)==null?void 0:h.display_name}),date:new Date().toString(),link:bt("/invoices/:id/edit",{id:f.id}),readAt:null};if(r.some(m=>m.label===g.label)||r.some(m=>m.link===g.link))return;o(m=>[...m,g])}if(u==="App\\Events\\Credit\\CreditWasCreated"){const f=d,g={label:`${n("credit_created")}: ${f.number}`,date:new Date().toString(),link:bt("/credits/:id/edit",{id:f.id}),readAt:null};if(r.some(m=>m.label===g.label)||r.some(m=>m.link===g.link))return;o(m=>[...m,g])}if(u==="App\\Events\\Credit\\CreditWasUpdated"){const f=d,g={label:`${n("credit_updated")}: ${f.number}`,date:new Date().toString(),link:bt("/credits/:id/edit",{id:f.id}),readAt:null};if(r.some(m=>m.label===g.label)||r.some(m=>m.link===g.link))return;o(m=>[...m,g])}if(u==="App\\Events\\Payment\\PaymentWasUpdated"){const f=d,g={label:`${n("payment_updated")}: ${f.number}`,date:new Date().toString(),link:bt("/payments/:id/edit",{id:f.id}),readAt:null};if(r.some(m=>m.label===g.label)||r.some(m=>m.link===g.link))return;o(m=>[...m,g])}}});const a=Hpe(),l=lc(),c=Ha();return w.useEffect(()=>{if(c.preferences.enable_public_notifications&&a){const u="general_selfhosted";return a.subscribe(u).bind("App\\Events\\General\\GenericMessage",h=>{const f={label:h.message,date:new Date().toString(),link:h.link,readAt:null};o(g=>[...g,f])}),()=>{a.channel(u).unsubscribe()}}},[a,c.preferences.enable_public_notifications]),c.preferences.enable_public_notifications?N(dt,{children:[p("div",{className:"relative mt-2 mr-1",children:N("button",{onClick:()=>i(!t),className:Nt({"animate-jiggle":r.length>0}),children:[p(T1t,{size:20}),r.length>0?p("span",{className:"absolute top-0 right-0 h-2 w-2 rounded-full border-white border-2 bg-blue-500"}):null]})}),N(GUt,{visible:t,onClose:()=>i(!1),size:"regular",title:n("notifications"),topRight:p("button",{type:"button",onClick:()=>o([]),children:p(hwt,{size:18})}),children:[r.map((u,d)=>u.link?p(wl,{to:u.link,children:N("div",{children:[p("p",{children:u.label}),p("p",{className:"text-xs",children:go(u.date,`${l.dateFormat} ${e}`)})]})},d):N(Lse,{children:[p("p",{children:u.label}),p("p",{className:"text-xs",children:go(u.date,`${l.dateFormat} ${e}`)})]},d)),r.length===0?p(Lse,{children:n("no_unread_notifications")}):null]})]}):null}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ZUt(){const n=Ig();return new Date(n==null?void 0:n.plan_expires)>new Date&&(rc()||Vm()),Rk()}function JUt(){const n=Ig();return(n==null?void 0:n.plan_expires)!==""&&!Un(n.plan_expires).isBefore(Un())}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function GS(){const n=Qi();return async()=>Ae("POST",Te("/api/v1/refresh")).then(e=>{n(w0(e.data.data))})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function R_e(){const{data:n}=ed(),[e,t]=w.useState([]);return w.useEffect(()=>{n!=null&&n.countries&&t(n.countries)},[n]),e}const ejt=n=>ae.isValidElement(n)&&n.type==="option";function YS({children:n,value:e,errorMessage:t,disabled:i,onValueChange:r,label:o,dismissable:s,clearAfterSelection:a}){if(ae.Children.toArray(n).every(ejt)===!1)throw new Error("SearchableSelect must have only <option> elements as children.");const c=ae.Children.map(n,g=>w.isValidElement(g)&&{id:Vq(),label:Array.isArray(g.props.children)?g.props.children.join(""):g.props.children,value:g.props.value,resource:null,eventType:"external",searchable:`${g.props.children??""} ${g.props.value??""}`}),u=ae.Children.map(n,g=>w.isValidElement(g)&&{label:Array.isArray(g.props.children)?g.props.children.join(""):g.props.children,value:g.props.value}),d=a?"":c==null?void 0:c.find(g=>g.value===e),h=ni();return N("div",{className:"space-y-2",children:[o?p(pg,{children:o}):null,p(mv,{options:u,value:d,onChange:g=>r(g===null?"":g.value),isDisabled:i,isClearable:s,styles:{input:g=>({...g,color:h.$3}),singleValue:g=>({...g,color:h.$3}),menu:g=>({...g,width:"max-content",minWidth:"100%",backgroundColor:h.$4,borderColor:h.$4,zIndex:50}),control:(g,{isDisabled:m})=>({...g,borderRadius:"3px",backgroundColor:h.$1,color:h.$3,borderColor:h.$5,cursor:m?"not-allowed":"pointer",pointerEvents:m?"auto":"unset"}),option:(g,{isSelected:m,isFocused:v})=>({...g,color:h.$3,backgroundColor:m||v?h.$7:h.$1,":hover":{backgroundColor:h.$7}})}}),t&&p(Ls,{className:"mt-2",type:"danger",children:t})]})}function FN(n){const e=R_e();return p(YS,{onValueChange:n.onChange,value:n.value,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,disabled:n.disabled,children:e.map((t,i)=>N("option",{value:t.id,children:[t.name," (",t.iso_3166_3,")"]},i))})}const tjt={plan_check:"plan",token:"token",vat_check:"vat",buy_credits:"credits",form:"form",completed:"completed"},njt=["plan_check","token","vat_check","buy_credits","form","completed"];function ijt(){const n=vo(),{t:e}=pe(),[t,i]=w.useState(!1),[r,o]=w.useState("plan_check"),[s,a]=w.useState(njt),[l,c]=w.useState();w.useEffect(()=>{r==="completed"&&(i(!1),ce.success(e("peppol_successfully_configured")))},[r]),w.useEffect(()=>{},[s]);const u=()=>{const d=s[s.indexOf(r)+1];d&&o(d)};return w.useEffect(()=>{t||o("plan_check")},[t]),N(dt,{children:[p(K,{children:N("div",{className:"space-x-1",children:[p("span",{children:e("peppol_onboarding")}),p("button",{style:{color:n},type:"button",onClick:()=>{o("plan_check"),i(!0)},children:e("get_started")})]})}),p(Ui,{visible:t,onClose:()=>i(!1),title:e("configure_peppol"),size:"regular",children:p("div",{className:"",children:N("div",{className:"max-w-xl mx-auto space-y-10",children:[p("ol",{className:"lg:flex items-center w-full space-y-4 lg:space-x-8 lg:space-y-0",children:s.filter(d=>!["token","completed"].includes(d)).map((d,h)=>p("li",{className:"flex-1",children:N("a",{className:"border-l-2 flex flex-col border-t-0 pl-4 pt-0 border-solid font-medium lg:pt-4 lg:border-t-2 lg:border-l-0 lg:pl-0",style:{borderColor:r===d?n:""},children:[N("span",{className:"text-sm",style:{color:r===d?n:""},children:[e("step")," ",h+1]}),p("h4",{className:"text-base lg:text-lg text-gray-900",children:e(tjt[d])})]})},h))}),r==="plan_check"?p(rjt,{step:r,onContinue:u}):null,r==="token"?p(ojt,{step:r,onContinue:u}):null,r==="vat_check"?p(ljt,{businessType:l,setBusinessType:c,onContinue:u,step:r}):null,r==="buy_credits"?p(sjt,{step:r,onContinue:u}):null,r==="form"?p(ajt,{step:r,onContinue:u,businessType:l}):null]})})})]})}function rjt({onContinue:n}){const e=Ig(),t=JUt(),i=vo(),[r,o]=w.useState(!1),{t:s}=pe();w.useEffect(()=>{},[e==null?void 0:e.plan,t]);const a=td({initialValues:{},onSubmit(c,{setSubmitting:u}){Ae("POST",Te("/api/v1/check_license")).then(()=>{o(!0),n()}).catch(d=>{var h;if(((h=d.response)==null?void 0:h.status)===422){ce.error(d.response.data.message);return}console.error(d),ce.error(s("invalid_white_label_license"))}).finally(()=>u(!1))}}),l="https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase";return N("div",{className:"space-y-5",children:[p("p",{className:"text-lg",children:s("license")}),N("div",{children:[s("peppol_whitelabel_warning")," ",p("br",{})," ",p("br",{}),s("add_license_to_env")," ",p("a",{href:"https://invoiceninja.github.io/en/env-variables/",target:"_blank",rel:"noreferrer",style:{color:i},children:s("learn_more")}),p("form",{className:"mt-4",id:"checkLicenseForm",onSubmit:a.handleSubmit}),t?null:p("div",{className:"mt-2",children:p(Li,{to:l,external:!0,children:s("purchase_license")})})]}),null,p("div",{className:"flex justify-end",children:r?p(Gt,{behavior:"button",type:"primary",onClick:()=>n(),children:s("continue")}):p(Gt,{form:"checkLicenseForm",type:"primary",onClick:a.submitForm,disabled:a.isSubmitting,children:s("verify")})})]})}function ojt({onContinue:n}){const e=()=>{Ae("POST",Te("/api/v1/einvoice/token/update")).then(()=>{n()}).catch(()=>ce.error())};return w.useEffect(()=>{e()},[]),p(ns,{})}function sjt({onContinue:n}){const{t:e}=pe(),t=ni();return N("div",{children:[p("p",{className:"text-lg",children:e("credits")}),p("p",{children:e("peppol_credits_info")}),N("div",{className:"my-3 space-y-2",children:[N("a",{href:"https://invoiceninja.invoicing.co/client/subscriptions/WJxboqNegw/purchase",target:"_blank",rel:"noreferrer",className:"rounded w-full p-3 text-left border flex justify-between items-center hover:underline",style:{backgroundColor:t.$1},children:[e("buy")," (PEPPOL 500)"]}),N("a",{href:"https://invoiceninja.invoicing.co/client/subscriptions/k8mep0reMy/purchase",target:"_blank",rel:"noreferrer",className:"rounded w-full p-3 text-left border flex justify-between items-center hover:underline",style:{backgroundColor:t.$1},children:[e("buy")," (PEPPOL 1000)"]})]}),p("div",{className:"flex justify-end",children:p(Gt,{behavior:"button",type:"primary",onClick:()=>n(),children:e("continue")})})]})}function ajt({onContinue:n,businessType:e}){var c,u,d,h,f,g,m,v;const{t}=pe(),i=ci(),r=GS(),o=Ig(),[s,a]=w.useState(null),l=td({initialValues:{party_name:((c=i==null?void 0:i.settings)==null?void 0:c.name)||"",line1:((u=i==null?void 0:i.settings)==null?void 0:u.address1)||"",line2:((d=i==null?void 0:i.settings)==null?void 0:d.address2)||"",city:((h=i==null?void 0:i.settings)==null?void 0:h.city)||"",county:((f=i==null?void 0:i.settings)==null?void 0:f.state)||"",zip:((g=i==null?void 0:i.settings)==null?void 0:g.postal_code)||"",country:((m=i==null?void 0:i.settings)==null?void 0:m.country_id)||"",acts_as_sender:!0,acts_as_receiver:!0,vat_number:((v=i==null?void 0:i.settings)==null?void 0:v.vat_number)||"",id_number:(i==null?void 0:i.settings.id_number)||""},onSubmit:(_,{setSubmitting:b})=>{ce.processing(),a(null),Ae("POST",Te("/api/v1/einvoice/peppol/setup"),{..._,tenant_id:i==null?void 0:i.company_key,e_invoicing_token:o==null?void 0:o.e_invoicing_token,classification:e}).then(()=>{ce.success("peppol_successfully_configured"),n(),r()}).catch(y=>{var C;if(console.error(y),((C=y.response)==null?void 0:C.status)===422){a(y.response.data),ce.dismiss();return}ce.error()}).finally(()=>b(!1))}});return N("div",{children:[p("p",{className:"text-lg",children:t("details")}),p("p",{children:t("details_update_info")}),p("div",{className:"my-4",children:s?p(Ls,{type:"danger",children:s.message??un.get(s,"errors.0.details")}):null}),N("form",{onSubmit:l.handleSubmit,className:"space-y-5",children:[p(We,{label:t("company_name"),value:l.values.party_name,onChange:l.handleChange,id:"party_name",errorMessage:un.get(s,"errors.party_name")}),e==="business"?p(We,{value:l.values.vat_number,onChange:l.handleChange,label:t("vat_number"),id:"vat_number",errorMessage:un.get(s,"errors.vat_number")}):null,e==="individual"?p(We,{value:l.values.id_number,onChange:l.handleChange,label:t("id_number"),id:"id_number",errorMessage:un.get(s,"errors.id_number")}):null,p(FN,{value:l.values.country,label:t("country"),onChange:_=>l.setFieldValue("country",_),errorMessage:un.get(s,"errors.country")}),p(We,{value:l.values.line1,id:"line1",label:t("address1"),onChange:l.handleChange,errorMessage:un.get(s,"errors.line1")}),p(We,{value:l.values.line2,id:"line2",label:t("address2"),onChange:l.handleChange,errorMessage:un.get(s,"errors.line2")}),p(We,{value:l.values.city,id:"city",label:t("city"),onChange:l.handleChange,errorMessage:un.get(s,"errors.city")}),p(We,{value:l.values.county,id:"county",label:t("state"),onChange:l.handleChange,errorMessage:un.get(s,"errors.county")}),p(We,{value:l.values.zip,id:"zip",label:t("postal_code"),onChange:l.handleChange,errorMessage:un.get(s,"errors.zip")}),p(ft,{checked:l.values.acts_as_sender,label:t("acts_as_sender"),id:"acts_as_sender",onChange:_=>l.setFieldValue("acts_as_sender",_)}),p(ft,{checked:l.values.acts_as_receiver,label:t("acts_as_receiver"),id:"acts_as_receiver",onChange:_=>l.setFieldValue("acts_as_receiver",_)}),p("div",{className:"flex justify-end",children:p(Gt,{type:"primary",disabled:l.isSubmitting,children:t("continue")})})]})]})}function ljt({businessType:n,setBusinessType:e,onContinue:t}){const{t:i}=pe(),r=vo(),o=ni();return N("div",{children:[p("p",{className:"text-lg",children:"Are you registered for VAT?"}),N("div",{className:"my-5 space-y-2",children:[N("button",{className:"rounded w-full p-3 text-left border flex justify-between items-center",style:{backgroundColor:o.$1,borderColor:n==="business"?r:o.$5},onClick:()=>e("business"),children:[p("p",{children:"Yes, I have a VAT number"}),p(MD,{size:18,color:r,className:Nt({hidden:n!=="business"})})]}),N("button",{className:"rounded w-full p-3 text-left border flex justify-between items-center",style:{backgroundColor:o.$1,borderColor:n==="individual"?r:o.$5},onClick:()=>e("individual"),children:[p("p",{children:"No, I am an individual"}),p(MD,{size:18,color:r,className:Nt({hidden:n!=="individual"})})]})]}),p("div",{className:"flex justify-end",children:p(Gt,{behavior:"button",type:"primary",disabled:!n,disableWithoutIcon:!0,onClick:()=>t(),children:i("Continue")})})]})}function cjt(){const n=vo(),e=GS(),t=ci(),i=Ig(),{t:r}=pe(),[o,s]=w.useState(!1),a=()=>{ce.processing(),Ae("POST",Te("/api/v1/einvoice/peppol/disconnect"),{company_key:t.company_key,legal_entity_id:t.legal_entity_id,tax_data:t.tax_data,e_invoicing_token:i==null?void 0:i.e_invoicing_token}).then(()=>{ce.success("disconnected")}).catch(()=>{ce.error()}).finally(()=>{s(!1),e()})};return N(dt,{children:[p("button",{type:"button",style:{color:n},onClick:()=>s(!0),children:r("disconnect")}),N(Ui,{title:r("peppol_disconnect"),visible:o,onClose:()=>s(!1),children:[r("peppol_disconnect_long"),p("div",{className:"flex justify-end mt-5",children:p(Gt,{behavior:"button",type:"primary",onClick:a,children:r("continue")})})]})]})}function ujt(){var u,d,h,f,g,m;const{t:n}=pe(),e=ci(),t=GS(),i=Ig(),r=vo(),o=ed(),s=td({initialValues:{acts_as_sender:(u=e==null?void 0:e.tax_data)==null?void 0:u.acts_as_sender,acts_as_receiver:(d=e==null?void 0:e.tax_data)==null?void 0:d.acts_as_receiver,legal_entity_id:e.legal_entity_id,e_invoicing_token:i==null?void 0:i.e_invoicing_token},onSubmit:v=>{ce.processing(),Ae("PUT",Te("/api/v1/einvoice/peppol/update"),v).then(()=>{ce.success(n("updated_settings"))}).catch(_=>{var b;if(((b=_.response)==null?void 0:b.status)===422){un.get(_.response.data,"errors.acts_as_receiver.0")&&ce.error(un.get(_.response.data,"errors.acts_as_receiver.0"));return}ce.error()}).finally(()=>t())}}),[a,l]=w.useState(!1),[c]=w.useState(((h=o.data)==null?void 0:h.license_key)!==void 0&&((f=o.data)==null?void 0:f.license_key)!=="");return w.useEffect(()=>{!c&&a&&ce.error(n("white_label_license_not_present"))},[a]),N(dt,{children:[N(Ui,{title:n("buy_credits"),visible:a,onClose:()=>l(!1),children:[p("p",{children:n("peppol_credits_info")}),N("div",{className:"py-2 flex gap-2 flex-col",children:[null,c?N(Li,{to:`https://invoiceninja.invoicing.co/client/subscriptions/WJxboqNegw/purchase?license_key=${(g=o.data)==null?void 0:g.license_key}`,external:!0,children:[n("buy")," (PEPPOL 500)"]}):null,null,c?N(Li,{to:`https://invoiceninja.invoicing.co/client/subscriptions/k8mep0reMy/purchase?license_key=${(m=o.data)==null?void 0:m.license_key}`,external:!0,children:[n("buy")," (PEPPOL 1000)"]}):null]})]}),N(Qt,{title:`PEPPOL: ${n("preferences")}`,children:[p(K,{leftSide:n("status"),children:N("div",{className:"flex flex-col",children:[N("p",{children:[n("connected")," (",e.legal_entity_id,")"]}),p("div",{children:p(cjt,{})})]})}),p(K,{leftSide:n("act_as_sender"),children:p(ft,{checked:s.values.acts_as_sender,onValueChange:v=>{s.setFieldValue("acts_as_sender",v),s.submitForm()}})}),p(K,{leftSide:n("act_as_receiver"),children:p(ft,{checked:s.values.acts_as_receiver,onValueChange:v=>{s.setFieldValue("acts_as_receiver",v),s.submitForm()}})}),N(K,{leftSide:n("credits"),children:[N("div",{className:"flex items-center gap-1",children:[N("p",{children:[n("total_credits_amount"),":"]}),p(djt,{})]}),p("button",{type:"button",onClick:()=>l(!0),style:{color:r},children:n("buy_credits")})]})]})]})}function O_e(){Ig();const n=ci(),e=Ti({queryKey:["/api/v1/einvoice/quota"],queryFn:()=>Ae("GET",Te("/api/v1/einvoice/quota")).then(i=>i.data).catch(i=>{var r;((r=i.response)==null?void 0:r.status)===422&&ce.error(i.response.data.message)}),enabled:!!n&&(n==null?void 0:n.settings.enable_e_invoice)&&(n==null?void 0:n.settings.e_invoice_type)==="PEPPOL",retry:()=>!1,staleTime:1/0});return(()=>{var i;return e&&typeof((i=e.data)==null?void 0:i.quota)=="number"?parseInt(e.data.quota):null})()}function djt(){const n=O_e();return p("div",{children:p("p",{children:n})})}const hjt=15;function fjt(){const n=ci(),e=O_e(),[t,i]=w.useState(!1),{t:r}=pe();return!n.legal_entity_id||n.settings.e_invoice_type!=="PEPPOL"?null:e!==null&&e<=0?N(dt,{children:[p(z2e,{isVisible:t,setVisible:i,text:r("notification_no_credits")}),p(fse,{variant:"red",children:N("div",{className:"flex space-x-1",children:[p("span",{children:r("notification_no_credits")}),p("span",{className:pse,onClick:()=>i(!0),children:r("learn_more")})]})})]}):e!==null&&e<hjt?N(dt,{children:[p(z2e,{isVisible:t,setVisible:i,text:r("notification_credits_low")}),p(fse,{variant:"orange",children:N("div",{className:"flex space-x-1",children:[p("span",{children:r("notification_credits_low")}),p("span",{className:pse,onClick:()=>i(!0),children:r("learn_more")})]})})]}):null}function z2e({isVisible:n,setVisible:e,text:t}){const{t:i}=pe(),r=vo(),o=O_e(),s=Tl();return w.useEffect(()=>{e(!1)},[s.pathname]),N(Ui,{visible:n,onClose:()=>e(!1),title:i("credits"),children:[p("p",{children:i("peppol_credits_info")}),p("p",{children:t}),N("p",{className:"font-medium",children:[i("total_credits_amount"),": ",o]}),p(C0,{to:"/settings/e_invoice",style:{color:r},children:i("view_settings")})]})}function BN(n){var _;const[e]=pe(),t=Tl(),i=ni(),r=kWe(),o=ps(),s=Mk(),a=T1(),l=ci(),c=xF(),u=!!((_=a==null?void 0:a.company_user)!=null&&_.react_settings.show_mini_sidebar),d=!f1()&&(Y$t()||Q$t()),[h,f]=w.useState(!1),g=[{name:e("dashboard"),href:"/dashboard",icon:Y8e,current:t.pathname.startsWith("/dashboard"),visible:o("view_dashboard")},{name:e("clients"),href:"/clients",icon:vwt,current:t.pathname.startsWith("/clients"),visible:o("view_client")||o("create_client")||o("edit_client"),rightButton:{icon:Yd,to:"/clients/create",label:e("new_client"),visible:o("create_client")}},{name:e("products"),href:"/products",icon:N1t,current:t.pathname.startsWith("/products"),visible:o("view_product")||o("create_product")||o("edit_product"),rightButton:{icon:Yd,to:"/products/create",label:e("new_product"),visible:o("create_product")}},{name:e("invoices"),href:"/invoices",icon:oS,current:t.pathname.startsWith("/invoices"),visible:r(Ci.Invoices)&&(o("view_invoice")||o("create_invoice")||o("edit_invoice")),rightButton:{icon:Yd,to:"/invoices/create",label:e("new_invoice"),visible:o("create_invoice")}},{name:e("recurring_invoices"),href:"/recurring_invoices",icon:_H,current:t.pathname.startsWith("/recurring_invoices"),visible:r(Ci.RecurringInvoices)&&(o("view_recurring_invoice")||o("create_recurring_invoice")||o("edit_recurring_invoice")),rightButton:{icon:Yd,to:"/recurring_invoices/create",label:e("new_recurring_invoice"),visible:o("create_recurring_invoice")}},{name:e("payments"),href:"/payments",icon:aCt,current:t.pathname.startsWith("/payments"),visible:o("view_payment")||o("create_payment")||o("edit_payment"),rightButton:{icon:Yd,to:"/payments/create",label:e("new_payment"),visible:o("create_payment")}},{name:e("quotes"),href:"/quotes",icon:wge,current:t.pathname.startsWith("/quotes"),visible:r(Ci.Quotes)&&(o("view_quote")||o("create_quote")||o("edit_quote")),rightButton:{icon:Yd,to:"/quotes/create",label:e("new_quote"),visible:o("create_quote")}},{name:e("credits"),href:"/credits",icon:oS,current:t.pathname.startsWith("/credits"),visible:r(Ci.Credits)&&(o("view_credit")||o("create_credit")||o("edit_credit")),rightButton:{icon:Yd,to:"/credits/create",label:e("new_credit"),visible:o("create_credit")}},{name:e("projects"),href:"/projects",icon:P1t,current:t.pathname.startsWith("/projects"),visible:r(Ci.Projects)&&(o("view_project")||o("create_project")||o("edit_project")),rightButton:{icon:Yd,to:"/projects/create",label:e("new_project"),visible:o("create_project")}},{name:e("tasks"),href:"/tasks",icon:rCt,current:t.pathname.startsWith("/tasks"),visible:r(Ci.Tasks)&&(o("view_task")||o("edit_task")||o("create_task")),rightButton:{icon:Yd,to:"/tasks/create",label:e("new_task"),visible:o("create_task")}},{name:e("vendors"),href:"/vendors",icon:UAt,current:t.pathname.startsWith("/vendors"),visible:r(Ci.Vendors)&&(o("view_vendor")||o("create_vendor")||o("edit_vendor")),rightButton:{icon:Yd,to:"/vendors/create",label:e("new_vendor"),visible:o("create_vendor")}},{name:e("purchase_orders"),href:"/purchase_orders",icon:Fme,current:t.pathname.startsWith("/purchase_orders"),visible:r(Ci.PurchaseOrders)&&(o("view_purchase_order")||o("create_purchase_order")||o("edit_purchase_order")),rightButton:{icon:Yd,to:"/purchase_orders/create",label:e("new_purchase_order"),visible:o("create_purchase_order")}},{name:e("expenses"),href:"/expenses",icon:GAt,current:t.pathname.startsWith("/expenses"),visible:r(Ci.Expenses)&&(o("view_expense")||o("create_expense")||o("edit_expense")),rightButton:{icon:Yd,to:"/expenses/create",label:e("new_expense"),visible:o("create_expense")}},{name:e("recurring_expenses"),href:"/recurring_expenses",icon:_H,current:t.pathname.startsWith("/recurring_expenses"),visible:r(Ci.RecurringExpenses)&&(o("view_recurring_expense")||o("create_recurring_expense")||o("edit_recurring_expense")),rightButton:{icon:Yd,to:"/recurring_expenses/create",label:e("new_recurring_expense"),visible:o("create_recurring_expense")}},{name:e("reports"),href:"/reports",icon:jCt,current:t.pathname.startsWith("/reports"),visible:o("view_reports")},{name:e("transactions"),href:"/transactions",icon:n2t,current:t.pathname.startsWith("/transactions"),visible:r(Ci.Transactions)&&(o("view_bank_transaction")||o("create_bank_transaction")||o("edit_bank_transaction")),rightButton:{icon:Yd,to:"/transactions/create",label:e("new_transaction"),visible:o("create_bank_transaction")}},{name:e("settings"),href:c!=null&&c.is_admin||c!=null&&c.is_owner?"/settings/company_details":"/settings/user_details",icon:Bge,current:t.pathname.startsWith("/settings"),visible:!!l}],m=Fi(IWe),v=J$t();return u8e({on:["App\\Events\\Invoice\\InvoiceWasViewed"],callback:({data:b})=>{var y;!(c!=null&&c.notifications.email.includes("invoice_viewed"))||!(c!=null&&c.notifications.email.includes("invoice_viewed_user"))||p8e(N("div",{className:"flex flex-col gap-2",children:[N("span",{className:"flex items-center gap-1",children:[p(Q8e,{size:18}),N("span",{children:[Ms("notification_invoice_viewed_subject",{invoice:b.number,client:(y=b.client)==null?void 0:y.display_name}),"."]})]}),p("div",{className:"flex justify-center",children:p(Li,{to:`/invoices/${b.id}/edit`,children:e("view_invoice")})})]}),{duration:8e3,position:"top-center"})}}),N("div",{children:[p(tVt,{}),p(eVt,{}),p(nVt,{}),p(fjt,{}),p(v3t,{navigation:g,sidebarOpen:h,setSidebarOpen:f}),p(_3t,{navigation:g,docsLink:n.docsLink}),N("div",{className:`${u?"md:pl-16":"md:pl-64"} flex flex-col flex-1`,children:[N("div",{style:{backgroundColor:i.$1,borderColor:i.$4},className:"sticky top-0 z-10 flex-shrink-0 flex h-16 border-b shadow",children:[N("button",{type:"button",className:"px-4 border-r border-gray-200 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500 md:hidden",onClick:()=>f(!0),children:[p("span",{className:"sr-only",children:"Open sidebar"}),p($Ct,{className:"dark:text-gray-100"})]}),N("div",{className:"flex-1 px-4 xl:px-8 flex items-center","data-cy":"topNavbar",children:[N("div",{className:"flex flex-1 items-center space-x-4",children:[p("h2",{style:{color:i.$3},className:"text-sm md:text-lg whitespace-nowrap",children:n.title}),p(G$t,{}),p(KUt,{})]}),N("div",{className:"ml-4 flex items-center md:ml-6 space-x-2 lg:space-x-3",children:[p(XUt,{}),d&&p("button",{className:"hidden sm:inline-flex items-center justify-center py-2 px-4 rounded text-sm text-white bg-green-500 hover:bg-green-600",onClick:()=>s({url:"https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",externalLink:!0}),children:p("span",{children:e("white_label_button")})}),n.onCancelClick&&p(Gt,{onClick:n.onCancelClick,type:"secondary",children:e("cancel")}),(!!n.onSaveClick||m)&&N("div",{children:[!n.additionalSaveOptions&&p(Gt,{onClick:(m==null?void 0:m.onClick)||n.onSaveClick,disabled:(m==null?void 0:m.disableSaveButton)||n.disableSaveButton,disableWithoutIcon:!0,children:((m==null?void 0:m.label)||n.saveButtonLabel)??e("save")}),n.additionalSaveOptions&&N("div",{className:"flex",children:[p(Gt,{className:"rounded-br-none rounded-tr-none px-3",onClick:(m==null?void 0:m.onClick)||n.onSaveClick,disabled:(m==null?void 0:m.disableSaveButton)||n.disableSaveButton,disableWithoutIcon:!0,children:((m==null?void 0:m.label)||n.saveButtonLabel)??e("save")}),p($m,{className:"rounded-bl-none rounded-tl-none h-full px-1 border-gray-200 border-l-1 border-y-0 border-r-0",cardActions:!0,disabled:(m==null?void 0:m.disableSaveButton)||n.disableSaveButton,children:n.additionalSaveOptions.map((b,y)=>p(tn,{icon:b.icon,disabled:n.disableSaveButton,onClick:b.onClick,children:b.label},y))})]})]}),(v||n.navigationTopRight)&&p("div",{className:"flex space-x-3 items-center",children:(v==null?void 0:v.element)||n.navigationTopRight})]})]})]}),n.aboveMainContainer,N("main",{className:"flex-1",children:[(n.breadcrumbs||n.topRight||n.afterBreadcrumbs)&&n.breadcrumbs.length>0&&N("div",{className:"pt-4 px-4 md:px-8 md:pt-8 dark:text-gray-100 flex flex-col lg:flex-row lg:justify-between lg:items-center space-y-4 lg:space-y-0",children:[N("div",{className:"flex items-center",children:[n.breadcrumbs&&p(Mme,{pages:n.breadcrumbs}),n.afterBreadcrumbs]}),n.topRight&&p("div",{children:n.topRight})]}),p("div",{style:{color:i.$3,backgroundColor:i.$2},className:"p-4 md:py-8 xl:p-8 dark:text-gray-100",children:n.children})]})]})]})}function HWe({children:n,type:e="page"}){return p(w.Suspense,{fallback:e==="page"||e==="component"?p(BN,{breadcrumbs:[],children:p(ns,{})}):p(ns,{}),children:n})}function WWe(){const n=Qpe(),e=Oc(t=>t.user);return n?e.user.id?p(HWe,{children:p(Tg,{})}):p(l1t,{}):p(iS,{to:"/login"})}function pjt(){const[n]=pe(),[e,t]=w.useState(!0);return w.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),p(BN,{breadcrumbs:[],children:p("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?p(ns,{}):N(dt,{children:[p(j8e,{size:128}),N("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})})}function gjt(){const[n]=pe(),[e,t]=w.useState(!0);return w.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),p("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?p(ns,{}):N(dt,{children:[p(j8e,{size:128}),N("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})}function mjt(){const n=xF(),e=_o(),t=il(),i=pa(),r=k_e();return{companyUser:n,queryClient:e,params:t,user:i,settingsLevel:r.level}}function $n({guards:n,component:e,type:t="page"}){const[i,r]=w.useState("loading"),{companyUser:o,queryClient:s,params:a,user:l,settingsLevel:c}=mjt();return w.useEffect(()=>{const u=n.map(d=>d({companyUser:o,queryClient:s,params:a,user:l,settingsLevel:c}));Promise.all(u).then(d=>{d.includes(!1)?r("unauthorized"):r("authorized")}).catch(()=>r("loading"))}),i==="loading"?t==="page"?p(BN,{breadcrumbs:[],children:p(ns,{})}):p(ns,{}):i==="unauthorized"?t==="page"?p(pjt,{}):t==="subPage"?p(gjt,{}):null:p(HWe,{type:t,children:e})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Zt(n){const[e]=n.split("_");return({companyUser:t})=>{const i=(t==null?void 0:t.permissions)??"",r=!!(t!=null&&t.is_admin||t!=null&&t.is_owner||i.includes(n)||i.includes(`${e}_all`)&&n!=="view_reports"&&n!=="view_dashboard");return Promise.resolve(r)}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Di(...n){return async e=>new Promise(async t=>{for(const i of n)if(await i(e)===!0){t(!0);break}t(!1)})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ka(n,e="id"){return({params:t,user:i})=>{const r=t[e],o=bt(n,{id:r});return Ae("GET",Te(o)).then(s=>s.data.data.user_id===(i==null?void 0:i.id)||s.data.data.assigned_user_id===(i==null?void 0:i.id)?Promise.resolve(!0):Promise.resolve(!1)).catch(()=>Promise.resolve(!1))}}const _jt=w.lazy(()=>ne(()=>import("./Invoices-dd3143de.js"),["Invoices-dd3143de.js","Actions-d2496d38.js","invoice-status-756326ba.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","DataTableColumnsPicker-72027136.js","ImportButton-83a39628.js","useFooterColumns-00da9dca.js","useDownloadPdfs-4d13e7c1.js","payments-0a3eee62.js","atoms-f5ce5583.js","useSumTableColumn-8f701cc1.js","InvoiceSlider-1d96545b.js","PaymentStatus-030854d8.js","payment-status-51e1486d.js","EmailRecord-9930c242.js","DataTableFooterColumnsPicker-4117910d.js"])),vjt=w.lazy(()=>ne(()=>import("./Invoice-f2ede174.js"),["Invoice-f2ede174.js","Actions-d2496d38.js","invoice-status-756326ba.js","CommonActions-323e4db3.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","useInvoiceUtilities-400c192c.js","AddUninvoicedItemsButton-0680723b.js","PreviousNextNavigation-f6f14b66.js"])),bjt=w.lazy(()=>ne(()=>import("./Import-b6f8b549.js"),[])),yjt=w.lazy(()=>ne(()=>import("./Create-e3232def.js"),["Create-e3232def.js","blank-invitation-ca06b7b6.js","useInvoiceUtilities-400c192c.js","AddUninvoicedItemsButton-0680723b.js"])),Cjt=w.lazy(()=>ne(()=>import("./Edit-c808c791.js"),["Edit-c808c791.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","InvoiceFooter-022e1313.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","useTaskColumns-e922e1b4.js","useInvoiceUtilities-400c192c.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js"])),wjt=w.lazy(()=>ne(()=>import("./Pdf-da5ffd6b.js"),["Pdf-da5ffd6b.js","InvoiceViewer-8cc71da3.js"])),Sjt=w.lazy(()=>ne(()=>import("./Email-0869bf59.js"),["Email-0869bf59.js","Mailer-bea14c11.js","InvoiceViewer-8cc71da3.js"])),Ejt=w.lazy(()=>ne(()=>import("./EInvoice-6d31a24f.js"),["EInvoice-6d31a24f.js","invoice-status-756326ba.js"])),U2e=w.lazy(()=>ne(()=>import("./Documents-718110aa.js"),[])),j2e=w.lazy(()=>ne(()=>import("./Settings-244afc59.js"),["Settings-244afc59.js","ProjectSelector-720c414a.js","DesignSelector-08028961.js","designs-25baeda6.js"])),xjt=w.lazy(()=>ne(()=>import("./Activities-8fb04922.js"),["Activities-8fb04922.js","InvoiceSlider-1d96545b.js","Actions-d2496d38.js","invoice-status-756326ba.js","PaymentStatus-030854d8.js","payment-status-51e1486d.js","InvoiceStatus-e46861b3.js","EmailRecord-9930c242.js"])),Tjt=w.lazy(()=>ne(()=>import("./History-db7d7726.js"),[])),kjt=w.lazy(()=>ne(()=>import("./EmailHistory-36244bcc.js"),["EmailHistory-36244bcc.js","EmailRecord-9930c242.js"])),Ijt=w.lazy(()=>ne(()=>import("./CreatePage-eb4f4bdf.js"),["CreatePage-eb4f4bdf.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","InvoiceFooter-022e1313.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","useTaskColumns-e922e1b4.js","useInvoiceUtilities-400c192c.js"])),Ljt=N(_e,{path:"/invoices",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.Invoices),Di(Zt("view_invoice"),Zt("create_invoice"),Zt("edit_invoice"))],component:p(_jt,{})})}),p(_e,{path:"import",element:p($n,{guards:[xr(Ci.Invoices),Di(Zt("create_invoice"),Zt("edit_invoice"))],component:p(bjt,{})})}),N(_e,{path:"create",element:p($n,{guards:[xr(Ci.Invoices),Zt("create_invoice")],component:p(yjt,{})}),children:[p(_e,{path:"",element:p(Ijt,{})}),p(_e,{path:"documents",element:p(U2e,{})}),p(_e,{path:"settings",element:p(j2e,{})})]}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.Invoices),Di(Zt("view_invoice"),Zt("edit_invoice"),ka("/api/v1/invoices/:id"))],component:p(vjt,{})}),children:[p(_e,{path:"edit",element:p(Cjt,{})}),p(_e,{path:"e_invoice",element:p(Ejt,{})}),p(_e,{path:"documents",element:p(U2e,{})}),p(_e,{path:"settings",element:p(j2e,{})}),p(_e,{path:"activity",element:p(xjt,{})}),p(_e,{path:"history",element:p(Tjt,{})}),p(_e,{path:"email_history",element:p(kjt,{})})]}),p(_e,{path:":id/pdf",element:p($n,{guards:[xr(Ci.Invoices),Di(Zt("edit_invoice"),ka("/api/v1/invoices/:id"))],component:p(wjt,{})})}),p(_e,{path:":id/email",element:p($n,{guards:[xr(Ci.Invoices),Di(Zt("edit_invoice"),ka("/api/v1/invoices/:id"))],component:p(Sjt,{})})})]}),Djt=w.lazy(()=>ne(()=>import("./Clients-1ad1d57d.js"),["Clients-1ad1d57d.js","DataTableColumnsPicker-72027136.js","ImportButton-83a39628.js"])),Ajt=w.lazy(()=>ne(()=>import("./Import-fc761a8c.js"),[])),Njt=w.lazy(()=>ne(()=>import("./Create-08df65e8.js"),[])),Rjt=w.lazy(()=>ne(()=>import("./Edit-fc525cb5.js"),["Edit-fc525cb5.js","PreviousNextNavigation-f6f14b66.js"])),Ojt=w.lazy(()=>ne(()=>import("./Client-eb358318.js"),["Client-eb358318.js","InfoCard-3b3f3798.js","ConfirmActionModal-1bb60c06.js","EmailRecord-9930c242.js","PreviousNextNavigation-f6f14b66.js"])),Pjt=w.lazy(()=>ne(()=>import("./Quotes-4074ea88.js"),["Quotes-4074ea88.js","useFooterColumns-351ff362.js","useDownloadPdfs-4d13e7c1.js","useSumTableColumn-8f701cc1.js"])),Mjt=w.lazy(()=>ne(()=>import("./Payments-e82e0ac1.js"),["Payments-e82e0ac1.js","usePaymentColumns-8b0e3712.js","PaymentStatus-030854d8.js","payment-status-51e1486d.js","useActions-e3dd1ee9.js","payments-0a3eee62.js"])),Fjt=w.lazy(()=>ne(()=>import("./RecurringInvoices-277b8b62.js"),["RecurringInvoices-277b8b62.js","useFooterColumns-a34e3dd2.js","useSumTableColumn-8f701cc1.js"])),Bjt=w.lazy(()=>ne(()=>import("./Credits-cf203a37.js"),["Credits-cf203a37.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","useCustomBulkActions-ba75d32d.js","useDownloadPdfs-4d13e7c1.js","payments-0a3eee62.js","atoms-f5ce5583.js"])),$jt=w.lazy(()=>ne(()=>import("./Projects-8c55cee8.js"),["Projects-8c55cee8.js","hooks-344a2ac4.js","atoms-d3dbf501.js"])),Vjt=w.lazy(()=>ne(()=>import("./Tasks-c097e20c.js"),["Tasks-c097e20c.js","useShowEditOption-6f2fb612.js"])),Hjt=w.lazy(()=>ne(()=>import("./Expenses-ea60c77f.js"),[])),Wjt=w.lazy(()=>ne(()=>import("./RecurringExpenses-e0c255e0.js"),["RecurringExpenses-e0c255e0.js","hooks-2f667abc.js"])),zjt=w.lazy(()=>ne(()=>import("./Statement-d7435981.js"),[])),Ujt=w.lazy(()=>ne(()=>import("./Invoices-7cc26171.js"),["Invoices-7cc26171.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","Actions-d2496d38.js","useFooterColumns-00da9dca.js","useDownloadPdfs-4d13e7c1.js","payments-0a3eee62.js","atoms-f5ce5583.js","useSumTableColumn-8f701cc1.js"])),jjt=w.lazy(()=>ne(()=>import("./Activities-aacfcbdd.js"),[])),qjt=w.lazy(()=>ne(()=>import("./Documents-1e1db644.js"),["Documents-1e1db644.js","DataTableColumnsPicker-72027136.js"])),Kjt=N(_e,{path:"clients",children:[p(_e,{path:"",element:p($n,{guards:[Di(Zt("view_client"),Zt("create_client"),Zt("edit_client"))],component:p(Djt,{})})}),p(_e,{path:"import",element:p($n,{guards:[Di(Zt("create_client"),Zt("edit_client"))],component:p(Ajt,{})})}),p(_e,{path:"create",element:p($n,{guards:[Zt("create_client")],component:p(Njt,{})})}),p(_e,{path:":id/edit",element:p($n,{guards:[Di(Zt("edit_client"),ka("/api/v1/clients/:id"))],component:p(Rjt,{})})}),N(_e,{path:":id",element:p($n,{guards:[Di(Zt("view_client"),Zt("edit_client"),ka("/api/v1/clients/:id"))],component:p(Ojt,{})}),children:[p(_e,{path:"",element:p(Ujt,{})}),p(_e,{path:"quotes",element:p(Pjt,{})}),p(_e,{path:"payments",element:p(Mjt,{})}),p(_e,{path:"recurring_invoices",element:p(Fjt,{})}),p(_e,{path:"credits",element:p(Bjt,{})}),p(_e,{path:"projects",element:p($jt,{})}),p(_e,{path:"tasks",element:p(Vjt,{})}),p(_e,{path:"expenses",element:p(Hjt,{})}),p(_e,{path:"recurring_expenses",element:p(Wjt,{})}),p(_e,{path:"activities",element:p(jjt,{})}),p(_e,{path:"documents",element:p(qjt,{})})]}),p(_e,{path:":id/statement",element:p($n,{guards:[Di(Zt("edit_client"),ka("/api/v1/clients/:id"))],component:p(zjt,{})})})]});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Y2(){return({companyUser:n})=>Promise.resolve(!!(n!=null&&n.is_admin))}const kJ=w.lazy(()=>ne(()=>import("./Product-5323381a.js"),["Product-5323381a.js","PreviousNextNavigation-f6f14b66.js"])),Gjt=w.lazy(()=>ne(()=>import("./Import-42f058bd.js"),[])),Yjt=w.lazy(()=>ne(()=>import("./Products-3a902e2a.js"),["Products-3a902e2a.js","DataTableColumnsPicker-72027136.js","ImportButton-83a39628.js"])),Qjt=w.lazy(()=>ne(()=>import("./Create-6b5ebafe.js"),[])),Xjt=w.lazy(()=>ne(()=>import("./Edit-85eb6c46.js"),[])),Zjt=w.lazy(()=>ne(()=>import("./Show-2d32bcd7.js"),[])),Jjt=w.lazy(()=>ne(()=>import("./Documents-d77b7a9c.js"),[])),eqt=w.lazy(()=>ne(()=>import("./ProductFields-2b641af1.js"),[])),tqt=N(_e,{path:"products",children:[p(_e,{path:"",element:p($n,{guards:[Di(Zt("view_product"),Zt("create_product"),Zt("edit_product"))],component:p(Yjt,{})})}),p(_e,{path:"import",element:p($n,{guards:[Di(Zt("create_product"),Zt("edit_product"))],component:p(Gjt,{})})}),p(_e,{path:"create",element:p($n,{guards:[Zt("create_product")],component:p(Qjt,{})})}),N(_e,{path:":id",element:p($n,{guards:[Di(Zt("view_product"),Zt("edit_product"),ka("/api/v1/products/:id"))],component:p(kJ,{})}),children:[p(_e,{path:"",element:p(Zjt,{})}),p(_e,{path:"documents",element:p(Jjt,{})})]}),p(_e,{path:":id",element:p($n,{guards:[Y2()],component:p(kJ,{})}),children:p(_e,{path:"product_fields",element:p(eqt,{})})}),p(_e,{path:":id/edit",element:p($n,{guards:[Di(Zt("view_product"),Zt("edit_product"),ka("/api/v1/products/:id"))],component:p(kJ,{})}),children:p(_e,{path:"",element:p(Xjt,{})})})]}),nqt=w.lazy(()=>ne(()=>import("./Import-f1a56b21.js"),[])),iqt=w.lazy(()=>ne(()=>import("./RecurringInvoices-7712d74f.js"),["RecurringInvoices-7712d74f.js","ImportButton-83a39628.js","DataTableColumnsPicker-72027136.js","RecurringInvoiceSlider-b5daf183.js","useFooterColumns-a34e3dd2.js","useSumTableColumn-8f701cc1.js","DataTableFooterColumnsPicker-4117910d.js"])),rqt=w.lazy(()=>ne(()=>import("./RecurringInvoice-4b01323c.js"),["RecurringInvoice-4b01323c.js","ConfirmActionModal-1bb60c06.js","CommonActions-323e4db3.js","Actions-d2496d38.js","invoice-status-756326ba.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","PreviousNextNavigation-f6f14b66.js"])),oqt=w.lazy(()=>ne(()=>import("./Create-54e943a3.js"),["Create-54e943a3.js","blank-invitation-ca06b7b6.js","ConfirmActionModal-1bb60c06.js"])),sqt=w.lazy(()=>ne(()=>import("./CreatePage-862e8d5e.js"),["CreatePage-862e8d5e.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","InvoiceFooter-c912c27f.js","useTaskColumns-e922e1b4.js"])),q2e=w.lazy(()=>ne(()=>import("./Documents-88165733.js"),[])),K2e=w.lazy(()=>ne(()=>import("./Settings-8c4850eb.js"),["Settings-8c4850eb.js","ProjectSelector-720c414a.js","DesignSelector-08028961.js","designs-25baeda6.js"])),aqt=w.lazy(()=>ne(()=>import("./Activities-a44583fa.js"),["Activities-a44583fa.js","RecurringInvoiceSlider-b5daf183.js"])),lqt=w.lazy(()=>ne(()=>import("./History-1db2fa9c.js"),[])),cqt=w.lazy(()=>ne(()=>import("./Schedule-ac603981.js"),[])),uqt=w.lazy(()=>ne(()=>import("./Edit-03d4c231.js"),["Edit-03d4c231.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","InvoiceFooter-c912c27f.js","useTaskColumns-e922e1b4.js"])),dqt=w.lazy(()=>ne(()=>import("./Pdf-9c127fac.js"),["Pdf-9c127fac.js","InvoiceViewer-8cc71da3.js"])),hqt=N(_e,{path:"/recurring_invoices",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.RecurringInvoices),Di(Zt("view_recurring_invoice"),Zt("create_recurring_invoice"),Zt("edit_recurring_invoice"))],component:p(iqt,{})})}),N(_e,{path:"create",element:p($n,{guards:[xr(Ci.RecurringInvoices),Zt("create_recurring_invoice")],component:p(oqt,{})}),children:[p(_e,{path:"",element:p(sqt,{})}),p(_e,{path:"documents",element:p(q2e,{})}),p(_e,{path:"settings",element:p(K2e,{})})]}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.RecurringInvoices),Di(Zt("view_recurring_invoice"),Zt("edit_recurring_invoice"),ka("/api/v1/recurring_invoices/:id"))],component:p(rqt,{})}),children:[p(_e,{path:"edit",element:p(uqt,{})}),p(_e,{path:"documents",element:p(q2e,{})}),p(_e,{path:"settings",element:p(K2e,{})}),p(_e,{path:"activity",element:p(aqt,{})}),p(_e,{path:"history",element:p(lqt,{})}),p(_e,{path:"schedule",element:p(cqt,{})})]}),p(_e,{path:":id/pdf",element:p($n,{guards:[xr(Ci.RecurringInvoices),Di(Zt("edit_recurring_invoice"),ka("/api/v1/recurring_invoices/:id"))],component:p(dqt,{})})}),p(_e,{path:"import",element:p($n,{guards:[xr(Ci.Invoices),Di(Zt("create_recurring_invoice"),Zt("edit_recurring_invoice"))],component:p(nqt,{})})})]}),IJ=w.lazy(()=>ne(()=>import("./Payment-4e618096.js"),["Payment-4e618096.js","payments-0a3eee62.js","useActions-e3dd1ee9.js","PreviousNextNavigation-f6f14b66.js"])),fqt=w.lazy(()=>ne(()=>import("./Payments-8f5c713b.js"),["Payments-8f5c713b.js","usePaymentColumns-8b0e3712.js","PaymentStatus-030854d8.js","payment-status-51e1486d.js","DataTableColumnsPicker-72027136.js","useActions-e3dd1ee9.js","payments-0a3eee62.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","CreditStatus-ef9aafcc.js"])),pqt=w.lazy(()=>ne(()=>import("./Create-3fff1ec6.js"),["Create-3fff1ec6.js","payments-0a3eee62.js","usePaymentTypes-db32e981.js","atoms-f5ce5583.js"])),gqt=w.lazy(()=>ne(()=>import("./Edit-1f3e718d.js"),["Edit-1f3e718d.js","usePaymentTypes-db32e981.js","PaymentStatus-030854d8.js","payment-status-51e1486d.js","InfoCard-3b3f3798.js","ClientActionButtons-a4f20d96.js"])),mqt=w.lazy(()=>ne(()=>import("./Documents-32bf51f8.js"),["Documents-32bf51f8.js","payments-0a3eee62.js"])),_qt=w.lazy(()=>ne(()=>import("./PaymentFields-1be9535a.js"),[])),vqt=w.lazy(()=>ne(()=>import("./Apply-c242a0a6.js"),["Apply-c242a0a6.js","payments-0a3eee62.js"])),bqt=w.lazy(()=>ne(()=>import("./Refund-341d5450.js"),["Refund-341d5450.js","payments-0a3eee62.js"])),yqt=N(_e,{path:"/payments",children:[p(_e,{path:"",element:p($n,{guards:[Di(Zt("view_payment"),Zt("create_payment"),Zt("edit_payment"))],component:p(fqt,{})})}),p(_e,{path:"create",element:p($n,{guards:[Zt("create_payment")],component:p(pqt,{})})}),N(_e,{path:":id",element:p($n,{guards:[Di(Zt("edit_payment"),ka("/api/v1/payments/:id"))],component:p(IJ,{})}),children:[p(_e,{path:"apply",element:p(vqt,{})}),p(_e,{path:"refund",element:p(bqt,{})})]}),N(_e,{path:":id",element:p($n,{guards:[Di(Zt("view_payment"),Zt("edit_payment"),ka("/api/v1/payments/:id"))],component:p(IJ,{})}),children:[p(_e,{path:"edit",element:p(gqt,{})}),p(_e,{path:"documents",element:p(mqt,{})})]}),p(_e,{path:":id",element:p($n,{guards:[Y2()],component:p(IJ,{})}),children:p(_e,{path:"payment_fields",element:p(_qt,{})})})]});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function la(n){return({companyUser:e})=>new Promise(t=>t(!0))}function Cqt(){const n=wi();return w.useEffect(()=>{n("/settings/company_details")}),p(dt,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Pc(n){const e=ci(),t=ji(),i=Qi(),{isCompanySettingsActive:r}=ea();return w.useEffect(()=>{t&&(n==null?void 0:n.overwrite)===!1||r&&i(rS({object:"company",data:e}))},[e]),t}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Pi(n,e=!0){const[t]=pe();ci();const[i,r]=w.useState(e?t(n)||"":n),o=()=>{let s="";return s="Invoice Ninja",`${s}: ${i}`};return w.useEffect(()=>{document.title=o()},[i]),{documentTitle:i,setDocumentTitle:r}}function wqt(n){const[e]=pe(),{entity:t}=n||{};return(i,r)=>i==="id"&&t==="client"?N("div",{className:"inline-flex flex-col justify-center",children:[N("div",{className:"flex items-center space-x-2",children:[N("span",{children:[e("clients_limit"),"!"]}),N(Li,{className:"underline",to:"/settings/account_management",children:[e("unlock_unlimited_clients"),"!"]})]}),p("span",{children:r})]}):r}function Sqt(n){const{entity:e,withoutTopMessage:t,withoutListBullets:i}=n,r=wqt({entity:e});return N(Ls,{className:"mb-6",type:"danger",children:[!t&&p("p",{children:n.errors.message}),p("ul",{children:Object.keys(n.errors.errors).map((o,s)=>N("li",{children:[!i&&p(dt,{children:"– "}),r(o,n.errors.errors[o])]},s))})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function zWe(){const n=Qi();return()=>{n(Ype("company")),n(EF({status:{name:"",level:"company"}}))}}const G2e=rl(C0)` color: ${n=>n.theme.color}; background-color: ${n=>n.theme.backgroundColor}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function ir(n){const[e]=pe(),[t,i]=Yo($s),r=k_e(),o=zWe(),{isGroupSettingsActive:s,isClientSettingsActive:a}=ea(),l=Tl(),c=wi(),u=l.pathname.split("/")[2],{basic:d,advanced:h}=X$t();w.useEffect(()=>{i(void 0)},[u]);const f=ni();return p(BN,{onSaveClick:n.onSaveClick,onCancelClick:n.onCancelClick,title:n.title,docsLink:n.docsLink,navigationTopRight:n.navigationTopRight,disableSaveButton:n.disableSaveButton,breadcrumbs:[],aboveMainContainer:n.aboveMainContainer,children:N("div",{className:"grid grid-cols-12 lg:gap-10",children:[N("div",{className:"col-span-12 lg:col-span-3",children:[(s||a)&&N("div",{className:"flex items-center justify-between border py-3 rounded space-x-3 px-2",style:{backgroundColor:f.$1,borderColor:f.$5},children:[N("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[p("div",{children:p(vt,{element:s?p4t:P9e,size:20})}),N("span",{className:"text-sm truncate",children:[e(s?"group_settings":"client_settings"),": ",r.name]})]}),p("div",{className:"cursor-pointer",onClick:()=>{o(),s&&c("/settings/group_settings"),a&&c("/clients")},children:p(vt,{element:t0,size:20})})]}),p("a",{className:"flex items-center py-4 px-3 text-xs uppercase font-medium",children:p("span",{className:"truncate",children:e("basic_settings")})}),p(Cn,{className:"lg:hidden",value:l.pathname,onValueChange:g=>c(g),withBlank:!0,children:d.map(g=>g.enabled&&p("option",{value:g.href,children:g.name},g.name))}),p("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:d.map(g=>g.enabled&&p(G2e,{to:g.href,className:fZ("flex items-center px-3 py-2 text-sm font-medium rounded"),"aria-current":g.current?"page":void 0,theme:{backgroundColor:g.current?f.$5:"",color:g.current?f.$3:"",hoverColor:f.$5},children:p("span",{className:"truncate",children:g.name})},g.name))}),h.filter(g=>g.enabled).length>0&&N("div",{className:"flex items-center py-4 px-3 text-xs uppercase font-medium mt-8 truncate space-x-1",children:[p("span",{children:e("advanced_settings")}),p("sup",{children:e("pro")})]}),p(Cn,{className:"lg:hidden",value:l.pathname,onValueChange:g=>c(g),withBlank:!0,children:h.map(g=>g.enabled&&p("option",{value:g.href,children:g.name},g.name))}),p("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:h.map((g,m)=>N("div",{children:[g.enabled&&p(G2e,{to:g.href,className:fZ("flex items-center px-3 py-2 text-sm font-medium rounded"),"aria-current":g.current?"page":void 0,theme:{backgroundColor:g.current?f.$5:"",color:g.current?f.$3:"",hoverColor:f.$5},children:p("span",{className:"truncate",children:g.name})},g.name),g.children&&g.current&&p("div",{className:"bg-gray-100 space-y-4 py-3 rounded-b",children:g.children&&g.children.map((v,_)=>p(C0,{to:v.href,className:fZ(v.current?"text-gray-900 font-semibold":"","ml-4 px-3 text-sm block text-gray-700 hover:text-gray-900 transition duration-200 ease-in-out"),children:v.name},_))})]},m))})]}),N("div",{className:"col-span-12 lg:col-start-4 space-y-6 mt-5",children:[n.breadcrumbs&&p(Mme,{pages:n.breadcrumbs}),t&&p(Sqt,{errors:t}),n.children]})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Kk=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function lp(){const n=Qi(),{isCompanySettingsActive:e,isGroupSettingsActive:t,isClientSettingsActive:i}=ea(),r=Fi(Kk);return()=>{e&&n(Ype("company")),(t||i)&&r&&n(Go({object:"company",property:"settings",value:r.settings}))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Wq=Oo(!1);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const UWe={industry_id:"",size_id:"",lock_invoices:"",show_all_tasks_client_portal:"",portal_design_id:"",timezone_id:"",date_format_id:"",language_id:"",company_gateway_ids:"",currency_id:"",custom_value1:"",custom_value2:"",custom_value3:"",custom_value4:"",default_task_rate:0,payment_terms:"",custom_message_dashboard:"",custom_message_unpaid_invoice:"",custom_message_paid_invoice:"",custom_message_unapproved_quote:"",entity_send_time:0,quote_footer:"",counter_number_applied:"",quote_number_applied:"",invoice_number_pattern:"",invoice_number_counter:0,recurring_invoice_number_pattern:"",recurring_invoice_number_counter:0,quote_number_pattern:"",quote_number_counter:0,client_number_pattern:"",client_number_counter:0,credit_number_pattern:"",credit_number_counter:0,task_number_pattern:"",task_number_counter:0,expense_number_pattern:"",expense_number_counter:0,recurring_expense_number_pattern:"",recurring_expense_number_counter:0,recurring_quote_number_pattern:"",recurring_quote_number_counter:0,vendor_number_pattern:"",vendor_number_counter:0,ticket_number_pattern:"",ticket_number_counter:0,payment_number_pattern:"",payment_number_counter:0,project_number_pattern:"",project_number_counter:0,postmark_secret:"",mailgun_secret:"",mailgun_domain:"",mailgun_endpoint:"",purchase_order_number_pattern:"",purchase_order_number_counter:0,recurring_number_prefix:"",reset_counter_frequency_id:0,reset_counter_date:"",counter_padding:0,auto_bill:"",auto_bill_date:"",invoice_terms:"",quote_terms:"",invoice_taxes:0,invoice_design_id:"",quote_design_id:"",credit_design_id:"",purchase_order_design_id:"",purchase_order_footer:"",purchase_order_terms:"",purchase_order_public_notes:"",invoice_footer:"",credit_footer:"",credit_terms:"",invoice_labels:"",tax_name1:"",tax_rate1:0,tax_name2:"",tax_rate2:0,tax_name3:"",tax_rate3:0,payment_type_id:"",valid_until:"",email_sending_method:"",gmail_sending_user_id:"",reply_to_email:"",reply_to_name:"",bcc_email:"",email_style:"",email_style_custom:"",email_subject_invoice:"",email_subject_quote:"",email_subject_credit:"",email_subject_payment:"",email_subject_payment_partial:"",email_subject_statement:"",email_subject_purchase_order:"",email_template_purchase_order:"",email_template_invoice:"",email_template_credit:"",email_template_quote:"",email_template_payment:"",email_template_payment_partial:"",email_template_statement:"",email_subject_reminder1:"",email_subject_reminder2:"",email_subject_reminder3:"",email_subject_reminder_endless:"",email_template_reminder1:"",email_template_reminder2:"",email_template_reminder3:"",email_template_reminder_endless:"",email_signature:"",email_subject_custom1:"",email_subject_custom2:"",email_subject_custom3:"",email_template_custom1:"",email_template_custom2:"",email_template_custom3:"",num_days_reminder1:0,num_days_reminder2:0,num_days_reminder3:0,schedule_reminder1:"",schedule_reminder2:"",schedule_reminder3:"",reminder_send_time:0,late_fee_amount1:0,late_fee_amount2:0,late_fee_amount3:0,late_fee_percent1:0,late_fee_percent2:0,late_fee_percent3:0,endless_reminder_frequency_id:"",late_fee_endless_amount:0,late_fee_endless_percent:0,name:"",company_logo:"",website:"",address1:"",address2:"",city:"",state:"",postal_code:"",phone:"",email:"",country_id:"",vat_number:"",id_number:"",page_size:"",page_layout:"",font_size:0,primary_font:"",secondary_font:"",primary_color:"",secondary_color:"",page_numbering_alignment:"",portal_custom_head:"",portal_custom_css:"",portal_custom_footer:"",portal_custom_js:"",client_portal_terms:"",client_portal_privacy_policy:"",client_portal_under_payment_minimum:0,use_credits_payment:"",email_from_name:"",first_month_of_year:"",qr_iban:"",besr_id:"",company_logo_size:"",client_initiated_payments_minimum:0,e_invoice_type:"",default_expense_payment_type_id:"",classification:"",e_quote_type:"",brevo_secret:""};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function jWe(n){const{id:e}=il(),t=_o(),i=Qi(),r=ji(),o=Fi(Kk),s=Fi(tu),{isGroupSettingsActive:a}=ea(),{groupSettings:l,setErrors:c,setIsFormBusy:u,isFormBusy:d}=n,h=()=>{const f=un.cloneDeep(r==null?void 0:r.settings);return f&&((!f.email_template_custom1||!f.email_subject_custom1)&&(delete f.email_template_custom1,delete f.email_subject_custom1),(!f.email_template_custom2||!f.email_subject_custom2)&&(delete f.email_template_custom2,delete f.email_subject_custom2),(!f.email_template_custom3||!f.email_subject_custom3)&&(delete f.email_template_custom3,delete f.email_subject_custom3),Object.entries(f).forEach(([g,m])=>{m===null&&(f[g]=UWe[g])})),{...o,settings:f}};return()=>{d||(ce.processing(),c==null||c(void 0),u==null||u(!0),Ae("PUT",Te("/api/v1/group_settings/:id",{id:e||(o==null?void 0:o.id)}),l||h()).then(f=>{ce.success("updated_group"),En(["group_settings"]),a&&(i(Go({object:"company",property:"settings",value:f.data.data.settings})),i(EF({status:{name:f.data.data.name,level:"group"}}))),s&&t.invalidateQueries([s])}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(ce.dismiss(),c==null||c(f.response.data))}).finally(()=>u==null?void 0:u(!1)))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Eqt(){const n=Qi(),e=ji(),t=Fi(Kk),i=Ar($s),r=()=>{const o=un.cloneDeep(e==null?void 0:e.settings);return o&&((!o.email_template_custom1||!o.email_subject_custom1)&&(delete o.email_template_custom1,delete o.email_subject_custom1),(!o.email_template_custom2||!o.email_subject_custom2)&&(delete o.email_template_custom2,delete o.email_subject_custom2),(!o.email_template_custom3||!o.email_subject_custom3)&&(delete o.email_template_custom3,delete o.email_subject_custom3),delete o.e_invoice,Object.entries(o).forEach(([s,a])=>{a===null&&(o[s]=UWe[s])})),{...t,settings:o,e_invoice:(e==null?void 0:e.e_invoice)||{}}};return()=>{ce.processing(),i(void 0),Ae("PUT",Te("/api/v1/clients/:id",{id:t==null?void 0:t.id}),r()).then(o=>{ce.success("updated_settings"),En(["clients"]),n(Go({object:"company",property:"settings",value:o.data.data.settings})),n(EF({status:{name:o.data.data.display_name,level:"client"}}))}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(ce.dismiss(),i(o.response.data))})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Tu(){const n=Qi(),e=Pc(),t=jWe({}),i=Eqt(),{isGroupSettingsActive:r,isCompanySettingsActive:o,isClientSettingsActive:s}=ea(),[,a]=Yo($s),[l,c]=Yo(Wq),u=Jgt();return async d=>{if(!u()&&o)return;if(r)return t();if(s)return i();const h=typeof d=="boolean"&&d;return!h&&ce.processing(),a(void 0),Ae("PUT",Te("/api/v1/companies/:id",{id:e==null?void 0:e.id}),e).then(f=>{n(US({object:"company",data:f.data.data})),!h&&ce.dismiss(),l&&(En(["statics"]),c(!1)),!h&&ce.success("updated_settings")}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(a(f.response.data),ce.dismiss())})}}function QS(n){var f;const e=wi(),{visible:t=!0,withoutDefaultTabSpace:i,tabBarClassName:r}=n,o=il(),s=Tl(),a=ni(),l=vo(),[c]=dF(),u=w.useRef(null),d=g=>{var m;return s.pathname===g.href||((m=g.matcher)==null?void 0:m.some(v=>v(o)===bt(s.pathname,o)))},h=g=>{const m=g.currentTarget,v=u.current,_=v.scrollWidth/6,b=m.getBoundingClientRect().width/2;v.scrollTo({left:m.offsetLeft-_-b})};return w.useEffect(()=>{if(n.tabs.length&&!n.disableBackupNavigation){const g=n.tabs.some(({href:m})=>m===s.pathname);if(c.get("redirect")==="false")return;g||e(n.tabs[0].href)}},[]),t?N("div",{className:n.className,"data-cy":"tabs",children:[N("div",{className:"flex flex-col space-y-5 sm:hidden",children:[p("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),p("select",{id:"tabs",name:"tabs",className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",defaultValue:(f=n.tabs.find(g=>g))==null?void 0:f.name,onChange:g=>e(g.currentTarget.value),children:n.tabs.map(g=>{var m;return(typeof g.enabled>"u"||g.enabled)&&p("option",{value:g.href,children:((m=g.formatName)==null?void 0:m.call(g))||g.name},g.name)})}),n.rightSide]}),p("div",{className:"hidden sm:block",children:N("div",{className:"flex justify-between border-b",style:{borderColor:a.$5},children:[p("nav",{ref:u,className:Nt("-mb-px flex relative scroll-smooth overflow-x-auto",{"space-x-8":!i},r),"aria-label":"Tabs",children:n.tabs.map(g=>{var m;return(typeof g.enabled>"u"||g.enabled)&&p(C0,{to:g.href,onClick:v=>h(v),style:{borderColor:d(g)?l:"transparent",color:d(g)?l:a.$3},className:"whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm","aria-current":d(g)?"page":void 0,children:((m=g.formatName)==null?void 0:m.call(g))||g.name},g.name)})}),n.rightSide]})})]}):p(dt,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function qWe(n){return Ti(["/api/v1/documents",n],()=>Ae("GET",Te("/api/v1/documents?per_page=:perPage&page=:currentPage&company_documents=:companyDocuments",{perPage:n.perPage,currentPage:n.currentPage,companyDocuments:n.companyDocuments??"false"})),{staleTime:1/0})}const KWe=()=>(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/documents/bulk?per_page=100"),{action:e,ids:n}).then(()=>ce.success("exported_data"))},GWe=()=>async(n,e)=>(ce.processing(),Ae("PUT",Te("/api/v1/documents/:id",{id:n}),{is_public:e}).then(()=>ce.success("success")));function P_e(n){const[e]=pe(),{numberOfDocuments:t}=n;return N("div",{className:"flex space-x-1",children:[p("span",{children:e("documents")}),!!t&&N("span",{className:"font-bold",children:["(",t,")"]})]})}function xqt(){const{t:n}=pe(),{data:e}=qWe({companyDocuments:"true"}),{isGroupSettingsActive:t,isClientSettingsActive:i}=ea();let r=[{name:n("details"),href:"/settings/company_details"},{name:n("address"),href:"/settings/company_details/address"},{name:n("logo"),href:"/settings/company_details/logo"},{name:n("defaults"),href:"/settings/company_details/defaults"},{name:n("documents"),href:"/settings/company_details/documents",formatName:()=>{var o;return p(P_e,{numberOfDocuments:(o=e==null?void 0:e.data)==null?void 0:o.meta.pagination.total})}},{name:n("custom_fields"),href:"/settings/company_details/custom_fields"}];return(t||i)&&(r=r.filter(o=>o.name!==n("custom_fields")&&o.name!==n("documents"))),r}function Tqt(){const[n]=pe();Pi("company_details");const e=[{name:n("settings"),href:"/settings"},{name:n("company_details"),href:"/settings/company_details"}],t=Tu(),i=lp(),r=xqt();return Pc(),N(ir,{onSaveClick:t,onCancelClick:i,title:n("company_details"),breadcrumbs:e,docsLink:"en/basic-settings/#company_details",children:[p(QS,{tabs:r,className:"mt-6"}),p("div",{className:"my-4",children:p(Tg,{})})]})}function $N(){return($N=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}).apply(this,arguments)}function zq(n,e){if(n==null)return{};var t,i,r={},o=Object.keys(n);for(i=0;i<o.length;i++)e.indexOf(t=o[i])>=0||(r[t]=n[t]);return r}function j4(n){var e=w.useRef(n),t=w.useRef(function(i){e.current&&e.current(i)});return e.current=n,t.current}var q4=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n<e?e:n},rM=function(n){return"touches"in n},Dse=function(n){return n&&n.ownerDocument.defaultView||self},Y2e=function(n,e,t){var i=n.getBoundingClientRect(),r=rM(e)?function(o,s){for(var a=0;a<o.length;a++)if(o[a].identifier===s)return o[a];return o[0]}(e.touches,t):e;return{left:q4((r.pageX-(i.left+Dse(n).pageXOffset))/i.width),top:q4((r.pageY-(i.top+Dse(n).pageYOffset))/i.height)}},Q2e=function(n){!rM(n)&&n.preventDefault()},YWe=ae.memo(function(n){var e=n.onMove,t=n.onKey,i=zq(n,["onMove","onKey"]),r=w.useRef(null),o=j4(e),s=j4(t),a=w.useRef(null),l=w.useRef(!1),c=w.useMemo(function(){var f=function(v){Q2e(v),(rM(v)?v.touches.length>0:v.buttons>0)&&r.current?o(Y2e(r.current,v,a.current)):m(!1)},g=function(){return m(!1)};function m(v){var _=l.current,b=Dse(r.current),y=v?b.addEventListener:b.removeEventListener;y(_?"touchmove":"mousemove",f),y(_?"touchend":"mouseup",g)}return[function(v){var _=v.nativeEvent,b=r.current;if(b&&(Q2e(_),!function(C,x){return x&&!rM(C)}(_,l.current)&&b)){if(rM(_)){l.current=!0;var y=_.changedTouches||[];y.length&&(a.current=y[0].identifier)}b.focus(),o(Y2e(b,_,a.current)),m(!0)}},function(v){var _=v.which||v.keyCode;_<37||_>40||(v.preventDefault(),s({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},m]},[s,o]),u=c[0],d=c[1],h=c[2];return w.useEffect(function(){return h},[h]),ae.createElement("div",$N({},i,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:r,onKeyDown:d,tabIndex:0,role:"slider"}))}),M_e=function(n){return n.filter(Boolean).join(" ")},QWe=function(n){var e=n.color,t=n.left,i=n.top,r=i===void 0?.5:i,o=M_e(["react-colorful__pointer",n.className]);return ae.createElement("div",{className:o,style:{top:100*r+"%",left:100*t+"%"}},ae.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Ed=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t},kqt=function(n){return Nqt(Ase(n))},Ase=function(n){return n[0]==="#"&&(n=n.substring(1)),n.length<6?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Ed(parseInt(n[3]+n[3],16)/255,2):1}:{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16),a:n.length===8?Ed(parseInt(n.substring(6,8),16)/255,2):1}},Iqt=function(n){return Aqt(Dqt(n))},Lqt=function(n){var e=n.s,t=n.v,i=n.a,r=(200-e)*t/100;return{h:Ed(n.h),s:Ed(r>0&&r<200?e*t/100/(r<=100?r:200-r)*100:0),l:Ed(r/2),a:Ed(i,2)}},Nse=function(n){var e=Lqt(n);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},Dqt=function(n){var e=n.h,t=n.s,i=n.v,r=n.a;e=e/360*6,t/=100,i/=100;var o=Math.floor(e),s=i*(1-t),a=i*(1-(e-o)*t),l=i*(1-(1-e+o)*t),c=o%6;return{r:Ed(255*[i,a,s,s,l,i][c]),g:Ed(255*[l,i,i,a,s,s][c]),b:Ed(255*[s,s,l,i,i,a][c]),a:Ed(r,2)}},j8=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},Aqt=function(n){var e=n.r,t=n.g,i=n.b,r=n.a,o=r<1?j8(Ed(255*r)):"";return"#"+j8(e)+j8(t)+j8(i)+o},Nqt=function(n){var e=n.r,t=n.g,i=n.b,r=n.a,o=Math.max(e,t,i),s=o-Math.min(e,t,i),a=s?o===e?(t-i)/s:o===t?2+(i-e)/s:4+(e-t)/s:0;return{h:Ed(60*(a<0?a+6:a)),s:Ed(o?s/o*100:0),v:Ed(o/255*100),a:r}},Rqt=ae.memo(function(n){var e=n.hue,t=n.onChange,i=M_e(["react-colorful__hue",n.className]);return ae.createElement("div",{className:i},ae.createElement(YWe,{onMove:function(r){t({h:360*r.left})},onKey:function(r){t({h:q4(e+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":Ed(e),"aria-valuemax":"360","aria-valuemin":"0"},ae.createElement(QWe,{className:"react-colorful__hue-pointer",left:e/360,color:Nse({h:e,s:100,v:100,a:1})})))}),Oqt=ae.memo(function(n){var e=n.hsva,t=n.onChange,i={backgroundColor:Nse({h:e.h,s:100,v:100,a:1})};return ae.createElement("div",{className:"react-colorful__saturation",style:i},ae.createElement(YWe,{onMove:function(r){t({s:100*r.left,v:100-100*r.top})},onKey:function(r){t({s:q4(e.s+100*r.left,0,100),v:q4(e.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Ed(e.s)+"%, Brightness "+Ed(e.v)+"%"},ae.createElement(QWe,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:Nse(e)})))}),XWe=function(n,e){if(n===e)return!0;for(var t in n)if(n[t]!==e[t])return!1;return!0},Pqt=function(n,e){return n.toLowerCase()===e.toLowerCase()||XWe(Ase(n),Ase(e))};function Mqt(n,e,t){var i=j4(t),r=w.useState(function(){return n.toHsva(e)}),o=r[0],s=r[1],a=w.useRef({color:e,hsva:o});w.useEffect(function(){if(!n.equal(e,a.current.color)){var c=n.toHsva(e);a.current={hsva:c,color:e},s(c)}},[e,n]),w.useEffect(function(){var c;XWe(o,a.current.hsva)||n.equal(c=n.fromHsva(o),a.current.color)||(a.current={hsva:o,color:c},i(c))},[o,n,i]);var l=w.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[o,l]}var Fqt=typeof window<"u"?w.useLayoutEffect:w.useEffect,Bqt=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},X2e=new Map,$qt=function(n){Fqt(function(){var e=n.current?n.current.ownerDocument:document;if(e!==void 0&&!X2e.has(e)){var t=e.createElement("style");t.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,X2e.set(e,t);var i=Bqt();i&&t.setAttribute("nonce",i),e.head.appendChild(t)}},[])},Vqt=function(n){var e=n.className,t=n.colorModel,i=n.color,r=i===void 0?t.defaultColor:i,o=n.onChange,s=zq(n,["className","colorModel","color","onChange"]),a=w.useRef(null);$qt(a);var l=Mqt(t,r,o),c=l[0],u=l[1],d=M_e(["react-colorful",e]);return ae.createElement("div",$N({},s,{ref:a,className:d}),ae.createElement(Oqt,{hsva:c,onChange:u}),ae.createElement(Rqt,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},Hqt={defaultColor:"000",toHsva:kqt,fromHsva:function(n){return Iqt({h:n.h,s:n.s,v:n.v,a:1})},equal:Pqt},Wqt=function(n){return ae.createElement(Vqt,$N({},n,{colorModel:Hqt}))},zqt=/^#?([0-9A-F]{3,8})$/i,Uqt=function(n){var e=n.color,t=e===void 0?"":e,i=n.onChange,r=n.onBlur,o=n.escape,s=n.validate,a=n.format,l=n.process,c=zq(n,["color","onChange","onBlur","escape","validate","format","process"]),u=w.useState(function(){return o(t)}),d=u[0],h=u[1],f=j4(i),g=j4(r),m=w.useCallback(function(_){var b=o(_.target.value);h(b),s(b)&&f(l?l(b):b)},[o,l,s,f]),v=w.useCallback(function(_){s(_.target.value)||h(o(t)),g(_)},[t,o,s,g]);return w.useEffect(function(){h(o(t))},[t,o]),ae.createElement("input",$N({},c,{value:a?a(d):d,spellCheck:"false",onChange:m,onBlur:v}))},Z2e=function(n){return"#"+n},jqt=function(n){var e=n.prefixed,t=n.alpha,i=zq(n,["prefixed","alpha"]),r=w.useCallback(function(s){return s.replace(/([^0-9A-F]+)/gi,"").substring(0,t?8:6)},[t]),o=w.useCallback(function(s){return function(a,l){var c=zqt.exec(a),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8}(s,t)},[t]);return ae.createElement(Uqt,$N({},i,{escape:r,format:e?Z2e:void 0,process:Z2e,validate:o}))};const qqt=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2f7dc3","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b","#616161","#000000","#57a6e4","#324da1","#4c9a1c","#cd8900","#b93700"];function Gk(n){const{t:e}=pe(),{includeDefaultPalette:t}=n,i=ni(),[r,o]=w.useState(n.value||"#000000"),[s,a]=w.useState(!1),[l,c]=w.useState(!1);return QD(()=>{var u;return(u=n.onValueChange)==null?void 0:u.call(n,r)},500,[r]),w.useEffect(()=>{n.value&&o(n.value)},[n.value]),N("div",{children:[N(Ui,{title:e("color"),visible:s,onClose:a,centerContent:!0,disableClosing:l,children:[p(Wqt,{color:r,onChange:o}),p(jqt,{color:r,onChange:o,className:"border rounded-md my-2 p-2 border-gray-300",style:{backgroundColor:i.$1,borderColor:i.$4}}),N("div",{className:"flex w-full justify-between",children:[t&&p(Gt,{behavior:"button",type:"secondary",onClick:()=>c(!0),children:e("default")}),p(Gt,{className:Nt({"w-full":!t}),behavior:"button",onClick:()=>a(!1),children:e("done")})]})]}),p(Ui,{title:e("default"),visible:l,size:"small",onClose:()=>c(!1),children:N("div",{className:"flex flex-col space-y-6",children:[p("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:qqt.map(u=>p("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>o(u),style:{height:32,backgroundColor:u},children:r===u&&p(vt,{className:"absolute",element:sme,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},u))}),p("div",{className:"flex justify-end",children:p(Gt,{behavior:"button",onClick:()=>c(!1),children:e("done")})})]})}),p("div",{style:{backgroundColor:r},className:Nt("w-16 h-6 shadow rounded-md",{"opacity-75 cursor-not-allowed":n.disabled,"cursor-pointer":typeof n.disabled>"u"||!n.disabled}),onClick:()=>(!n.disabled||typeof n.disabled>"u")&&a(!0)})]})}function Kqt(){var i,r;const[n]=pe(),e=Qi(),t=Oc(o=>o.user.changes);return p(Qt,{title:n("accent_color"),children:p(K,{leftSide:n("accent_color"),children:p(Gk,{value:((r=(i=t==null?void 0:t.company_user)==null?void 0:i.settings)==null?void 0:r.accent_color)||Z8e.primary,onValueChange:o=>e(Ak({property:"company_user.settings.accent_color",value:o}))})})})}const Gqt=w.createContext(null);function Yqt(){const n=w.useContext(Gqt);if(!n)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return n}function Qqt(n){var e;return(e=n==null?void 0:n.clientId)!==null&&e!==void 0?e:n==null?void 0:n.client_id}const Xqt={large:40,medium:32,small:20};function ZWe({onSuccess:n,onError:e,useOneTap:t,promptMomentNotification:i,type:r="standard",theme:o="outline",size:s="large",text:a,shape:l,logo_alignment:c,width:u,locale:d,click_listener:h,containerProps:f,...g}){const m=w.useRef(null),{clientId:v,scriptLoadedSuccessfully:_}=Yqt(),b=w.useRef(n);b.current=n;const y=w.useRef(e);y.current=e;const C=w.useRef(i);return C.current=i,w.useEffect(()=>{var x,E,k,L,D,A,O,P,F;if(_)return(k=(E=(x=window==null?void 0:window.google)===null||x===void 0?void 0:x.accounts)===null||E===void 0?void 0:E.id)===null||k===void 0||k.initialize({client_id:v,callback:B=>{var M;if(!(B!=null&&B.credential))return(M=y.current)===null||M===void 0?void 0:M.call(y);const{credential:V,select_by:U}=B;b.current({credential:V,clientId:Qqt(B),select_by:U})},...g}),(A=(D=(L=window==null?void 0:window.google)===null||L===void 0?void 0:L.accounts)===null||D===void 0?void 0:D.id)===null||A===void 0||A.renderButton(m.current,{type:r,theme:o,size:s,text:a,shape:l,logo_alignment:c,width:u,locale:d,click_listener:h}),t&&((F=(P=(O=window==null?void 0:window.google)===null||O===void 0?void 0:O.accounts)===null||P===void 0?void 0:P.id)===null||F===void 0||F.prompt(C.current)),()=>{var B,M,V;t&&((V=(M=(B=window==null?void 0:window.google)===null||B===void 0?void 0:B.accounts)===null||M===void 0?void 0:M.id)===null||V===void 0||V.cancel())}},[v,_,t,r,o,s,a,l,c,u,d]),ae.createElement("div",{...f,ref:m,style:{height:Xqt[s],...f==null?void 0:f.style}})}/*! @azure/msal-common v14.3.0 2023-10-30 */const St={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},q8={SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR_RANGE_START:400,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR_RANGE_START:500,SERVER_ERROR_RANGE_END:599},jF=[St.OPENID_SCOPE,St.PROFILE_SCOPE,St.OFFLINE_ACCESS_SCOPE],J2e=[...jF,St.EMAIL_SCOPE],kb={CONTENT_TYPE:"Content-Type",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},sd={ID_TOKEN:"idtoken",CLIENT_INFO:"client.info",ADAL_ID_TOKEN:"adal.idtoken",ERROR:"error",ERROR_DESC:"error.description",ACTIVE_ACCOUNT:"active-account",ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},oM={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Wr={CLIENT_ID:"client_id",REDIRECT_URI:"redirect_uri",RESPONSE_TYPE:"response_type",RESPONSE_MODE:"response_mode",GRANT_TYPE:"grant_type",CLAIMS:"claims",SCOPE:"scope",ERROR:"error",ERROR_DESCRIPTION:"error_description",ACCESS_TOKEN:"access_token",ID_TOKEN:"id_token",REFRESH_TOKEN:"refresh_token",EXPIRES_IN:"expires_in",STATE:"state",NONCE:"nonce",PROMPT:"prompt",SESSION_STATE:"session_state",CLIENT_INFO:"client_info",CODE:"code",CODE_CHALLENGE:"code_challenge",CODE_CHALLENGE_METHOD:"code_challenge_method",CODE_VERIFIER:"code_verifier",CLIENT_REQUEST_ID:"client-request-id",X_CLIENT_SKU:"x-client-SKU",X_CLIENT_VER:"x-client-VER",X_CLIENT_OS:"x-client-OS",X_CLIENT_CPU:"x-client-CPU",X_CLIENT_CURR_TELEM:"x-client-current-telemetry",X_CLIENT_LAST_TELEM:"x-client-last-telemetry",X_MS_LIB_CAPABILITY:"x-ms-lib-capability",X_APP_NAME:"x-app-name",X_APP_VER:"x-app-ver",POST_LOGOUT_URI:"post_logout_redirect_uri",ID_TOKEN_HINT:"id_token_hint",DEVICE_CODE:"device_code",CLIENT_SECRET:"client_secret",CLIENT_ASSERTION:"client_assertion",CLIENT_ASSERTION_TYPE:"client_assertion_type",TOKEN_TYPE:"token_type",REQ_CNF:"req_cnf",OBO_ASSERTION:"assertion",REQUESTED_TOKEN_USE:"requested_token_use",ON_BEHALF_OF:"on_behalf_of",FOCI:"foci",CCS_HEADER:"X-AnchorMailbox",RETURN_SPA_CODE:"return_spa_code",NATIVE_BROKER:"nativebroker",LOGOUT_HINT:"logout_hint"},K8={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},ah={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},LJ={ACCOUNT:"account",SID:"sid",LOGIN_HINT:"login_hint",ID_TOKEN:"id_token",DOMAIN_HINT:"domain_hint",ORGANIZATIONS:"organizations",CONSUMERS:"consumers",ACCOUNT_ID:"accountIdentifier",HOMEACCOUNT_ID:"homeAccountIdentifier"},eLe={PLAIN:"plain",S256:"S256"},qF={QUERY:"query",FRAGMENT:"fragment"},Zqt={...qF,FORM_POST:"form_post"},JWe={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},G8={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},vd={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},Or={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Rse="appmetadata",Jqt="client_info",sM="1",aM={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Dp={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},ld={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},Ea={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},lM={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},tLe={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},nLe={username:"username",password:"password"},Y8={httpSuccess:200,httpBadRequest:400},qI={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},DJ={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},tx={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},eKt={Jwt:"JWT",Jwk:"JWK",Pop:"pop"};/*! @azure/msal-common v14.3.0 2023-10-30 */const F_e="unexpected_error",tKt="post_request_failed";/*! @azure/msal-common v14.3.0 2023-10-30 */const iLe={[F_e]:"Unexpected error in authentication.",[tKt]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class Bl extends Error{constructor(e,t,i){const r=t?`${e}: ${t}`:e;super(r),Object.setPrototypeOf(this,Bl.prototype),this.errorCode=e||St.EMPTY_STRING,this.errorMessage=t||St.EMPTY_STRING,this.subError=i||St.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function eze(n,e){return new Bl(n,e?`${iLe[n]} ${e}`:iLe[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */const B_e="client_info_decoding_error",tze="client_info_empty_error",$_e="token_parsing_error",nze="null_or_empty_token",uy="endpoints_resolution_error",ize="network_error",rze="openid_config_error",Ose="hash_not_deserialized",rA="invalid_state",oze="state_mismatch",nW="state_not_found",sze="nonce_mismatch",V_e="auth_time_not_found",aze="max_age_transpired",nKt="multiple_matching_tokens",iKt="multiple_matching_accounts",lze="multiple_matching_appMetadata",cze="request_cannot_be_made",uze="cannot_remove_empty_scope",dze="cannot_append_scopeset",Pse="empty_input_scopeset",rKt="device_code_polling_cancelled",oKt="device_code_expired",sKt="device_code_unknown_error",H_e="no_account_in_silent_request",hze="invalid_cache_record",W_e="invalid_cache_environment",Mse="no_account_found",Fse="no_crypto_object",Bse="unexpected_credential_type",aKt="invalid_assertion",lKt="invalid_client_credential",QC="token_refresh_required",cKt="user_timeout_reached",fze="token_claims_cnf_required_for_signedjwt",pze="authorization_code_missing_from_server_response",gze="binding_key_not_removed",mze="end_session_endpoint_not_supported",z_e="key_id_missing",uKt="no_network_connectivity",dKt="user_canceled",hKt="missing_tenant_id_error",jo="method_not_implemented",fKt="nested_app_auth_bridge_disabled";/*! @azure/msal-common v14.3.0 2023-10-30 */const rLe={[B_e]:"The client info could not be parsed/decoded correctly",[tze]:"The client info was empty",[$_e]:"Token cannot be parsed",[nze]:"The token is null or empty",[uy]:"Endpoints cannot be resolved",[ize]:"Network request failed",[rze]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[Ose]:"The hash parameters could not be deserialized",[rA]:"State was not the expected format",[oze]:"State mismatch error",[nW]:"State not found",[sze]:"Nonce mismatch error",[V_e]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[aze]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[nKt]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[iKt]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[lze]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[cze]:"Token request cannot be made without authorization code or refresh token.",[uze]:"Cannot remove null or empty scope from ScopeSet",[dze]:"Cannot append ScopeSet",[Pse]:"Empty input ScopeSet cannot be processed",[rKt]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[oKt]:"Device code is expired.",[sKt]:"Device code stopped polling for unknown reasons.",[H_e]:"Please pass an account object, silent flow is not supported without account information",[hze]:"Cache record object was null or undefined.",[W_e]:"Invalid environment when attempting to create cache entry",[Mse]:"No account found in cache for given key.",[Fse]:"No crypto object detected.",[Bse]:"Unexpected credential type.",[aKt]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[lKt]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[QC]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[cKt]:"User defined timeout for device code polling reached",[fze]:"Cannot generate a POP jwt if the token_claims are not populated",[pze]:"Server response does not contain an authorization code to proceed",[gze]:"Could not remove the credential's binding key from storage.",[mze]:"The provided authority does not support logout",[z_e]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[uKt]:"No network connectivity. Check your internet connection.",[dKt]:"User cancelled the flow.",[hKt]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[jo]:"This method has not been implemented",[fKt]:"The nested app auth bridge is disabled"};class Uq extends Bl{constructor(e,t){super(e,t?`${rLe[e]}: ${t}`:rLe[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,Uq.prototype)}}function Nn(n,e){return new Uq(n,e)}/*! @azure/msal-common v14.3.0 2023-10-30 */const iW={createNewGuid:()=>{throw Nn(jo)},base64Decode:()=>{throw Nn(jo)},base64Encode:()=>{throw Nn(jo)},async getPublicKeyThumbprint(){throw Nn(jo)},async removeTokenBindingKey(){throw Nn(jo)},async clearKeystore(){throw Nn(jo)},async signJwt(){throw Nn(jo)},async hashString(){throw Nn(jo)}};/*! @azure/msal-common v14.3.0 2023-10-30 */var Ou;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose",n[n.Trace=4]="Trace"})(Ou||(Ou={}));class FT{constructor(e,t,i){this.level=Ou.Info;const r=()=>{},o=e||FT.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||r,this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level=typeof o.logLevel=="number"?o.logLevel:Ou.Info,this.correlationId=o.correlationId||St.EMPTY_STRING,this.packageName=t||St.EMPTY_STRING,this.packageVersion=i||St.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ou.Info}}clone(e,t,i){return new FT({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:i||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const o=`${`[${new Date().toUTCString()}] : [${t.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${Ou[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,o,t.containsPii||!1)}executeCallback(e,t,i){this.localCallback&&this.localCallback(e,t,i)}error(e,t){this.logMessage(e,{logLevel:Ou.Error,containsPii:!1,correlationId:t||St.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:Ou.Error,containsPii:!0,correlationId:t||St.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:Ou.Warning,containsPii:!1,correlationId:t||St.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:Ou.Warning,containsPii:!0,correlationId:t||St.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:Ou.Info,containsPii:!1,correlationId:t||St.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:Ou.Info,containsPii:!0,correlationId:t||St.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:Ou.Verbose,containsPii:!1,correlationId:t||St.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:Ou.Verbose,containsPii:!0,correlationId:t||St.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:Ou.Trace,containsPii:!1,correlationId:t||St.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:Ou.Trace,containsPii:!0,correlationId:t||St.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */const _ze="@azure/msal-common",U_e="14.3.0";/*! @azure/msal-common v14.3.0 2023-10-30 */const j_e={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};/*! @azure/msal-common v14.3.0 2023-10-30 */function lS(n,e){const t=pKt(n);try{const i=e(t);return JSON.parse(i)}catch{throw Nn($_e)}}function pKt(n){if(!n)throw Nn(nze);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(n);if(!t||t.length<4)throw Nn($_e);return t[2]}function vze(n,e){if(e===0||Date.now()-3e5>n+e)throw Nn(aze)}/*! @azure/msal-common v14.3.0 2023-10-30 */class Wh{static nowSeconds(){return Math.round(new Date().getTime()/1e3)}static isTokenExpired(e,t){const i=Number(e)||0;return Wh.nowSeconds()+t>i}static wasClockTurnedBack(e){return Number(e)>Wh.nowSeconds()}static delay(e,t){return new Promise(i=>setTimeout(()=>i(t),e))}}/*! @azure/msal-common v14.3.0 2023-10-30 */function Q2(n){return[gKt(n),mKt(n),_Kt(n),vKt(n),bKt(n)].join(vd.CACHE_KEY_SEPARATOR).toLowerCase()}function jq(n,e,t,i,r){return{credentialType:Or.ID_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t,realm:r}}function qq(n,e,t,i,r,o,s,a,l,c,u,d,h,f,g){var v,_;const m={homeAccountId:n,credentialType:Or.ACCESS_TOKEN,secret:t,cachedAt:Wh.nowSeconds().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:i,realm:r,target:o,tokenType:u||Ea.BEARER};if(d&&(m.userAssertionHash=d),c&&(m.refreshOn=c.toString()),f&&(m.requestedClaims=f,m.requestedClaimsHash=g),((v=m.tokenType)==null?void 0:v.toLowerCase())!==Ea.BEARER.toLowerCase())switch(m.credentialType=Or.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case Ea.POP:const b=lS(t,l);if(!((_=b==null?void 0:b.cnf)!=null&&_.kid))throw Nn(fze);m.keyId=b.cnf.kid;break;case Ea.SSH:m.keyId=h}return m}function bze(n,e,t,i,r,o){const s={credentialType:Or.REFRESH_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t};return o&&(s.userAssertionHash=o),r&&(s.familyId=r),s}function q_e(n){return n.hasOwnProperty("homeAccountId")&&n.hasOwnProperty("environment")&&n.hasOwnProperty("credentialType")&&n.hasOwnProperty("clientId")&&n.hasOwnProperty("secret")}function oLe(n){return n?q_e(n)&&n.hasOwnProperty("realm")&&n.hasOwnProperty("target")&&(n.credentialType===Or.ACCESS_TOKEN||n.credentialType===Or.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function sLe(n){return n?q_e(n)&&n.hasOwnProperty("realm")&&n.credentialType===Or.ID_TOKEN:!1}function aLe(n){return n?q_e(n)&&n.credentialType===Or.REFRESH_TOKEN:!1}function gKt(n){return[n.homeAccountId,n.environment].join(vd.CACHE_KEY_SEPARATOR).toLowerCase()}function mKt(n){const e=n.credentialType===Or.REFRESH_TOKEN&&n.familyId||n.clientId;return[n.credentialType,e,n.realm||""].join(vd.CACHE_KEY_SEPARATOR).toLowerCase()}function _Kt(n){return(n.target||"").toLowerCase()}function vKt(n){return(n.requestedClaimsHash||"").toLowerCase()}function bKt(n){return n.tokenType&&n.tokenType.toLowerCase()!==Ea.BEARER.toLowerCase()?n.tokenType.toLowerCase():""}/*! @azure/msal-common v14.3.0 2023-10-30 */const yze="redirect_uri_empty",yKt="claims_request_parsing_error",Cze="authority_uri_insecure",aP="url_parse_error",K_e="empty_url_error",wze="empty_input_scopes_error",Sze="invalid_prompt_value",G_e="invalid_claims",Eze="token_request_empty",xze="logout_request_empty",Tze="invalid_code_challenge_method",Y_e="pkce_params_missing",Q_e="invalid_cloud_discovery_metadata",kze="invalid_authority_metadata",Ize="untrusted_authority",Kq="missing_ssh_jwk",Lze="missing_ssh_kid",CKt="missing_nonce_authentication_header",wKt="invalid_authentication_header",Dze="cannot_set_OIDCOptions",Aze="cannot_allow_native_broker",Nze="authority_mismatch";/*! @azure/msal-common v14.3.0 2023-10-30 */const SKt={[yze]:"A redirect URI is required for all calls, and none has been set.",[yKt]:"Could not parse the given claims request object.",[Cze]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[aP]:"URL could not be parsed into appropriate segments.",[K_e]:"URL was empty or null.",[wze]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[Sze]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[G_e]:"Given claims parameter must be a stringified JSON object.",[Eze]:"Token request was empty and not found in cache.",[xze]:"The logout request was null or undefined.",[Tze]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Y_e]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Q_e]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[kze]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[Ize]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Kq]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Lze]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[CKt]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[wKt]:"Invalid authentication header provided",[Dze]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[Aze]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[Nze]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class X_e extends Bl{constructor(e){super(e,SKt[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,X_e.prototype)}}function xa(n){return new X_e(n)}/*! @azure/msal-common v14.3.0 2023-10-30 */class Bp{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return Object.keys(t).length===0}catch{}return!0}static startsWith(e,t){return e.indexOf(t)===0}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},i=e.split("&"),r=o=>decodeURIComponent(o.replace(/\+/g," "));return i.forEach(o=>{if(o.trim()){const[s,a]=o.split(/=(.+)/g,2);s&&a&&(t[r(s)]=r(a))}}),t}static trimArrayEntries(e){return e.map(t=>t.trim())}static removeEmptyStringsFromArray(e){return e.filter(t=>!!t)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class jc{constructor(e){const t=e?Bp.trimArrayEntries([...e]):[],i=t?Bp.removeEmptyStringsFromArray(t):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(r=>this.scopes.add(r))}static fromString(e){const i=(e||St.EMPTY_STRING).split(" ");return new jc(i)}static createSearchScopes(e){const t=new jc(e);return t.containsOnlyOIDCScopes()?t.removeScope(St.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw xa(wze)}containsScope(e){const t=this.printScopesLowerCase().split(" "),i=new jc(t);return e?i.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(t=>this.containsScope(t))}containsOnlyOIDCScopes(){let e=0;return J2e.forEach(t=>{this.containsScope(t)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(t=>this.appendScope(t))}catch{throw Nn(dze)}}removeScope(e){if(!e)throw Nn(uze);this.scopes.delete(e.trim())}removeOIDCScopes(){J2e.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Nn(Pse);const t=new Set;return e.scopes.forEach(i=>t.add(i.toLowerCase())),this.scopes.forEach(i=>t.add(i.toLowerCase())),t}intersectingScopeSets(e){if(!e)throw Nn(Pse);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),i=e.getScopeCount(),r=this.getScopeCount();return t.size<r+i}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(t=>e.push(t)),e}printScopes(){return this.scopes?this.asArray().join(" "):St.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v14.3.0 2023-10-30 */function $se(n,e){if(!n)throw Nn(tze);try{const t=e.base64Decode(n);return JSON.parse(t)}catch{throw Nn(B_e)}}function X2(n){if(!n)throw Nn(B_e);const e=n.split(vd.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?St.EMPTY_STRING:e[1]}}/*! @azure/msal-common v14.3.0 2023-10-30 */const D_={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v14.3.0 2023-10-30 */const Gy={AAD:"AAD",OIDC:"OIDC"};/*! @azure/msal-common v14.3.0 2023-10-30 */class kc{generateAccountId(){return[this.homeAccountId,this.environment].join(vd.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return kc.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType}}static generateAccountCacheKey(e){return[e.homeAccountId,e.environment||St.EMPTY_STRING,e.tenantId||St.EMPTY_STRING].join(vd.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t){const i=new kc;t.authorityType===D_.Adfs?i.authorityType=G8.ADFS_ACCOUNT_TYPE:t.protocolMode===Gy.AAD?i.authorityType=G8.MSSTS_ACCOUNT_TYPE:i.authorityType=G8.GENERIC_ACCOUNT_TYPE,i.clientInfo=e.clientInfo,i.homeAccountId=e.homeAccountId,i.nativeAccountId=e.nativeAccountId;const r=e.environment||t&&t.getPreferredCache();if(!r)throw Nn(W_e);i.environment=r,i.realm=e.idTokenClaims.tid||St.EMPTY_STRING,i.localAccountId=e.idTokenClaims.oid||e.idTokenClaims.sub||St.EMPTY_STRING;const o=e.idTokenClaims.preferred_username||e.idTokenClaims.upn,s=e.idTokenClaims.emails?e.idTokenClaims.emails[0]:null;return i.username=o||s||St.EMPTY_STRING,i.name=e.idTokenClaims.name,i.cloudGraphHostName=e.cloudGraphHostName,i.msGraphHost=e.msGraphHost,i}static createFromAccountInfo(e,t,i){const r=new kc;return r.authorityType=e.authorityType||G8.GENERIC_ACCOUNT_TYPE,r.homeAccountId=e.homeAccountId,r.localAccountId=e.localAccountId,r.nativeAccountId=e.nativeAccountId,r.realm=e.tenantId,r.environment=e.environment,r.username=e.username,r.name=e.name,r.cloudGraphHostName=t,r.msGraphHost=i,r}static generateHomeAccountId(e,t,i,r,o){const s=o!=null&&o.sub?o.sub:St.EMPTY_STRING;if(t===D_.Adfs||t===D_.Dsts)return s;if(e)try{const a=$se(e,r);if(a.uid&&a.utid)return`${a.uid}${vd.CLIENT_INFO_SEPARATOR}${a.utid}`}catch{}return i.verbose("No client info in response"),s}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,t,i){if(!e||!t)return!1;let r=!0;if(i){const o=e.idTokenClaims||{},s=t.idTokenClaims||{};r=o.iat===s.iat&&o.nonce===s.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&r}}/*! @azure/msal-common v14.3.0 2023-10-30 */class wr{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw xa(K_e);this.getHash()||(this._urlString=wr.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Bp.endsWith(t,"?")?t=t.slice(0,-1):Bp.endsWith(t,"?/")&&(t=t.slice(0,-2)),Bp.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw xa(aP)}if(!e.HostNameAndPort||!e.PathSegments)throw xa(aP);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw xa(Cze)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return wr.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),i=t.PathSegments;return e&&i.length!==0&&(i[0]===oM.COMMON||i[0]===oM.ORGANIZATIONS)&&(i[0]=e),wr.constructAuthorityUriFromObject(t)}getHash(){return wr.parseHash(this.urlString)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw xa(aP);const i={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let r=i.AbsolutePath.split("/");return r=r.filter(o=>o&&o.length>0),i.PathSegments=r,i.QueryString&&i.QueryString.endsWith("/")&&(i.QueryString=i.QueryString.substring(0,i.QueryString.length-1)),i}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),i=e.match(t);if(!i)throw xa(aP);return i[2]}static getAbsoluteUrl(e,t){if(e[0]===St.FORWARD_SLASH){const r=new wr(t).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static parseHash(e){const t=e.indexOf("#"),i=e.indexOf("#/");return i>-1?e.substring(i+2):t>-1?e.substring(t+1):St.EMPTY_STRING}static parseQueryString(e){const t=e.indexOf("?"),i=e.indexOf("/?");return i>-1?e.substring(i+2):t>-1?e.substring(t+1):St.EMPTY_STRING}static parseQueryServerResponse(e){const t=e.indexOf("?code"),i=e.indexOf("/?code"),r=e.indexOf("#");return i>-1&&r>-1?e.substring(i+2,r):i>-1?e.substring(i+2):t>-1&&r>-1?e.substring(t+1,r):t>-1?e.substring(t+1):St.EMPTY_STRING}static constructAuthorityUriFromObject(e){return new wr(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static getDeserializedHash(e){if(!e)return{};const t=wr.parseHash(e),i=Bp.queryStringToObject(t||e);if(!i)throw Nn(Ose);return i}static getDeserializedQueryString(e){if(!e)return{};const t=wr.parseQueryString(e),i=Bp.queryStringToObject(t||e);if(!i)throw Nn(Ose);return i}static getDeserializedCodeResponse(e,t){const i=new wr(t);let r;return e===qF.QUERY?r=wr.getDeserializedQueryString(t):r=wr.getDeserializedHash(i.getHash()),r}static hashContainsKnownProperties(e){if(!e||e.indexOf("=")<0)return!1;const t=wr.getDeserializedHash(e);return!!(t.code||t.error_description||t.error||t.state)}}/*! @azure/msal-common v14.3.0 2023-10-30 */const Rze={endpointMetadata:{"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},instanceDiscoveryMetadata:{tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},lLe=Rze.endpointMetadata,Z_e=Rze.instanceDiscoveryMetadata,Oze=new Set;Z_e.metadata.forEach(n=>{n.aliases.forEach(e=>{Oze.add(e)})});function EKt(n,e){var r;let t;const i=n.canonicalAuthority;if(i){const o=new wr(i).getUrlComponents().HostNameAndPort;t=cLe(o,(r=n.cloudDiscoveryMetadata)==null?void 0:r.metadata,Dp.CONFIG,e)||cLe(o,Z_e.metadata,Dp.HARDCODED_VALUES,e)||n.knownAuthorities}return t||[]}function cLe(n,e,t,i){if(i==null||i.trace(`getAliasesFromMetadata called with source: ${t}`),n&&e){const r=rW(e,n);if(r)return i==null||i.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${t}, returning aliases`),r.aliases;i==null||i.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${t}`)}return null}function xKt(n){return rW(Z_e.metadata,n)}function rW(n,e){for(let t=0;t<n.length;t++){const i=n[t];if(i.aliases.includes(e))return i}return null}/*! @azure/msal-common v14.3.0 2023-10-30 */class kC{constructor(e,t,i,r){this.clientId=e,this.cryptoImpl=t,this.commonLogger=i.clone(_ze,U_e),this.staticAuthorityOptions=r}getAllAccounts(e){const t=[];return this.getAccountsFilteredBy(e||{}).forEach(i=>{const r=this.getAccountInfoFromEntity(i,e);r&&t.push(r)}),t}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);return t.length>1?t.filter(i=>!!i.idTokenClaims)[0]:t.length===1?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}getAccountInfoFromEntity(e,t){const i=e.getAccountInfo(),r=this.getIdToken(i);if(r){const o=lS(r.secret,this.cryptoImpl.base64Decode);if(this.idTokenClaimsMatchAccountFilter(o,t))return i.idToken=r.secret,i.idTokenClaims=o,i}return i}idTokenClaimsMatchAccountFilter(e,t){return!(t&&(t.loginHint&&!this.matchLoginHint(e,t.loginHint)||t.sid&&!this.matchSid(e,t.sid)))}async saveCacheRecord(e,t){if(!e)throw Nn(hze);e.account&&this.setAccount(e.account),e.idToken&&(t==null?void 0:t.idToken)!==!1&&this.setIdTokenCredential(e.idToken),e.accessToken&&(t==null?void 0:t.accessToken)!==!1&&await this.saveAccessToken(e.accessToken),e.refreshToken&&(t==null?void 0:t.refreshToken)!==!1&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}async saveAccessToken(e){const t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),r=jc.fromString(e.target),o=[];i.accessToken.forEach(s=>{if(!this.accessTokenKeyMatchesFilter(s,t,!1))return;const a=this.getAccessTokenCredential(s);a&&this.credentialMatchesFilter(a,t)&&jc.fromString(a.target).intersectingScopeSets(r)&&o.push(this.removeAccessToken(s))}),await Promise.all(o),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),i=[];return t.forEach(r=>{if(!this.isAccountKey(r,e.homeAccountId,e.tenantId))return;const o=this.getAccount(r);o&&(e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId)||e.localAccountId&&!this.matchLocalAccountId(o,e.localAccountId)||e.username&&!this.matchUsername(o,e.username)||e.environment&&!this.matchEnvironment(o,e.environment)||e.realm&&!this.matchRealm(o,e.realm)||e.tenantId&&!this.matchRealm(o,e.tenantId)||e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(o,e.authorityType)||e.name&&!this.matchName(o,e.name)||i.push(o))}),i}isAccountKey(e,t,i){return!(e.split(vd.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||i&&!e.toLowerCase().includes(i.toLowerCase()))}isCredentialKey(e){if(e.split(vd.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(t.indexOf(Or.ID_TOKEN.toLowerCase())===-1&&t.indexOf(Or.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(Or.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(Or.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(Or.REFRESH_TOKEN.toLowerCase())>-1){const i=`${Or.REFRESH_TOKEN}${vd.CACHE_KEY_SEPARATOR}${this.clientId}${vd.CACHE_KEY_SEPARATOR}`,r=`${Or.REFRESH_TOKEN}${vd.CACHE_KEY_SEPARATOR}${sM}${vd.CACHE_KEY_SEPARATOR}`;if(t.indexOf(i.toLowerCase())===-1&&t.indexOf(r.toLowerCase())===-1)return!1}else if(t.indexOf(this.clientId.toLowerCase())===-1)return!1;return!0}credentialMatchesFilter(e,t){return!(t.clientId&&!this.matchClientId(e,t.clientId)||t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash)||typeof t.homeAccountId=="string"&&!this.matchHomeAccountId(e,t.homeAccountId)||t.environment&&!this.matchEnvironment(e,t.environment)||t.realm&&!this.matchRealm(e,t.realm)||t.credentialType&&!this.matchCredentialType(e,t.credentialType)||t.familyId&&!this.matchFamilyId(e,t.familyId)||t.target&&!this.matchTarget(e,t.target)||(t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash||e.credentialType===Or.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===Ea.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId)))}getAppMetadataFilteredBy(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)}getAppMetadataFilteredByInternal(e,t){const i=this.getKeys(),r={};return i.forEach(o=>{if(!this.isAppMetadata(o))return;const s=this.getAppMetadata(o);s&&(e&&!this.matchEnvironment(s,e)||t&&!this.matchClientId(s,t)||(r[o]=s))}),r}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let i=null;return t.forEach(r=>{if(!this.isAuthorityMetadata(r)||r.indexOf(this.clientId)===-1)return;const o=this.getAuthorityMetadata(r);o&&o.aliases.indexOf(e)!==-1&&(i=o)}),i}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach(i=>{t.push(this.removeAccount(i))}),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),i=e.generateAccountId(),r=[];t.idToken.forEach(o=>{o.indexOf(i)===0&&this.removeIdToken(o)}),t.accessToken.forEach(o=>{o.indexOf(i)===0&&r.push(this.removeAccessToken(o))}),t.refreshToken.forEach(o=>{o.indexOf(i)===0&&this.removeRefreshToken(o)}),await Promise.all(r)}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===Or.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===Ea.POP){const r=t.keyId;if(r)try{await this.cryptoImpl.removeTokenBindingKey(r)}catch{throw Nn(gze)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(t=>{this.isAppMetadata(t)&&this.removeItem(t)}),!0}readCacheRecord(e,t,i){const r=this.getTokenKeys(),o=this.readAccountFromCache(e),s=this.getIdToken(e,r),a=this.getAccessToken(e,t,r),l=this.getRefreshToken(e,!1,r),c=this.readAppMetadataFromCache(i);return o&&s&&(o.idTokenClaims=lS(s.secret,this.cryptoImpl.base64Decode)),{account:o,idToken:s,accessToken:a,refreshToken:l,appMetadata:c}}readAccountFromCache(e){const t=kc.generateAccountCacheKey(e);return this.getAccount(t)}getIdToken(e,t){this.commonLogger.trace("CacheManager - getIdToken called");const i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Or.ID_TOKEN,clientId:this.clientId,realm:e.tenantId},r=this.getIdTokensByFilter(i,t),o=r.length;return o<1?(this.commonLogger.info("CacheManager:getIdToken - No token found"),null):o>1?(this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them"),r.forEach(s=>{this.removeIdToken(Q2(s))}),null):(this.commonLogger.info("CacheManager:getIdToken - Returning id token"),r[0])}getIdTokensByFilter(e,t){const i=t&&t.idToken||this.getTokenKeys().idToken,r=[];return i.forEach(o=>{if(!this.idTokenKeyMatchesFilter(o,{clientId:this.clientId,...e}))return;const s=this.getIdTokenCredential(o);s&&this.credentialMatchesFilter(s,e)&&r.push(s)}),r}idTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.clientId&&i.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&i.indexOf(t.homeAccountId.toLowerCase())===-1)}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,i){this.commonLogger.trace("CacheManager - getAccessToken called");const r=jc.createSearchScopes(t.scopes),o=t.authenticationScheme||Ea.BEARER,s=o&&o.toLowerCase()!==Ea.BEARER.toLowerCase()?Or.ACCESS_TOKEN_WITH_AUTH_SCHEME:Or.ACCESS_TOKEN,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:s,clientId:this.clientId,realm:e.tenantId,target:r,tokenType:o,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},l=i&&i.accessToken||this.getTokenKeys().accessToken,c=[];l.forEach(d=>{if(this.accessTokenKeyMatchesFilter(d,a,!0)){const h=this.getAccessTokenCredential(d);h&&this.credentialMatchesFilter(h,a)&&c.push(h)}});const u=c.length;return u<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):u>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),c.forEach(d=>{this.removeAccessToken(Q2(d))}),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),c[0])}accessTokenKeyMatchesFilter(e,t,i){const r=e.toLowerCase();if(t.clientId&&r.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&r.indexOf(t.homeAccountId.toLowerCase())===-1||t.realm&&r.indexOf(t.realm.toLowerCase())===-1||t.requestedClaimsHash&&r.indexOf(t.requestedClaimsHash.toLowerCase())===-1)return!1;if(t.target){const o=t.target.asArray();for(let s=0;s<o.length;s++){if(i&&!r.includes(o[s].toLowerCase()))return!1;if(!i&&r.includes(o[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),i=[];return t.accessToken.forEach(r=>{if(!this.accessTokenKeyMatchesFilter(r,e,!0))return;const o=this.getAccessTokenCredential(r);o&&this.credentialMatchesFilter(o,e)&&i.push(o)}),i}getRefreshToken(e,t,i){this.commonLogger.trace("CacheManager - getRefreshToken called");const r=t?sM:void 0,o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Or.REFRESH_TOKEN,clientId:this.clientId,familyId:r},s=i&&i.refreshToken||this.getTokenKeys().refreshToken,a=[];return s.forEach(c=>{if(this.refreshTokenKeyMatchesFilter(c,o)){const u=this.getRefreshTokenCredential(c);u&&this.credentialMatchesFilter(u,o)&&a.push(u)}}),a.length<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),a[0])}refreshTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.familyId&&i.indexOf(t.familyId.toLowerCase())===-1||!t.familyId&&t.clientId&&i.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&i.indexOf(t.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(t),r=Object.keys(i).map(s=>i[s]),o=r.length;if(o<1)return null;if(o>1)throw Nn(lze);return r[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===sM)}matchHomeAccountId(e,t){return typeof e.homeAccountId=="string"&&t===e.homeAccountId}matchLocalAccountId(e,t){return typeof e.localAccountId=="string"&&t===e.localAccountId}matchUsername(e,t){return typeof e.username=="string"&&t.toLowerCase()===e.username.toLowerCase()}matchName(e,t){var i;return t.toLowerCase()===((i=e.name)==null?void 0:i.toLowerCase())}matchUserAssertionHash(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const r=EKt(this.staticAuthorityOptions,this.commonLogger);if(r.includes(t)&&r.includes(e.environment))return!0}const i=this.getAuthorityMetadataByAlias(t);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!!(e.clientId&&t===e.clientId)}matchFamilyId(e,t){return!!(e.familyId&&t===e.familyId)}matchRealm(e,t){return!!(e.realm&&t===e.realm)}matchNativeAccountId(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)}matchLoginHint(e,t){return(e==null?void 0:e.login_hint)===t||e.preferred_username===t||(e==null?void 0:e.upn)===t}matchSid(e,t){return!!(e!=null&&e.sid&&e.sid===t)}matchAuthorityType(e,t){return!!(e.authorityType&&t.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,t){return e.credentialType!==Or.ACCESS_TOKEN&&e.credentialType!==Or.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:jc.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!!(e.tokenType&&e.tokenType===t)}matchKeyId(e,t){return!!(e.keyId&&e.keyId===t)}isAppMetadata(e){return e.indexOf(Rse)!==-1}isAuthorityMetadata(e){return e.indexOf(aM.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${aM.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const i in t)e[i]=t[i];return e}}class TKt extends kC{setAccount(){throw Nn(jo)}getAccount(){throw Nn(jo)}setIdTokenCredential(){throw Nn(jo)}getIdTokenCredential(){throw Nn(jo)}setAccessTokenCredential(){throw Nn(jo)}getAccessTokenCredential(){throw Nn(jo)}setRefreshTokenCredential(){throw Nn(jo)}getRefreshTokenCredential(){throw Nn(jo)}setAppMetadata(){throw Nn(jo)}getAppMetadata(){throw Nn(jo)}setServerTelemetry(){throw Nn(jo)}getServerTelemetry(){throw Nn(jo)}setAuthorityMetadata(){throw Nn(jo)}getAuthorityMetadata(){throw Nn(jo)}getAuthorityMetadataKeys(){throw Nn(jo)}setThrottlingCache(){throw Nn(jo)}getThrottlingCache(){throw Nn(jo)}removeItem(){throw Nn(jo)}containsKey(){throw Nn(jo)}getKeys(){throw Nn(jo)}getAccountKeys(){throw Nn(jo)}getTokenKeys(){throw Nn(jo)}async clear(){throw Nn(jo)}updateCredentialCacheKey(){throw Nn(jo)}}/*! @azure/msal-common v14.3.0 2023-10-30 */const kKt=300,Pze={tokenRenewalOffsetSeconds:kKt,preventCorsPreflight:!1},IKt={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ou.Info,correlationId:St.EMPTY_STRING},LKt={claimsBasedCachingEnabled:!1},DKt={async sendGetRequestAsync(){throw Nn(jo)},async sendPostRequestAsync(){throw Nn(jo)}},AKt={sku:St.SKU,version:U_e,cpu:St.EMPTY_STRING,os:St.EMPTY_STRING},NKt={clientSecret:St.EMPTY_STRING,clientAssertion:void 0},RKt={azureCloudInstance:j_e.None,tenant:`${St.DEFAULT_COMMON_TENANT}`},OKt={application:{appName:"",appVersion:""}};function PKt({authOptions:n,systemOptions:e,loggerOptions:t,cacheOptions:i,storageInterface:r,networkInterface:o,cryptoInterface:s,clientCredentials:a,libraryInfo:l,telemetry:c,serverTelemetryManager:u,persistencePlugin:d,serializableCache:h}){const f={...IKt,...t};return{authOptions:MKt(n),systemOptions:{...Pze,...e},loggerOptions:f,cacheOptions:{...LKt,...i},storageInterface:r||new TKt(n.clientId,iW,new FT(f)),networkInterface:o||DKt,cryptoInterface:s||iW,clientCredentials:a||NKt,libraryInfo:{...AKt,...l},telemetry:{...OKt,...c},serverTelemetryManager:u||null,persistencePlugin:d||null,serializableCache:h||null}}function MKt(n){return{clientCapabilities:[],azureCloudOptions:RKt,skipAuthorityMetadataCache:!1,...n}}function Vse(n){return n.authOptions.authority.options.protocolMode===Gy.OIDC}/*! @azure/msal-common v14.3.0 2023-10-30 */class cS extends Bl{constructor(e,t,i){super(e,t,i),this.name="ServerError",Object.setPrototypeOf(this,cS.prototype)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class hb{static generateThrottlingStorageKey(e){return`${lM.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var o;const i=hb.generateThrottlingStorageKey(t),r=e.getThrottlingCache(i);if(r){if(r.throttleTime<Date.now()){e.removeItem(i);return}throw new cS(((o=r.errorCodes)==null?void 0:o.join(" "))||St.EMPTY_STRING,r.errorMessage,r.subError)}}static postProcess(e,t,i){if(hb.checkResponseStatus(i)||hb.checkResponseForRetryAfter(i)){const r={throttleTime:hb.calculateThrottleTime(parseInt(i.headers[kb.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(hb.generateThrottlingStorageKey(t),r)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(kb.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,i=Date.now()/1e3;return Math.floor(Math.min(i+(t||lM.DEFAULT_THROTTLE_TIME_SECONDS),i+lM.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,i,r){const o={clientId:t,authority:i.authority,scopes:i.scopes,homeAccountIdentifier:r,claims:i.claims,authenticationScheme:i.authenticationScheme,resourceRequestMethod:i.resourceRequestMethod,resourceRequestUri:i.resourceRequestUri,shrClaims:i.shrClaims,sshKid:i.sshKid},s=this.generateThrottlingStorageKey(o);e.removeItem(s)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class FKt{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,i){hb.preProcess(this.cacheManager,e);let r;try{r=await this.networkClient.sendPostRequestAsync(t,i)}catch(o){throw o instanceof Bl?o:Nn(ize)}return hb.postProcess(this.cacheManager,e,r),r}}/*! @azure/msal-common v14.3.0 2023-10-30 */const Gp={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v14.3.0 2023-10-30 */class nx{static validateRedirectUri(e){if(!e)throw xa(yze)}static validatePrompt(e){const t=[];for(const i in ah)t.push(ah[i]);if(t.indexOf(e)<0)throw xa(Sze)}static validateClaims(e){try{JSON.parse(e)}catch{throw xa(G_e)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw xa(Y_e);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([eLe.PLAIN,eLe.S256].indexOf(e)<0)throw xa(Tze)}static sanitizeEQParams(e,t){return e?(t.forEach((i,r)=>{e[r]&&delete e[r]}),Object.fromEntries(Object.entries(e).filter(i=>i[1]!==""))):{}}}/*! @azure/msal-common v14.3.0 2023-10-30 */class cM{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(Wr.RESPONSE_TYPE,encodeURIComponent(St.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(Wr.RESPONSE_TYPE,encodeURIComponent(`${St.TOKEN_RESPONSE_TYPE} ${St.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set(Wr.RESPONSE_MODE,encodeURIComponent(e||Zqt.QUERY))}addNativeBroker(){this.parameters.set(Wr.NATIVE_BROKER,encodeURIComponent("1"))}addScopes(e,t=!0,i=jF){t&&!i.includes("openid")&&!e.includes("openid")&&i.push("openid");const r=t?[...e||[],...i]:e||[],o=new jc(r);this.parameters.set(Wr.SCOPE,encodeURIComponent(o.printScopes()))}addClientId(e){this.parameters.set(Wr.CLIENT_ID,encodeURIComponent(e))}addRedirectUri(e){nx.validateRedirectUri(e),this.parameters.set(Wr.REDIRECT_URI,encodeURIComponent(e))}addPostLogoutRedirectUri(e){nx.validateRedirectUri(e),this.parameters.set(Wr.POST_LOGOUT_URI,encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set(Wr.ID_TOKEN_HINT,encodeURIComponent(e))}addDomainHint(e){this.parameters.set(LJ.DOMAIN_HINT,encodeURIComponent(e))}addLoginHint(e){this.parameters.set(LJ.LOGIN_HINT,encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(kb.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(kb.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set(LJ.SID,encodeURIComponent(e))}addClaims(e,t){const i=this.addClientCapabilitiesToClaims(e,t);nx.validateClaims(i),this.parameters.set(Wr.CLAIMS,encodeURIComponent(i))}addCorrelationId(e){this.parameters.set(Wr.CLIENT_REQUEST_ID,encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set(Wr.X_CLIENT_SKU,e.sku),this.parameters.set(Wr.X_CLIENT_VER,e.version),e.os&&this.parameters.set(Wr.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(Wr.X_CLIENT_CPU,e.cpu)}addApplicationTelemetry(e){e!=null&&e.appName&&this.parameters.set(Wr.X_APP_NAME,e.appName),e!=null&&e.appVersion&&this.parameters.set(Wr.X_APP_VER,e.appVersion)}addPrompt(e){nx.validatePrompt(e),this.parameters.set(`${Wr.PROMPT}`,encodeURIComponent(e))}addState(e){e&&this.parameters.set(Wr.STATE,encodeURIComponent(e))}addNonce(e){this.parameters.set(Wr.NONCE,encodeURIComponent(e))}addCodeChallengeParams(e,t){if(nx.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(Wr.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(Wr.CODE_CHALLENGE_METHOD,encodeURIComponent(t));else throw xa(Y_e)}addAuthorizationCode(e){this.parameters.set(Wr.CODE,encodeURIComponent(e))}addDeviceCode(e){this.parameters.set(Wr.DEVICE_CODE,encodeURIComponent(e))}addRefreshToken(e){this.parameters.set(Wr.REFRESH_TOKEN,encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set(Wr.CODE_VERIFIER,encodeURIComponent(e))}addClientSecret(e){this.parameters.set(Wr.CLIENT_SECRET,encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set(Wr.CLIENT_ASSERTION,encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set(Wr.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))}addOboAssertion(e){this.parameters.set(Wr.OBO_ASSERTION,encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set(Wr.REQUESTED_TOKEN_USE,encodeURIComponent(e))}addGrantType(e){this.parameters.set(Wr.GRANT_TYPE,encodeURIComponent(e))}addClientInfo(){this.parameters.set(Jqt,"1")}addExtraQueryParameters(e){const t=nx.sanitizeEQParams(e,this.parameters);Object.keys(t).forEach(i=>{this.parameters.set(i,e[i])})}addClientCapabilitiesToClaims(e,t){let i;if(!e)i={};else try{i=JSON.parse(e)}catch{throw xa(G_e)}return t&&t.length>0&&(i.hasOwnProperty(K8.ACCESS_TOKEN)||(i[K8.ACCESS_TOKEN]={}),i[K8.ACCESS_TOKEN][K8.XMS_CC]={values:t}),JSON.stringify(i)}addUsername(e){this.parameters.set(nLe.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(nLe.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(Wr.TOKEN_TYPE,Ea.POP),this.parameters.set(Wr.REQ_CNF,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(Wr.TOKEN_TYPE,Ea.SSH),this.parameters.set(Wr.REQ_CNF,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set(Wr.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(Wr.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set(Wr.X_MS_LIB_CAPABILITY,lM.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set(Wr.LOGOUT_HINT,encodeURIComponent(e))}createQueryString(){const e=new Array;return this.parameters.forEach((t,i)=>{e.push(`${i}=${t}`)}),e.join("&")}}/*! @azure/msal-common v14.3.0 2023-10-30 */function BKt(n){return n.hasOwnProperty("authorization_endpoint")&&n.hasOwnProperty("token_endpoint")&&n.hasOwnProperty("issuer")&&n.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v14.3.0 2023-10-30 */class Hse{constructor(){this.expiresAt=Wh.nowSeconds()+aM.REFRESH_TIME_SECONDS}updateCloudDiscoveryMetadata(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t}updateEndpointMetadata(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri}updateCanonicalAuthority(e){this.canonical_authority=e}resetExpiresAt(){this.expiresAt=Wh.nowSeconds()+aM.REFRESH_TIME_SECONDS}isExpired(){return this.expiresAt<=Wh.nowSeconds()}static isAuthorityMetadataEntity(e,t){return t?e.indexOf(aM.CACHE_KEY)===0&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"):!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */function $Kt(n){return n.hasOwnProperty("tenant_discovery_endpoint")&&n.hasOwnProperty("metadata")}/*! @azure/msal-common v14.3.0 2023-10-30 */function VKt(n){return n.hasOwnProperty("error")&&n.hasOwnProperty("error_description")}/*! @azure/msal-common v14.3.0 2023-10-30 */const Lt={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",StandardInteractionClientInitializeAuthorizationCodeRequest:"standardInteractionClientInitializeAuthorizationCodeRequest",GetAuthCodeUrl:"getAuthCodeUrl",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponseFromHash:"handleCodeResponseFromHash",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",AuthClientCreateQueryString:"authClientCreateQueryString",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromiseMeasurement",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues"},HKt={NotStarted:0,InProgress:1,Completed:2};/*! @azure/msal-common v14.3.0 2023-10-30 */const KF=(n,e,t,i,r)=>(...o)=>{t.trace(`Executing function ${e}`);const s=i==null?void 0:i.startMeasurement(e,r);try{const a=n(...o);return s==null||s.end({success:!0}),t.trace(`Returning result from ${e}`),a}catch(a){t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1}),a}},ri=(n,e,t,i,r)=>(...o)=>{t.trace(`Executing function ${e}`);const s=i==null?void 0:i.startMeasurement(e,r);return i==null||i.setPreQueueTime(e,r),n(...o).then(a=>(t.trace(`Returning result from ${e}`),s==null||s.end({success:!0}),a)).catch(a=>{t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1}),a})};/*! @azure/msal-common v14.3.0 2023-10-30 */class Gq{constructor(e,t,i,r){this.networkInterface=e,this.logger=t,this.performanceClient=i,this.correlationId=r}async detectRegion(e,t){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Lt.RegionDiscoveryDetectRegion,this.correlationId);let i=e;if(i)t.region_source=qI.ENVIRONMENT_VARIABLE;else{const o=Gq.IMDS_OPTIONS;try{const s=await ri(this.getRegionFromIMDS.bind(this),Lt.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(St.IMDS_VERSION,o);if(s.status===Y8.httpSuccess&&(i=s.body,t.region_source=qI.IMDS),s.status===Y8.httpBadRequest){const a=await ri(this.getCurrentVersion.bind(this),Lt.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(o);if(!a)return t.region_source=qI.FAILED_AUTO_DETECTION,null;const l=await ri(this.getRegionFromIMDS.bind(this),Lt.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(a,o);l.status===Y8.httpSuccess&&(i=l.body,t.region_source=qI.IMDS)}}catch{return t.region_source=qI.FAILED_AUTO_DETECTION,null}}return i||(t.region_source=qI.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,t){var i;return(i=this.performanceClient)==null||i.addQueueMeasurement(Lt.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${St.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,St.IMDS_TIMEOUT)}async getCurrentVersion(e){var t;(t=this.performanceClient)==null||t.addQueueMeasurement(Lt.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const i=await this.networkInterface.sendGetRequestAsync(`${St.IMDS_ENDPOINT}?format=json`,e);return i.status===Y8.httpBadRequest&&i.body&&i.body["newest-versions"]&&i.body["newest-versions"].length>0?i.body["newest-versions"][0]:null}catch{return null}}}Gq.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v14.3.0 2023-10-30 */class eh{constructor(e,t,i,r,o,s,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=i,this.authorityOptions=r,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=s,this.correlationId=a,this.regionDiscovery=new Gq(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(St.CIAM_AUTH_URL))return D_.Ciam;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case St.ADFS:return D_.Adfs;case St.DSTS:return D_.Dsts}return D_.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new wr(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Nn(uy)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Nn(uy)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Nn(uy)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Nn(mze);return this.replacePath(this.metadata.end_session_endpoint)}else throw Nn(uy)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Nn(uy)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Nn(uy)}canReplaceTenant(e){return e.PathSegments.length===1&&!eh.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===D_.Default&&this.protocolMode===Gy.AAD}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new wr(this.metadata.canonical_authority).getUrlComponents(),o=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,l)=>{let c=o[l];if(l===0&&this.canReplaceTenant(r)){const u=new wr(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];c!==u&&(this.logger.verbose(`Replacing tenant domain name ${c} with id ${u}`),c=u)}a!==c&&(t=t.replace(`/${c}/`,`/${a}/`))}),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===D_.Adfs||this.protocolMode!==Gy.AAD&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Lt.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await ri(this.updateCloudDiscoveryMetadata.bind(this),Lt.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const i=await ri(this.updateEndpointMetadata.bind(this),Lt.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:i})}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e=new Hse,e.updateCanonicalAuthority(this.canonicalAuthority)),e}updateCachedMetadata(e,t,i){t!==Dp.CACHE&&(i==null?void 0:i.source)!==Dp.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority));const r=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(r,e),this.metadata=e}async updateEndpointMetadata(e){var r,o,s;(r=this.performanceClient)==null||r.addQueueMeasurement(Lt.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===Dp.HARDCODED_VALUES&&(o=this.authorityOptions.azureRegionConfiguration)!=null&&o.azureRegion&&t.metadata){const a=await ri(this.updateMetadataWithRegionalInformation.bind(this),Lt.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata);e.updateEndpointMetadata(a,!1)}return t.source}let i=await ri(this.getEndpointMetadataFromNetwork.bind(this),Lt.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(i=await ri(this.updateMetadataWithRegionalInformation.bind(this),Lt.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(i)),e.updateEndpointMetadata(i,!0),Dp.NETWORK;throw Nn(rze,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),e.updateEndpointMetadata(t,!1),{source:Dp.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const r=this.getEndpointMetadataFromHardcodedValues();if(r)return e.updateEndpointMetadata(r,!1),{source:Dp.HARDCODED_VALUES,metadata:r};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const i=e.isExpired();return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:Dp.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new wr(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw xa(kze)}return null}async getEndpointMetadataFromNetwork(){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(Lt.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const r=await this.networkInterface.sendGetRequestAsync(t,e);return BKt(r.body)?r.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(r){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${r}`),null}}getEndpointMetadataFromHardcodedValues(){return this.canonicalAuthority in lLe?lLe[this.canonicalAuthority]:null}async updateMetadataWithRegionalInformation(e){var i,r,o;(i=this.performanceClient)==null||i.addQueueMeasurement(Lt.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const t=(r=this.authorityOptions.azureRegionConfiguration)==null?void 0:r.azureRegion;if(t){if(t!==St.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=DJ.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,eh.replaceWithRegionalInformation(e,t);const s=await ri(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Lt.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((o=this.authorityOptions.azureRegionConfiguration)==null?void 0:o.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=DJ.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,eh.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=DJ.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Lt.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const i=await ri(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Lt.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return e.updateCloudDiscoveryMetadata(i,!0),Dp.NETWORK;throw xa(Ize)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||St.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||St.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||St.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),e.updateCloudDiscoveryMetadata(t,!1),Dp.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const r=xKt(this.hostnameAndPort);if(r)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(r,!1),Dp.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const i=e.isExpired();return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("Found cloud discovery metadata in the cache."),Dp.CACHE):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===D_.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),eh.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=rW(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),xa(Q_e)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),eh.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Lt.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${St.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let i=null;try{const o=await this.networkInterface.sendGetRequestAsync(e,t);let s,a;if($Kt(o.body))s=o.body,a=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${s.tenant_discovery_endpoint}`);else if(VKt(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${o.status}`),s=o.body,s.error===St.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${s.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${s.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=rW(a,this.hostnameAndPort)}catch(o){if(o instanceof Bl)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. Error: ${o.errorCode} Error Description: ${o.errorMessage}`);else{const s=o;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. Error: ${s.name} Error Description: ${s.message}`)}return null}return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=eh.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>wr.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let i;if(t&&t.azureCloudInstance!==j_e.None){const r=t.tenant?t.tenant:St.DEFAULT_COMMON_TENANT;i=`${t.azureCloudInstance}/${r}/`}return i||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw Nn(uy)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Oze.has(e)}static isPublicCloudAuthority(e){return St.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,i){const r=new wr(e);r.validateAsUri();const o=r.getUrlComponents();let s=`${t}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(s=`${t}.${St.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=wr.constructAuthorityUriFromObject({...r.getUrlComponents(),HostNameAndPort:s}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,t){const i={...e};return i.authorization_endpoint=eh.buildRegionalAuthorityString(i.authorization_endpoint,t),i.token_endpoint=eh.buildRegionalAuthorityString(i.token_endpoint,t,St.REGIONAL_AUTH_NON_MSI_QUERY_STRING),i.end_session_endpoint&&(i.end_session_endpoint=eh.buildRegionalAuthorityString(i.end_session_endpoint,t)),i}static transformCIAMAuthority(e){let t=e;const r=new wr(e).getUrlComponents();if(r.PathSegments.length===0&&r.HostNameAndPort.endsWith(St.CIAM_AUTH_URL)){const o=r.HostNameAndPort.split(".")[0];t=`${t}${o}${St.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}eh.reservedTenantDomains=new Set(["{tenant}","{tenantid}",oM.COMMON,oM.CONSUMERS,oM.ORGANIZATIONS]);function Mze(n){return n.endsWith(St.FORWARD_SLASH)?n:`${n}${St.FORWARD_SLASH}`}function WKt(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw xa(Q_e)}return{canonicalAuthority:n.authority?Mze(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.3.0 2023-10-30 */class BT{static async createDiscoveredInstance(e,t,i,r,o,s,a){s==null||s.addQueueMeasurement(Lt.AuthorityFactoryCreateDiscoveredInstance,a);const l=eh.transformCIAMAuthority(Mze(e)),c=BT.createInstance(l,t,i,r,o,s,a);try{return await ri(c.resolveEndpointsAsync.bind(c),Lt.AuthorityResolveEndpointsAsync,o,s,a)(),c}catch{throw Nn(uy)}}static createInstance(e,t,i,r,o,s,a){if(!e)throw xa(K_e);return new eh(e,t,i,r,o,s,a)}}/*! @azure/msal-common v14.3.0 2023-10-30 */let J_e=class{constructor(e,t){this.config=PKt(e),this.logger=new FT(this.config.loggerOptions,_ze,U_e),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new FKt(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[kb.CONTENT_TYPE]=St.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Gp.HOME_ACCOUNT_ID:try{const i=X2(e.credential);t[kb.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case Gp.UPN:t[kb.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,i,r,o,s){var l,c,u,d;s&&((l=this.performanceClient)==null||l.addQueueMeasurement(s,o));const a=await this.networkManager.sendPostRequest(r,e,{body:t,headers:i});return(d=this.performanceClient)==null||d.addFields({refreshTokenSize:((c=a.body.refresh_token)==null?void 0:c.length)||0,httpVerToken:((u=a.headers)==null?void 0:u[kb.X_MS_HTTP_VERSION])||""},o),this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async updateAuthority(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(Lt.UpdateTokenEndpointAuthority,t);const i=`https://${e}/${this.authority.tenant}/`,r=await BT.createDiscoveredInstance(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,this.performanceClient,t);this.authority=r}createTokenQueryParameters(e){const t=new cM;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}};/*! @azure/msal-common v14.3.0 2023-10-30 */const oW="no_tokens_found",Fze="native_account_unavailable",zKt="interaction_required",UKt="consent_required",jKt="login_required";/*! @azure/msal-common v14.3.0 2023-10-30 */const uLe=[zKt,UKt,jKt],qKt=["message_only","additional_action","basic_action","user_password_expired","consent_required"],KKt={[oW]:"No refresh token found in the cache. Please sign-in.",[Fze]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."};class Kb extends Bl{constructor(e,t,i,r,o,s,a){super(e,t,i),Object.setPrototypeOf(this,Kb.prototype),this.timestamp=r||St.EMPTY_STRING,this.traceId=o||St.EMPTY_STRING,this.correlationId=s||St.EMPTY_STRING,this.claims=a||St.EMPTY_STRING,this.name="InteractionRequiredAuthError"}}function dLe(n,e,t){const i=!!n&&uLe.indexOf(n)>-1,r=!!t&&qKt.indexOf(t)>-1,o=!!e&&uLe.some(s=>e.indexOf(s)>-1);return i||o||r}function Bze(n){return new Kb(n,KKt[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */class WL{constructor(e,t,i,r,o){this.account=e||null,this.idToken=t||null,this.accessToken=i||null,this.refreshToken=r||null,this.appMetadata=o||null}}/*! @azure/msal-common v14.3.0 2023-10-30 */class av{static setRequestState(e,t,i){const r=av.generateLibraryState(e,i);return t?`${r}${St.RESOURCE_DELIM}${t}`:r}static generateLibraryState(e,t){if(!e)throw Nn(Fse);const i={id:e.createNewGuid()};t&&(i.meta=t);const r=JSON.stringify(i);return e.base64Encode(r)}static parseRequestState(e,t){if(!e)throw Nn(Fse);if(!t)throw Nn(rA);try{const i=t.split(St.RESOURCE_DELIM),r=i[0],o=i.length>1?i.slice(1).join(St.RESOURCE_DELIM):St.EMPTY_STRING,s=e.base64Decode(r),a=JSON.parse(s);return{userRequestState:o||St.EMPTY_STRING,libraryState:a}}catch{throw Nn(rA)}}}/*! @azure/msal-common v14.3.0 2023-10-30 */const GKt={SW:"sw",UHW:"uhw"};class oA{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(Lt.PopTokenGenerateCnf,e.correlationId);const i=await ri(this.generateKid.bind(this),Lt.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),r=this.cryptoUtils.base64Encode(JSON.stringify(i));return{kid:i.kid,reqCnfString:r,reqCnfHash:await this.cryptoUtils.hashString(r)}}async generateKid(e){var i;return(i=this.performanceClient)==null||i.addQueueMeasurement(Lt.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:GKt.SW}}async signPopToken(e,t,i){return this.signPayload(e,t,i)}async signPayload(e,t,i,r){const{resourceRequestMethod:o,resourceRequestUri:s,shrClaims:a,shrNonce:l}=i,c=s?new wr(s):void 0,u=c==null?void 0:c.getUrlComponents();return await this.cryptoUtils.signJwt({at:e,ts:Wh.nowSeconds(),m:o==null?void 0:o.toUpperCase(),u:u==null?void 0:u.HostNameAndPort,nonce:l||this.cryptoUtils.createNewGuid(),p:u==null?void 0:u.AbsolutePath,q:u!=null&&u.QueryString?[[],u.QueryString]:void 0,client_claims:a||void 0,...r},t,i.correlationId)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class sA{generateAppMetadataKey(){return sA.generateAppMetadataCacheKey(this.environment,this.clientId)}static generateAppMetadataCacheKey(e,t){return[Rse,e,t].join(vd.CACHE_KEY_SEPARATOR).toLowerCase()}static createAppMetadataEntity(e,t,i){const r=new sA;return r.clientId=e,r.environment=t,i&&(r.familyId=i),r}static isAppMetadataEntity(e,t){return t?e.indexOf(Rse)===0&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"):!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */class YKt{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.3.0 2023-10-30 */class $T{constructor(e,t,i,r,o,s,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=i,this.logger=r,this.serializableCache=o,this.persistencePlugin=s,this.performanceClient=a}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?Nn(nW,"Cached State"):Nn(nW,"Server State");let i,r;try{i=decodeURIComponent(e.state)}catch{throw Nn(rA,e.state)}try{r=decodeURIComponent(t)}catch{throw Nn(rA,e.state)}if(i!==r)throw Nn(oze);if(e.error||e.error_description||e.suberror)throw dLe(e.error,e.error_description,e.suberror)?new Kb(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||""):new cS(e.error||"",e.error_description,e.suberror)}validateTokenResponse(e,t){if(e.error||e.error_description||e.suberror){const i=`${e.error_codes} - [${e.timestamp}]: ${e.error_description} - Correlation ID: ${e.correlation_id} - Trace ID: ${e.trace_id}`,r=new cS(e.error,i,e.suberror);if(t&&e.status&&e.status>=q8.SERVER_ERROR_RANGE_START&&e.status<=q8.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. ${r}`);return}else if(t&&e.status&&e.status>=q8.CLIENT_ERROR_RANGE_START&&e.status<=q8.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. ${r}`);return}throw dLe(e.error,e.error_description,e.suberror)?new Kb(e.error,e.error_description,e.suberror,e.timestamp||St.EMPTY_STRING,e.trace_id||St.EMPTY_STRING,e.correlation_id||St.EMPTY_STRING,e.claims||St.EMPTY_STRING):r}}async handleServerTokenResponse(e,t,i,r,o,s,a,l,c){var g;(g=this.performanceClient)==null||g.addQueueMeasurement(Lt.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=lS(e.id_token||St.EMPTY_STRING,this.cryptoObj.base64Decode),o&&o.nonce&&u.nonce!==o.nonce)throw Nn(sze);if(r.maxAge||r.maxAge===0){const m=u.auth_time;if(!m)throw Nn(V_e);vze(m,r.maxAge)}}this.homeAccountIdentifier=kc.generateHomeAccountId(e.client_info||St.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,u);let d;o&&o.state&&(d=av.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||r.sshKid||void 0;const h=this.generateCacheRecord(e,t,i,r,u,s,o);let f;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new YKt(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(f)),a&&!l&&h.account){const m=h.account.generateAccountKey();if(!this.cacheStorage.getAccount(m))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),$T.generateAuthenticationResult(this.cryptoObj,t,h,!1,r,u,d,void 0,c)}await this.cacheStorage.saveCacheRecord(h,r.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&f&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(f))}return $T.generateAuthenticationResult(this.cryptoObj,t,h,!1,r,u,d,e,c)}generateCacheRecord(e,t,i,r,o,s,a){const l=t.getPreferredCache();if(!l)throw Nn(W_e);let c,u;e.id_token&&o&&(c=jq(this.homeAccountIdentifier,l,e.id_token,this.clientId,o.tid||""),u=kc.createAccount({homeAccountId:this.homeAccountIdentifier,idTokenClaims:o,clientInfo:e.client_info,cloudGraphHostName:a==null?void 0:a.cloud_graph_host_name,msGraphHost:a==null?void 0:a.msgraph_host},t));let d=null;if(e.access_token){const g=e.scope?jc.fromString(e.scope):new jc(r.scopes||[]),m=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,v=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,_=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,b=i+m,y=b+v,C=_&&_>0?i+_:void 0;d=qq(this.homeAccountIdentifier,l,e.access_token,this.clientId,(o==null?void 0:o.tid)||t.tenant,g.printScopes(),b,y,this.cryptoObj.base64Decode,C,e.token_type,s,e.key_id,r.claims,r.requestedClaimsHash)}let h=null;e.refresh_token&&(h=bze(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,s));let f=null;return e.foci&&(f=sA.createAppMetadataEntity(this.clientId,l,e.foci)),new WL(u,c,d,h,f)}static async generateAuthenticationResult(e,t,i,r,o,s,a,l,c){var y,C,x,E;let u=St.EMPTY_STRING,d=[],h=null,f,g,m=St.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType===Ea.POP){const k=new oA(e),{secret:L,keyId:D}=i.accessToken;if(!D)throw Nn(z_e);u=await k.signPopToken(L,D,o)}else u=i.accessToken.secret;d=jc.fromString(i.accessToken.target).asArray(),h=new Date(Number(i.accessToken.expiresOn)*1e3),f=new Date(Number(i.accessToken.extendedExpiresOn)*1e3),i.accessToken.refreshOn&&(g=new Date(Number(i.accessToken.refreshOn)*1e3))}i.appMetadata&&(m=i.appMetadata.familyId===sM?sM:"");const v=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",_=(s==null?void 0:s.tid)||"";l!=null&&l.spa_accountid&&i.account&&(i.account.nativeAccountId=l==null?void 0:l.spa_accountid);const b=i.account?{...i.account.getAccountInfo(),idTokenClaims:s}:null;return{authority:t.canonicalAuthority,uniqueId:v,tenantId:_,scopes:d,account:b,idToken:((y=i==null?void 0:i.idToken)==null?void 0:y.secret)||"",idTokenClaims:s||{},accessToken:u,fromCache:r,expiresOn:h,extExpiresOn:f,refreshOn:g,correlationId:o.correlationId,requestId:c||St.EMPTY_STRING,familyId:m,tokenType:((C=i.accessToken)==null?void 0:C.tokenType)||St.EMPTY_STRING,state:a?a.userRequestState:St.EMPTY_STRING,cloudGraphHostName:((x=i.account)==null?void 0:x.cloudGraphHostName)||St.EMPTY_STRING,msGraphHost:((E=i.account)==null?void 0:E.msGraphHost)||St.EMPTY_STRING,code:l==null?void 0:l.spa_code,fromNativeBroker:!1}}}/*! @azure/msal-common v14.3.0 2023-10-30 */class $ze extends J_e{constructor(e,t){var i;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(i=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:i.defaultScopes}async getAuthCodeUrl(e){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(Lt.GetAuthCodeUrl,e.correlationId);const t=await ri(this.createAuthCodeUrlQueryString.bind(this),Lt.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return wr.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var a,l;if((a=this.performanceClient)==null||a.addQueueMeasurement(Lt.AuthClientAcquireToken,e.correlationId),!e.code)throw Nn(cze);const i=Wh.nowSeconds(),r=await ri(this.executeTokenRequest.bind(this),Lt.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=(l=r.headers)==null?void 0:l[kb.X_MS_REQUEST_ID],s=new $T(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(r.body),ri(s.handleServerTokenResponse.bind(s),Lt.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,i,e,t,void 0,void 0,void 0,o)}handleFragmentResponse(e,t){var o;const i=new $T(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),r=wr.getDeserializedCodeResponse((o=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:o.serverResponseType,e);if(i.validateServerAuthorizationCodeResponse(r,t),!r.code)throw Nn(pze);return{...r,code:r.code}}getLogoutUri(e){if(!e)throw xa(xze);const t=this.createLogoutUrlQueryString(e);return wr.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var c,u;(c=this.performanceClient)==null||c.addQueueMeasurement(Lt.AuthClientExecuteTokenRequest,t.correlationId);const i=this.createTokenQueryParameters(t),r=wr.appendQueryString(e.tokenEndpoint,i),o=await ri(this.createTokenRequestBody.bind(this),Lt.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const d=$se(t.clientInfo,this.cryptoUtils);s={credential:`${d.uid}${vd.CLIENT_INFO_SEPARATOR}${d.utid}`,type:Gp.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||t.ccsCredential),l={clientId:((u=t.tokenBodyParameters)==null?void 0:u.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return ri(this.executePostToTokenEndpoint.bind(this),Lt.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(r,o,a,l,t.correlationId,Lt.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,s;(o=this.performanceClient)==null||o.addQueueMeasurement(Lt.AuthClientCreateTokenRequestBody,e.correlationId);const t=new cM;if(t.addClientId(((s=e.tokenBodyParameters)==null?void 0:s[Wr.CLIENT_ID])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):nx.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Vse(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;t.addClientAssertion(a.assertion),t.addClientAssertionType(a.assertionType)}if(t.addGrantType(JWe.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Ea.POP){const a=new oA(this.cryptoUtils,this.performanceClient),l=await ri(a.generateCnf.bind(a),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);t.addPopToken(l.reqCnfString)}else if(e.authenticationScheme===Ea.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw xa(Kq);const i=e.correlationId||this.config.cryptoInterface.createNewGuid();t.addCorrelationId(i),(!Bp.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const a=$se(e.clientInfo,this.cryptoUtils);r={credential:`${a.uid}${vd.CLIENT_INFO_SEPARATOR}${a.utid}`,type:Gp.HOME_ACCOUNT_ID}}catch(a){this.logger.verbose("Could not parse client info for CCS Header: "+a)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Gp.HOME_ACCOUNT_ID:try{const a=X2(r.credential);t.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case Gp.UPN:t.addCcsUpn(r.credential);break}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Wr.RETURN_SPA_CODE])&&t.addExtraQueryParameters({[Wr.RETURN_SPA_CODE]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var o,s;(o=this.performanceClient)==null||o.addQueueMeasurement(Lt.AuthClientCreateQueryString,e.correlationId);const t=new cM;t.addClientId(((s=e.extraQueryParameters)==null?void 0:s[Wr.CLIENT_ID])||this.config.authOptions.clientId);const i=[...e.scopes||[],...e.extraScopesToConsent||[]];t.addScopes(i,!0,this.oidcDefaultScopes),t.addRedirectUri(e.redirectUri);const r=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(r),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),Vse(this.config)||t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==ah.SELECT_ACCOUNT)if(e.sid&&e.prompt===ah.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){const a=this.extractAccountSid(e.account),l=this.extractLoginHint(e.account);if(l){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(l);try{const c=X2(e.account.homeAccountId);t.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===ah.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(a);try{const c=X2(e.account.homeAccountId);t.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{const c=X2(e.account.homeAccountId);t.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),e.nativeBroker&&(t.addNativeBroker(),e.authenticationScheme===Ea.POP)){const a=new oA(this.cryptoUtils),l=await ri(a.generateCnf.bind(a),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);t.addPopToken(l.reqCnfHash)}return t.createQueryString()}createLogoutUrlQueryString(e){const t=new cM;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.3.0 2023-10-30 */class Wse extends J_e{constructor(e,t){super(e,t)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(Lt.RefreshTokenClientAcquireToken,e.correlationId);const t=Wh.nowSeconds(),i=await ri(this.executeTokenRequest.bind(this),Lt.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),r=(a=i.headers)==null?void 0:a[kb.X_MS_REQUEST_ID],o=new $T(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body),ri(o.handleServerTokenResponse.bind(o),Lt.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,r)}async acquireTokenByRefreshToken(e){var i;if(!e)throw xa(Eze);if((i=this.performanceClient)==null||i.addQueueMeasurement(Lt.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Nn(H_e);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return ri(this.acquireTokenWithCachedRefreshToken.bind(this),Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(r){const o=r instanceof Kb&&r.errorCode===oW,s=r instanceof cS&&r.errorCode===tLe.INVALID_GRANT_ERROR&&r.subError===tLe.CLIENT_MISMATCH_ERROR;if(o||s)return ri(this.acquireTokenWithCachedRefreshToken.bind(this),Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw r}return ri(this.acquireTokenWithCachedRefreshToken.bind(this),Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const i=KF(this.cacheManager.getRefreshToken.bind(this.cacheManager),Lt.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t);if(!i)throw Bze(oW);const r={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||Ea.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Gp.HOME_ACCOUNT_ID}};return ri(this.acquireToken.bind(this),Lt.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(r)}async executeTokenRequest(e,t){var l,c;(l=this.performanceClient)==null||l.addQueueMeasurement(Lt.RefreshTokenClientExecuteTokenRequest,e.correlationId);const i=this.createTokenQueryParameters(e),r=wr.appendQueryString(t.tokenEndpoint,i),o=await ri(this.createTokenRequestBody.bind(this),Lt.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:((c=e.tokenBodyParameters)==null?void 0:c.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return ri(this.executePostToTokenEndpoint.bind(this),Lt.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(r,o,s,a,e.correlationId,Lt.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,o,s;(r=this.performanceClient)==null||r.addQueueMeasurement(Lt.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,i=new cM;if(i.addClientId(((o=e.tokenBodyParameters)==null?void 0:o[Wr.CLIENT_ID])||this.config.authOptions.clientId),e.redirectUri&&i.addRedirectUri(e.redirectUri),i.addScopes(e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),i.addGrantType(JWe.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&!Vse(this.config)&&i.addServerTelemetry(this.serverTelemetryManager),i.addCorrelationId(t),i.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&i.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;i.addClientAssertion(a.assertion),i.addClientAssertionType(a.assertionType)}if(e.authenticationScheme===Ea.POP){const a=new oA(this.cryptoUtils,this.performanceClient),l=await ri(a.generateCnf.bind(a),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);i.addPopToken(l.reqCnfString)}else if(e.authenticationScheme===Ea.SSH)if(e.sshJwk)i.addSshJwk(e.sshJwk);else throw xa(Kq);if((!Bp.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Gp.HOME_ACCOUNT_ID:try{const a=X2(e.ccsCredential.credential);i.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case Gp.UPN:i.addCcsUpn(e.ccsCredential.credential);break}return e.tokenBodyParameters&&i.addExtraQueryParameters(e.tokenBodyParameters),i.createQueryString()}}/*! @azure/msal-common v14.3.0 2023-10-30 */class QKt extends J_e{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,i]=await this.acquireCachedToken(e);return i===tx.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Wse(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),t}catch(t){if(t instanceof Uq&&t.errorCode===QC)return new Wse(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw t}}async acquireCachedToken(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(Lt.SilentFlowClientAcquireCachedToken,e.correlationId);let t=tx.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Bp.isEmptyObj(e.claims))throw this.setCacheOutcome(tx.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Nn(QC);if(!e.account)throw Nn(H_e);const i=e.authority||this.authority.getPreferredCache(),r=this.cacheManager.readCacheRecord(e.account,e,i);if(r.accessToken){if(Wh.wasClockTurnedBack(r.accessToken.cachedAt)||Wh.isTokenExpired(r.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(tx.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Nn(QC);r.accessToken.refreshOn&&Wh.isTokenExpired(r.accessToken.refreshOn,0)&&(t=tx.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(tx.NO_CACHED_ACCESS_TOKEN,e.correlationId),Nn(QC);return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await ri(this.generateResultFromCacheRecord.bind(this),Lt.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(r,e),t]}setCacheOutcome(e,t){var i,r;(i=this.serverTelemetryManager)==null||i.setCacheOutcome(e),(r=this.performanceClient)==null||r.addFields({cacheOutcome:e},t),this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Lt.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let i;if(e.idToken&&(i=lS(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const o=i==null?void 0:i.auth_time;if(!o)throw Nn(V_e);vze(o,t.maxAge)}return await $T.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,i)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class sW{constructor(){this.failedRequests=[],this.errors=[],this.cacheHits=0}static isServerTelemetryEntity(e,t){const i=e.indexOf(ld.CACHE_KEY)===0;let r=!0;return t&&(r=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),i&&r}}/*! @azure/msal-common v14.3.0 2023-10-30 */class hLe{static isThrottlingEntity(e,t){let i=!1;e&&(i=e.indexOf(lM.THROTTLING_PREFIX)===0);let r=!0;return t&&(r=t.hasOwnProperty("throttleTime")),i&&r}}/*! @azure/msal-common v14.3.0 2023-10-30 */const XKt={sendGetRequestAsync:()=>Promise.reject(Nn(jo)),sendPostRequestAsync:()=>Promise.reject(Nn(jo))};/*! @azure/msal-common v14.3.0 2023-10-30 */const Vze="missing_kid_error",Hze="missing_alg_error";/*! @azure/msal-common v14.3.0 2023-10-30 */const ZKt={[Vze]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Hze]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class eve extends Bl{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,eve.prototype)}}function fLe(n){return new eve(n,ZKt[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */class tve{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw fLe(Vze);if(!e.alg)throw fLe(Hze);const t=new tve({typ:e.typ||eKt.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class aW{constructor(e,t){this.cacheOutcome=tx.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||St.EMPTY_STRING,this.wrapperVer=e.wrapperVer||St.EMPTY_STRING,this.telemetryCacheKey=ld.CACHE_KEY+vd.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${ld.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer].join(ld.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),r=[e,i].join(ld.VALUE_SEPARATOR);return[ld.SCHEMA_VERSION,r,t].join(ld.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=aW.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*t).join(ld.VALUE_SEPARATOR),r=e.errors.slice(0,t).join(ld.VALUE_SEPARATOR),o=e.errors.length,s=t<o?ld.OVERFLOW_TRUE:ld.OVERFLOW_FALSE,a=[o,s].join(ld.VALUE_SEPARATOR);return[ld.SCHEMA_VERSION,e.cacheHits,i,r,a].join(ld.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=ld.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Bl?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(ld.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e=new sW;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=aW.maxErrorsToSend(e),i=e.errors.length;if(t===i)this.cacheManager.removeItem(this.telemetryCacheKey);else{const r=new sW;r.failedRequests=e.failedRequests.slice(t*2),r.errors=e.errors.slice(t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)}}static maxErrorsToSend(e){let t,i=0,r=0;const o=e.errors.length;for(t=0;t<o;t++){const s=e.failedRequests[2*t]||St.EMPTY_STRING,a=e.failedRequests[2*t+1]||St.EMPTY_STRING,l=e.errors[t]||St.EMPTY_STRING;if(r+=s.toString().length+a.toString().length+l.length+3,r<ld.MAX_LAST_HEADER_BYTES)i+=1;else break}return i}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||St.EMPTY_STRING),e.push(this.regionSource||St.EMPTY_STRING),e.push(this.regionOutcome||St.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}}/*! @azure/msal-common v14.3.0 2023-10-30 */class pLe{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class JKt{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:HKt.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new pLe}}startPerformanceMeasurement(){return new pLe}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const nve="pkce_not_created",Wze="crypto_nonexistent",Yq="empty_navigate_uri",Qq="hash_empty_error",zze="no_state_in_hash",ive="hash_does_not_contain_known_properties",Uze="unable_to_parse_state",jze="state_interaction_type_mismatch",qze="interaction_in_progress",Kze="popup_window_error",Gze="empty_window_error",VT="user_cancelled",Yze="monitor_popup_timeout",Qze="monitor_window_timeout",Xze="redirect_in_iframe",Zze="block_iframe_reload",Jze="block_nested_popups",eGt="iframe_closed_prematurely",Xq="silent_logout_unsupported",eUe="no_account_error",tUe="silent_prompt_value_error",nUe="no_token_request_cache_error",iUe="unable_to_parse_token_request_cache_error",rve="no_cached_authority_error",tGt="auth_request_not_set_error",nGt="invalid_cache_type",rUe="non_browser_environment",C2="database_not_open",lW="no_network_connectivity",oUe="post_request_failed",sUe="get_request_failed",zse="failed_to_parse_response",__="unable_to_load_token",ove="crypto_key_not_found",aUe="auth_code_required",lUe="auth_code_or_nativeAccountId_required",cUe="spa_code_and_nativeAccountId_present",sve="database_unavailable",uUe="unable_to_acquire_token_from_native_platform",dUe="native_handshake_timeout",hUe="native_extension_not_installed",GF="native_connection_not_established",fUe="uninitialized_public_client_application",pUe="native_prompt_not_supported",gUe="invalid_base64_string";/*! @azure/msal-browser v3.4.0 2023-10-30 */const G0="For more visit: aka.ms/msaljs/browser-errors",iGt={[nve]:"The PKCE code challenge and verifier could not be generated.",[Wze]:"The crypto object or function is not available.",[Yq]:"Navigation URI is empty. Please check stack trace for more info.",[Qq]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${G0}`,[zze]:"Hash does not contain state. Please verify that the request originated from msal.",[ive]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${G0}`,[Uze]:"Unable to parse state. Please verify that the request originated from msal.",[jze]:"Hash contains state but the interaction type does not match the caller.",[qze]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${G0}`,[Kze]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Gze]:"window.open returned null or undefined window object.",[VT]:"User cancelled the flow.",[Yze]:`Token acquisition in popup failed due to timeout. ${G0}`,[Qze]:`Token acquisition in iframe failed due to timeout. ${G0}`,[Xze]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Zze]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${G0}`,[Jze]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[eGt]:"The iframe being monitored was closed prematurely.",[Xq]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[eUe]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[tUe]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[nUe]:"No token request found in cache.",[iUe]:"The cached token request could not be parsed.",[rve]:"No cached authority found.",[tGt]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[nGt]:"Invalid cache type",[rUe]:"Login and token requests are not supported in non-browser environments.",[C2]:"Database is not open!",[lW]:"No network connectivity. Check your internet connection.",[oUe]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[sUe]:"Network request failed. Please check the network trace to determine root cause.",[zse]:"Failed to parse network response. Check network trace.",[__]:"Error loading token to cache.",[ove]:"Cryptographic Key or Keypair not found in browser storage.",[aUe]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[lUe]:"An authorization code or nativeAccountId must be provided to this flow.",[cUe]:"Request cannot contain both spa code and native account id.",[sve]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[uUe]:`Unable to acquire token from native platform. ${G0}`,[dUe]:"Timed out while attempting to establish connection to browser extension",[hUe]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[GF]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${G0}`,[fUe]:`You must call and await the initialize function before attempting to call any other MSAL API. ${G0}`,[pUe]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[gUe]:"Invalid base64 encoded string."};class YF extends Bl{constructor(e){super(e,iGt[e]),Object.setPrototypeOf(this,YF.prototype),this.name="BrowserAuthError"}}function fi(n){return new YF(n)}/*! @azure/msal-browser v3.4.0 2023-10-30 */const F_={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},lP={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},Hx={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Wu={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},gLe={GET:"GET",POST:"POST"},Os={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},J1={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},Q8={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ul={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var Mi;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(Mi||(Mi={}));const mLe={scopes:jF},mUe="jwk",Use="msal.db",rGt=1,oGt=`${Use}.keys`,Zg={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5};/*! @azure/msal-browser v3.4.0 2023-10-30 */function sGt(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function aGt(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function ave(){return window.parent!==window}function lGt(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${F_.POPUP_NAME_PREFIX}.`)===0}function Ry(){return window.location.href.split("?")[0].split("#")[0]}function cGt(){const e=new wr(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function AJ(){if(wr.hashContainsKnownProperties(window.location.hash)&&ave())throw fi(Zze)}function uGt(n,e){const t=ave();if(n===Mi.Redirect&&t&&!e)throw fi(Xze)}function dGt(){if(lGt())throw fi(Jze)}function hGt(n){if(!n)throw fi(rUe)}function _Le(n){if(!n)throw fi(fUe)}function _Ue(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class cW{navigateInternal(e,t){return cW.defaultNavigateWindow(e,t)}navigateExternal(e,t){return cW.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(i=>{setTimeout(()=>{i(!0)},t.timeout)})}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class fGt{async sendGetRequestAsync(e,t){let i;try{i=await fetch(e,{method:gLe.GET,headers:this.getFetchHeaders(t)})}catch{throw window.navigator.onLine?fi(sUe):fi(lW)}try{return{headers:this.getHeaderDict(i.headers),body:await i.json(),status:i.status}}catch{throw fi(zse)}}async sendPostRequestAsync(e,t){const i=t&&t.body||St.EMPTY_STRING;let r;try{r=await fetch(e,{method:gLe.POST,headers:this.getFetchHeaders(t),body:i})}catch{throw window.navigator.onLine?fi(oUe):fi(lW)}try{return{headers:this.getHeaderDict(r.headers),body:await r.json(),status:r.status}}catch{throw fi(zse)}}getFetchHeaders(e){const t=new Headers;if(!(e&&e.headers))return t;const i=e.headers;return Object.keys(i).forEach(r=>{t.append(r,i[r])}),t}getHeaderDict(e){const t={};return e.forEach((i,r)=>{t[r]=i}),t}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const pGt=6e4,jse=6e3,gGt=3e4,mGt=2e3;function _Gt({auth:n,cache:e,system:t,telemetry:i},r){const o={clientId:St.EMPTY_STRING,authority:`${St.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:St.EMPTY_STRING,authorityMetadata:St.EMPTY_STRING,redirectUri:St.EMPTY_STRING,postLogoutRedirectUri:St.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Gy.AAD,OIDCOptions:{serverResponseType:qF.FRAGMENT,defaultScopes:[St.OPENID_SCOPE,St.PROFILE_SCOPE,St.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:j_e.None,tenant:St.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1},s={cacheLocation:Wu.SessionStorage,temporaryCacheLocation:Wu.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Wu.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:Ou.Info,piiLoggingEnabled:!1},c={...{...Pze,loggerOptions:a,networkClient:r?new fGt:XKt,navigationClient:new cW,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||pGt,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||jse,navigateFrameWait:0,redirectNavigationTimeout:gGt,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||mGt,pollIntervalMilliseconds:F_.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},u={application:{appName:St.EMPTY_STRING,appVersion:St.EMPTY_STRING},client:new JKt};if((n==null?void 0:n.protocolMode)!==Gy.OIDC&&(n!=null&&n.OIDCOptions)&&new FT(c.loggerOptions).warning(JSON.stringify(xa(Dze))),n!=null&&n.protocolMode&&n.protocolMode!==Gy.AAD&&(c!=null&&c.allowNativeBroker))throw xa(Aze);return{auth:{...o,...n,OIDCOptions:{...o.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...s,...e},system:c,telemetry:{...u,...i}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const vGt="@azure/msal-browser",lve="3.4.0";/*! @azure/msal-browser v3.4.0 2023-10-30 */class bGt{constructor(e){this.browserEnvironment=typeof window<"u",this.config=_Gt(e,this.browserEnvironment),this.logger=new FT(this.config.system.loggerOptions,vGt,lve),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class HT extends bGt{getModuleName(){return HT.MODULE_NAME}getId(){return HT.ID}async initialize(){return this.available=typeof window<"u",this.available}}HT.MODULE_NAME="";HT.ID="StandardOperatingContext";async function yGt(n){const e=new HT(n);return await e.initialize(),await(await ne(()=>Promise.resolve().then(()=>aYt),void 0)).StandardController.createController(e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */function NJ(n){return encodeURIComponent(cve(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function uW(n){return vUe(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function cve(n){return vUe(new TextEncoder().encode(n))}function vUe(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */function xw(n){return new TextDecoder().decode(CGt(n))}function CGt(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw fi(gUe)}const t=atob(e);return Uint8Array.from(t,i=>i.codePointAt(0)||0)}/*! @azure/msal-browser v3.4.0 2023-10-30 */const wGt="RSASSA-PKCS1-v1_5",bUe="SHA-256",SGt=2048,EGt=new Uint8Array([1,0,1]),uve={name:wGt,hash:bUe,modulusLength:SGt,publicExponent:EGt};function xGt(n){if("crypto"in window)n.verbose("BrowserCrypto: modern crypto interface available");else throw n.error("BrowserCrypto: crypto interface is unavailable"),fi(Wze)}async function yUe(n,e,t){e==null||e.addQueueMeasurement(Lt.Sha256Digest,t);const r=new TextEncoder().encode(n);return window.crypto.subtle.digest(bUe,r)}function TGt(n){return window.crypto.getRandomValues(n)}function uS(){return window.crypto.randomUUID()}async function kGt(n,e){return window.crypto.subtle.generateKey(uve,n,e)}async function RJ(n){return window.crypto.subtle.exportKey(mUe,n)}async function IGt(n,e,t){return window.crypto.subtle.importKey(mUe,n,uve,e,t)}async function LGt(n,e){return window.crypto.subtle.sign(uve,n,e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class DGt{constructor(){this.dbName=Use,this.version=rGt,this.tableName=oGt,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const i=window.indexedDB.open(this.dbName,this.version);i.addEventListener("upgradeneeded",r=>{r.target.result.createObjectStore(this.tableName)}),i.addEventListener("success",r=>{const o=r;this.db=o.target.result,this.dbOpen=!0,e()}),i.addEventListener("error",()=>t(fi(sve)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return await this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(fi(C2));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const l=a;this.closeConnection(),t(l.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((i,r)=>{if(!this.db)return r(fi(C2));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);a.addEventListener("success",()=>{this.closeConnection(),i()}),a.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(fi(C2));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),t()}),s.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(fi(C2));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();o.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),o.addEventListener("error",s=>{this.closeConnection(),t(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(fi(C2));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const l=a;this.closeConnection(),t(l.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const i=window.indexedDB.deleteDatabase(Use);i.addEventListener("success",()=>e(!0)),i.addEventListener("blocked",()=>e(!0)),i.addEventListener("error",()=>t(!1))})}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class qse{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,i)=>{e.push(i)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class vLe{constructor(e,t){this.inMemoryCache=new qse,this.indexedDBCache=new DGt,this.logger=e,this.storeName=t}handleDatabaseAccessError(e){if(e instanceof YF&&e.errorCode===sve)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(i){this.handleDatabaseAccessError(i)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(i){this.handleDatabaseAccessError(i)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(i){this.handleDatabaseAccessError(i)}return t}clearInMemory(){this.logger.verbose(`Deleting in-memory keystore ${this.storeName}`),this.inMemoryCache.clear(),this.logger.verbose(`In-memory keystore ${this.storeName} deleted`)}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const bLe={asymmetricKeys:"asymmetricKeys",symmetricKeys:"symmetricKeys"};class AGt{constructor(e){this.logger=e,this.asymmetricKeys=new vLe(this.logger,bLe.asymmetricKeys),this.symmetricKeys=new vLe(this.logger,bLe.symmetricKeys)}async clear(){this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory();try{return await this.asymmetricKeys.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class aA{constructor(e,t){this.logger=e,xGt(e),this.cache=new AGt(this.logger),this.performanceClient=t}createNewGuid(){return uS()}base64Encode(e){return cve(e)}base64Decode(e){return xw(e)}async getPublicKeyThumbprint(e){var u;const t=(u=this.performanceClient)==null?void 0:u.startMeasurement(Lt.CryptoOptsGetPublicKeyThumbprint,e.correlationId),i=await kGt(aA.EXTRACTABLE,aA.POP_KEY_USAGES),r=await RJ(i.publicKey),o={e:r.e,kty:r.kty,n:r.n},s=yLe(o),a=await this.hashString(s),l=await RJ(i.privateKey),c=await IGt(l,!1,["sign"]);return await this.cache.asymmetricKeys.setItem(a,{privateKey:c,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.asymmetricKeys.removeItem(e),!await this.cache.asymmetricKeys.containsKey(e)}async clearKeystore(){return await this.cache.clear()}async signJwt(e,t,i){var b;const r=(b=this.performanceClient)==null?void 0:b.startMeasurement(Lt.CryptoOptsSignJwt,i),o=await this.cache.asymmetricKeys.getItem(t);if(!o)throw fi(ove);const s=await RJ(o.publicKey),a=yLe(s),l=NJ(JSON.stringify({kid:t})),c=tve.getShrHeaderString({kid:l,alg:s.alg}),u=NJ(c);e.cnf={jwk:JSON.parse(a)};const d=NJ(JSON.stringify(e)),h=`${u}.${d}`,g=new TextEncoder().encode(h),m=await LGt(o.privateKey,g),v=uW(new Uint8Array(m)),_=`${h}.${v}`;return r&&r.end({success:!0}),_}async hashString(e){const t=await yUe(e),i=new Uint8Array(t);return uW(i)}}aA.POP_KEY_USAGES=["sign","verify"];aA.EXTRACTABLE=!0;function yLe(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.4.0 2023-10-30 */const CUe="storage_not_supported",NGt="stubbed_public_client_application_called",wUe="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.4.0 2023-10-30 */const RGt={[CUe]:"Given storage configuration option was not supported.",[NGt]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[wUe]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class dve extends Bl{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,dve.prototype)}}function SUe(n){return new dve(n,RGt[n])}/*! @azure/msal-browser v3.4.0 2023-10-30 */class CLe{constructor(e){this.validateWindowStorage(e),this.windowStorage=window[e]}validateWindowStorage(e){if(e!==Wu.LocalStorage&&e!==Wu.SessionStorage||!window[e])throw SUe(CUe)}getItem(e){return this.windowStorage.getItem(e)}setItem(e,t){this.windowStorage.setItem(e,t)}removeItem(e){this.windowStorage.removeItem(e)}getKeys(){return Object.keys(this.windowStorage)}containsKey(e){return this.windowStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class EUe{static extractBrowserRequestState(e,t){if(!t)return null;try{return av.parseRequestState(e,t).libraryState.meta}catch{throw Nn(rA)}}static parseServerResponseFromHash(e){if(!e)return{};const t=new wr(e);return wr.getDeserializedHash(t.getHash())}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Kse extends kC{constructor(e,t,i,r,o){super(e,i,r,o),this.COOKIE_LIFE_MULTIPLIER=24*60*60*1e3,this.cacheConfig=t,this.logger=r,this.internalStorage=new qse,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation,this.cacheConfig.cacheLocation),t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps())}setupBrowserStorage(e){switch(e){case Wu.LocalStorage:case Wu.SessionStorage:try{return new CLe(e)}catch(t){this.logger.verbose(t);break}}return this.cacheConfig.cacheLocation=Wu.MemoryStorage,new qse}setupTemporaryCacheStorage(e,t){switch(t){case Wu.LocalStorage:case Wu.SessionStorage:try{return new CLe(e||Wu.SessionStorage)}catch(i){return this.logger.verbose(i),this.internalStorage}case Wu.MemoryStorage:default:return this.internalStorage}}migrateCacheEntries(){const e=`${St.CACHE_PREFIX}.${sd.ID_TOKEN}`,t=`${St.CACHE_PREFIX}.${sd.CLIENT_INFO}`,i=`${St.CACHE_PREFIX}.${sd.ERROR}`,r=`${St.CACHE_PREFIX}.${sd.ERROR_DESC}`,o=this.browserStorage.getItem(e),s=this.browserStorage.getItem(t),a=this.browserStorage.getItem(i),l=this.browserStorage.getItem(r),c=[o,s,a,l];[sd.ID_TOKEN,sd.CLIENT_INFO,sd.ERROR,sd.ERROR_DESC].forEach((d,h)=>this.migrateCacheEntry(d,c[h]))}migrateCacheEntry(e,t){t&&this.setTemporaryCache(e,t,!0)}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(J1.ACCOUNT_KEYS),t=this.getItem(`${J1.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(r=>{if(this.isCredentialKey(r)){const o=this.getItem(r);if(o){const s=this.validateAndParseJson(o);if(s&&s.hasOwnProperty("credentialType"))switch(s.credentialType){case Or.ID_TOKEN:if(sLe(s)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${r} found, saving key to token key map`);const a=s,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,Or.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${r}`);break;case Or.ACCESS_TOKEN:case Or.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(oLe(s)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${r} found, saving key to token key map`);const a=s,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,Or.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${r}`);break;case Or.REFRESH_TOKEN:if(aLe(s)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${r} found, saving key to token key map`);const a=s,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,Or.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${r}`);break}}}if(this.isAccountKey(r)){const o=this.getItem(r);if(o){const s=this.validateAndParseJson(o);s&&kc.isAccountEntity(s)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${r} found, saving key to account key map`),this.addAccountKeyToMap(r))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e){this.logger.trace("BrowserCacheManager.getAccount called");const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const i=this.validateAndParseJson(t);return!i||!kc.isAccountEntity(i)?(this.removeAccountKeyFromMap(e),null):kC.toObject(new kc,i)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(J1.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(J1.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),i=t.indexOf(e);i>-1?(t.splice(i,1),this.setItem(J1.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,Or.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,Or.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,Or.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${J1.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const i=this.getTokenKeys();switch(t){case Or.ID_TOKEN:i.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(e));break;case Or.ACCESS_TOKEN:i.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(e));break;case Or.REFRESH_TOKEN:i.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),i.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Nn(Bse)}this.setItem(`${J1.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const i=this.getTokenKeys();switch(t){case Or.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const r=i.idToken.indexOf(e);r>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),i.idToken.splice(r,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case Or.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const o=i.accessToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),i.accessToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case Or.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const s=i.refreshToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),i.refreshToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Nn(Bse)}this.setItem(`${J1.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,Or.ID_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!sLe(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,Or.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=Q2(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,Or.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,Or.ACCESS_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!oLe(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,Or.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=Q2(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,Or.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,Or.REFRESH_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!aLe(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,Or.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=Q2(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,Or.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return!i||!sA.isAppMetadataEntity(e,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),kC.toObject(new sA,i))}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const i=this.validateAndParseJson(t);return!i||!sW.isServerTelemetryEntity(e,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),kC.toObject(new sW,i))}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&Hse.isAuthorityMetadataEntity(e,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),kC.toObject(new Hse,i)):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Q8.WRAPPER_SKU,e),this.internalStorage.setItem(Q8.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Q8.WRAPPER_SKU)||St.EMPTY_STRING,t=this.internalStorage.getItem(Q8.WRAPPER_VER)||St.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(sd.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const r=this.generateCacheKey(sd.ACTIVE_ACCOUNT),o=this.getItem(r);if(!o)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const s=this.getAccountInfoFilteredBy({localAccountId:o});return s?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(s),s):null}const i=this.validateAndParseJson(t);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(sd.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(sd.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const r={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId};this.browserStorage.setItem(t,JSON.stringify(r)),this.browserStorage.setItem(i,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(i)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const i=this.validateAndParseJson(t);return!i||!hLe.isThrottlingEntity(e,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),kC.toObject(new hLe,i))}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const i=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const o=this.getItemCookie(i);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}const r=this.temporaryCacheStorage.getItem(i);if(!r){if(this.cacheConfig.cacheLocation===Wu.LocalStorage){const o=this.browserStorage.getItem(i);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),o}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),r}setTemporaryCache(e,t,i){const r=i?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(r,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(r,t))}removeItem(e){this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e))}containsKey(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)}getKeys(){return[...this.browserStorage.getKeys(),...this.temporaryCacheStorage.getKeys()]}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.getKeys().forEach(e=>{(this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e))&&(e.indexOf(St.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e){e.addQueueMeasurement(Lt.ClearTokensAndKeysWithClaims);const t=this.getTokenKeys(),i=[];t.accessToken.forEach(r=>{const o=this.getAccessTokenCredential(r);o!=null&&o.requestedClaimsHash&&r.includes(o.requestedClaimsHash.toLowerCase())&&i.push(this.removeAccessToken(r))}),await Promise.all(i),i.length>0&&this.logger.warning(`${i.length} access tokens with claims in the cache keys have been removed from the cache.`)}setItemCookie(e,t,i){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(i){const o=this.getCookieExpirationTime(i);r+=`expires=${o};`}this.cacheConfig.secureCookies&&(r+="Secure;"),document.cookie=r}getItemCookie(e){const t=`${encodeURIComponent(e)}=`,i=document.cookie.split(";");for(let r=0;r<i.length;r++){let o=i[r];for(;o.charAt(0)===" ";)o=o.substring(1);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}return St.EMPTY_STRING}clearMsalCookies(){const e=`${St.CACHE_PREFIX}.${this.clientId}`;document.cookie.split(";").forEach(i=>{for(;i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(e)===0){const r=i.split("=")[0];this.clearItemCookie(r)}})}clearItemCookie(e){this.setItemCookie(e,St.EMPTY_STRING,-1)}getCookieExpirationTime(e){const t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()}getCache(){return this.browserStorage}setCache(){}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Bp.startsWith(e,St.CACHE_PREFIX)||Bp.startsWith(e,sd.ADAL_ID_TOKEN)?e:`${St.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=av.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Os.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=av.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Os.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=av.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Os.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),i=this.getTemporaryCache(t);if(!i)return null;const r=this.generateAuthorityKey(i);return this.getTemporaryCache(r)}updateCacheEntries(e,t,i,r,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const s=this.generateStateKey(e);this.setTemporaryCache(s,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);const l=this.generateAuthorityKey(e);if(this.setTemporaryCache(l,i,!1),o){const c={credential:o.homeAccountId,type:Gp.HOME_ACCOUNT_ID};this.setTemporaryCache(Os.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(r){const c={credential:r,type:Gp.UPN};this.setTemporaryCache(Os.CCS_CREDENTIAL,JSON.stringify(c),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeItem(t)}),this.removeItem(this.generateStateKey(e)),this.removeItem(this.generateNonceKey(e)),this.removeItem(this.generateAuthorityKey(e))),this.removeItem(this.generateCacheKey(Os.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(Os.ORIGIN_URI)),this.removeItem(this.generateCacheKey(Os.URL_HASH)),this.removeItem(this.generateCacheKey(Os.CORRELATION_ID)),this.removeItem(this.generateCacheKey(Os.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(Os.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),i=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i||St.EMPTY_STRING)}this.clearMsalCookies()}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(t=>{if(t.indexOf(Os.REQUEST_STATE)===-1)return;const i=this.temporaryCacheStorage.getItem(t);if(!i)return;const r=EUe.extractBrowserRequestState(this.cryptoImpl,i);r&&r.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i))}),this.clearMsalCookies(),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=cve(JSON.stringify(e));this.setTemporaryCache(Os.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Os.REQUEST_PARAMS,!0);if(!t)throw fi(nUe);let i;try{i=JSON.parse(xw(t))}catch(r){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${r}`),fi(iUe)}if(this.removeItem(this.generateCacheKey(Os.REQUEST_PARAMS)),!i.authority){const r=this.generateAuthorityKey(e),o=this.getTemporaryCache(r);if(!o)throw fi(rve);i.authority=o}return i}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Os.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${St.CACHE_PREFIX}.${Os.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${St.CACHE_PREFIX}.${Os.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw fi(qze);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(sd.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(sd.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(sd.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(sd.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const i=t||e;if(i){const r=lS(i,xw);if(r.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),r.preferred_username;if(r.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),r.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const i=Q2(t);if(e!==i){const r=this.getItem(e);if(r)return this.removeItem(e),this.setItem(i,r),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),i;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}getRedirectRequestContext(){return this.getTemporaryCache(Os.REDIRECT_CONTEXT,!0)}setRedirectRequestContext(e){this.setTemporaryCache(Os.REDIRECT_CONTEXT,e,!0)}async hydrateCache(e,t){var a,l,c,u,d;const i=jq((a=e.account)==null?void 0:a.homeAccountId,(l=e.account)==null?void 0:l.environment,e.idToken,this.clientId,e.tenantId);let r;t.claims&&(r=await this.cryptoImpl.hashString(t.claims));const o=qq((c=e.account)==null?void 0:c.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),((u=e.expiresOn)==null?void 0:u.getTime())||0,((d=e.extExpiresOn)==null?void 0:d.getTime())||0,xw,void 0,e.tokenType,void 0,t.sshKid,t.claims,r),s=new WL(void 0,i,o);return this.saveCacheRecord(s)}}const OGt=(n,e)=>{const t={cacheLocation:Wu.MemoryStorage,temporaryCacheLocation:Wu.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new Kse(n,t,iW,e)};/*! @azure/msal-browser v3.4.0 2023-10-30 */const zr={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.4.0 2023-10-30 */class PGt{constructor(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}addEventCallback(e){if(typeof window<"u"){const t=uS();return this.eventCallbacks.set(t,e),this.logger.verbose(`Event callback registered with id: ${t}`),t}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}emitEvent(e,t,i,r){if(typeof window<"u"){const o={eventType:e,interactionType:t||null,payload:i||null,error:r||null,timestamp:Date.now()};this.logger.info(`Emitting event: ${e}`),this.eventCallbacks.forEach((s,a)=>{this.logger.verbose(`Emitting event to callback ${a}: ${e}`),s.apply(null,[o])})}}handleAccountCacheChange(e){try{const t=e.newValue||e.oldValue;if(!t)return;const i=JSON.parse(t);if(typeof i!="object"||!kc.isAccountEntity(i))return;const o=kC.toObject(new kc,i).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(zr.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(zr.ACCOUNT_REMOVED,void 0,o))}catch{return}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class xUe{constructor(e,t,i,r,o,s,a,l,c){this.config=e,this.browserStorage=t,this.browserCrypto=i,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=s,this.nativeMessageHandler=l,this.correlationId=c||uS(),this.logger=r.clone(F_.MSAL_SKU,lve,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){kc.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(kc.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}async initializeBaseRequest(e,t){this.performanceClient.addQueueMeasurement(Lt.InitializeBaseRequest,e.correlationId);const i=e.authority||this.config.auth.authority;t&&await this.validateRequestAuthority(i,t);const r=[...e&&e.scopes||[]],o={...e,correlationId:this.correlationId,authority:i,scopes:r};if(!o.authenticationScheme)o.authenticationScheme=Ea.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(o.authenticationScheme===Ea.SSH){if(!e.sshJwk)throw xa(Kq);if(!e.sshKid)throw xa(Lze)}this.logger.verbose(`Authentication Scheme set to "${o.authenticationScheme}" as configured in Auth request`)}return this.config.cache.claimsBasedCachingEnabled&&e.claims&&!Bp.isEmptyObj(e.claims)&&(o.requestedClaimsHash=await this.browserCrypto.hashString(e.claims)),o}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri||Ry();return wr.getAbsoluteUrl(t,Ry())}async validateRequestAuthority(e,t){if(!(await this.getDiscoveredAuthority(e)).isAlias(t.environment))throw xa(Nze)}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const i={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new aW(i,this.browserStorage)}async getDiscoveredAuthority(e){this.logger.verbose("getDiscoveredAuthority called");const t={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata};return e?(this.logger.verbose("Creating discovered authority with request authority"),await BT.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t,this.logger)):(this.logger.verbose("Creating discovered authority with configured authority"),await BT.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger))}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const MGt=32;async function FGt(n,e,t){n.addQueueMeasurement(Lt.GeneratePkceCodes,t);const i=KF(BGt,Lt.GenerateCodeVerifier,e,n,t)(n,e,t),r=await ri($Gt,Lt.GenerateCodeChallengeFromVerifier,e,n,t)(i,n,e,t);return{verifier:i,challenge:r}}function BGt(n,e,t){try{const i=new Uint8Array(MGt);return KF(TGt,Lt.GetRandomValues,e,n,t)(i),uW(i)}catch{throw fi(nve)}}async function $Gt(n,e,t,i){e.addQueueMeasurement(Lt.GenerateCodeChallengeFromVerifier,i);try{const r=await ri(yUe,Lt.Sha256Digest,t,e,i)(n,e,i);return uW(new Uint8Array(r))}catch{throw fi(nve)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class VN extends xUe{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,e.correlationId);const t=await ri(FGt,Lt.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),i={...e,redirectUri:e.redirectUri,code:St.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=St.S256_CODE_CHALLENGE_METHOD,i}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||uS(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const i=this.getLogoutHintFromIdTokenClaims(e.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=i)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=wr.getAbsoluteUrl(e.postLogoutRedirectUri,Ry())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=wr.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Ry())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=wr.getAbsoluteUrl(Ry(),Ry())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e,t,i){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const r=await ri(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new $ze(r,this.performanceClient)}async getClientConfiguration(e,t,i){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientGetClientConfiguration,this.correlationId);const r=await ri(this.getDiscoveredAuthority.bind(this),Lt.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)(t,i),o=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:r,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:o.loggerCallback,piiLoggingEnabled:o.piiLoggingEnabled,logLevel:o.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:e,libraryInfo:{sku:F_.MSAL_SKU,version:lve,cpu:St.EMPTY_STRING,os:St.EMPTY_STRING},telemetry:this.config.telemetry}}validateAndExtractStateFromHash(e,t,i){if(this.logger.verbose("validateAndExtractStateFromHash called",i),!e.state)throw fi(zze);const r=EUe.extractBrowserRequestState(this.browserCrypto,e.state);if(!r)throw fi(Uze);if(r.interactionType!==t)throw fi(jze);return this.logger.verbose("Returning state from hash",i),e.state}async getDiscoveredAuthority(e,t){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const i={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},r=e||this.config.auth.authority,o=eh.generateAuthority(r,t||this.config.auth.azureCloudOptions);return await ri(BT.createDiscoveredInstance.bind(BT),Lt.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(o,this.config.system.networkClient,this.browserStorage,i,this.logger,this.performanceClient,this.correlationId)}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const i=this.getRedirectUri(e.redirectUri),r={interactionType:t},o=av.setRequestState(this.browserCrypto,e&&e.state||St.EMPTY_STRING,r),a={...await ri(this.initializeBaseRequest.bind(this),Lt.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)(e),redirectUri:i,state:o,nonce:e.nonce||uS(),responseMode:this.config.auth.OIDCOptions.serverResponseType},l=e.account||this.browserStorage.getActiveAccount();if(l&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${l.homeAccountId}`,this.correlationId),a.account=l),!a.loginHint&&!l){const c=this.browserStorage.getLegacyLoginHint();c&&(a.loginHint=c)}return a}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const VGt="ContentError",TUe="user_switch";/*! @azure/msal-browser v3.4.0 2023-10-30 */const HGt="USER_INTERACTION_REQUIRED",WGt="USER_CANCEL",zGt="NO_NETWORK",UGt="PERSISTENT_ERROR",jGt="DISABLED",qGt="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.4.0 2023-10-30 */const KGt=-2147186943,GGt={[TUe]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class wy extends Bl{constructor(e,t,i){super(e,t),Object.setPrototypeOf(this,wy.prototype),this.name="NativeAuthError",this.ext=i}}function w2(n){if(n.ext&&n.ext.status&&(n.ext.status===UGt||n.ext.status===jGt)||n.ext&&n.ext.error&&n.ext.error===KGt)return!0;switch(n.errorCode){case VGt:return!0;default:return!1}}function Gse(n,e,t){if(t&&t.status)switch(t.status){case qGt:return Bze(Fze);case HGt:return new Kb(n,e);case WGt:return fi(VT);case zGt:return fi(lW)}return new wy(n,GGt[n]||e,t)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class kUe extends VN{async acquireToken(e){this.performanceClient.addQueueMeasurement(Lt.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(ul.acquireTokenSilent_silentFlow),i=await this.createSilentFlowClient(t,e.authority,e.azureCloudOptions);this.logger.verbose("Silent auth client created");try{const o=(await ri(i.acquireCachedToken.bind(i),Lt.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(r){throw r instanceof YF&&r.errorCode===ove&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),r}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}async createSilentFlowClient(e,t,i){const r=await ri(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new QKt(r,this.performanceClient)}async initializeSilentRequest(e,t){this.performanceClient.addQueueMeasurement(Lt.InitializeSilentRequest,this.correlationId);const i=await ri(this.initializeBaseRequest.bind(this),Lt.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)(e,t);return{...e,...i,account:t,forceRefresh:e.forceRefresh||!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const OJ={BROKER_CLIENT_ID:"brk_client_id",BROKER_REDIRECT_URI:"brk_redirect_uri"};class zL extends xUe{constructor(e,t,i,r,o,s,a,l,c,u,d,h){super(e,t,i,r,o,s,l,c,h),this.apiId=a,this.accountId=u,this.nativeMessageHandler=c,this.nativeStorageManager=d,this.silentCacheClient=new kUe(e,this.nativeStorageManager,i,r,o,s,l,c,h)}async acquireToken(e){this.performanceClient.addQueueMeasurement(Lt.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(Lt.NativeInteractionClientAcquireToken,e.correlationId),i=Wh.nowSeconds(),r=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,r);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const o={method:Hx.GetToken,request:r},s=await this.nativeMessageHandler.sendMessage(o),a=this.validateNativeResponse(s);return this.handleNativeResponse(a,r,i).then(l=>(t.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),l)).catch(l=>{throw t.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:jc.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),Nn(Mse);const i=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!i)throw Nn(Mse);try{const r=this.createSilentCacheRequest(t,i),o=await this.silentCacheClient.acquireToken(r),s={...i,idTokenClaims:o==null?void 0:o.idTokenClaims};return{...o,account:s}}catch(r){throw r}}async acquireTokenRedirect(e){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const t=await this.initializeNativeRequest(e),i={method:Hx.GetToken,request:t};try{const s=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(s)}catch(s){if(s instanceof wy&&w2(s))throw s}this.browserStorage.setTemporaryCache(Os.NATIVE_REQUEST,JSON.stringify(t),!0);const r={apiId:ul.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);await this.navigationClient.navigateExternal(o,r)}async handleRedirectPromise(){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const e=this.browserStorage.getCachedNativeRequest();if(!e)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),null;const{prompt:t,...i}=e;t&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Os.NATIVE_REQUEST));const r={method:Hx.GetToken,request:i},o=Wh.nowSeconds();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const s=await this.nativeMessageHandler.sendMessage(r);this.validateNativeResponse(s);const a=this.handleNativeResponse(s,i,o);return this.browserStorage.setInteractionInProgress(!1),a}catch(s){throw this.browserStorage.setInteractionInProgress(!1),s}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,i){if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),e.account.id!==t.accountId)throw Gse(TUe);const r=await this.getDiscoveredAuthority(t.authority),o=lS(e.id_token,xw),s=this.createHomeAccountIdentifier(e,o),a=kc.createAccount({homeAccountId:s,idTokenClaims:o,clientInfo:e.client_info,nativeAccountId:e.account.id},r),l=await this.generateAuthenticationResult(e,t,o,a,r.canonicalAuthority,i);return this.cacheAccount(a),this.cacheNativeTokens(e,t,s,o,l.accessToken,l.tenantId,i),l}createHomeAccountIdentifier(e,t){return kc.generateHomeAccountId(e.client_info||St.EMPTY_STRING,D_.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?jc.fromString(e.scope):jc.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Ea.POP){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const i=new oA(this.browserCrypto),r={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw Nn(z_e);return await i.signPopToken(e.access_token,t.keyId,r)}else return e.access_token}async generateAuthenticationResult(e,t,i,r,o,s){const a=this.addTelemetryFromNativeResponse(e),l=e.scope?jc.fromString(e.scope):jc.fromString(t.scope),c=e.account.properties||{},u=c.UID||i.oid||i.sub||St.EMPTY_STRING,d=c.TenantId||i.tid||St.EMPTY_STRING,f=(i?Object.assign(new kc,{...r,idTokenClaims:i}):r).getAccountInfo(),g=await this.generatePopAccessToken(e,t),m=t.tokenType===Ea.POP?Ea.POP:Ea.BEARER;return{authority:o,uniqueId:u,tenantId:d,scopes:l.asArray(),account:f,idToken:e.id_token,idTokenClaims:i,accessToken:g,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:new Date(Number(s+e.expires_in)*1e3),tokenType:m,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,i,r,o,s,a){const l=jq(i,t.authority,e.id_token||"",t.clientId,r.tid||""),c=t.tokenType===Ea.POP?St.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=a+c,d=this.generateScopes(e,t),h=qq(i,t.authority,o,t.clientId,r.tid||s,d.printScopes(),u,0,xw),f=new WL(void 0,l,h);this.nativeStorageManager.saveCacheRecord(f,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw eze(F_e,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.validateRequestAuthority(t,e.account);const i=new wr(t);i.validateAsUri();const{scopes:r,...o}=e,s=new jc(r||[]);s.appendScopes(jF);const a=()=>{switch(this.apiId){case ul.ssoSilent:case ul.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),ah.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case ah.NONE:case ah.CONSENT:case ah.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),fi(pUe)}},l={...o,accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1};if(this.handleExtraBrokerParams(l),l.extraParameters=l.extraParameters||{},l.extraParameters.telemetry=lP.MATS_TELEMETRY,e.authenticationScheme===Ea.POP){const c={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new oA(this.browserCrypto),d=await ri(u.generateCnf.bind(u),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,this.correlationId)(c,this.logger);l.reqCnf=d.reqCnfHash,l.keyId=d.kid}return l}handleExtraBrokerParams(e){if(e.extraParameters&&e.extraParameters.hasOwnProperty(OJ.BROKER_CLIENT_ID)&&e.extraParameters.hasOwnProperty(OJ.BROKER_REDIRECT_URI)&&e.extraParameters.hasOwnProperty(Wr.CLIENT_ID)){const t=e.extraParameters[Wr.CLIENT_ID],i=e.redirectUri,r=e.extraParameters[OJ.BROKER_REDIRECT_URI];e.extraParameters={child_client_id:t,child_redirect_uri:i},e.redirectUri=r}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Ib{constructor(e,t,i,r){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=r,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=i,this.handshakeEvent=i.startMeasurement(Lt.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:lP.CHANNEL_ID,extensionId:this.extensionId,responseId:uS(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((i,r)=>{this.resolvers.set(t.responseId,{resolve:i,reject:r})})}static async createProvider(e,t,i){e.trace("NativeMessageHandler - createProvider called.");try{const r=new Ib(e,t,i,lP.PREFERRED_EXTENSION_ID);return await r.sendHandshakeRequest(),r}catch{const o=new Ib(e,t,i);return await o.sendHandshakeRequest(),o}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:lP.CHANNEL_ID,extensionId:this.extensionId,responseId:uS(),body:{method:Hx.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,i)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:i}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),i(fi(dUe)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==lP.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===Hx.HandshakeRequest){const i=this.handshakeResolvers.get(t.responseId);if(!i){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),i.reject(fi(hUe))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,i=this.resolvers.get(t.responseId),r=this.handshakeResolvers.get(t.responseId);try{const o=t.body.method;if(o===Hx.Response){if(!i)return;const s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")i.reject(Gse(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?i.reject(Gse(s.result.code,s.result.description,s.result.ext)):i.resolve(s.result);else throw eze(F_e,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(o===Hx.HandshakeResponse){if(!r){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),r.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(o){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${o}`),this.logger.errorPii(`Unable to parse ${e}`),i?i.reject(o):r&&r.reject(o)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,i,r){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!i)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(r)switch(r){case Ea.BEARER:case Ea.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class hve{constructor(e,t,i,r,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=r,this.performanceClient=o}async handleCodeResponseFromHash(e,t){if(this.performanceClient.addQueueMeasurement(Lt.HandleCodeResponseFromHash,t.correlationId),!e)throw fi(Qq);let i;try{i=this.authModule.handleFragmentResponse(e,t.state)}catch(r){throw r instanceof cS&&r.subError===VT?fi(VT):r}return ri(this.handleCodeResponseFromServer.bind(this),Lt.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(i,t)}async handleCodeResponseFromServer(e,t,i=!0){if(this.performanceClient.addQueueMeasurement(Lt.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await ri(this.authModule.updateAuthority.bind(this.authModule),Lt.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),i&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const o=this.createCcsCredentials(t);o&&(this.authCodeRequest.ccsCredential=o)}return await ri(this.authModule.acquireToken.bind(this.authModule),Lt.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Gp.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Gp.UPN}:null}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class YGt extends VN{constructor(e,t,i,r,o,s,a,l,c,u){super(e,t,i,r,o,s,a,c,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=l}acquireToken(e){try{const t=this.generatePopupName(e.scopes||jF,e.authority||this.config.auth.authority),i=e.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t,i);{this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");const r=this.openSizedPopup("about:blank",t,i);return this.acquireTokenPopupAsync(e,t,i,r)}}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),i=this.generateLogoutPopupName(t),r=e&&e.authority,o=e&&e.mainWindowRedirectUri,s=(e==null?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,i,s,r,void 0,o);{this.logger.verbose("asyncPopup set to false, opening popup");const a=this.openSizedPopup("about:blank",i,s);return this.logoutPopupAsync(t,i,s,r,a,o)}}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t,i,r){this.logger.verbose("acquireTokenPopupAsync called");const o=this.initializeServerTelemetryManager(ul.acquireTokenPopup),s=await ri(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Mi.Popup);_Ue(s.authority);try{const a=await ri(this.initializeAuthorizationCodeRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(s),l=await ri(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(o,s.authority,s.azureCloudOptions),c=Ib.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let u;c&&(u=this.performanceClient.startMeasurement(Lt.FetchAccountIdWithNativeBroker,e.correlationId));const d=await l.getAuthCodeUrl({...s,nativeBroker:c}),h=new hve(l,this.browserStorage,a,this.logger,this.performanceClient),f={popup:r,popupName:t,popupWindowAttributes:i},g=this.initiateAuthRequest(d,f);this.eventHandler.emitEvent(zr.POPUP_OPENED,Mi.Popup,{popupWindow:g},null);const m=await this.monitorPopupForHash(g),v=wr.getDeserializedHash(m);if(hb.removeThrottle(this.browserStorage,this.config.auth.clientId,a),v.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),u&&u.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw fi(GF);const b=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,v.accountId,this.nativeStorage,s.correlationId),{userRequestState:y}=av.parseRequestState(this.browserCrypto,s.state);return b.acquireToken({...s,state:y,prompt:void 0})}return await h.handleCodeResponseFromHash(m,s)}catch(a){throw r&&r.close(),a instanceof Bl&&(a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a)),a}}async logoutPopupAsync(e,t,i,r,o,s){var l,c;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(zr.LOGOUT_START,Mi.Popup,e);const a=this.initializeServerTelemetryManager(ul.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await ri(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(a,r);try{u.authority.endSessionEndpoint}catch{if((l=e.account)!=null&&l.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===Gy.OIDC){if(this.browserStorage.removeAccount((c=e.account)==null?void 0:c.homeAccountId),this.eventHandler.emitEvent(zr.LOGOUT_SUCCESS,Mi.Popup,e),s){const f={apiId:ul.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},g=wr.getAbsoluteUrl(s,Ry());await this.navigationClient.navigateInternal(g,f)}o&&o.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(zr.LOGOUT_SUCCESS,Mi.Popup,e);const h=this.openPopup(d,{popupName:t,popupWindowAttributes:i,popup:o});if(this.eventHandler.emitEvent(zr.POPUP_OPENED,Mi.Popup,{popupWindow:h},null),await this.waitForLogoutPopup(h),s){const f={apiId:ul.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},g=wr.getAbsoluteUrl(s,Ry());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${g}`),await this.navigationClient.navigateInternal(g,f)}else this.logger.verbose("No main window navigation requested")}catch(u){throw o&&o.close(),u instanceof Bl&&(u.setCorrelationId(this.correlationId),a.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(zr.LOGOUT_FAILURE,Mi.Popup,null,u),this.eventHandler.emitEvent(zr.LOGOUT_END,Mi.Popup),u}this.eventHandler.emitEvent(zr.LOGOUT_END,Mi.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),fi(Yq)}monitorPopupForHash(e){return new Promise((t,i)=>{const r=this.config.system.windowHashTimeout/this.config.system.pollIntervalMilliseconds;let o=0;this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),this.cleanPopup(),clearInterval(s),i(fi(VT));return}let a=St.EMPTY_STRING,l=St.EMPTY_STRING;try{a=e.location.href,l=this.extractServerResponseStringFromPopup(e,a)}catch{}!a||a==="about:blank"||(this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),o++,l?(this.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(s),this.cleanPopup(e),wr.hashContainsKnownProperties(l)?(this.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),t(l)):(this.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),this.logger.errorPii(`PopupHandler.monitorPopupForHash - hash found: ${l}`),i(fi(ive)))):o>r&&(this.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(s),i(fi(Yze))))},this.config.system.pollIntervalMilliseconds)})}waitForLogoutPopup(e){return new Promise(t=>{this.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");const i=setInterval(()=>{e.closed&&(this.logger.error("PopupHandler.waitForLogoutPopup - window closed"),this.cleanPopup(),clearInterval(i),t());let r=St.EMPTY_STRING;try{r=e.location.href}catch{}!r||r==="about:blank"||(this.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(i),this.cleanPopup(e),t())},this.config.system.pollIntervalMilliseconds)})}openPopup(e,t){try{let i;if(t.popup?(i=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),i.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),i=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!i)throw fi(Gze);return i.focus&&i.focus(),this.currentWindow=i,window.addEventListener("beforeunload",this.unloadWindow),i}catch(i){throw this.logger.error("error opening popup "+i.message),this.browserStorage.setInteractionInProgress(!1),fi(Kze)}}openSizedPopup(e,t,i){var h,f,g,m;const r=window.screenLeft?window.screenLeft:window.screenX,o=window.screenTop?window.screenTop:window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(h=i.popupSize)==null?void 0:h.width,c=(f=i.popupSize)==null?void 0:f.height,u=(g=i.popupPosition)==null?void 0:g.top,d=(m=i.popupPosition)==null?void 0:m.left;return(!l||l<0||l>s)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=F_.POPUP_WIDTH),(!c||c<0||c>a)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=F_.POPUP_HEIGHT),(!u||u<0||u>a)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),u=Math.max(0,a/2-F_.POPUP_HEIGHT/2+o)),(!d||d<0||d>s)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),d=Math.max(0,s/2-F_.POPUP_WIDTH/2+r)),window.open(e,t,`width=${l}, height=${c}, top=${u}, left=${d}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(Mi.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${F_.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${F_.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}extractServerResponseStringFromPopup(e,t){var r;let i;return((r=this.config.auth.OIDCOptions)==null?void 0:r.serverResponseType)===qF.QUERY?i=wr.parseQueryServerResponse(t):i=e.location.hash,i}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class wLe{constructor(e,t,i,r,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=r,this.performanceClient=o}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Os.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Os.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const i={apiId:ul.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,i);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,i);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),fi(Yq)}async handleCodeResponseFromHash(e,t){if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),!e)throw fi(Qq);this.browserStorage.setInteractionInProgress(!1);const i=this.browserStorage.generateStateKey(t),r=this.browserStorage.getTemporaryCache(i);if(!r)throw Nn(nW,"Cached State");let o;try{o=this.authModule.handleFragmentResponse(e,r)}catch(c){throw c instanceof cS&&c.subError===VT?fi(VT):c}const s=this.browserStorage.generateNonceKey(r),a=this.browserStorage.getTemporaryCache(s);if(this.authCodeRequest.code=o.code,o.cloud_instance_host_name&&await ri(this.authModule.updateAuthority.bind(this.authModule),Lt.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(o.cloud_instance_host_name,this.authCodeRequest.correlationId),o.nonce=a||void 0,o.state=r,o.client_info)this.authCodeRequest.clientInfo=o.client_info;else{const c=this.checkCcsCredentials();c&&(this.authCodeRequest.ccsCredential=c)}const l=await this.authModule.acquireToken(this.authCodeRequest,o);return this.browserStorage.cleanRequestByState(t),l}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Os.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class QGt extends VN{constructor(e,t,i,r,o,s,a,l,c,u){super(e,t,i,r,o,s,a,c,u),this.nativeStorage=l}async acquireToken(e){const t=await ri(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Mi.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const i=this.initializeServerTelemetryManager(ul.acquireTokenRedirect),r=o=>{o.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(zr.RESTORE_FROM_BFCACHE,Mi.Redirect))};try{const o=await ri(this.initializeAuthorizationCodeRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),s=await ri(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,t.authority,t.azureCloudOptions),a=new wLe(s,this.browserStorage,o,this.logger,this.performanceClient),l=await s.getAuthCodeUrl({...t,nativeBroker:Ib.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),c=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${c}`),window.addEventListener("pageshow",r),await a.initiateAuthRequest(l,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:c,onRedirectNavigate:e.onRedirectNavigate})}catch(o){throw o instanceof Bl&&(o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o)),window.removeEventListener("pageshow",r),this.browserStorage.cleanRequestByState(t.state),o}}async handleRedirectPromise(e){const t=this.initializeServerTelemetryManager(ul.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const i=this.getRedirectResponseHash(e||window.location.hash);if(!i)return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(Mi.Redirect),null;let r;try{const l=wr.getDeserializedHash(i);r=this.validateAndExtractStateFromHash(l,Mi.Redirect),this.logger.verbose("State extracted from hash")}catch(l){return this.logger.info(`handleRedirectPromise was unable to extract state due to: ${l}`),this.browserStorage.cleanRequestByInteractionType(Mi.Redirect),null}const o=this.browserStorage.getTemporaryCache(Os.ORIGIN_URI,!0)||St.EMPTY_STRING,s=wr.removeHashFromUrl(o),a=wr.removeHashFromUrl(window.location.href);if(s===a&&this.config.auth.navigateToLoginRequestUrl){this.logger.verbose("Current page is loginRequestUrl, handling hash");const l=await this.handleHash(i,r,t);return o.indexOf("#")>-1&&aGt(o),l}else if(this.config.auth.navigateToLoginRequestUrl){if(!ave()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Os.URL_HASH,i,!0);const l={apiId:ul.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let c=!0;if(!o||o==="null"){const u=cGt();this.browserStorage.setTemporaryCache(Os.ORIGIN_URI,u,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),c=await this.navigationClient.navigateInternal(u,l)}else this.logger.verbose(`Navigating to loginRequestUrl: ${o}`),c=await this.navigationClient.navigateInternal(o,l);if(!c)return this.handleHash(i,r,t)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),this.handleHash(i,r,t);return null}catch(i){throw i instanceof Bl&&(i.setCorrelationId(this.correlationId),t.cacheFailedRequest(i)),this.browserStorage.cleanRequestByInteractionType(Mi.Redirect),i}}getRedirectResponseHash(e){if(this.logger.verbose("getRedirectResponseHash called"),wr.hashContainsKnownProperties(e))return sGt(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;const i=this.browserStorage.getTemporaryCache(Os.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Os.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),i}async handleHash(e,t,i){const r=this.browserStorage.getCachedRequest(t);this.logger.verbose("handleHash called, retrieved cached request");const o=wr.getDeserializedHash(e);if(o.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw fi(GF);const c=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,o.accountId,this.nativeStorage,r.correlationId),{userRequestState:u}=av.parseRequestState(this.browserCrypto,t);return c.acquireToken({...r,state:u,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(t)})}const s=this.browserStorage.getCachedAuthority(t);if(!s)throw fi(rve);const a=await ri(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,s);return hb.removeThrottle(this.browserStorage,this.config.auth.clientId,r),await new wLe(a,this.browserStorage,r,this.logger,this.performanceClient).handleCodeResponseFromHash(e,t)}async logout(e){var r,o;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),i=this.initializeServerTelemetryManager(ul.logout);try{this.eventHandler.emitEvent(zr.LOGOUT_START,Mi.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:ul.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await ri(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,e&&e.authority);if(a.authority.protocolMode===Gy.OIDC)try{a.authority.endSessionEndpoint}catch{if((r=t.account)!=null&&r.homeAccountId){this.browserStorage.removeAccount((o=t.account)==null?void 0:o.homeAccountId),this.eventHandler.emitEvent(zr.LOGOUT_SUCCESS,Mi.Redirect,t);return}}const l=a.getLogoutUri(t);if(this.eventHandler.emitEvent(zr.LOGOUT_SUCCESS,Mi.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(l)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(l,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(l,s);return}}catch(s){throw s instanceof Bl&&(s.setCorrelationId(this.correlationId),i.cacheFailedRequest(s)),this.eventHandler.emitEvent(zr.LOGOUT_FAILURE,Mi.Redirect,null,s),this.eventHandler.emitEvent(zr.LOGOUT_END,Mi.Redirect),s}this.eventHandler.emitEvent(zr.LOGOUT_END,Mi.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return wr.getAbsoluteUrl(t,Ry())}}/*! @azure/msal-browser v3.4.0 2023-10-30 */async function XGt(n,e,t,i,r){if(e.addQueueMeasurement(Lt.SilentHandlerInitiateAuthRequest,i),!n)throw t.info("Navigate url is empty"),fi(Yq);return r?await ri(JGt,Lt.SilentHandlerLoadFrame,t,e,i)(n,r,e,i):KF(eYt,Lt.SilentHandlerLoadFrameSync,t,e,i)(n)}async function ZGt(n,e,t,i,r,o){return i.addQueueMeasurement(Lt.SilentHandlerMonitorIframeForHash,o),new Promise((s,a)=>{e<jse&&r.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${jse}ms). This may result in timeouts.`);const l=window.setTimeout(()=>{window.clearInterval(c),a(fi(Qze))},e),c=window.setInterval(()=>{let u="";const d=n.contentWindow;try{u=d?d.location.href:""}catch{}if(!u||u==="about:blank")return;const h=d?d.location.hash:"";window.clearTimeout(l),window.clearInterval(c),s(h)},t)}).finally(()=>{KF(tYt,Lt.RemoveHiddenIframe,r,i,o)(n)})}function JGt(n,e,t,i){return t.addQueueMeasurement(Lt.SilentHandlerLoadFrame,i),new Promise((r,o)=>{const s=IUe();window.setTimeout(()=>{if(!s){o("Unable to load iframe");return}s.src=n,r(s)},e)})}function eYt(n){const e=IUe();return e.src=n,e}function IUe(){const n=document.createElement("iframe");return n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(n),n}function tYt(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class nYt extends VN{constructor(e,t,i,r,o,s,a,l,c,u,d){super(e,t,i,r,o,s,l,u,d),this.apiId=a,this.nativeStorage=c}async acquireToken(e){if(this.performanceClient.addQueueMeasurement(Lt.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),e.prompt&&e.prompt!==ah.NONE&&e.prompt!==ah.NO_SESSION)throw fi(tUe);const t=await ri(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)({...e,prompt:e.prompt||ah.NONE},Mi.Silent);_Ue(t.authority);const i=this.initializeServerTelemetryManager(this.apiId);try{const r=await ri(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)(i,t.authority,t.azureCloudOptions);return await ri(this.silentTokenHelper.bind(this),Lt.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(r,t)}catch(r){throw r instanceof Bl&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),r}}logout(){return Promise.reject(fi(Xq))}async silentTokenHelper(e,t){const i=t.correlationId;this.performanceClient.addQueueMeasurement(Lt.SilentIframeClientTokenHelper,i);const r=await ri(this.initializeAuthorizationCodeRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,i)(t),o=await ri(e.getAuthCodeUrl.bind(e),Lt.GetAuthCodeUrl,this.logger,this.performanceClient,i)({...t,nativeBroker:Ib.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),s=new hve(e,this.browserStorage,r,this.logger,this.performanceClient),a=await ri(XGt,Lt.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,i)(o,this.performanceClient,this.logger,i,this.config.system.navigateFrameWait),l=await ri(ZGt,Lt.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,i)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,i);if(l){if(!wr.hashContainsKnownProperties(l))throw this.logger.error("A hash is present in the iframe but it does not contain known properties. It's likely that the hash has been replaced by code running on the redirectUri page."),this.logger.errorPii(`The hash detected in the iframe is: ${l}`),fi(ive)}else throw this.logger.error("The request has returned to the redirectUri but a hash is not present in the iframe. It's likely that the hash has been removed or the page has been redirected by code running on the redirectUri page."),fi(Qq);const c=wr.getDeserializedHash(l);if(c.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw fi(GF);const u=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,c.accountId,this.browserStorage,i),{userRequestState:d}=av.parseRequestState(this.browserCrypto,t.state);return ri(u.acquireToken.bind(u),Lt.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,i)({...t,state:d,prompt:t.prompt||ah.NONE})}return ri(s.handleCodeResponseFromHash.bind(s),Lt.HandleCodeResponseFromHash,this.logger,this.performanceClient,i)(l,t)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class iYt extends VN{async acquireToken(e){this.performanceClient.addQueueMeasurement(Lt.SilentRefreshClientAcquireToken,e.correlationId);const t=await ri(this.initializeBaseRequest.bind(this),Lt.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,e.account),i={...e,...t},r=this.initializeServerTelemetryManager(ul.acquireTokenSilent_silentFlow),o=await this.createRefreshTokenClient(r,i.authority,i.azureCloudOptions);return ri(o.acquireTokenByRefreshToken.bind(o),Lt.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(i).catch(s=>{throw s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s),s})}logout(){return Promise.reject(fi(Xq))}async createRefreshTokenClient(e,t,i){const r=await ri(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new Wse(r,this.performanceClient)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class rYt{constructor(e,t,i,r){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=i,this.cryptoObj=r}loadExternalTokens(e,t,i){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw fi(__);const r=lS(t.id_token,xw);let o,s,a;if(e.account)a=kc.createFromAccountInfo(e.account),o=new WL(a,this.loadIdToken(t.id_token,a.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,a.homeAccountId,e.account.environment,e.account.tenantId,i),this.loadRefreshToken(e,t,a.homeAccountId,e.account.environment));else if(e.authority){const l=eh.generateAuthority(e.authority,e.azureCloudOptions),c={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};if(s=new eh(l,this.config.system.networkClient,this.storage,c,this.logger),i.clientInfo)this.logger.trace("TokenCache - homeAccountId from options"),a=this.loadAccount(r,s,i.clientInfo),o=new WL(a,this.loadIdToken(t.id_token,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,i),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort));else if(t.client_info)this.logger.trace("TokenCache - homeAccountId from response"),a=this.loadAccount(r,s,t.client_info),o=new WL(a,this.loadIdToken(t.id_token,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,i),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort));else throw fi(__)}else throw fi(__);return this.generateAuthenticationResult(e,r,o,a,s)}loadAccount(e,t,i,r){let o;if(r?o=r:t.authorityType!==void 0&&i&&(o=kc.generateHomeAccountId(i,t.authorityType,this.logger,this.cryptoObj,e)),!o)throw fi(__);const s=kc.createAccount({homeAccountId:o,idTokenClaims:e,clientInfo:i,environment:t.hostnameAndPort},t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(s),s;throw fi(__)}loadIdToken(e,t,i,r){const o=jq(t,i,e,this.config.auth.clientId,r);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw fi(__)}loadAccessToken(e,t,i,r,o,s){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in||!s.extendedExpiresOn)throw fi(__);const a=new jc(e.scopes).printScopes(),l=s.expiresOn||t.expires_in+new Date().getTime()/1e3,c=s.extendedExpiresOn,u=qq(i,r,t.access_token,this.config.auth.clientId,o,a,l,c,xw);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(u),u;throw fi(__)}loadRefreshToken(e,t,i,r){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;const o=bze(i,r,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(o),o;throw fi(__)}generateAuthenticationResult(e,t,i,r,o){var h,f;let s=St.EMPTY_STRING,a=[],l=null,c;i!=null&&i.accessToken&&(s=i.accessToken.secret,a=jc.fromString(i.accessToken.target).asArray(),l=new Date(Number(i.accessToken.expiresOn)*1e3),c=new Date(Number(i.accessToken.extendedExpiresOn)*1e3));const u=t.oid||t.sub||St.EMPTY_STRING,d=t.tid||St.EMPTY_STRING;return{authority:o?o.canonicalAuthority:St.EMPTY_STRING,uniqueId:u,tenantId:d,scopes:a,account:r.getAccountInfo(),idToken:((h=i.idToken)==null?void 0:h.secret)||"",idTokenClaims:t||{},accessToken:s,fromCache:!0,expiresOn:l,correlationId:e.correlationId||St.EMPTY_STRING,requestId:St.EMPTY_STRING,extExpiresOn:c,familyId:St.EMPTY_STRING,tokenType:((f=i==null?void 0:i.accessToken)==null?void 0:f.tokenType)||St.EMPTY_STRING,state:St.EMPTY_STRING,cloudGraphHostName:r.cloudGraphHostName||St.EMPTY_STRING,msGraphHost:r.msGraphHost||St.EMPTY_STRING,code:void 0,fromNativeBroker:!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class oYt extends $ze{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class sYt extends VN{constructor(e,t,i,r,o,s,a,l,c,u){super(e,t,i,r,o,s,l,c,u),this.apiId=a}async acquireToken(e){if(!e.code)throw fi(aUe);const t=await ri(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,Mi.Silent),i=this.initializeServerTelemetryManager(this.apiId);try{const r={...t,code:e.code},o=await ri(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)(i,t.authority),s=new oYt(o);this.logger.verbose("Auth code client created");const a=new hve(s,this.browserStorage,r,this.logger,this.performanceClient);return ri(a.handleCodeResponseFromServer.bind(a),Lt.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(r){throw r instanceof Bl&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),r}}logout(){return Promise.reject(fi(Xq))}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Zq{constructor(e){this.atsAsyncMeasurement=void 0,this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new aA(this.logger,this.performanceClient):iW,this.eventHandler=new PGt(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Kse(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,WKt(this.config.auth)):OGt(this.config.auth.clientId,this.logger);const t={cacheLocation:Wu.MemoryStorage,temporaryCacheLocation:Wu.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Kse(this.config.auth.clientId,t,this.browserCrypto,this.logger),this.tokenCache=new rYt(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e){const t=new Zq(e);return await t.initialize(),t}trackPageVisibility(){this.atsAsyncMeasurement&&(this.logger.info("Perf: Visibility change detected"),this.atsAsyncMeasurement.increment({visibilityChangeCount:1}))}async initialize(){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}const e=this.config.system.allowNativeBroker,t=this.performanceClient.startMeasurement(Lt.InitializeClientApplication);if(this.eventHandler.emitEvent(zr.INITIALIZE_START),e)try{this.nativeExtensionProvider=await Ib.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await ri(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),Lt.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient)(this.performanceClient)),this.initialized=!0,this.eventHandler.emitEvent(zr.INITIALIZE_END),t.end({allowNativeBroker:e,success:!0})}async handleRedirectPromise(e){var r;this.logger.verbose("handleRedirectPromise called"),_Le(this.initialized);let t=e;if(((r=this.config.auth.OIDCOptions)==null?void 0:r.serverResponseType)===qF.QUERY){const o=window.location.href;t=wr.parseQueryServerResponse(o)}const i=this.getAllAccounts();if(this.isBrowserEnvironment){const o=t||St.EMPTY_STRING;let s=this.redirectResponse.get(o);if(typeof s>"u"){this.eventHandler.emitEvent(zr.HANDLE_REDIRECT_START,Mi.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise");const a=this.browserStorage.getCachedNativeRequest();let l;if(a&&Ib.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!t)this.logger.trace("handleRedirectPromise - acquiring token from native platform"),l=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,a.accountId,this.nativeInternalStorage,a.correlationId).handleRedirectPromise();else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const c=this.browserStorage.getTemporaryCache(Os.CORRELATION_ID,!0)||St.EMPTY_STRING;l=this.createRedirectClient(c).handleRedirectPromise(t)}s=l.then(c=>(c&&(i.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(zr.LOGIN_SUCCESS,Mi.Redirect,c),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_SUCCESS,Mi.Redirect,c),this.logger.verbose("handleRedirectResponse returned result, acquire token success"))),this.eventHandler.emitEvent(zr.HANDLE_REDIRECT_END,Mi.Redirect),c)).catch(c=>{throw i.length>0?this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_FAILURE,Mi.Redirect,null,c):this.eventHandler.emitEvent(zr.LOGIN_FAILURE,Mi.Redirect,null,c),this.eventHandler.emitEvent(zr.HANDLE_REDIRECT_END,Mi.Redirect),c}),this.redirectResponse.set(o,s)}else this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call");return s}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(Mi.Redirect);const i=this.getAllAccounts().length>0;i?this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_START,Mi.Redirect,e):this.eventHandler.emitEvent(zr.LOGIN_START,Mi.Redirect,e);let r;return this.nativeExtensionProvider&&this.canUseNative(e)?r=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireTokenRedirect(e).catch(s=>{if(s instanceof wy&&w2(s))return this.nativeExtensionProvider=void 0,this.createRedirectClient(e.correlationId).acquireToken(e);if(s instanceof Kb)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(e.correlationId).acquireToken(e);throw this.getBrowserStorage().setInteractionInProgress(!1),s}):r=this.createRedirectClient(e.correlationId).acquireToken(e),r.catch(o=>{throw i?this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_FAILURE,Mi.Redirect,null,o):this.eventHandler.emitEvent(zr.LOGIN_FAILURE,Mi.Redirect,null,o),o})}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Lt.AcquireTokenPopup,t);try{this.logger.verbose("acquireTokenPopup called",t),this.preflightBrowserEnvironmentCheck(Mi.Popup)}catch(s){return Promise.reject(s)}const r=this.getAllAccounts();r.length>0?this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_START,Mi.Popup,e):this.eventHandler.emitEvent(zr.LOGIN_START,Mi.Popup,e);let o;return this.canUseNative(e)?o=this.acquireTokenNative(e,ul.acquireTokenPopup).then(s=>(this.getBrowserStorage().setInteractionInProgress(!1),i.end({success:!0,isNativeBroker:!0,requestId:s.requestId}),s)).catch(s=>{if(s instanceof wy&&w2(s))return this.nativeExtensionProvider=void 0,this.createPopupClient(e.correlationId).acquireToken(e);if(s instanceof Kb)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(e.correlationId).acquireToken(e);throw this.getBrowserStorage().setInteractionInProgress(!1),s}):o=this.createPopupClient(e.correlationId).acquireToken(e),o.then(s=>(r.length<this.getAllAccounts().length?this.eventHandler.emitEvent(zr.LOGIN_SUCCESS,Mi.Popup,s):this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_SUCCESS,Mi.Popup,s),i.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),i.end({success:!0,requestId:s.requestId}),s)).catch(s=>(r.length>0?this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_FAILURE,Mi.Popup,null,s):this.eventHandler.emitEvent(zr.LOGIN_FAILURE,Mi.Popup,null,s),i.end({errorCode:s.errorCode,subErrorCode:s.subError,success:!1}),Promise.reject(s)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var o;const t=this.getRequestCorrelationId(e),i={...e,prompt:e.prompt,correlationId:t};this.preflightBrowserEnvironmentCheck(Mi.Silent),this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Lt.SsoSilent,t),(o=this.ssoSilentMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(zr.SSO_SILENT_START,Mi.Silent,i);let r;return this.canUseNative(i)?r=this.acquireTokenNative(i,ul.ssoSilent).catch(s=>{if(s instanceof wy&&w2(s))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(i.correlationId).acquireToken(i);throw s}):r=this.createSilentIframeClient(i.correlationId).acquireToken(i),r.then(s=>{var a,l;return this.eventHandler.emitEvent(zr.SSO_SILENT_SUCCESS,Mi.Silent,s),(a=this.ssoSilentMeasurement)==null||a.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),(l=this.ssoSilentMeasurement)==null||l.end({success:!0,isNativeBroker:s.fromNativeBroker,requestId:s.requestId}),s}).catch(s=>{var a;throw this.eventHandler.emitEvent(zr.SSO_SILENT_FAILURE,Mi.Silent,null,s),(a=this.ssoSilentMeasurement)==null||a.end({errorCode:s.errorCode,subErrorCode:s.subError,success:!1}),s}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.preflightBrowserEnvironmentCheck(Mi.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_BY_CODE_START,Mi.Silent,e);const i=this.performanceClient.startMeasurement(Lt.AcquireTokenByCode,e.correlationId);try{if(e.code&&e.nativeAccountId)throw fi(cUe);if(e.code){const r=e.code;let o=this.hybridAuthCodeResponses.get(r);return o?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),i.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),o=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(s=>(this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Mi.Silent,s),this.hybridAuthCodeResponses.delete(r),i.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),i.end({success:!0,isNativeBroker:s.fromNativeBroker,requestId:s.requestId}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(r),this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_BY_CODE_FAILURE,Mi.Silent,null,s),i.end({errorCode:s.errorCode,subErrorCode:s.subError,success:!1}),s}),this.hybridAuthCodeResponses.set(r,o)),o}else if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return this.acquireTokenNative(e,ul.acquireTokenByCode,e.nativeAccountId).catch(r=>{throw r instanceof wy&&w2(r)&&(this.nativeExtensionProvider=void 0),r});throw fi(uUe)}else throw fi(lUe)}catch(r){throw this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_BY_CODE_FAILURE,Mi.Silent,null,r),i.end({errorCode:r instanceof Bl&&r.errorCode||void 0,subErrorCode:r instanceof Bl&&r.subError||void 0,success:!1}),r}}async acquireTokenByCodeAsync(e){var r;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(Lt.AcquireTokenByCodeAsync,e.correlationId),(r=this.acquireTokenByCodeAsyncMeasurement)==null||r.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(o=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:o.fromCache,isNativeBroker:o.fromNativeBroker,requestId:o.requestId}),o}).catch(o=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({errorCode:o.errorCode,subErrorCode:o.subError,success:!1}),o}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t,i){switch(this.performanceClient.addQueueMeasurement(Lt.AcquireTokenFromCache,t.correlationId),i){case Zg.Default:case Zg.AccessToken:case Zg.AccessTokenAndRefreshToken:return ri(e.acquireToken.bind(e),Lt.SilentCacheClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(t);default:throw Nn(QC)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(Lt.AcquireTokenByRefreshToken,e.correlationId),t){case Zg.Default:case Zg.AccessTokenAndRefreshToken:case Zg.RefreshToken:case Zg.RefreshTokenAndNetwork:const i=this.createSilentRefreshClient(e.correlationId);return ri(i.acquireToken.bind(i),Lt.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Nn(QC)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(Lt.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return ri(t.acquireToken.bind(t),Lt.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(Mi.Redirect),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(Mi.Popup),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts(e):[]}getAccount(e){if(this.logger.trace("getAccount called"),Object.keys(e).length===0)return this.logger.warning("getAccount: No accountFilter provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy(e);return t?(this.logger.verbose("getAccount: Account matching provided filter found, returning"),t):(this.logger.verbose("getAccount: No matching account found, returning null"),null)}getAccountByUsername(e){if(this.logger.trace("getAccountByUsername called"),!e)return this.logger.warning("getAccountByUsername: No username provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy({username:e});return t?(this.logger.verbose("getAccountByUsername: Account matching username found, returning"),this.logger.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${e}`),t):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)}getAccountByHomeId(e){if(this.logger.trace("getAccountByHomeId called"),!e)return this.logger.warning("getAccountByHomeId: No homeAccountId provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy({homeAccountId:e});return t?(this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),this.logger.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${e}`),t):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)}getAccountByLocalId(e){if(this.logger.trace("getAccountByLocalId called"),!e)return this.logger.warning("getAccountByLocalId: No localAccountId provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy({localAccountId:e});return t?(this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),this.logger.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${e}`),t):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)}setActiveAccount(e){this.browserStorage.setActiveAccount(e)}getActiveAccount(){return this.browserStorage.getActiveAccount()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const i=kc.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(i),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}preflightBrowserEnvironmentCheck(e,t=!1){if(this.logger.verbose("preflightBrowserEnvironmentCheck started"),hGt(this.isBrowserEnvironment),uGt(e,this.config.system.allowRedirectInIframe),AJ(),dGt(),_Le(this.initialized),e===Mi.Redirect&&this.config.cache.cacheLocation===Wu.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw SUe(wUe);(e===Mi.Redirect||e===Mi.Popup)&&this.preflightInteractiveRequest(!t)}preflightInteractiveRequest(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),AJ(),e&&this.getBrowserStorage().setInteractionInProgress(!0)}async acquireTokenNative(e,t,i){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw fi(GF);return new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,i||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Ib.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case ah.NONE:case ah.CONSENT:case ah.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.browserStorage.getAccountInfoFilteredBy({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new YGt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new QGt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new nYt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new kUe(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new iYt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new sYt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e){return this.eventHandler.addEventCallback(e)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){this.eventHandler.enableAccountStorageEvents()}disableAccountStorageEvents(){this.eventHandler.disableAccountStorageEvents()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}getBrowserStorage(){return this.browserStorage}isBrowserEnv(){return this.isBrowserEnvironment}getEventHandler(){return this.eventHandler}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?uS():St.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||mLe})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||mLe})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Lt.AcquireTokenSilent,t);i.add({cacheLookupPolicy:e.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(Mi.Silent),this.logger.verbose("acquireTokenSilent called",t);const r=e.account||this.getActiveAccount();if(!r)throw fi(eUe);const o={clientId:this.config.auth.clientId,authority:e.authority||St.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:r.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},s=JSON.stringify(o),a=this.activeSilentTokenRequests.get(s);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const l=ri(this.acquireTokenSilentAsync.bind(this),Lt.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},r).then(c=>(this.activeSilentTokenRequests.delete(s),i.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),i.end({success:!0,fromCache:c.fromCache,isNativeBroker:c.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:c.requestId}),c)).catch(c=>{throw this.activeSilentTokenRequests.delete(s),i.end({errorCode:c.errorCode,subErrorCode:c.subError,success:!1}),c});return this.activeSilentTokenRequests.set(s,l),l}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),i.discard(),a}async acquireTokenSilentAsync(e,t){var r;this.performanceClient.addQueueMeasurement(Lt.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_START,Mi.Silent,e),this.atsAsyncMeasurement=this.performanceClient.startMeasurement(Lt.AcquireTokenSilentAsync,e.correlationId),(r=this.atsAsyncMeasurement)==null||r.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibility);let i;if(Ib.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&t.nativeAccountId){this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform");const o={...e,account:t};i=this.acquireTokenNative(o,ul.acquireTokenSilent_silentFlow).catch(async s=>{if(s instanceof wy&&w2(s))return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,this.createSilentIframeClient(e.correlationId).acquireToken(e);throw s})}else{this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow");const o=this.createSilentCacheClient(e.correlationId),s=await ri(o.initializeSilentRequest.bind(o),Lt.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t),a=e.cacheLookupPolicy||Zg.Default;i=ri(this.acquireTokenFromCache.bind(this),Lt.AcquireTokenFromCache,this.logger,this.performanceClient,s.correlationId)(o,s,a).catch(l=>{if(e.cacheLookupPolicy===Zg.AccessToken)throw l;return AJ(),this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_NETWORK_START,Mi.Silent,s),ri(this.acquireTokenByRefreshToken.bind(this),Lt.AcquireTokenByRefreshToken,this.logger,this.performanceClient,s.correlationId)(s,a).catch(c=>{const u=!(c instanceof Kb)&&(c.errorCode===F_.INVALID_GRANT_ERROR||c.errorCode===QC)||c.errorCode===oW,d=a===Zg.Default||a===Zg.Skip||a===Zg.RefreshTokenAndNetwork;if(u&&d)return this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",e.correlationId),ri(this.acquireTokenBySilentIframe.bind(this),Lt.AcquireTokenBySilentIframe,this.logger,this.performanceClient,s.correlationId)(s);throw c})})}return i.then(o=>{var s;return this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_SUCCESS,Mi.Silent,o),(s=this.atsAsyncMeasurement)==null||s.end({success:!0,fromCache:o.fromCache,isNativeBroker:o.fromNativeBroker,requestId:o.requestId}),o}).catch(o=>{var s;throw this.eventHandler.emitEvent(zr.ACQUIRE_TOKEN_FAILURE,Mi.Silent,null,o),(s=this.atsAsyncMeasurement)==null||s.end({errorCode:o.errorCode,subErrorCode:o.subError,success:!1}),o}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibility)})}}const aYt=Object.freeze(Object.defineProperty({__proto__:null,StandardController:Zq},Symbol.toStringTag,{value:"Module"}));/*! @azure/msal-browser v3.4.0 2023-10-30 */class fve{static async createPublicClientApplication(e){const t=await yGt(e);return new fve(e,t)}constructor(e,t){if(t)this.controller=t;else{const i=new HT(e);this.controller=new Zq(i)}}async initialize(){return this.controller.initialize()}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e){return this.controller.addEventCallback(e)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const K4=new fve({auth:{clientId:"",redirectUri:{}.VITE_MICROSOFT_REDIRECT_URI}});K4.initialize();function LUe(n){return p("button",{disabled:n.disabled,onClick:n.onClick,className:"rounded px-4 py-2 bg-white border border-gray-200 flex justify-center items-center space-x-2 text-center hover:bg-gray-50 cursor-pointer text-sm disabled:cursor-not-allowed",children:n.children})}function lYt(){const n=Qi(),e=r=>{localStorage.removeItem("X-CURRENT-INDEX");let o=0;const s=r.data.data,a=s[0].account.default_company_id;o=s.findIndex(l=>l.company.id===a)||0,n(sF({type:yN.TOKEN,user:r.data.data[o].user,token:r.data.data[o].token.token})),n(w0(r.data.data)),n(Hj(o))},t=r=>{Ae("POST",Te("/api/v1/oauth_login?provider=google&id_token=:token&create=true",{token:r})).then(o=>e(o))},i=r=>{Ae("POST",Te("/api/v1/oauth_login?provider=microsoft"),{accessToken:r}).then(o=>e(o))};return p("div",{className:"grid grid-cols-3 text-sm mt-4",children:N("div",{className:"col-span-3 flex flex-col items-center space-y-3",children:[p(ZWe,{onSuccess:r=>r.credential&&t(r.credential),onError:()=>ce.error()}),N(LUe,{onClick:async()=>{await K4.handleRedirectPromise(),K4.loginPopup({scopes:["user.read"]}).then(r=>i(r.accessToken))},children:[N("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 23 23",children:[p("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),p("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),p("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),p("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),p("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),p("p",{children:"Log in with Microsoft"})]})]})})}function cYt(){const[n]=pe(),e=Qi(),t=T1(),i=ci(),[r,o]=Yo(DUe),[s,a]=w.useState(!1),l=()=>{a(!1),o("false")},c=()=>{const u=(t==null?void 0:t.oauth_provider_id)==="google";ce.processing(),Ae("PUT",Te("/api/v1/companies/:id",{id:i==null?void 0:i.id}),{...i,settings:{...i.settings,email_sending_method:u?"gmail":"office365",gmail_sending_user_id:t==null?void 0:t.id}}).then(d=>{e(US({object:"company",data:d.data.data})),ce.success("updated_settings"),l()})};return w.useEffect(()=>{((t==null?void 0:t.oauth_provider_id)==="microsoft"||(t==null?void 0:t.oauth_provider_id)==="google")&&(t!=null&&t.oauth_user_token)&&r==="true"&&a(!0)},[t,r]),N(Ui,{title:n("email_provider"),visible:s,onClose:l,children:[p("span",{className:"text-base font-medium",children:Ms("select_email_provider",{provider:(t==null?void 0:t.oauth_provider_id)==="google"?"Gmail":"Outlook"})}),p(Gt,{className:"self-end",behavior:"button",type:"primary",onClick:c,children:n("yes")})]})}const DUe=hF("connectMailer","false");function uYt(){const[n]=pe(),e=pa(),t=Ar(DUe),i=l=>{ce.processing(),window.location.href=Te("/auth/:mailer?react=true",{mailer:l}),t("true")},r=()=>{ce.processing(),Ae("POST",Te("/api/v1/users/:id/disconnect_mailer",{id:e.id}),{}).then(l=>{En(["users"]),ce.success(l.data.message),window.location.reload()}).finally(()=>t("false"))},o=()=>{ce.processing(),Ae("POST",Te("/api/v1/users/:id/disconnect_oauth",{id:e.id})).then(l=>{En(["users"]),ce.success(l.data.message),window.location.reload()}).finally(()=>t("false"))},s=l=>{Ae("POST",Te("/api/v1/connected_account?include=company_user&provider=microsoft"),{accessToken:l}).then(()=>{window.location.reload()}).finally(()=>t("false"))},a=l=>{Ae("POST",Te("/api/v1/connected_account?include=company_user&provider=google&id_token=:token",{token:l})).then(()=>{window.location.reload()}).finally(()=>t("false"))};return N(dt,{children:[p(cYt,{}),N(Qt,{title:n("oneclick_login"),children:[!(e!=null&&e.oauth_provider_id)&&Ro()&&N(dt,{children:[p("div",{className:"grid grid-cols-3 text-sm mt-4",children:p(K,{leftSide:"Google",children:p(ZWe,{onSuccess:l=>l.credential&&a(l.credential),onError:()=>ce.error()})})}),p("div",{className:Nt("grid grid-cols-3 text-sm",{"mt-4":Ro()}),children:p(K,{leftSide:"Microsoft",children:N(LUe,{onClick:async()=>{await K4.handleRedirectPromise(),K4.loginPopup({scopes:["user.read"]}).then(l=>s(l.accessToken))},children:[N("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 23 23",children:[p("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),p("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),p("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),p("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),p("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),p("p",{style:{color:"#000"},children:"Log in with Microsoft"})]})})})]}),(e==null?void 0:e.oauth_provider_id)==="google"&&N(dt,{children:[p(K,{leftSide:"Google",children:p(Gt,{type:"minimal",behavior:"button",onClick:o,children:n("disconnect_google")})}),!ake()&&p(K,{leftSide:"Gmail",children:e!=null&&e.oauth_user_token?p(Gt,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_gmail")}):p(Gt,{type:"minimal",behavior:"button",onClick:()=>i("google"),children:n("connect_gmail")})})]}),(e==null?void 0:e.oauth_provider_id)==="microsoft"&&N(dt,{children:[p(K,{leftSide:"Microsoft",children:p(Gt,{type:"minimal",behavior:"button",onClick:o,children:n("disconnect_microsoft")})}),!ake()&&p(K,{leftSide:"Email",children:e!=null&&e.oauth_user_token?p(Gt,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_email")}):p(Gt,{type:"minimal",behavior:"button",onClick:()=>i("microsoft"),children:n("connect_email")})})]})]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function pve(){const{isAdmin:n}=Po();return!((Vm()||rc())&&n)}var PC=(n=>(n.SingleLineText="single_line_text",n.MultiLineText="multi_line_text",n.Switch="switch",n.Dropdown="dropdown",n.Date="date",n))(PC||{});function Jf(n){const[e]=pe(),[t,i]=w.useState(""),[r,o]=w.useState(""),s=pve(),[a,l]=w.useState("single_line_text"),c=["single_line_text","multi_line_text","switch","dropdown","date"],u=w.useRef(),d=w.useRef();w.useEffect(()=>{if(n.initialValue){const f=n.initialValue.split("|");n.initialValue.includes("|")?c.includes(f[1])?l(f[1]):(l("dropdown"),o(f[1])):l("multi_line_text"),i(f[0])}},[]);const h=f=>{var _,b,y;f&&l(f);const g=f||a,m=g==="dropdown"?(_=d.current)==null?void 0:_.value.split(",").map(C=>C.trim()).join(","):g,v=m==="multi_line_text"?`${((b=u.current)==null?void 0:b.value)||""}`:`${((y=u.current)==null?void 0:y.value)||""}|${m}`;n.onChange&&n.onChange(v,n.field,g)};return N(dt,{children:[p(K,{noExternalPadding:n.noExternalPadding,leftSide:p(We,{id:n.field,innerRef:u,placeholder:n.placeholder,onValueChange:()=>h(),value:t,disabled:s}),children:N(Cn,{value:a,onValueChange:f=>h(f),dismissable:!1,customSelector:!0,children:[p("option",{value:"single_line_text",children:e("single_line_text")}),p("option",{value:"multi_line_text",children:e("multi_line_text")}),p("option",{value:"switch",children:e("switch")}),p("option",{value:"dropdown",children:e("dropdown")}),p("option",{value:"date",children:e("date")})]})}),a==="dropdown"&&p(x0,{children:p(We,{id:"multi_line_text",innerRef:d,placeholder:e("comma_sparated_list"),value:r,onValueChange:()=>h()})})]})}function SLe(n){const[e,t]=w.useState("single_line_text"),i=ni();return w.useEffect(()=>{const[,r]=n.value.includes("|")?n.value.split("|"):[n.value,"multi_line_text"];t(r)},[n.field]),N(dt,{children:[e===PC.SingleLineText&&p(We,{style:{color:i.$3,colorScheme:i.$0},type:"text",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===PC.MultiLineText&&p(We,{style:{color:i.$3,colorScheme:i.$0},element:"textarea",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===PC.Switch&&p(ft,{style:{color:i.$3,colorScheme:i.$0},onChange:r=>{const o=r?"yes":"no";n.onValueChange(o)},checked:typeof n.defaultValue=="string"?n.defaultValue==="true"||n.defaultValue==="1"||n.defaultValue==="yes":n.defaultValue}),e===PC.Date&&p(We,{style:{color:i.$3,colorScheme:i.$0},type:"date",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),!Object.values(PC).includes(e)&&p(Cn,{value:n.defaultValue||"",onValueChange:r=>n.onValueChange(r),customSelector:!0,withBlank:!0,children:e.split(",").map((r,o)=>p("option",{value:r,children:r},o))})]})}function dW(n){const[e,t]=n.includes("|")?n.split("|"):[n,""];return{label:()=>e,type:()=>t}}function J2r(){const n=ci();return e=>n&&n.custom_fields[e]?dW(n.custom_fields[e]):dW("")}function ls(n){const[e,t]=w.useState("");return w.useEffect(()=>{const[i]=n.value.includes("|")?n.value.split("|"):[n.value,""];t(i||"")},[]),n.fieldOnly?p(SLe,{...n}):p(K,{leftSide:e,noExternalPadding:n.noExternalPadding,children:p(SLe,{...n})})}function QF(n){const e=Bj();return p(YS,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,children:e.map((t,i)=>p("option",{value:t.id,children:t.name},i))})}var Yse=globalThis&&globalThis.__assign||function(){return Yse=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},Yse.apply(this,arguments)},AUe={onActivate:gn.func,onAddUndo:gn.func,onBeforeAddUndo:gn.func,onBeforeExecCommand:gn.func,onBeforeGetContent:gn.func,onBeforeRenderUI:gn.func,onBeforeSetContent:gn.func,onBeforePaste:gn.func,onBlur:gn.func,onChange:gn.func,onClearUndos:gn.func,onClick:gn.func,onContextMenu:gn.func,onCommentChange:gn.func,onCompositionEnd:gn.func,onCompositionStart:gn.func,onCompositionUpdate:gn.func,onCopy:gn.func,onCut:gn.func,onDblclick:gn.func,onDeactivate:gn.func,onDirty:gn.func,onDrag:gn.func,onDragDrop:gn.func,onDragEnd:gn.func,onDragGesture:gn.func,onDragOver:gn.func,onDrop:gn.func,onExecCommand:gn.func,onFocus:gn.func,onFocusIn:gn.func,onFocusOut:gn.func,onGetContent:gn.func,onHide:gn.func,onInit:gn.func,onInput:gn.func,onKeyDown:gn.func,onKeyPress:gn.func,onKeyUp:gn.func,onLoadContent:gn.func,onMouseDown:gn.func,onMouseEnter:gn.func,onMouseLeave:gn.func,onMouseMove:gn.func,onMouseOut:gn.func,onMouseOver:gn.func,onMouseUp:gn.func,onNodeChange:gn.func,onObjectResizeStart:gn.func,onObjectResized:gn.func,onObjectSelected:gn.func,onPaste:gn.func,onPostProcess:gn.func,onPostRender:gn.func,onPreProcess:gn.func,onProgressState:gn.func,onRedo:gn.func,onRemove:gn.func,onReset:gn.func,onSaveContent:gn.func,onSelectionChange:gn.func,onSetAttrib:gn.func,onSetContent:gn.func,onShow:gn.func,onSubmit:gn.func,onUndo:gn.func,onVisualAid:gn.func,onSkinLoadError:gn.func,onThemeLoadError:gn.func,onModelLoadError:gn.func,onPluginLoadError:gn.func,onIconsLoadError:gn.func,onLanguageLoadError:gn.func,onScriptsLoad:gn.func,onScriptsLoadError:gn.func},dYt=Yse({apiKey:gn.string,licenseKey:gn.string,id:gn.string,inline:gn.bool,init:gn.object,initialValue:gn.string,onEditorChange:gn.func,value:gn.string,tagName:gn.string,cloudChannel:gn.string,plugins:gn.oneOfType([gn.string,gn.array]),toolbar:gn.oneOfType([gn.string,gn.array]),disabled:gn.bool,textareaName:gn.string,tinymceScriptSrc:gn.oneOfType([gn.string,gn.arrayOf(gn.string),gn.arrayOf(gn.shape({src:gn.string,async:gn.bool,defer:gn.bool}))]),rollback:gn.oneOfType([gn.number,gn.oneOf([!1])]),scriptLoading:gn.shape({async:gn.bool,defer:gn.bool,delay:gn.number})},AUe),PJ=function(n){return typeof n=="function"},ELe=function(n){return n in AUe},xLe=function(n){return n.substr(2)},hYt=function(n,e,t,i,r,o,s){var a=Object.keys(r).filter(ELe),l=Object.keys(o).filter(ELe),c=a.filter(function(d){return o[d]===void 0}),u=l.filter(function(d){return r[d]===void 0});c.forEach(function(d){var h=xLe(d),f=s[h];t(h,f),delete s[h]}),u.forEach(function(d){var h=i(n,d),f=xLe(d);s[f]=h,e(f,h)})},fYt=function(n,e,t,i,r){return hYt(r,n.on.bind(n),n.off.bind(n),function(o,s){return function(a){var l;return(l=o(s))===null||l===void 0?void 0:l(a,n)}},e,t,i)},TLe=0,NUe=function(n){var e=Date.now(),t=Math.floor(Math.random()*1e9);return TLe++,n+"_"+t+TLe+String(e)},kLe=function(n){return n!==null&&(n.tagName.toLowerCase()==="textarea"||n.tagName.toLowerCase()==="input")},ILe=function(n){return typeof n>"u"||n===""?[]:Array.isArray(n)?n:n.split(" ")},pYt=function(n,e){return ILe(n).concat(ILe(e))},gYt=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},mYt=function(n){if(!("isConnected"in Node.prototype)){for(var e=n,t=n.parentNode;t!=null;)e=t,t=e.parentNode;return e===n.ownerDocument}return n.isConnected},LLe=function(n,e){n!==void 0&&(n.mode!=null&&typeof n.mode=="object"&&typeof n.mode.set=="function"?n.mode.set(e):n.setMode(e))},Qse=globalThis&&globalThis.__assign||function(){return Qse=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},Qse.apply(this,arguments)},_Yt=function(n,e,t){var i,r,o=n.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=e.id,o.src=e.src,o.async=(i=e.async)!==null&&i!==void 0?i:!1,o.defer=(r=e.defer)!==null&&r!==void 0?r:!1;var s=function(){o.removeEventListener("load",s),o.removeEventListener("error",a),t(e.src)},a=function(l){o.removeEventListener("load",s),o.removeEventListener("error",a),t(e.src,l)};o.addEventListener("load",s),o.addEventListener("error",a),n.head&&n.head.appendChild(o)},vYt=function(n){var e={},t=function(s,a){var l=e[s];l.done=!0,l.error=a;for(var c=0,u=l.handlers;c<u.length;c++){var d=u[c];d(s,a)}l.handlers=[]},i=function(s,a,l){var c=function(b){return l!==void 0?l(b):console.error(b)};if(s.length===0){c(new Error("At least one script must be provided"));return}for(var u=0,d=!1,h=function(b,y){d||(y?(d=!0,c(y)):++u===s.length&&a())},f=0,g=s;f<g.length;f++){var m=g[f],v=e[m.src];if(v)v.done?h(m.src,v.error):v.handlers.push(h);else{var _=NUe("tiny-");e[m.src]={id:_,src:m.src,done:!1,error:null,handlers:[h]},_Yt(n,Qse({id:_},m),t)}}},r=function(){for(var s,a=0,l=Object.values(e);a<l.length;a++){var c=l[a],u=n.getElementById(c.id);u!=null&&u.tagName==="SCRIPT"&&((s=u.parentNode)===null||s===void 0||s.removeChild(u))}e={}},o=function(){return n};return{loadScripts:i,deleteScripts:r,getDocument:o}},bYt=function(){var n=[],e=function(r){var o=n.find(function(s){return s.getDocument()===r});return o===void 0&&(o=vYt(r),n.push(o)),o},t=function(r,o,s,a,l){var c=function(){return e(r).loadScripts(o,a,l)};s>0?setTimeout(c,s):c()},i=function(){for(var r=n.pop();r!=null;r=n.pop())r.deleteScripts()};return{loadList:t,reinitialize:i}},yYt=bYt(),MJ=function(n){var e=n;return e&&e.tinymce?e.tinymce:null},CYt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Z2=globalThis&&globalThis.__assign||function(){return Z2=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},Z2.apply(this,arguments)},wYt=function(n){CYt(e,n);function e(t){var i,r,o,s=n.call(this,t)||this;return s.rollbackTimer=void 0,s.valueCursor=void 0,s.rollbackChange=function(){var a=s.editor,l=s.props.value;a&&l&&l!==s.currentContent&&a.undoManager.ignore(function(){if(a.setContent(l),s.valueCursor&&(!s.inline||a.hasFocus()))try{a.selection.moveToBookmark(s.valueCursor)}catch{}}),s.rollbackTimer=void 0},s.handleBeforeInput=function(a){if(s.props.value!==void 0&&s.props.value===s.currentContent&&s.editor&&(!s.inline||s.editor.hasFocus()))try{s.valueCursor=s.editor.selection.getBookmark(3)}catch{}},s.handleBeforeInputSpecial=function(a){(a.key==="Enter"||a.key==="Backspace"||a.key==="Delete")&&s.handleBeforeInput(a)},s.handleEditorChange=function(a){var l=s.editor;if(l&&l.initialized){var c=l.getContent();s.props.value!==void 0&&s.props.value!==c&&s.props.rollback!==!1&&(s.rollbackTimer||(s.rollbackTimer=window.setTimeout(s.rollbackChange,typeof s.props.rollback=="number"?s.props.rollback:200))),c!==s.currentContent&&(s.currentContent=c,PJ(s.props.onEditorChange)&&s.props.onEditorChange(c,l))}},s.handleEditorChangeSpecial=function(a){(a.key==="Backspace"||a.key==="Delete")&&s.handleEditorChange(a)},s.initialise=function(a){var l,c,u;a===void 0&&(a=0);var d=s.elementRef.current;if(d){if(!mYt(d)){if(a===0)setTimeout(function(){return s.initialise(1)},1);else if(a<100)setTimeout(function(){return s.initialise(a+1)},100);else throw new Error("tinymce can only be initialised when in a document");return}var h=MJ(s.view);if(!h)throw new Error("tinymce should have been loaded into global scope");var f=Z2(Z2(Z2(Z2({},s.props.init),{selector:void 0,target:d,readonly:s.props.disabled,inline:s.inline,plugins:pYt((l=s.props.init)===null||l===void 0?void 0:l.plugins,s.props.plugins),toolbar:(c=s.props.toolbar)!==null&&c!==void 0?c:(u=s.props.init)===null||u===void 0?void 0:u.toolbar}),s.props.licenseKey?{license_key:s.props.licenseKey}:{}),{setup:function(g){s.editor=g,s.bindHandlers({}),s.inline&&!kLe(d)&&g.once("PostRender",function(m){g.setContent(s.getInitialValue(),{no_events:!0})}),s.props.init&&PJ(s.props.init.setup)&&s.props.init.setup(g)},init_instance_callback:function(g){var m,v,_=s.getInitialValue();s.currentContent=(m=s.currentContent)!==null&&m!==void 0?m:g.getContent(),s.currentContent!==_&&(s.currentContent=_,g.setContent(_),g.undoManager.clear(),g.undoManager.add(),g.setDirty(!1));var b=(v=s.props.disabled)!==null&&v!==void 0?v:!1;LLe(s.editor,b?"readonly":"design"),s.props.init&&PJ(s.props.init.init_instance_callback)&&s.props.init.init_instance_callback(g)}});s.inline||(d.style.visibility=""),kLe(d)&&(d.value=s.getInitialValue()),h.init(f)}},s.id=s.props.id||NUe("tiny-react"),s.elementRef=w.createRef(),s.inline=(o=(i=s.props.inline)!==null&&i!==void 0?i:(r=s.props.init)===null||r===void 0?void 0:r.inline)!==null&&o!==void 0?o:!1,s.boundHandlers={},s}return Object.defineProperty(e.prototype,"view",{get:function(){var t,i;return(i=(t=this.elementRef.current)===null||t===void 0?void 0:t.ownerDocument.defaultView)!==null&&i!==void 0?i:window},enumerable:!1,configurable:!0}),e.prototype.componentDidUpdate=function(t){var i=this,r,o;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(t),this.editor.initialized)){if(this.currentContent=(r=this.currentContent)!==null&&r!==void 0?r:this.editor.getContent(),typeof this.props.initialValue=="string"&&this.props.initialValue!==t.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if(typeof this.props.value=="string"&&this.props.value!==this.currentContent){var s=this.editor;s.undoManager.transact(function(){var l;if(!i.inline||s.hasFocus())try{l=s.selection.getBookmark(3)}catch{}var c=i.valueCursor;if(s.setContent(i.props.value),!i.inline||s.hasFocus())for(var u=0,d=[l,c];u<d.length;u++){var h=d[u];if(h)try{s.selection.moveToBookmark(h),i.valueCursor=h;break}catch{}}})}if(this.props.disabled!==t.disabled){var a=(o=this.props.disabled)!==null&&o!==void 0?o:!1;LLe(this.editor,a?"readonly":"design")}}},e.prototype.componentDidMount=function(){var t=this,i,r,o,s,a;if(MJ(this.view)!==null)this.initialise();else if(Array.isArray(this.props.tinymceScriptSrc)&&this.props.tinymceScriptSrc.length===0)(r=(i=this.props).onScriptsLoadError)===null||r===void 0||r.call(i,new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));else if(!((o=this.elementRef.current)===null||o===void 0)&&o.ownerDocument){var l=function(){var u,d;(d=(u=t.props).onScriptsLoad)===null||d===void 0||d.call(u),t.initialise()},c=function(u){var d,h;(h=(d=t.props).onScriptsLoadError)===null||h===void 0||h.call(d,u)};yYt.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),(a=(s=this.props.scriptLoading)===null||s===void 0?void 0:s.delay)!==null&&a!==void 0?a:0,l,c)}},e.prototype.componentWillUnmount=function(){var t=this,i=this.editor;i&&(i.off(this.changeEvents(),this.handleEditorChange),i.off(this.beforeInputEvent(),this.handleBeforeInput),i.off("keypress",this.handleEditorChangeSpecial),i.off("keydown",this.handleBeforeInputSpecial),i.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach(function(r){i.off(r,t.boundHandlers[r])}),this.boundHandlers={},i.remove(),this.editor=void 0)},e.prototype.render=function(){return this.inline?this.renderInline():this.renderIframe()},e.prototype.changeEvents=function(){var t,i,r,o=(r=(i=(t=MJ(this.view))===null||t===void 0?void 0:t.Env)===null||i===void 0?void 0:i.browser)===null||r===void 0?void 0:r.isIE();return o?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"},e.prototype.beforeInputEvent=function(){return gYt()?"beforeinput SelectionChange":"SelectionChange"},e.prototype.renderInline=function(){var t=this.props.tagName,i=t===void 0?"div":t;return w.createElement(i,{ref:this.elementRef,id:this.id})},e.prototype.renderIframe=function(){return w.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})},e.prototype.getScriptSources=function(){var t,i,r=(t=this.props.scriptLoading)===null||t===void 0?void 0:t.async,o=(i=this.props.scriptLoading)===null||i===void 0?void 0:i.defer;if(this.props.tinymceScriptSrc!==void 0)return typeof this.props.tinymceScriptSrc=="string"?[{src:this.props.tinymceScriptSrc,async:r,defer:o}]:this.props.tinymceScriptSrc.map(function(c){return typeof c=="string"?{src:c,async:r,defer:o}:c});var s=this.props.cloudChannel,a=this.props.apiKey?this.props.apiKey:"no-api-key",l="https://cdn.tiny.cloud/1/".concat(a,"/tinymce/").concat(s,"/tinymce.min.js");return[{src:l,async:r,defer:o}]},e.prototype.getInitialValue=function(){return typeof this.props.initialValue=="string"?this.props.initialValue:typeof this.props.value=="string"?this.props.value:""},e.prototype.bindHandlers=function(t){var i=this;if(this.editor!==void 0){fYt(this.editor,t,this.props,this.boundHandlers,function(a){return i.props[a]});var r=function(a){return a.onEditorChange!==void 0||a.value!==void 0},o=r(t),s=r(this.props);!o&&s?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):o&&!s&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}},e.propTypes=dYt,e.defaultProps={cloudChannel:"7"},e}(w.Component);function pd(n){const[e,t]=w.useState(),i=w.useRef(null);w.useEffect(()=>{t(n.value)},[n.value]);const r=l=>{n.onChange(l)},o=w.useRef(un.debounce(l=>r(l),500)).current,s=l=>{t(l||""),o(l||"")},a=ni();return N("div",{className:"space-y-4",style:{zIndex:0},children:[n.label&&p(pg,{children:n.label}),p(wYt,{tinymceScriptSrc:"/tinymce_6.4.2/tinymce/js/tinymce/tinymce.min.js",ref:i,value:e,init:{height:300,entity_encoding:"raw",menubar:!1,plugins:["advlist","autolink","lists","link","image","charmap","anchor","searchreplace","visualblocks","code","fullscreen","insertdatetime","media","table","preview","help","wordcount","mceCodeEditor"],toolbar:"undo redo | blocks | link bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | code | help",content_style:"body { font-family:Helvetica,Arial,sans-serif; font-size:14px }",contextmenu:"",content_css:a.$0==="dark"?"dark":"/tinymce_6.4.2/tinymce/content.css",body_class:"h-screen",skin:a.$0==="dark"?"oxide-dark":"oxide",paste_data_images:!1,newline_behavior:"invert",browser_spellcheck:!0,convert_urls:!1},onEditorChange:s,disabled:n.disabled})]})}function SYt(){var l,c,u,d,h,f,g,m,v;const[n]=pe(),e=O8e(),t=pa(),i=Qi(),r=ci(),[,o]=Yo(Wq),s=Oc(_=>_.user.changes),a=(_,b)=>{i(Ak({property:_,value:b}))};return p(dt,{children:s&&N(Qt,{title:n("details"),children:[p(K,{leftSide:n("first_name"),children:p(We,{value:(s==null?void 0:s.first_name)||(t==null?void 0:t.first_name)||"",onValueChange:_=>a("first_name",_),errorMessage:(((l=e==null?void 0:e.errors)==null?void 0:l.first_name)??[])[0]})}),p(K,{leftSide:n("last_name"),children:p(We,{value:(s==null?void 0:s.last_name)||(t==null?void 0:t.last_name)||"",onValueChange:_=>a("last_name",_),errorMessage:(((c=e==null?void 0:e.errors)==null?void 0:c.last_name)??[])[0]})}),p(K,{leftSide:n("email"),children:p(We,{value:(s==null?void 0:s.email)||(t==null?void 0:t.email)||"",type:"email",onValueChange:_=>a("email",_),errorMessage:(((u=e==null?void 0:e.errors)==null?void 0:u.email)??[])[0]})}),p(K,{leftSide:n("language"),children:p(QF,{value:(s==null?void 0:s.language_id)||"",onChange:_=>{o(!0),a("language_id",_)},errorMessage:(((d=e==null?void 0:e.errors)==null?void 0:d.language_id)??[])[0],dismissable:!0})}),p(K,{leftSide:n("phone"),children:p(We,{value:(s==null?void 0:s.phone)||(t==null?void 0:t.phone)||"",onValueChange:_=>a("phone",_),errorMessage:(((h=e==null?void 0:e.errors)==null?void 0:h.phone)??[])[0]})}),p(K,{leftSide:n("signature"),children:p(pd,{value:(s==null?void 0:s.signature)||"",onChange:_=>a("signature",_)})}),((f=r==null?void 0:r.custom_fields)==null?void 0:f.user1)&&p(ls,{field:"user1",defaultValue:s.custom_value1,value:r.custom_fields.user1,onValueChange:_=>a("custom_value1",_)}),((g=r==null?void 0:r.custom_fields)==null?void 0:g.user2)&&p(ls,{field:"user2",defaultValue:s.custom_value2,value:r.custom_fields.user2,onValueChange:_=>a("custom_value2",_)}),((m=r==null?void 0:r.custom_fields)==null?void 0:m.user3)&&p(ls,{field:"user3",defaultValue:s.custom_value3,value:r.custom_fields.user3,onValueChange:_=>a("custom_value3",_)}),((v=r==null?void 0:r.custom_fields)==null?void 0:v.user4)&&p(ls,{field:"user4",defaultValue:s.custom_value4,value:r.custom_fields.user4,onValueChange:_=>a("custom_value4",_)})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function EYt(){const[n]=pe();return[{key:"invoice_created",label:n("invoice_created")},{key:"invoice_sent",label:n("invoice_sent_notification_label")},{key:"invoice_viewed",label:n("invoice_viewed")},{key:"invoice_late",label:n("invoice_late")},{key:"inventory_threshold",label:n("inventory_threshold")},{key:"payment_success",label:n("payment_success")},{key:"payment_failure",label:n("payment_failure")},{key:"payment_manual",label:n("manual_payment")},{key:"purchase_order_created",label:n("purchase_order_created")},{key:"purchase_order_sent",label:n("purchase_order_sent")},{key:"purchase_order_viewed",label:n("purchase_order_viewed")},{key:"purchase_order_accepted",label:n("purchase_order_accepted")},{key:"quote_created",label:n("quote_created")},{key:"quote_sent",label:n("quote_sent")},{key:"quote_viewed",label:n("quote_viewed")},{key:"quote_approved",label:n("quote_approved")},{key:"quote_expired",label:n("quote_expired")},{key:"credit_created",label:n("credit_created")},{key:"credit_sent",label:n("credit_sent")},{key:"credit_viewed",label:n("credit_viewed")}]}function xYt(){var d,h,f;const[n]=pe(),e=Qi(),t=EYt(),i=Oc(g=>g.user.changes),r=LF(),[o,s]=w.useState(""),a=g=>{var b,y,C;s(g);const m=un.cloneDeep(i);let v=g==="custom"?[]:[g];((C=(y=(b=m==null?void 0:m.company_user)==null?void 0:b.notifications)==null?void 0:y.email)==null?void 0:C.find(x=>x==="task_assigned"))&&(v=[...v,"task_assigned"]),un.set(m,"company_user.notifications.email",v),e(hZ(m))},l=g=>{var m,v,_;return o==="all_notifications"?`${g}_all`:o==="all_user_notifications"?`${g}_user`:((_=(v=(m=i==null?void 0:i.company_user)==null?void 0:m.notifications)==null?void 0:v.email)==null?void 0:_.find(b=>b.startsWith(g)))||"none"},c=(g,m)=>{var C,x;const v=(x=(C=i==null?void 0:i.company_user)==null?void 0:C.notifications)==null?void 0:x.email,_=v.findIndex(E=>E.startsWith(g));let b=[...v];_>-1?m!=="none"?b=v.map((E,k)=>_===k?m:E):b=v.filter((E,k)=>_!==k):b=[...b,m];const y=un.cloneDeep(i);un.set(y,"company_user.notifications.email",b),e(hZ(y))},u=g=>{var b,y;let v=[...(y=(b=i==null?void 0:i.company_user)==null?void 0:b.notifications)==null?void 0:y.email];g?v.find(x=>x==="task_assigned")||(v=[...v,"task_assigned"]):v=v.filter(C=>C!=="task_assigned");const _=un.cloneDeep(i);un.set(_,"company_user.notifications.email",v),e(hZ(_))};return w.useEffect(()=>{var m,v;const g=(v=(m=i==null?void 0:i.company_user)==null?void 0:m.notifications)==null?void 0:v.email;g&&!o&&(g.includes("all_notifications")||g.includes("all_user_notifications")?s(g[0]):s("custom"))},[i]),N(Qt,{title:n("notifications"),children:[p(K,{leftSide:n("login_notification"),leftSideHelp:n("login_notification_help"),children:p(ft,{checked:i==null?void 0:i.user_logged_in_notification,onChange:g=>r("user_logged_in_notification",g)})}),p(K,{className:"mb-4",leftSide:n("task_assigned_notification"),leftSideHelp:n("task_assigned_notification_help"),children:p(ft,{checked:!!((f=(h=(d=i==null?void 0:i.company_user)==null?void 0:d.notifications)==null?void 0:h.email)!=null&&f.find(g=>g==="task_assigned")),onChange:g=>u(g)})}),p(_i,{withoutPadding:!0}),p(K,{className:"my-4",leftSide:n("all_events"),children:N(Cn,{value:o,onValueChange:g=>a(g),customSelector:!0,dismissable:!1,children:[p("option",{value:"all_notifications",children:n("all_records")}),p("option",{value:"all_user_notifications",children:n("owned_by_user")}),p("option",{value:"custom",children:n("custom")})]})}),p(_i,{withoutPadding:!0}),p("div",{className:"flex flex-col",children:t.map((g,m)=>p(K,{className:"mt-0",leftSide:g.label,children:N(Cn,{value:l(g.key),onValueChange:v=>c(g.key,v),disabled:!!o&&o!=="custom",customSelector:!0,dismissable:!1,children:[p("option",{value:`${g.key}_all`,children:n("all_records")}),p("option",{value:`${g.key}_user`,children:n("owned_by_user")}),p("option",{value:"none",children:n("none")})]})},m))})]})}function TYt(){var s;const[n]=pe(),e=Qi(),t=O8e(),i=Oc(a=>a.user.changes),[r,o]=w.useState(!1);return w.useEffect(()=>{r&&window.addEventListener("user.updated",()=>e(pbt()))},[r]),p(Qt,{title:n("password"),children:p(K,{leftSide:n("new_password"),children:p(We,{type:"password",value:i.password||"",onValueChange:a=>{e(Ak({property:"password",value:a})),!r&&o(!0)},errorMessage:(s=t==null?void 0:t.errors)==null?void 0:s.password})})})}var Jq={},RUe={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},kYt=RUe;function OUe(n){this.mode=kYt.MODE_8BIT_BYTE,this.data=n}OUe.prototype={getLength:function(n){return this.data.length},write:function(n){for(var e=0;e<this.data.length;e++)n.put(this.data.charCodeAt(e),8)}};var IYt=OUe,PUe={L:1,M:0,Q:3,H:2},X8=PUe;function fb(n,e){this.totalCount=n,this.dataCount=e}fb.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];fb.getRSBlocks=function(n,e){var t=fb.getRsBlockTable(n,e);if(t==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+e);for(var i=t.length/3,r=new Array,o=0;o<i;o++)for(var s=t[o*3+0],a=t[o*3+1],l=t[o*3+2],c=0;c<s;c++)r.push(new fb(a,l));return r};fb.getRsBlockTable=function(n,e){switch(e){case X8.L:return fb.RS_BLOCK_TABLE[(n-1)*4+0];case X8.M:return fb.RS_BLOCK_TABLE[(n-1)*4+1];case X8.Q:return fb.RS_BLOCK_TABLE[(n-1)*4+2];case X8.H:return fb.RS_BLOCK_TABLE[(n-1)*4+3];default:return}};var LYt=fb;function MUe(){this.buffer=new Array,this.length=0}MUe.prototype={get:function(n){var e=Math.floor(n/8);return(this.buffer[e]>>>7-n%8&1)==1},put:function(n,e){for(var t=0;t<e;t++)this.putBit((n>>>e-t-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(n){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var DYt=MUe,j_={glog:function(n){if(n<1)throw new Error("glog("+n+")");return j_.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return j_.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var md=0;md<8;md++)j_.EXP_TABLE[md]=1<<md;for(var md=8;md<256;md++)j_.EXP_TABLE[md]=j_.EXP_TABLE[md-4]^j_.EXP_TABLE[md-5]^j_.EXP_TABLE[md-6]^j_.EXP_TABLE[md-8];for(var md=0;md<255;md++)j_.LOG_TABLE[j_.EXP_TABLE[md]]=md;var FUe=j_,PE=FUe;function x$(n,e){if(n.length==null)throw new Error(n.length+"/"+e);for(var t=0;t<n.length&&n[t]==0;)t++;this.num=new Array(n.length-t+e);for(var i=0;i<n.length-t;i++)this.num[i]=n[i+t]}x$.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var e=new Array(this.getLength()+n.getLength()-1),t=0;t<this.getLength();t++)for(var i=0;i<n.getLength();i++)e[t+i]^=PE.gexp(PE.glog(this.get(t))+PE.glog(n.get(i)));return new x$(e,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var e=PE.glog(this.get(0))-PE.glog(n.get(0)),t=new Array(this.getLength()),i=0;i<this.getLength();i++)t[i]=this.get(i);for(var i=0;i<n.getLength();i++)t[i]^=PE.gexp(PE.glog(n.get(i))+e);return new x$(t,0).mod(n)}};var BUe=x$,Jg=RUe,DLe=BUe,AYt=FUe,eC={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},cd={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){for(var e=n<<10;cd.getBCHDigit(e)-cd.getBCHDigit(cd.G15)>=0;)e^=cd.G15<<cd.getBCHDigit(e)-cd.getBCHDigit(cd.G15);return(n<<10|e)^cd.G15_MASK},getBCHTypeNumber:function(n){for(var e=n<<12;cd.getBCHDigit(e)-cd.getBCHDigit(cd.G18)>=0;)e^=cd.G18<<cd.getBCHDigit(e)-cd.getBCHDigit(cd.G18);return n<<12|e},getBCHDigit:function(n){for(var e=0;n!=0;)e++,n>>>=1;return e},getPatternPosition:function(n){return cd.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,e,t){switch(n){case eC.PATTERN000:return(e+t)%2==0;case eC.PATTERN001:return e%2==0;case eC.PATTERN010:return t%3==0;case eC.PATTERN011:return(e+t)%3==0;case eC.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case eC.PATTERN101:return e*t%2+e*t%3==0;case eC.PATTERN110:return(e*t%2+e*t%3)%2==0;case eC.PATTERN111:return(e*t%3+(e+t)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){for(var e=new DLe([1],0),t=0;t<n;t++)e=e.multiply(new DLe([1,AYt.gexp(t)],0));return e},getLengthInBits:function(n,e){if(1<=e&&e<10)switch(n){case Jg.MODE_NUMBER:return 10;case Jg.MODE_ALPHA_NUM:return 9;case Jg.MODE_8BIT_BYTE:return 8;case Jg.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(e<27)switch(n){case Jg.MODE_NUMBER:return 12;case Jg.MODE_ALPHA_NUM:return 11;case Jg.MODE_8BIT_BYTE:return 16;case Jg.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(e<41)switch(n){case Jg.MODE_NUMBER:return 14;case Jg.MODE_ALPHA_NUM:return 13;case Jg.MODE_8BIT_BYTE:return 16;case Jg.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+e)},getLostPoint:function(n){for(var e=n.getModuleCount(),t=0,i=0;i<e;i++)for(var r=0;r<e;r++){for(var o=0,s=n.isDark(i,r),a=-1;a<=1;a++)if(!(i+a<0||e<=i+a))for(var l=-1;l<=1;l++)r+l<0||e<=r+l||a==0&&l==0||s==n.isDark(i+a,r+l)&&o++;o>5&&(t+=3+o-5)}for(var i=0;i<e-1;i++)for(var r=0;r<e-1;r++){var c=0;n.isDark(i,r)&&c++,n.isDark(i+1,r)&&c++,n.isDark(i,r+1)&&c++,n.isDark(i+1,r+1)&&c++,(c==0||c==4)&&(t+=3)}for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)n.isDark(i,r)&&!n.isDark(i,r+1)&&n.isDark(i,r+2)&&n.isDark(i,r+3)&&n.isDark(i,r+4)&&!n.isDark(i,r+5)&&n.isDark(i,r+6)&&(t+=40);for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)n.isDark(i,r)&&!n.isDark(i+1,r)&&n.isDark(i+2,r)&&n.isDark(i+3,r)&&n.isDark(i+4,r)&&!n.isDark(i+5,r)&&n.isDark(i+6,r)&&(t+=40);for(var u=0,r=0;r<e;r++)for(var i=0;i<e;i++)n.isDark(i,r)&&u++;var d=Math.abs(100*u/e/e-50)/5;return t+=d*10,t}},NYt=cd,RYt=IYt,$Ue=LYt,VUe=DYt,XS=NYt,OYt=BUe;function Lb(n,e){this.typeNumber=n,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Ag=Lb.prototype;Ag.addData=function(n){var e=new RYt(n);this.dataList.push(e),this.dataCache=null};Ag.isDark=function(n,e){if(n<0||this.moduleCount<=n||e<0||this.moduleCount<=e)throw new Error(n+","+e);return this.modules[n][e]};Ag.getModuleCount=function(){return this.moduleCount};Ag.make=function(){if(this.typeNumber<1){var n=1;for(n=1;n<40;n++){for(var e=$Ue.getRSBlocks(n,this.errorCorrectLevel),t=new VUe,i=0,r=0;r<e.length;r++)i+=e[r].dataCount;for(var r=0;r<this.dataList.length;r++){var o=this.dataList[r];t.put(o.mode,4),t.put(o.getLength(),XS.getLengthInBits(o.mode,n)),o.write(t)}if(t.getLengthInBits()<=i*8)break}this.typeNumber=n}this.makeImpl(!1,this.getBestMaskPattern())};Ag.makeImpl=function(n,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var t=0;t<this.moduleCount;t++){this.modules[t]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[t][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(n,e),this.typeNumber>=7&&this.setupTypeNumber(n),this.dataCache==null&&(this.dataCache=Lb.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};Ag.setupPositionProbePattern=function(n,e){for(var t=-1;t<=7;t++)if(!(n+t<=-1||this.moduleCount<=n+t))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=t&&t<=6&&(i==0||i==6)||0<=i&&i<=6&&(t==0||t==6)||2<=t&&t<=4&&2<=i&&i<=4?this.modules[n+t][e+i]=!0:this.modules[n+t][e+i]=!1)};Ag.getBestMaskPattern=function(){for(var n=0,e=0,t=0;t<8;t++){this.makeImpl(!0,t);var i=XS.getLostPoint(this);(t==0||n>i)&&(n=i,e=t)}return e};Ag.createMovieClip=function(n,e,t){var i=n.createEmptyMovieClip(e,t),r=1;this.make();for(var o=0;o<this.modules.length;o++)for(var s=o*r,a=0;a<this.modules[o].length;a++){var l=a*r,c=this.modules[o][a];c&&(i.beginFill(0,100),i.moveTo(l,s),i.lineTo(l+r,s),i.lineTo(l+r,s+r),i.lineTo(l,s+r),i.endFill())}return i};Ag.setupTimingPattern=function(){for(var n=8;n<this.moduleCount-8;n++)this.modules[n][6]==null&&(this.modules[n][6]=n%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)};Ag.setupPositionAdjustPattern=function(){for(var n=XS.getPatternPosition(this.typeNumber),e=0;e<n.length;e++)for(var t=0;t<n.length;t++){var i=n[e],r=n[t];if(this.modules[i][r]==null)for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)o==-2||o==2||s==-2||s==2||o==0&&s==0?this.modules[i+o][r+s]=!0:this.modules[i+o][r+s]=!1}};Ag.setupTypeNumber=function(n){for(var e=XS.getBCHTypeNumber(this.typeNumber),t=0;t<18;t++){var i=!n&&(e>>t&1)==1;this.modules[Math.floor(t/3)][t%3+this.moduleCount-8-3]=i}for(var t=0;t<18;t++){var i=!n&&(e>>t&1)==1;this.modules[t%3+this.moduleCount-8-3][Math.floor(t/3)]=i}};Ag.setupTypeInfo=function(n,e){for(var t=this.errorCorrectLevel<<3|e,i=XS.getBCHTypeInfo(t),r=0;r<15;r++){var o=!n&&(i>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(var r=0;r<15;r++){var o=!n&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!n};Ag.mapData=function(n,e){for(var t=-1,i=this.moduleCount-1,r=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var a=0;a<2;a++)if(this.modules[i][s-a]==null){var l=!1;o<n.length&&(l=(n[o]>>>r&1)==1);var c=XS.getMask(e,i,s-a);c&&(l=!l),this.modules[i][s-a]=l,r--,r==-1&&(o++,r=7)}if(i+=t,i<0||this.moduleCount<=i){i-=t,t=-t;break}}};Lb.PAD0=236;Lb.PAD1=17;Lb.createData=function(n,e,t){for(var i=$Ue.getRSBlocks(n,e),r=new VUe,o=0;o<t.length;o++){var s=t[o];r.put(s.mode,4),r.put(s.getLength(),XS.getLengthInBits(s.mode,n)),s.write(r)}for(var a=0,o=0;o<i.length;o++)a+=i[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(Lb.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Lb.PAD1,8);return Lb.createBytes(r,i)};Lb.createBytes=function(n,e){for(var t=0,i=0,r=0,o=new Array(e.length),s=new Array(e.length),a=0;a<e.length;a++){var l=e[a].dataCount,c=e[a].totalCount-l;i=Math.max(i,l),r=Math.max(r,c),o[a]=new Array(l);for(var u=0;u<o[a].length;u++)o[a][u]=255&n.buffer[u+t];t+=l;var d=XS.getErrorCorrectPolynomial(c),h=new OYt(o[a],d.getLength()-1),f=h.mod(d);s[a]=new Array(d.getLength()-1);for(var u=0;u<s[a].length;u++){var g=u+f.getLength()-s[a].length;s[a][u]=g>=0?f.get(g):0}}for(var m=0,u=0;u<e.length;u++)m+=e[u].totalCount;for(var v=new Array(m),_=0,u=0;u<i;u++)for(var a=0;a<e.length;a++)u<o[a].length&&(v[_++]=o[a][u]);for(var u=0;u<r;u++)for(var a=0;a<e.length;a++)u<s[a].length&&(v[_++]=s[a][u]);return v};var PYt=Lb,gve={};Object.defineProperty(gve,"__esModule",{value:!0});var MYt=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},FYt=gn,em=WUe(FYt),HUe=w,Z8=WUe(HUe);function WUe(n){return n&&n.__esModule?n:{default:n}}function BYt(n,e){var t={};for(var i in n)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}var $Yt={bgColor:em.default.oneOfType([em.default.object,em.default.string]).isRequired,bgD:em.default.string.isRequired,fgColor:em.default.oneOfType([em.default.object,em.default.string]).isRequired,fgD:em.default.string.isRequired,size:em.default.number.isRequired,title:em.default.string,viewBoxSize:em.default.number.isRequired,xmlns:em.default.string},VYt={title:void 0,xmlns:"http://www.w3.org/2000/svg"},eK=(0,HUe.forwardRef)(function(n,e){var t=n.bgColor,i=n.bgD,r=n.fgD,o=n.fgColor,s=n.size,a=n.title,l=n.viewBoxSize,c=BYt(n,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize"]);return Z8.default.createElement("svg",MYt({},c,{height:s,ref:e,viewBox:"0 0 "+l+" "+l,width:s}),a?Z8.default.createElement("title",null,a):null,Z8.default.createElement("path",{d:i,fill:t}),Z8.default.createElement("path",{d:r,fill:o}))});eK.displayName="QRCodeSvg";eK.propTypes=$Yt;eK.defaultProps=VYt;gve.default=eK;Object.defineProperty(Jq,"__esModule",{value:!0});Jq.QRCode=void 0;var HYt=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},WYt=PYt,zYt=XF(WYt),UYt=PUe,jYt=XF(UYt),qYt=gn,Y0=XF(qYt),zUe=w,KYt=XF(zUe),GYt=gve,YYt=XF(GYt);function XF(n){return n&&n.__esModule?n:{default:n}}function QYt(n,e){var t={};for(var i in n)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}var XYt={bgColor:Y0.default.oneOfType([Y0.default.object,Y0.default.string]),fgColor:Y0.default.oneOfType([Y0.default.object,Y0.default.string]),level:Y0.default.string,size:Y0.default.number,value:Y0.default.string.isRequired},ZYt={bgColor:"#FFFFFF",fgColor:"#000000",level:"L",size:256},ZF=(0,zUe.forwardRef)(function(n,e){var t=n.bgColor,i=n.fgColor,r=n.level,o=n.size,s=n.value,a=QYt(n,["bgColor","fgColor","level","size","value"]),l=new zYt.default(-1,jYt.default[r]);l.addData(s),l.make();var c=l.modules;return KYt.default.createElement(YYt.default,HYt({},a,{bgColor:t,bgD:c.map(function(u,d){return u.map(function(h,f){return h?"":"M "+f+" "+d+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:i,fgD:c.map(function(u,d){return u.map(function(h,f){return h?"M "+f+" "+d+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:e,size:o,viewBoxSize:c.length}))});Jq.QRCode=ZF;ZF.displayName="QRCode";ZF.propTypes=XYt;ZF.defaultProps=ZYt;var JYt=Jq.default=ZF;function eQt(n){const[e]=pe(),{resendSmsCode:t,verifyPhoneNumber:i,setVisible:r}=n,[o,s]=w.useState("");return p(Ui,{title:e("sms_code"),visible:n.visible,onClose:()=>{r(!1),s("")},children:N("div",{children:[p("div",{className:"flex justify-end mb-1",children:p(Gt,{behavior:"button",type:"minimal",onClick:()=>s(""),children:e("clear")})}),p("div",{className:"flex justify-center",children:p(DWe,{value:o,onChange:s})}),N("div",{className:"flex justify-between mt-8",children:[p(Gt,{behavior:"button",type:"minimal",onClick:()=>{t(),s("")},children:e("resend_code")}),p(Gt,{behavior:"button",onClick:()=>i(o),disableWithoutIcon:!0,disabled:o.length!==6,children:e("verify")})]})]})})}function UUe(n){const[e]=pe(),t=pa(),i=Qi(),{checkVerification:r,setCheckVerification:o,isDisableModalOpen:s,setIsDisableModalOpen:a,checkOnlyPhoneNumberVerification:l}=n,[c,u]=w.useState(!1),[d,h]=w.useState(!1),[f,g]=w.useState(""),[m,v]=w.useState(""),[_,b]=w.useState(""),[y,C]=w.useState(!1),[x,E]=w.useState(),k=()=>{ce.processing(),Ae("GET",Te("/api/v1/settings/enable_two_factor")).then(B=>{ce.dismiss(),g(B.data.data.qrCode),v(B.data.data.secret),u(!0)})},L=()=>{ce.processing(),E(void 0),Ae("POST",Te("/api/v1/settings/enable_two_factor"),{secret:m,one_time_password:_}).then(B=>{ce.success(B.data.message),i(qy(un.merge({},t,{google_2fa_secret:!0}))),u(!1)}).catch(B=>{var M;((M=B.response)==null?void 0:M.status)===422&&(E(B.response.data),ce.dismiss())}).finally(()=>C(!1))},D=()=>{ce.processing(),Ae("POST",Te("/api/v1/settings/disable_two_factor")).then(()=>{ce.success("disabled_two_factor"),i(qy(un.merge({},t,{google_2fa_secret:!1}))),a==null||a(!1)})},A=()=>{ce.processing(),Ae("POST",Te("/api/v1/sms_reset"),{email:t.email}).then(()=>{ce.success("code_was_sent")})},O=B=>{ce.processing(),Ae("POST",Te("/api/v1/sms_reset/confirm?validate_only=true"),{code:B,email:t.email}).then(()=>{ce.success("verified_phone_number"),i(qy(un.merge({},t,{verified_phone_number:!0}))),h(!1),l||(k(),u(!0))})},P=()=>{k(),u(!0)};w.useEffect(()=>{r&&P()},[r]),w.useEffect(()=>{(!d||!c)&&o(!1)},[d,c]);const F=ni();return N(dt,{children:[p(eQt,{visible:d,setVisible:h,resendSmsCode:A,verifyPhoneNumber:O}),N(Ui,{title:e("enable_two_factor"),visible:c,onClose:u,children:[N("div",{className:"flex flex-col items-center pb-8 space-y-4",children:[p(JYt,{size:156,value:f}),p("p",{className:"font-semibold",style:{backgroundColor:F.$2,color:F.$3,colorScheme:F.$0},children:m})]}),p(We,{id:"one_time_password",type:"text",label:e("one_time_password"),onValueChange:B=>b(B),errorMessage:x==null?void 0:x.errors.one_time_password}),p(Gt,{behavior:"button",disabled:y,onClick:L,children:e("continue")}),p(Li,{external:!0,to:"https://github.com/antonioribeiro/google2fa#google-authenticator-apps",children:e("learn_more")})]}),a&&typeof s=="boolean"&&p(Ui,{title:e("disable_two_factor"),visible:s,onClose:a,children:p(Gt,{behavior:"button",disabled:y,onClick:D,children:e("confirm")})})]})}function tQt(){const[n]=pe(),e=pa(),[t,i]=w.useState(!1),[r,o]=w.useState(!1);return N(dt,{children:[p(UUe,{checkVerification:r,setCheckVerification:o,isDisableModalOpen:t,setIsDisableModalOpen:i}),p(Qt,{title:n("enable_two_factor"),children:N(K,{leftSide:"2FA",children:[!(e!=null&&e.google_2fa_secret)&&p(Gt,{behavior:"button",type:"minimal",onClick:()=>o(!0),children:n("enable")}),(e==null?void 0:e.google_2fa_secret)&&p(Gt,{behavior:"button",type:"minimal",onClick:()=>i(!0),children:n("disable")})]})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ym(){const n=Pc({overwrite:!1}),e=Qi();return(t,i)=>{const[r]=i.split("|");if(r===""){const o=un.cloneDeep(n);return o&&delete o.custom_fields[t],e(rS({object:"company",data:o}))}e(Go({object:"company",property:`custom_fields.${t}`,value:i}))}}function mve(n){const[e]=pe(),t=pa(),i=pve(),{isAdmin:r}=Po();return p(dt,{children:i&&N("div",{className:n.className,children:[!r&&p(Ls,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center space-x-1",children:[p(OT,{fontSize:18}),N("span",{children:[e("not_allowed"),"."]})]})}),r&&p(Ls,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center justify-between",children:[N("p",{className:"inline-flex items-center space-x-1",children:[p(OT,{fontSize:18}),N("span",{children:[e("upgrade_to_paid_plan"),"."]})]}),(t==null?void 0:t.company_user)&&p(Li,{to:t.company_user.ninja_portal_url||bt("/settings/account_management"),className:"ml-10",external:!0,children:e("plan_change")})]})})]})})}function nQt(){const[n]=pe(),e=ci(),t=Ym();return N(dt,{children:[p(mve,{}),p(Qt,{title:n("custom_fields"),children:e&&["user1","user2","user3","user4"].map(i=>p(Jf,{initialValue:e.custom_fields[i],field:i,placeholder:n("user_field"),onChange:r=>t(i,r)},i))})]})}function iQt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"17 1 21 5 17 9"}},{tag:"path",attr:{d:"M3 11V9a4 4 0 0 1 4-4h14"}},{tag:"polyline",attr:{points:"7 23 3 19 7 15"}},{tag:"path",attr:{d:"M21 13v2a4 4 0 0 1-4 4H3"}}]})(n)}function rQt(n){return xn({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(n)}function L1(){const n=pa(),e=T1({overwrite:!1}),[t]=pe(),[i,r]=w.useState(!1),[o,s]=w.useState(null),a=Qi(),l=(f,g)=>a(Ak({property:`company_user.react_settings.${f}`,value:g})),{getState:c}=U6e(),u=async({silent:f})=>{var g;un.isEqual((g=n==null?void 0:n.company_user)==null?void 0:g.react_settings,c().user.changes.company_user.react_settings)||(!f&&ce.processing(),Ae("PUT",Te(`/api/v1/company_users/${e==null?void 0:e.id}/preferences?include=company_user`),{react_settings:c().user.changes.company_user.react_settings}).then(m=>{!f&&ce.success("updated_user"),En(["company_users"]),a(qy(m.data.data)),a(Vpe()),r(!1)}).catch(m=>{var v;f&&ce.dismiss(),((v=m.response)==null?void 0:v.status)===412&&s(m.response.data)}))},d=w.useMemo(()=>({children:f})=>N(dt,{children:[N(Ui,{visible:i,onClose:r,title:t("preferences"),overflowVisible:!0,children:[f,p(Gt,{onClick:u,children:t("save")})]}),p(Gt,{type:"minimal",onClick:()=>r(!0),noBackgroundColor:!0,children:p(rQt,{})})]}),[i,o]),h=Ha();return{Preferences:d,update:l,preferences:h.preferences,save:u}}/*! * currency.js - v2.0.4 * http://scurker.github.io/currency.js * * Copyright (c) 2021 Jason Wilson * Released under MIT license */var oQt={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:cQt,fromCents:!1},jUe=function(e){return Math.round(e)},_ve=function(e){return Math.pow(10,e)},sQt=function(e,t){return jUe(e/t)*t},aQt=/(\d)(?=(\d{3})+\b)/g,lQt=/(\d)(?=(\d\d)+\d\b)/g;function B_(n,e){var t=this;if(!(t instanceof B_))return new B_(n,e);var i=Object.assign({},oQt,e),r=_ve(i.precision),o=T$(n,i);t.intValue=o,t.value=o/r,i.increment=i.increment||1/r,i.useVedic?i.groups=lQt:i.groups=aQt,this.s=i,this.p=r}function T$(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=0,r=e.decimal,o=e.errorOnInvalid,s=e.precision,a=e.fromCents,l=_ve(s),c=typeof n=="number",u=n instanceof B_;if(u&&a)return n.intValue;if(c||u)i=u?n.value:n;else if(typeof n=="string"){var d=new RegExp("[^-\\d"+r+"]","g"),h=new RegExp("\\"+r,"g");i=n.replace(/\((.*)\)/,"-$1").replace(d,"").replace(h,"."),i=i||0}else{if(o)throw Error("Invalid Input");i=0}return a||(i*=l,i=i.toFixed(4)),t?jUe(i):i}function cQt(n,e){var t=e.pattern,i=e.negativePattern,r=e.symbol,o=e.separator,s=e.decimal,a=e.groups,l=(""+n).replace(/^-/,"").split("."),c=l[0],u=l[1];return(n.value>=0?t:i).replace("!",r).replace("#",c.replace(a,"$1"+o)+(u?s+u:""))}B_.prototype={add:function(e){var t=this.intValue,i=this.s,r=this.p;return B_((t+=T$(e,i))/(i.fromCents?1:r),i)},subtract:function(e){var t=this.intValue,i=this.s,r=this.p;return B_((t-=T$(e,i))/(i.fromCents?1:r),i)},multiply:function(e){var t=this.intValue,i=this.s;return B_((t*=e)/(i.fromCents?1:_ve(i.precision)),i)},divide:function(e){var t=this.intValue,i=this.s;return B_(t/=T$(e,i,!1),i)},distribute:function(e){for(var t=this.intValue,i=this.p,r=this.s,o=[],s=Math[t>=0?"floor":"ceil"](t/e),a=Math.abs(t-s*e),l=r.fromCents?1:i;e!==0;e--){var c=B_(s/l,r);a-- >0&&(c=c[t>=0?"add":"subtract"](1/l)),o.push(c)}return o},dollars:function(){return~~this.value},cents:function(){var e=this.intValue,t=this.p;return~~(e%t)},format:function(e){var t=this.s;return typeof e=="function"?e(this,t):t.format(this,Object.assign({},t,e))},toString:function(){var e=this.intValue,t=this.p,i=this.s;return sQt(e/t,i.increment).toFixed(i.precision)},toJSON:function(){return this.value}};function qUe(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t}var G4;(function(n){n.event="event",n.props="prop"})(G4||(G4={}));function MC(){}function uQt(n){var e,t=void 0;return function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e&&i.length===e.length&&i.every(function(o,s){return o===e[s]})||(e=i,t=n.apply(void 0,i)),t}}function Y4(n){return!!(n||"").match(/\d/)}function UL(n){return n==null}function dQt(n){return typeof n=="number"&&isNaN(n)}function KUe(n){return UL(n)||dQt(n)||typeof n=="number"&&!isFinite(n)}function GUe(n){return n.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function hQt(n){switch(n){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function fQt(n,e,t){var i=hQt(t),r=n.search(/[1-9]/);return r=r===-1?n.length:r,n.substring(0,r)+n.substring(r,n.length).replace(i,"$1"+e)}function pQt(n){var e=w.useRef(n);e.current=n;var t=w.useRef(function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e.current.apply(e,i)});return t.current}function vve(n,e){e===void 0&&(e=!0);var t=n[0]==="-",i=t&&e;n=n.replace("-","");var r=n.split("."),o=r[0],s=r[1]||"";return{beforeDecimal:o,afterDecimal:s,hasNegation:t,addNegation:i}}function gQt(n){if(!n)return n;var e=n[0]==="-";e&&(n=n.substring(1,n.length));var t=n.split("."),i=t[0].replace(/^0+/,"")||"0",r=t[1]||"";return(e?"-":"")+i+(r?"."+r:"")}function YUe(n,e,t){for(var i="",r=t?"0":"",o=0;o<=e-1;o++)i+=n[o]||r;return i}function ALe(n,e){return Array(e+1).join(n)}function QUe(n){var e=n+"",t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var i=e.split(/[eE]/g),r=i[0],o=i[1];if(o=Number(o),!o)return t+r;r=r.replace(".","");var s=1+o,a=r.length;return s<0?r="0."+ALe("0",Math.abs(s))+r:s>=a?r=r+ALe("0",s-a):r=(r.substring(0,s)||"0")+"."+r.substring(s),t+r}function NLe(n,e,t){if(["","-"].indexOf(n)!==-1)return n;var i=(n.indexOf(".")!==-1||t)&&e,r=vve(n),o=r.beforeDecimal,s=r.afterDecimal,a=r.hasNegation,l=parseFloat("0."+(s||"0")),c=s.length<=e?"0."+s:l.toFixed(e),u=c.split("."),d=o;o&&Number(u[0])&&(d=o.split("").reverse().reduce(function(m,v,_){return m.length>_?(Number(m[0])+Number(v)).toString()+m.substring(1,m.length):v+m},u[0]));var h=YUe(u[1]||"",e,t),f=a?"-":"",g=i?".":"";return""+f+d+g+h}function mx(n,e){if(n.value=n.value,n!==null){if(n.createTextRange){var t=n.createTextRange();return t.move("character",e),t.select(),!0}return n.selectionStart||n.selectionStart===0?(n.focus(),n.setSelectionRange(e,e),!0):(n.focus(),!1)}}var XUe=uQt(function(n,e){for(var t=0,i=0,r=n.length,o=e.length;n[t]===e[t]&&t<r;)t++;for(;n[r-1-i]===e[o-1-i]&&o-i>t&&r-i>t;)i++;return{from:{start:t,end:r-i},to:{start:t,end:o-i}}}),mQt=function(n,e){var t=Math.min(n.selectionStart,e);return{from:{start:t,end:n.selectionEnd},to:{start:t,end:e}}};function _Qt(n,e,t){return Math.min(Math.max(n,e),t)}function FJ(n){return Math.max(n.selectionStart,n.selectionEnd)}function vQt(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function bQt(n){return{from:{start:0,end:0},to:{start:0,end:n.length},lastValue:""}}function yQt(n){var e=n.currentValue,t=n.formattedValue,i=n.currentValueIndex,r=n.formattedValueIndex;return e[i]===t[r]}function CQt(n,e,t,i,r,o,s){s===void 0&&(s=yQt);var a=r.findIndex(function(C){return C}),l=n.slice(0,a);!e&&!t.startsWith(l)&&(e=l,t=l+t,i=i+l.length);for(var c=t.length,u=n.length,d={},h=new Array(c),f=0;f<c;f++){h[f]=-1;for(var g=0,m=u;g<m;g++){var v=s({currentValue:t,lastValue:e,formattedValue:n,currentValueIndex:f,formattedValueIndex:g});if(v&&d[g]!==!0){h[f]=g,d[g]=!0;break}}}for(var _=i;_<c&&(h[_]===-1||!o(t[_]));)_++;var b=_===c||h[_]===-1?u:h[_];for(_=i-1;_>0&&h[_]===-1;)_--;var y=_===-1||h[_]===-1?0:h[_]+1;return y>b?b:i-y<b-i?y:b}function RLe(n,e,t,i){var r=n.length;if(e=_Qt(e,0,r),i==="left"){for(;e>=0&&!t[e];)e--;e===-1&&(e=t.indexOf(!0))}else{for(;e<=r&&!t[e];)e++;e>r&&(e=t.lastIndexOf(!0))}return e===-1&&(e=r),e}function wQt(n){for(var e=Array.from({length:n.length+1}).map(function(){return!0}),t=0,i=e.length;t<i;t++)e[t]=!!(Y4(n[t])||Y4(n[t-1]));return e}function ZUe(n,e,t,i,r,o){o===void 0&&(o=MC);var s=pQt(function(g,m){var v,_;return KUe(g)?(_="",v=""):typeof g=="number"||m?(_=typeof g=="number"?QUe(g):g,v=i(_)):(_=r(g,void 0),v=i(_)),{formattedValue:v,numAsString:_}}),a=w.useState(function(){return s(UL(n)?e:n,t)}),l=a[0],c=a[1],u=function(g,m){g.formattedValue!==l.formattedValue&&c({formattedValue:g.formattedValue,numAsString:g.value}),o(g,m)},d=n,h=t;UL(n)&&(d=l.numAsString,h=!0);var f=s(d,h);return w.useMemo(function(){c(f)},[f.formattedValue]),[l,u]}function SQt(n){return n.replace(/[^0-9]/g,"")}function EQt(n){return n}function xQt(n){var e=n.type;e===void 0&&(e="text");var t=n.displayType;t===void 0&&(t="input");var i=n.customInput,r=n.renderText,o=n.getInputRef,s=n.format;s===void 0&&(s=EQt);var a=n.removeFormatting;a===void 0&&(a=SQt);var l=n.defaultValue,c=n.valueIsNumericString,u=n.onValueChange,d=n.isAllowed,h=n.onChange;h===void 0&&(h=MC);var f=n.onKeyDown;f===void 0&&(f=MC);var g=n.onMouseUp;g===void 0&&(g=MC);var m=n.onFocus;m===void 0&&(m=MC);var v=n.onBlur;v===void 0&&(v=MC);var _=n.value,b=n.getCaretBoundary;b===void 0&&(b=wQt);var y=n.isValidInputCharacter;y===void 0&&(y=Y4);var C=n.isCharacterSame,x=qUe(n,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=ZUe(_,l,!!c,s,a,u),k=E[0],L=k.formattedValue,D=k.numAsString,A=E[1],O=w.useRef(),P=w.useRef({formattedValue:L,numAsString:D}),F=function(wt,pt){P.current={formattedValue:wt.formattedValue,numAsString:wt.value},A(wt,pt)},B=w.useState(!1),M=B[0],V=B[1],U=w.useRef(null),W=w.useRef({setCaretTimeout:null,focusTimeout:null});w.useEffect(function(){return V(!0),function(){clearTimeout(W.current.setCaretTimeout),clearTimeout(W.current.focusTimeout)}},[]);var q=s,H=function(wt,pt){var ot=parseFloat(pt);return{formattedValue:wt,value:pt,floatValue:isNaN(ot)?void 0:ot}},ie=function(wt,pt,ot){wt.selectionStart===0&&wt.selectionEnd===wt.value.length||(mx(wt,pt),W.current.setCaretTimeout=setTimeout(function(){wt.value===ot&&wt.selectionStart!==pt&&mx(wt,pt)},0))},se=function(wt,pt,ot){return RLe(wt,pt,b(wt),ot)},Q=function(wt,pt,ot){var we=b(pt),Se=CQt(pt,L,wt,ot,we,y,C);return Se=RLe(pt,Se,we),Se},Ee=function(wt){var pt=wt.formattedValue;pt===void 0&&(pt="");var ot=wt.input,we=wt.source,Se=wt.event,re=wt.numAsString,Y;if(ot){var Z=wt.inputValue||ot.value,le=FJ(ot);ot.value=pt,Y=Q(Z,pt,le),Y!==void 0&&ie(ot,Y,pt)}pt!==L&&F(H(pt,re),{event:Se,source:we})};w.useEffect(function(){var wt=P.current,pt=wt.formattedValue,ot=wt.numAsString;(L!==pt||D!==ot)&&F(H(L,D),{event:void 0,source:G4.props})},[L,D]);var Fe=U.current?FJ(U.current):void 0,He=typeof window<"u"?w.useLayoutEffect:w.useEffect;He(function(){var wt=U.current;if(L!==P.current.formattedValue&&wt){var pt=Q(P.current.formattedValue,L,Fe);wt.value=L,ie(wt,pt,L)}},[L]);var ke=function(wt,pt,ot){var we=pt.target,Se=O.current?mQt(O.current,we.selectionEnd):XUe(L,wt),re=Object.assign(Object.assign({},Se),{lastValue:L}),Y=a(wt,re),Z=q(Y);if(Y=a(Z,void 0),d&&!d(H(Z,Y))){var le=pt.target,te=FJ(le),me=Q(wt,L,te);return le.value=L,ie(le,me,L),!1}return Ee({formattedValue:Z,numAsString:Y,inputValue:wt,event:pt,source:ot,input:pt.target}),!0},Me=function(wt,pt){pt===void 0&&(pt=0);var ot=wt.selectionStart,we=wt.selectionEnd;O.current={selectionStart:ot,selectionEnd:we+pt}},je=function(wt){var pt=wt.target,ot=pt.value,we=ke(ot,wt,G4.event);we&&h(wt),O.current=void 0},qe=function(wt){var pt=wt.target,ot=wt.key,we=pt.selectionStart,Se=pt.selectionEnd,re=pt.value;re===void 0&&(re="");var Y;ot==="ArrowLeft"||ot==="Backspace"?Y=Math.max(we-1,0):ot==="ArrowRight"?Y=Math.min(we+1,re.length):ot==="Delete"&&(Y=we);var Z=0;ot==="Delete"&&we===Se&&(Z=1);var le=ot==="ArrowLeft"||ot==="ArrowRight";if(Y===void 0||we!==Se&&!le){f(wt),Me(pt,Z);return}var te=Y;if(le){var me=ot==="ArrowLeft"?"left":"right";te=se(re,Y,me),te!==Y&&wt.preventDefault()}else ot==="Delete"&&!y(re[Y])?te=se(re,Y,"right"):ot==="Backspace"&&!y(re[Y])&&(te=se(re,Y,"left"));te!==Y&&ie(pt,te,re),f(wt),Me(pt,Z)},Be=function(wt){var pt=wt.target,ot=function(){var we=pt.selectionStart,Se=pt.selectionEnd,re=pt.value;if(re===void 0&&(re=""),we===Se){var Y=se(re,we);Y!==we&&ie(pt,Y,re)}};ot(),requestAnimationFrame(function(){ot()}),g(wt),Me(pt)},_t=function(wt){wt.persist&&wt.persist();var pt=wt.target,ot=wt.currentTarget;U.current=pt,W.current.focusTimeout=setTimeout(function(){var we=pt.selectionStart,Se=pt.selectionEnd,re=pt.value;re===void 0&&(re="");var Y=se(re,we);Y!==we&&!(we===0&&Se===re.length)&&ie(pt,Y,re),m(Object.assign(Object.assign({},wt),{currentTarget:ot}))},0)},Wt=function(wt){U.current=null,clearTimeout(W.current.focusTimeout),clearTimeout(W.current.setCaretTimeout),v(wt)},Tt=M&&vQt()?"numeric":void 0,rn=Object.assign({inputMode:Tt},x,{type:e,value:L,onChange:je,onKeyDown:qe,onMouseUp:Be,onFocus:_t,onBlur:Wt});if(t==="text")return r?ae.createElement(ae.Fragment,null,r(L,x)||null):ae.createElement("span",Object.assign({},x,{ref:o}),L);if(i){var _n=i;return ae.createElement(_n,Object.assign({},rn,{ref:o}))}return ae.createElement("input",Object.assign({},rn,{ref:o}))}function Xse(n,e){var t=e.decimalScale,i=e.fixedDecimalScale,r=e.prefix;r===void 0&&(r="");var o=e.suffix;o===void 0&&(o="");var s=e.allowNegative,a=e.thousandsGroupStyle;if(a===void 0&&(a="thousand"),n===""||n==="-")return n;var l=tK(e),c=l.thousandSeparator,u=l.decimalSeparator,d=t!==0&&n.indexOf(".")!==-1||t&&i,h=vve(n,s),f=h.beforeDecimal,g=h.afterDecimal,m=h.addNegation;return t!==void 0&&(g=YUe(g,t,!!i)),c&&(f=fQt(f,c,a)),r&&(f=r+f),o&&(g=g+o),m&&(f="-"+f),n=f+(d&&u||"")+g,n}function tK(n){var e=n.decimalSeparator;e===void 0&&(e=".");var t=n.thousandSeparator,i=n.allowedDecimalSeparators;return t===!0&&(t=","),i||(i=[e,"."]),{decimalSeparator:e,thousandSeparator:t,allowedDecimalSeparators:i}}function TQt(n,e){n===void 0&&(n="");var t=new RegExp("(-)"),i=new RegExp("(-)(.)*(-)"),r=t.test(n),o=i.test(n);return n=n.replace(/-/g,""),r&&!o&&e&&(n="-"+n),n}function kQt(n,e){return new RegExp("(^-)|[0-9]|"+GUe(n),e?"g":void 0)}function IQt(n,e,t){return n===""?!0:!(e!=null&&e.match(/\d/))&&!(t!=null&&t.match(/\d/))&&typeof n=="string"&&!isNaN(Number(n))}function LQt(n,e,t){var i;e===void 0&&(e=bQt(n));var r=t.allowNegative,o=t.prefix;o===void 0&&(o="");var s=t.suffix;s===void 0&&(s="");var a=t.decimalScale,l=e.from,c=e.to,u=c.start,d=c.end,h=tK(t),f=h.allowedDecimalSeparators,g=h.decimalSeparator,m=n[d]===g;if(Y4(n)&&(n===o||n===s)&&e.lastValue==="")return n;if(d-u===1&&f.indexOf(n[u])!==-1){var v=a===0?"":g;n=n.substring(0,u)+v+n.substring(u+1,n.length)}var _=function(U,W,q){var H=!1,ie=!1;o.startsWith("-")?H=!1:U.startsWith("--")?(H=!1,ie=!0):s.startsWith("-")&&U.length===s.length?H=!1:U[0]==="-"&&(H=!0);var se=H?1:0;return ie&&(se=2),se&&(U=U.substring(se),W-=se,q-=se),{value:U,start:W,end:q,hasNegation:H}},b=_(n,u,d),y=b.hasNegation;i=b,n=i.value,u=i.start,d=i.end;var C=_(e.lastValue,l.start,l.end),x=C.start,E=C.end,k=C.value,L=n.substring(u,d);n.length&&k.length&&(x>k.length-s.length||E<o.length)&&!(L&&s.startsWith(L))&&(n=k);var D=0;n.startsWith(o)?D+=o.length:u<o.length&&(D=u),n=n.substring(D),d-=D;var A=n.length,O=n.length-s.length;n.endsWith(s)?A=O:(d>O||d>n.length-s.length)&&(A=d),n=n.substring(0,A),n=TQt(y?"-"+n:n,r),n=(n.match(kQt(g,!0))||[]).join("");var P=n.indexOf(g);n=n.replace(new RegExp(GUe(g),"g"),function(U,W){return W===P?".":""});var F=vve(n,r),B=F.beforeDecimal,M=F.afterDecimal,V=F.addNegation;return c.end-c.start<l.end-l.start&&B===""&&m&&!parseFloat(M)&&(n=V?"-":""),n}function DQt(n,e){var t=e.prefix;t===void 0&&(t="");var i=e.suffix;i===void 0&&(i="");var r=Array.from({length:n.length+1}).map(function(){return!0}),o=n[0]==="-";r.fill(!1,0,t.length+(o?1:0));var s=n.length;return r.fill(!1,s-i.length+1,s+1),r}function AQt(n){var e=tK(n),t=e.thousandSeparator,i=e.decimalSeparator,r=n.prefix;r===void 0&&(r="");var o=n.allowNegative;if(o===void 0&&(o=!0),t===i)throw new Error(` Decimal separator can't be same as thousand separator. thousandSeparator: `+t+` (thousandSeparator = {true} is same as thousandSeparator = ",") decimalSeparator: `+i+` (default value for decimalSeparator is .) `);return r.startsWith("-")&&o&&(console.error(` Prefix can't start with '-' when allowNegative is true. prefix: `+r+` allowNegative: `+o+` `),o=!1),Object.assign(Object.assign({},n),{allowNegative:o})}function NQt(n){n=AQt(n),n.decimalSeparator,n.allowedDecimalSeparators,n.thousandsGroupStyle;var e=n.suffix,t=n.allowNegative,i=n.allowLeadingZeros,r=n.onKeyDown;r===void 0&&(r=MC);var o=n.onBlur;o===void 0&&(o=MC);var s=n.thousandSeparator,a=n.decimalScale,l=n.fixedDecimalScale,c=n.prefix;c===void 0&&(c="");var u=n.defaultValue,d=n.value,h=n.valueIsNumericString,f=n.onValueChange,g=qUe(n,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),m=tK(n),v=m.decimalSeparator,_=m.allowedDecimalSeparators,b=function(V){return Xse(V,n)},y=function(V,U){return LQt(V,U,n)},C=UL(d)?u:d,x=h??IQt(C,c,e);UL(d)?UL(u)||(x=x||typeof u=="number"):x=x||typeof d=="number";var E=function(V){return KUe(V)?V:(typeof V=="number"&&(V=QUe(V)),x&&typeof a=="number"?NLe(V,a,!!l):V)},k=ZUe(E(d),E(u),!!x,b,y,f),L=k[0],D=L.numAsString,A=L.formattedValue,O=k[1],P=function(V){var U=V.target,W=V.key,q=U.selectionStart,H=U.selectionEnd,ie=U.value;if(ie===void 0&&(ie=""),(W==="Backspace"||W==="Delete")&&H<c.length){V.preventDefault();return}if(q!==H){r(V);return}W==="Backspace"&&ie[0]==="-"&&q===c.length+1&&t&&mx(U,1),a&&l&&(W==="Backspace"&&ie[q-1]===v?(mx(U,q-1),V.preventDefault()):W==="Delete"&&ie[q]===v&&V.preventDefault()),_!=null&&_.includes(W)&&ie[q]===v&&mx(U,q+1);var se=s===!0?",":s;W==="Backspace"&&ie[q-1]===se&&mx(U,q-1),W==="Delete"&&ie[q]===se&&mx(U,q+1),r(V)},F=function(V){var U=D;if(U.match(/\d/g)||(U=""),i||(U=gQt(U)),l&&a&&(U=NLe(U,a,l)),U!==D){var W=Xse(U,n);O({formattedValue:W,value:U,floatValue:parseFloat(U)},{event:V,source:G4.event})}o(V)},B=function(V){return V===v?!0:Y4(V)},M=function(V){var U=V.currentValue,W=V.lastValue,q=V.formattedValue,H=V.currentValueIndex,ie=V.formattedValueIndex,se=U[H],Q=q[ie],Ee=XUe(W,U),Fe=Ee.to,He=function(ke){return y(ke).indexOf(".")+c.length};return d===0&&l&&a&&U[Fe.start]===v&&He(U)<H&&He(q)>ie?!1:H>=Fe.start&&H<Fe.end&&_&&_.includes(se)&&Q===v?!0:se===Q};return Object.assign(Object.assign({},g),{value:A,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:M,onValueChange:O,format:b,removeFormatting:y,getCaretBoundary:function(V){return DQt(V,n)},onKeyDown:P,onBlur:F})}function RQt(n){var e=NQt(n);return ae.createElement(xQt,Object.assign({},e))}function wo(n){const e=ni(),t=ci(),i=Ha({overwrite:!1}),[r,o]=w.useState(typeof n.value=="number"?n.value:n.value?parseFloat(String(n.value)):void 0),s=()=>{if(n.precision!==0)return t!=null&&t.use_comma_as_decimal_place?",":"."},a=c=>{var d,h;const u=s();if(u===void 0)return 0;if(n.disablePrecision&&c)return c.includes(u)?((h=(d=c.split(u))==null?void 0:d[1])==null?void 0:h.length)||2:void 0;if(!n.disablePrecision)return typeof n.precision=="number"?n.precision:i!=null&&i.number_precision&&(i==null?void 0:i.number_precision)>0&&(i==null?void 0:i.number_precision)<=100?i.number_precision:2},l=()=>{if(n.precision!==0)return t!=null&&t.use_comma_as_decimal_place?".":","};return QD(()=>{n.onValueChange&&n.changeOverride&&n.onValueChange(typeof r=="number"?String(r):"0")},500,[r]),w.useEffect(()=>{o(n.value?parseFloat(String(n.value)):void 0)},[n.value]),N("section",{children:[n.label&&N(pg,{className:Nt("mb-2",{"whitespace-nowrap":n.withoutLabelWrapping}),for:n.id,children:[n.label,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),p("div",{className:"relative",children:p(RQt,{className:Nt(`w-full py-2 px-3 rounded text-sm disabled:opacity-75 disabled:cursor-not-allowed ${n.className}`,{"border border-gray-300":n.border!==!1}),value:r||"",placeholder:n.placeholder??void 0,onChange:c=>{if(n.onValueChange&&n.changeOverride){const u=c.target.value,d=u?B_(u,{separator:l(),decimal:s(),symbol:"",precision:a(u)===void 0?0:a(u)}).value:void 0;o(d)}},onBlur:c=>{if(n.onValueChange&&!n.changeOverride){const u=c.target.value,d=u?String(B_(u,{separator:l(),decimal:s(),symbol:"",precision:a(u)===void 0?0:a(u)}).value):"0";n.onValueChange(d)}},thousandSeparator:l(),decimalSeparator:s(),decimalScale:a(),allowNegative:!0,style:{backgroundColor:e.$1,borderColor:e.$5,color:e.$3,...n.style},disabled:n.disabled})}),n.errorMessage&&p(Ls,{className:"mt-2",type:"danger",children:n.errorMessage})]})}function OQt(){const[n]=pe(),e=Qi(),t=Ha(),i=(r,o)=>{e(Ak({property:r,value:o}))};return N("div",{className:"space-y-4",children:[N(Qt,{title:n("preferences"),children:[p(K,{leftSide:n("show_pdf_preview"),children:p(ft,{checked:typeof t.show_pdf_preview=="boolean"?t.show_pdf_preview:!0,onValueChange:r=>i("company_user.react_settings.show_pdf_preview",r)})}),p(K,{leftSide:n("show_document_preview"),children:p(ft,{checked:!!t.show_document_preview,onValueChange:r=>i("company_user.react_settings.show_document_preview",r)})}),p(K,{leftSide:n("react_notification_link"),leftSideHelp:n("react_notification_link_help"),children:p(ft,{checked:t.react_notification_link,onValueChange:r=>i("company_user.react_settings.react_notification_link",r)})}),p(K,{leftSide:n("number_precision"),leftSideHelp:n("number_precision_help"),children:p(wo,{precision:0,value:(t==null?void 0:t.number_precision)||"",onValueChange:r=>i("company_user.react_settings.number_precision",Number(r)),placeholder:n("number_precision"),disablePrecision:!0})}),p(K,{leftSide:n("dark_mode"),children:p(ft,{checked:!!(t!=null&&t.dark_mode),onChange:r=>i("company_user.react_settings.dark_mode",r)})}),p(K,{leftSide:n("show_table_footer"),leftSideHelp:n("show_table_footer_help"),children:p(ft,{checked:!!(t!=null&&t.show_table_footer),onValueChange:r=>i("company_user.react_settings.show_table_footer",r)})}),p(K,{leftSide:n("auto_expand_product_table_notes"),leftSideHelp:n("auto_expand_product_table_notes_help"),children:p(ft,{checked:!!t.preferences.auto_expand_product_table_notes,onValueChange:r=>i("company_user.react_settings.preferences.auto_expand_product_table_notes",r)})}),p(K,{leftSide:n("enable_public_notifications"),leftSideHelp:n("enable_public_notifications_help"),children:p(ft,{checked:!!t.preferences.enable_public_notifications,onValueChange:r=>i("company_user.react_settings.preferences.enable_public_notifications",r)})}),p(K,{leftSide:n("use_system_fonts"),leftSideHelp:n("use_system_fonts_help"),children:p(ft,{checked:!!t.preferences.use_system_fonts,onValueChange:r=>i("company_user.react_settings.preferences.use_system_fonts",r)})}),p(f3t,{})]}),N(BJ,{title:`${n("dashboard")} ${n("charts")}`,path:"dashboard_charts",children:[p(lO,{path:"dashboard_charts.default_view"}),p(lO,{path:"dashboard_charts.currency"}),p(lO,{path:"dashboard_charts.range"})]}),p(BJ,{title:n("datatable"),path:"datatables",children:p(lO,{path:"datatables.clients.sort"})}),p(BJ,{title:n("reports"),path:"reports",children:p(lO,{path:"reports.columns"})})]})}function BJ({title:n,children:e,path:t}){const{preferences:i}=L1();return JSON.stringify(un.get(sH,t))===JSON.stringify(un.get(i,t))?null:p(Qt,{title:n,children:e})}function lO({path:n}){const{preferences:e,update:t}=L1(),{t:i}=pe(),r={"dashboard_charts.default_view":`${i("default")} ${i("view")}`,"dashboard_charts.currency":i("currency"),"dashboard_charts.range":i("range"),"datatables.clients.sort":`${i("clients")} ${i("sort")}`,"reports.columns":i("columns")};return un.get(sH,n)===un.get(e,n)?null:p(wl,{onClick:()=>t(`preferences.${n}`,un.get(sH,n)),children:N(iA,{className:"space-x-2",children:[p("div",{children:r[n]}),p(kg,{size:18})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function PQt(){const{t:n}=pe();return[{name:n("details"),href:"/settings/user_details"},{name:n("password"),href:"/settings/user_details/password"},{name:n("oauth_mail"),href:"/settings/user_details/connect",enabled:Ro()},{name:n("enable_two_factor"),href:"/settings/user_details/enable_two_factor"},{name:n("accent_color"),href:"/settings/user_details/accent_color"},{name:n("notifications"),href:"/settings/user_details/notifications"},{name:n("custom_fields"),href:"/settings/user_details/custom_fields"},{name:n("preferences"),href:"/settings/user_details/preferences"}]}function MQt(){Pi("user_details");const[n]=pe(),e=Qi(),t=pa(),{isAdmin:i}=Po(),r=PQt(),o=Pc(),s=Lg(),[a,l]=w.useState(),[c,u]=w.useState(!1),d=[{name:n("settings"),href:"/settings"},{name:n("user_details"),href:"/settings/user_details"}],[h,f]=Yo(Wq),[g,m]=w.useState(!1),v=Oc(y=>y.user),{save:_}=L1(),b=(y,C)=>{ce.processing(),l(void 0);const x=[Ae("PUT",Te("/api/v1/users/:id?include=company_user",{id:t.id}),v.changes,{headers:{"X-Api-Password":y}})];i&&x.push(Ae("PUT",Te("/api/v1/companies/:id",{id:o==null?void 0:o.id}),o)),Ipe.all(x).then(E=>{ce.success("updated_settings"),En(["users"]),h&&(En(["statics"]),f(!1)),E[0].data.data.phone!==(t==null?void 0:t.phone)&&(t!=null&&t.google_2fa_secret)&&!E[0].data.data.verified_phone_number&&u(!0),e(qy(E[0].data.data)),window.dispatchEvent(new CustomEvent("user.updated")),i&&e(US({object:"company",data:E[1].data.data}))}).catch(E=>{var k,L;((k=E.response)==null?void 0:k.status)===412&&(s(C),m(!0)),((L=E.response)==null?void 0:L.status)==422&&(ce.dismiss(),l(E.response.data))}),_({silent:!0})};return w.useEffect(()=>{e(Vpe())},[t]),N(dt,{children:[N(ir,{onSaveClick:()=>m(!0),onCancelClick:()=>e(hbt()),title:n("user_details"),breadcrumbs:d,docsLink:"en/basic-settings/#user_details",children:[p(ap,{show:g,onClose:m,onSave:b}),p(QS,{tabs:r,className:"mt-6"}),p("div",{className:"my-4",children:p(Tg,{context:a})})]}),p(UUe,{checkVerification:c,setCheckVerification:u,checkOnlyPhoneNumberVerification:!0})]})}function FQt(){var g,m;const[n]=pe(),e=ji(),t=Qi(),[i,r]=w.useState(!1),[o,s]=w.useState(""),a=[{property:"amount",translation:n("amount")},{property:"address2",translation:n("address2")},{property:"balance",translation:n("balance")},{property:"country",translation:n("country")},{property:"credit",translation:n("credit")},{property:"credit_card",translation:n("credit_card")},{property:"date",translation:n("date")},{property:"description",translation:n("description")},{property:"details",translation:n("details")},{property:"discount",translation:n("discount")},{property:"due_date",translation:n("due_date")},{property:"email",translation:n("email")},{property:"from",translation:n("from")},{property:"hours",translation:n("hours")},{property:"id_number",translation:n("id_number")},{property:"invoice",translation:n("invoice")},{property:"item",translation:n("item")},{property:"line_total",translation:n("line_total")},{property:"po_number",translation:n("po_number")},{property:"paid_to_date",translation:n("paid_to_date")},{property:"partial_due",translation:n("partial_due")},{property:"payment_date",translation:n("payment_date")},{property:"phone",translation:n("phone")},{property:"quantity",translation:n("quantity")},{property:"quote",translation:n("quote")},{property:"rate",translation:n("rate")},{property:"service",translation:n("service")},{property:"statement",translation:n("statement")},{property:"address1",translation:n("address1")},{property:"subtotal",translation:n("subtotal")},{property:"surcharge",translation:n("surcharge")},{property:"tax",translation:n("tax")},{property:"taxes",translation:n("taxes")},{property:"terms",translation:n("terms")},{property:"to",translation:n("to")},{property:"total",translation:n("total")},{property:"unit_cost",translation:n("unit_cost")},{property:"vat_number",translation:n("vat_number")},{property:"valid_until",translation:n("valid_until")},{property:"website",translation:n("website")}],[l,c]=w.useState(a);w.useEffect(()=>{var _;const v=Object.keys(((_=e==null?void 0:e.settings)==null?void 0:_.translations)??[]);c(a.filter(b=>!v.includes(b.property)))},[e]);const u=v=>{const _=a.find(b=>b.property===v);return _?_.translation:n(v)},d=v=>{var b;const _=un.cloneDeep(e);(((b=_.settings.translations)==null?void 0:b.length)<=1||!_.settings.translations)&&(_.settings.translations={}),_.settings.translations[v]="",t(rS({object:"company",data:_}))},h=v=>t(Go({object:"company",property:v.target.id,value:v.target.value})),f=v=>{var b;const _=un.cloneDeep(e);(b=_==null?void 0:_.settings)==null||delete b.translations[v],t(rS({object:"company",data:_}))};return N(dt,{children:[N(Ui,{title:n("add_custom"),visible:i,onClose:r,children:[p(We,{onChange:v=>s(v.target.value),id:"custom_field",label:n("custom_field")}),p(Gt,{onClick:()=>{d(o),s(""),r(!1)},children:n("submit")}),p(Li,{external:!0,to:"https://github.com/invoiceninja/invoiceninja/blob/master/resources/lang/en/texts.php",children:n("labels")})]}),N(Qt,{title:n("custom_labels"),onFormSubmit:v=>v.preventDefault(),children:[p(K,{leftSide:N(Cn,{onChange:v=>d(v.target.value),defaultValue:"",children:[p("option",{value:""}),l.map(v=>p("option",{value:v.property,children:v.translation},v.property))]}),children:p(Gt,{behavior:"button",type:"minimal",onClick:()=>r(!0),children:n("add_custom")})}),Object.keys(((g=e==null?void 0:e.settings)==null?void 0:g.translations)??[]).length>0&&p(_i,{}),Object.keys(((m=e==null?void 0:e.settings)==null?void 0:m.translations)??[]).map(v=>{var _;return p(K,{leftSide:u(v),children:N("div",{className:"flex items-center space-x-4",children:[p(We,{value:((_=e==null?void 0:e.settings)==null?void 0:_.translations[v])||"",onChange:h,id:`settings.translations.${v}`}),p(kg,{className:"cursor-pointer",onClick:()=>f(v)})]})},v)})]})]})}function Bt(n){const{propertyKey:e,defaultValue:t="",onCheckboxChange:i}=n,{isCompanySettingsActive:r}=ea(),o=ji(),s=So(),[a,l]=w.useState(typeof(o==null?void 0:o.settings[e])<"u"),c=u=>{l(u);const d=un.cloneDeep(o==null?void 0:o.settings);d&&(u&&!Object.hasOwn(o==null?void 0:o.settings,e)&&(d[e]=t),!u&&Object.hasOwn(o==null?void 0:o.settings,e)&&delete d[e],s("settings",d))};return w.useEffect(()=>{c(a)},[a]),w.useEffect(()=>{o&&Object.hasOwn(o.settings,e)&&c(!0)},[e]),w.useEffect(()=>{typeof n.checked=="boolean"&&l(n.checked)},[n.checked]),N("div",{className:"flex items-center",children:[!r&&p(Ph,{checked:a,onValueChange:(u,d)=>{l(!!d),i==null||i(!!d)}}),p("div",{className:Nt({"opacity-75":!a&&!r,"cursor-pointer":!r}),onClick:()=>{!r&&l(u=>!u),!r&&(i==null||i(!a))},children:n.labelElement})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ma(){const n=ji(),{isCompanySettingsActive:e}=ea();return t=>n&&typeof n.settings[t]>"u"&&!e}function $t(n){const{label:e,helpLabel:t,required:i}=n,r=ni();return N("div",{className:"flex flex-col text-sm",children:[N("span",{className:"font-medium",style:{color:r.$3},children:[e,i&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),t&&p(dt,{children:typeof t=="string"?p("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:t},style:{color:r.$3,opacity:.8}}):p("div",{className:"text-xs",style:{color:r.$3,opacity:.8},children:t})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function bve(){const{data:n}=ed(),[e,t]=w.useState([]);return w.useEffect(()=>{n!=null&&n.currencies&&t(n.currencies)},[n]),e}function lA(n){const e=bve();return p(YS,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,children:e.map((t,i)=>N("option",{value:t.id,children:[t.name," (",t.code,")"]},i))})}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Zse(n,e=0,t=".",i=","){const r=typeof n=="string"?parseFloat(n):n,o=r<0?"-":"",s=Math.abs(r).toFixed(e).toString().split("."),a=s[0],l=s[1]||"",c=[];for(let d=a.length;d>0;d-=3)c.unshift(a.substring(Math.max(0,d-3),d));const u=c.join(i);return o+u+(l?t+l:"")}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */let yve=class{static formatValue(e,t){const i=t.thousand_separator,r=t.decimal_separator,o=t.precision;return Zse(e,o,r,i)}static formatMoney(e,t,i,r){var h,f;let o=t.thousand_separator,s=t.decimal_separator,a=t.swap_currency_symbol;const l=t.precision,c=t.code;((h=i.thousand_separator)==null?void 0:h.length)>=1&&(o=i.thousand_separator),((f=i.decimal_separator)==null?void 0:f.length)>=1&&(s=i.decimal_separator),i.swap_currency_symbol&&(a=i.swap_currency_symbol);const u=Zse(e,l,s,o),d=t.symbol;return r!=null&&r.showCurrencyCode&&t.code==="CHF"?`${c} ${u}`:r!=null&&r.showCurrencyCode?`${u} ${c}`:a?`${u} ${d.trim()}`:r!=null&&r.showCurrencyCode?this.formatValue(u,t):`${d} ${u}`}};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ZS(){const n=R_e();return e=>n.find(t=>t.id==e)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function JS(n){const e=bve(),{resolveBy:t}=n||{};return t==="code"?i=>e.find(r=>r.code===i):i=>e.find(r=>r.id==i)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function tf(){const n=ZS(),e=JS(),t=ci();return(i,r,o,s,a)=>{const l=r||(t==null?void 0:t.settings.country_id),c=o&&o!=="999"?o:t==null?void 0:t.settings.currency_id,u=n(l),d=e(c);return u&&d?yve.formatMoney(isNaN(Number(i))?0:i,d,u,{showCurrencyCode:a??t.settings.show_currency_code}):s?Number(i).toFixed(s):i}}function BQt(){var d,h,f,g,m,v,_;const[n]=pe(),{data:e}=ed(),t=Pc(),{isCompanySettingsActive:i}=ea(),r=Qi(),o=tf(),s=ma(),a=So(),l=Fi($s),c=Ar(Wq),u=[{id:"symbol",title:`${n("currency_symbol")}: ${o(1e3,t==null?void 0:t.settings.country_id,t==null?void 0:t.settings.currency_id,2)}`,value:"false"},{id:"code",title:`${n("currency_code")}: ${o(1e3,t==null?void 0:t.settings.country_id,t==null?void 0:t.settings.currency_id,2,!0)}`,value:"true"}];return p(dt,{children:N(Qt,{title:n("settings"),children:[p(K,{leftSide:p(Bt,{propertyKey:"currency_id",labelElement:p($t,{label:n("currency")}),defaultValue:"1"}),children:p(lA,{value:(t==null?void 0:t.settings.currency_id)||"",onChange:b=>a("settings.currency_id",b),disabled:s("currency_id"),errorMessage:l==null?void 0:l.errors["settings.currency_id"]})}),p(K,{leftSide:p(Bt,{propertyKey:"show_currency_code",labelElement:p($t,{label:n("currency_format")}),defaultValue:"false"}),children:p(L7e,{onValueChange:b=>r(Go({object:"company",property:"settings.show_currency_code",value:b==="true"})),name:"show_currency_code",options:u,defaultSelected:((h=(d=t==null?void 0:t.settings)==null?void 0:d.show_currency_code)==null?void 0:h.toString())??"false",disabled:s("show_currency_code")})}),!f1()&&p(K,{leftSide:p(Bt,{propertyKey:"language_id",labelElement:p($t,{label:n("language")}),defaultValue:"1"}),children:p(QF,{onChange:b=>{c(!0),a("settings.language_id",b)},value:((f=t==null?void 0:t.settings)==null?void 0:f.language_id)||"",disabled:s("language_id"),errorMessage:l==null?void 0:l.errors["settings.language_id"]})}),p(K,{leftSide:p(Bt,{propertyKey:"timezone_id",labelElement:p($t,{label:n("timezone")}),defaultValue:"1"}),children:p(YS,{value:((g=t==null?void 0:t.settings)==null?void 0:g.timezone_id)||"1",disabled:s("timezone_id"),errorMessage:l==null?void 0:l.errors["settings.timezone_id"],onValueChange:b=>a("settings.timezone_id",b),children:e==null?void 0:e.timezones.sort((b,y)=>b.name.localeCompare(y.name)).map(b=>p("option",{value:b.id,children:b.name},b.id))})}),p(K,{leftSide:p(Bt,{propertyKey:"date_format_id",labelElement:p($t,{label:n("date_format")}),defaultValue:"1"}),children:p(Cn,{value:((m=t==null?void 0:t.settings)==null?void 0:m.date_format_id)||"1",onValueChange:b=>a("settings.date_format_id",b),disabled:s("date_format_id"),errorMessage:l==null?void 0:l.errors["settings.date_format_id"],customSelector:!0,dismissable:!1,children:e==null?void 0:e.date_formats.map(b=>p("option",{value:b.id,children:Un().format(b.format_moment)},b.id))})}),p(K,{leftSide:p(Bt,{propertyKey:"military_time",labelElement:p($t,{label:n("military_time")}),defaultValue:!1}),children:p(ft,{checked:!!((v=t==null?void 0:t.settings)!=null&&v.military_time),onChange:b=>r(Go({object:"company",property:"settings.military_time",value:b})),disabled:s("military_time"),cypressRef:"militaryTimeToggle"})}),p(K,{leftSide:p(Bt,{propertyKey:"enable_rappen_rounding",labelElement:p($t,{label:n("rappen_rounding")}),defaultValue:!1}),children:p(ft,{checked:!!((_=t==null?void 0:t.settings)!=null&&_.enable_rappen_rounding),onChange:b=>r(Go({object:"company",property:"settings.enable_rappen_rounding",value:b})),disabled:s("enable_rappen_rounding")})}),i&&p(K,{leftSide:n("decimal_comma"),leftSideHelp:n("use_comma_as_decimal_place"),children:p(ft,{checked:!!(t!=null&&t.use_comma_as_decimal_place),onChange:b=>a("use_comma_as_decimal_place",b)})}),i&&p(_i,{}),i&&p(K,{leftSide:n("first_month_of_the_year"),children:N(Cn,{value:(t==null?void 0:t.first_month_of_year)||"1",onValueChange:b=>a("first_month_of_year",b),errorMessage:l==null?void 0:l.errors["settings.first_month_of_year"],customSelector:!0,dismissable:!1,children:[p("option",{value:"1",children:n("january")}),p("option",{value:"2",children:n("february")}),p("option",{value:"3",children:n("march")}),p("option",{value:"4",children:n("april")}),p("option",{value:"5",children:n("may")}),p("option",{value:"6",children:n("june")}),p("option",{value:"7",children:n("july")}),p("option",{value:"8",children:n("august")}),p("option",{value:"9",children:n("september")}),p("option",{value:"10",children:n("october")}),p("option",{value:"11",children:n("november")}),p("option",{value:"12",children:n("december")})]})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $Qt(){const[n]=pe(),{isGroupSettingsActive:e,isClientSettingsActive:t}=ea();let i=[{name:n("settings"),href:"/settings/localization"},{name:n("custom_labels"),href:"/settings/localization/custom_labels"}];return(e||t)&&(i=i.filter(r=>n(r.name)!==n("custom_labels"))),i}function VQt(){const[n]=pe();Pi("localization");const e=$Qt(),t=[{name:n("settings"),href:"/settings"},{name:n("localization"),href:"/settings/localization"}],i=Tu(),r=lp();return N(ir,{onSaveClick:i,onCancelClick:r,title:n("localization"),breadcrumbs:t,docsLink:"en/basic-settings/#localization",children:[p(QS,{tabs:e,className:"mt-6"}),p("div",{className:"my-4",children:p(Tg,{})})]})}const HQt={variant:"generic"};function pr(n){n={...HQt,...n};const e=vo(),t={...n.style};return n.variant==="primary"&&(t.backgroundColor=t.backgroundColor||e,t.color="white"),p("span",{style:t,className:Nt("text-xs px-2 py-1 rounded",{"bg-gray-500 text-white":n.variant==="generic","bg-white border text-gray-900 hover:bg-white":n.variant==="white","bg-yellow-600 text-white":n.variant==="yellow","bg-red-600 text-white":n.variant==="red","bg-blue-300 text-white":n.variant==="light-blue","bg-blue-400 text-white":n.variant==="blue","bg-blue-700 text-white":n.variant==="dark-blue","bg-orange-500 text-white":n.variant==="orange","bg-green-500 text-white":n.variant==="green","bg-black text-white":n.variant==="black","bg-purple text-white":n.variant==="purple"}),children:n.children})}function Hm(n){const[e]=pe(),t=Sr(n.entity);return t===Zi.Active?p(pr,{variant:"primary",children:e("active")}):t===Zi.Archived?p(pr,{variant:"yellow",children:e("archived")}):t===Zi.Deleted?p(pr,{variant:"red",children:e("deleted")}):p(dt,{})}const WQt={totalPages:1,currentPage:1,currentPerPage:"10",onPageChange:n=>n,onRowsChange:n=>n,totalRecords:0};function JUe(n){n={...WQt,...n};const[e]=pe(),t=r=>{r>=1&&r<=n.totalPages&&n.onPageChange(r)},i=ni();return N("div",{className:"flex items-center justify-between space-x-2 my-3 overflow-y-auto pb-2",children:[p("div",{className:"flex justify-center md:justify-start items-center space-x-4",children:N("div",{className:"flex items-center space-x-2 flex-wrap",children:[N(Cn,{value:n.currentPerPage,onValueChange:r=>n.onRowsChange(r),children:[p("option",{value:"10",children:"10"}),p("option",{value:"50",children:"50"}),p("option",{value:"100",children:"100"})]}),p("label",{htmlFor:"location",className:"block text-sm font-medium",style:{color:i.$3},children:e("rows")})]})}),N("p",{className:"hidden lg:block text-sm font-medium",style:{color:i.$3},children:[Ms("pdf_page_info",{current:n.currentPage,total:n.totalPages}),".",n.totalRecords&&N("span",{className:"ml-1",children:[e("total_results"),": ",n.totalRecords]})]}),N("nav",{className:"flex justify-center md:justify-end my-4 md:my-0 items-center",style:{color:i.$3},children:[n.leftSideChevrons,p("button",{onClick:()=>t(1),className:"py-1.5 px-2 border rounded-l",style:{backgroundColor:i.$1,borderColor:i.$5},children:p(J1t,{})}),p("button",{onClick:()=>t(n.currentPage-1),className:"py-1.5 px-2 bg-white border-b border-t border-r hover:bg-gray-50",style:{backgroundColor:i.$1,borderColor:i.$5},children:p(K8e,{})}),p("button",{"data-cy":"dataTableChevronRight",onClick:()=>t(n.currentPage+1),className:"py-1.5 px-2 bg-white border-b border-t border-r hover:bg-gray-50",style:{backgroundColor:i.$1,borderColor:i.$5},children:p(dge,{})}),p("button",{onClick:()=>t(n.totalPages),className:"py-1.5 px-2 bg-white border-b border-t border-r hover:bg-gray-50 rounded-r",style:{backgroundColor:i.$1,borderColor:i.$5},children:p(rm,{})})]})]})}function eE(n){var f,g;const{onVerticalOverflowChange:e}=n,[t,i]=w.useState(),[r,o]=w.useState(),[s,a]=w.useState((f=n.style)==null?void 0:f.height),[l,c]=w.useState(!0),u=m=>{m&&e&&i(m.clientHeight)},d=m=>{m&&e&&o(m.clientHeight)};w.useEffect(()=>{typeof r=="number"&&typeof t=="number"&&!n.isDataLoading&&e&&(r>t?(e(!0),c(!0)):(e(!1),c(!1)))},[n.isDataLoading,r,t]),w.useEffect(()=>{var m;(m=n.style)!=null&&m.height&&a(n.style.height)},[(g=n.style)==null?void 0:g.height]),w.useEffect(()=>{!l&&e&&a("auto")},[l]);const h=ni();return p("div",{className:Nt("flex flex-col",{"mt-2":!n.withoutPadding}),children:p("div",{className:Nt("align-middle inline-block min-w-full",{"py-1.5":!n.withoutPadding}),children:p("div",{className:Nt("overflow-hidden border rounded border-b border-t",{"border-b-0":n.withoutBottomBorder,"border-t-0":n.withoutTopBorder,"border-l-0":n.withoutLeftBorder,"border-r-0":n.withoutRightBorder}),style:{backgroundColor:h.$1,color:h.$3,borderColor:h.$4},children:p("div",{ref:u,className:`overflow-auto min-w-full rounded ${n.className}`,style:{...n.style,height:s},children:p("table",{ref:d,className:Nt({"min-w-full table-auto":!n.resizable,"min-w-full table-fixed":n.resizable}),children:n.children})})})})})}function tE(n){const[e]=pe();return N("tbody",{style:n.style,ref:n.innerRef,children:[!n.data&&n.showHelperPlaceholders&&p(Ec,{children:p(ko,{colSpan:20,children:p(ns,{})})}),n.data&&n.showHelperPlaceholders&&n.data.data.meta.pagination.total===0&&p(Ec,{children:p(ko,{colSpan:20,children:p("p",{children:e("empty_table")})})}),n.children]})}const eje=hF("columnWidths",{});function zQt(n){const e=w.useRef(null),[t,i]=w.useState(!1),[r,o]=w.useState(0),[s,a]=w.useState(0),[l,c]=Yo(eje),u=w.useCallback(_=>{var x;const y=(x=e.current)==null?void 0:x.offsetWidth,C=_.clientX-e.current.getBoundingClientRect().left;return y&&C>y-10},[e]),d=w.useMemo(()=>n?un.get(l,n,-1):-1,[l,n]),h=w.useCallback(_=>{n&&c(b=>({...b,[n]:_}))},[n]),f=w.useCallback(_=>{var x,E;if(!n||_.button!==0)return;const b=(x=e.current)==null?void 0:x.offsetWidth,y=_.clientX-e.current.getBoundingClientRect().left;if(b&&y>b-15){i(!0),o(_.clientX),a(b);const k=(E=e.current)==null?void 0:E.closest("table");k&&(k.style.userSelect="none")}},[n]),g=w.useCallback(_=>{if(document.body.style.cursor=u(_)&&n?"ew-resize":"",!t||!e.current||d===null)return;const b=_.clientX-r,y=s+b-45;console.log({dx:b,newWidth:y}),y>=1&&(h(y),e.current.style.width=`${y}px`)},[t,r,s,d,h]),m=w.useCallback(()=>{var b;i(!1);const _=(b=e.current)==null?void 0:b.closest("table");_&&(_.style.userSelect="")},[]);w.useEffect(()=>{var b;t?(document.addEventListener("mousemove",g),document.addEventListener("mouseup",m)):(document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m));const _=(b=e.current)==null?void 0:b.closest("table");return _&&(t?_.classList.add("is-resizing"):_.classList.remove("is-resizing")),document.body.style.cursor=t&&n?"ew-resize":"",()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m)}},[t,g,m]);const v=w.useCallback(_=>{var x;const y=(x=e.current)==null?void 0:x.offsetWidth,C=_.clientX-e.current.getBoundingClientRect().left;n&&y&&C>y-30&&(h(-1),e.current&&(e.current.style.width="auto"))},[n,h]);return{thRef:e,currentWidth:d,handleMouseDown:f,handleMouseMove:g,handleMouseUp:m,handleDoubleClick:v,setCurrentWidth:h,isResizing:t,inResizeZone:u}}function UQt(n){const{customizeTextColor:e}=n,t=RF(),i=ni(),r=vo(),{red:o,green:s,blue:a,hex:l}=DN(r),c=NF(o,s,a)?-220:220,u=e?t(l,c):i.$3;return p(jQt,{...n,color:u})}function jQt(n){const[e]=Yo(eje),t=ae.useRef(null);return w.useEffect(()=>{if(t.current){const i=e[n.resizable]??-1;t.current.style.maxWidth=`${i}px`}},[e]),p("td",{width:n.width,colSpan:n.colSpan,rowSpan:n.rowSpan,onClick:n.onClick,className:`px-2 lg:px-2.5 xl:px-4 py-2 text-sm break-words ${n.className} overflow-hidden whitespace-nowrap text-ellipsis`,style:{color:n.color},ref:t,children:n.children})}const ko=ae.memo(UQt),qQt={isCurrentlyUsed:!1};function KQt(n){n={...qQt,...n};const{thRef:e,currentWidth:t,handleMouseDown:i,handleDoubleClick:r,handleMouseMove:o,isResizing:s}=zQt(n.resizable),[a,l]=w.useState("asc"),c=w.useCallback(()=>{n.onColumnClick&&(l(a==="desc"?"asc":"desc"),n.onColumnClick({sort:`${n.id}|${a}`,field:n.id}))},[a,n.onColumnClick,n.id]),u=ni();return N("th",{ref:e,style:{color:n.textColor||u.$9,borderColor:u.$4,width:t},onMouseDown:i,onDoubleClick:r,className:Nt(`px-2 lg:px-2.5 xl:px-4 py-2.5 text-left text-xs font-medium tracking-wider whitespace-nowrap ${n.className}`,{"border-r relative":n.resizable,uppercase:!n.disableUppercase}),onMouseMove:o,children:[p("div",{className:`flex items-center space-x-1 ${n.childrenClassName} select-none`,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.onColumnClick?N("div",{className:"flex items-center space-x-1 overflow-hidden whitespace-nowrap text-ellipsis",onClick:c,style:{width:t!==-1?t:"auto"},children:[p("span",{className:"overflow-hidden whitespace-nowrap text-ellipsis",children:n.children}),p("div",{className:Nt("flex items-center bg-opacity-25",{hidden:t===-1?!1:t<50}),children:n.isCurrentlyUsed?N("div",{className:"flex flex-col items-center justify-center -space-y-4",children:[p(m4t,{className:Nt({"opacity-30":a!=="asc"}),size:16}),p(g4t,{className:Nt({"opacity-30":a!=="desc"}),size:16})]}):p(_4t,{size:16,className:"opacity-30"})})]}):p("span",{children:n.children})}),n.resizable?p("span",{className:Nt("column-resizer block absolute inset-y-0 right-0 m-0 w-1 h-full p-0 cursor-col-resize border border-transparent hover:bg-white hover:transition duration-50",{"bg-white":s})}):null]})}const Fa=ae.memo(KQt);function nE(n){const{backgroundColor:e}=n,t=vo();return p("thead",{style:{backgroundColor:e||t},children:p("tr",{children:n.children})})}function Ec(n){const{onClick:e,innerRef:t,backgroundColor:i,...r}=n,o=ni();return p("tr",{style:{backgroundColor:i||o.$1},onClick:s=>{var a;return n.onClick&&((a=s.target)==null?void 0:a.nodeName)==="TD"?n.onClick():null},ref:t,...r,className:Nt(`${n.className}`,{"cursor-pointer":e}),tabIndex:n.tabIndex,children:n.children})}function GQt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function tje(n,e){var t=w.useState(function(){return{inputs:e,result:n()}})[0],i=w.useRef(!0),r=w.useRef(t),o=i.current||!!(e&&r.current.inputs&&GQt(e,r.current.inputs)),s=o?r.current:{inputs:e,result:n()};return w.useEffect(function(){i.current=!1,r.current=s},[s]),s.result}function YQt(n,e){return tje(function(){return n},e)}var cs=tje,Xi=YQt,QQt="Invariant failed";function XQt(n,e){if(!n)throw new Error(QQt)}var J_=function(e){var t=e.top,i=e.right,r=e.bottom,o=e.left,s=i-o,a=r-t,l={top:t,right:i,bottom:r,left:o,width:s,height:a,x:o,y:t,center:{x:(i+o)/2,y:(r+t)/2}};return l},Cve=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},OLe=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},ZQt=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},$J={top:0,right:0,bottom:0,left:0},wve=function(e){var t=e.borderBox,i=e.margin,r=i===void 0?$J:i,o=e.border,s=o===void 0?$J:o,a=e.padding,l=a===void 0?$J:a,c=J_(Cve(t,r)),u=J_(OLe(t,s)),d=J_(OLe(u,l));return{marginBox:c,borderBox:J_(t),paddingBox:u,contentBox:d,margin:r,border:s,padding:l}},tm=function(e){var t=e.slice(0,-2),i=e.slice(-2);if(i!=="px")return 0;var r=Number(t);return isNaN(r)&&XQt(!1),r},JQt=function(){return{x:window.pageXOffset,y:window.pageYOffset}},hW=function(e,t){var i=e.borderBox,r=e.border,o=e.margin,s=e.padding,a=ZQt(i,t);return wve({borderBox:a,border:r,margin:o,padding:s})},fW=function(e,t){return t===void 0&&(t=JQt()),hW(e,t)},nje=function(e,t){var i={top:tm(t.marginTop),right:tm(t.marginRight),bottom:tm(t.marginBottom),left:tm(t.marginLeft)},r={top:tm(t.paddingTop),right:tm(t.paddingRight),bottom:tm(t.paddingBottom),left:tm(t.paddingLeft)},o={top:tm(t.borderTopWidth),right:tm(t.borderRightWidth),bottom:tm(t.borderBottomWidth),left:tm(t.borderLeftWidth)};return wve({borderBox:e,margin:i,padding:r,border:o})},ije=function(e){var t=e.getBoundingClientRect(),i=window.getComputedStyle(e);return nje(t,i)},eXt=function(e){var t=[],i=null,r=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];t=a,!i&&(i=requestAnimationFrame(function(){i=null,e.apply(void 0,t)}))};return r.cancel=function(){i&&(cancelAnimationFrame(i),i=null)},r};const Q4=eXt;function rje(n,e){}rje.bind(null,"warn");rje.bind(null,"error");function Tw(){}function tXt(n,e){return{...n,...e}}function gm(n,e,t){const i=e.map(r=>{const o=tXt(t,r.options);return n.addEventListener(r.eventName,r.fn,o),function(){n.removeEventListener(r.eventName,r.fn,o)}});return function(){i.forEach(o=>{o()})}}const nXt="Invariant failed";class pW extends Error{}pW.prototype.toString=function(){return this.message};function Gn(n,e){if(!n)throw new pW(nXt)}class iXt extends ae.Component{constructor(){super(...arguments),this.callbacks=null,this.unbind=Tw,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof pW&&e.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=gm(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof pW){this.setState({});return}throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const rXt=` Press space bar to start a drag. When dragging you can use the arrow keys to move the item around and escape to cancel. Some screen readers may require you to be in focus mode or to use your pass through key `,gW=n=>n+1,oXt=n=>` You have lifted an item in position ${gW(n.source.index)} `,oje=(n,e)=>{const t=n.droppableId===e.droppableId,i=gW(n.index),r=gW(e.index);return t?` You have moved the item from position ${i} to position ${r} `:` You have moved the item from position ${i} in list ${n.droppableId} to list ${e.droppableId} in position ${r} `},sje=(n,e,t)=>e.droppableId===t.droppableId?` The item ${n} has been combined with ${t.draggableId}`:` The item ${n} in list ${e.droppableId} has been combined with ${t.draggableId} in list ${t.droppableId} `,sXt=n=>{const e=n.destination;if(e)return oje(n.source,e);const t=n.combine;return t?sje(n.draggableId,n.source,t):"You are over an area that cannot be dropped on"},PLe=n=>` The item has returned to its starting position of ${gW(n.index)} `,aXt=n=>{if(n.reason==="CANCEL")return` Movement cancelled. ${PLe(n.source)} `;const e=n.destination,t=n.combine;return e?` You have dropped the item. ${oje(n.source,e)} `:t?` You have dropped the item. ${sje(n.draggableId,n.source,t)} `:` The item has been dropped while not over a drop area. ${PLe(n.source)} `},lXt={dragHandleUsageInstructions:rXt,onDragStart:oXt,onDragUpdate:sXt,onDragEnd:aXt};var k$=lXt;const Xu={x:0,y:0},xd=(n,e)=>({x:n.x+e.x,y:n.y+e.y}),Yp=(n,e)=>({x:n.x-e.x,y:n.y-e.y}),kw=(n,e)=>n.x===e.x&&n.y===e.y,HN=n=>({x:n.x!==0?-n.x:0,y:n.y!==0?-n.y:0}),WT=function(n,e,t){return t===void 0&&(t=0),n==="x"?{x:e,y:t}:{x:t,y:e}},X4=(n,e)=>Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2),MLe=(n,e)=>Math.min(...e.map(t=>X4(n,t))),aje=n=>e=>({x:n(e.x),y:n(e.y)});var cXt=(n,e)=>{const t=J_({top:Math.max(e.top,n.top),right:Math.min(e.right,n.right),bottom:Math.min(e.bottom,n.bottom),left:Math.max(e.left,n.left)});return t.width<=0||t.height<=0?null:t};const JF=(n,e)=>({top:n.top+e.y,left:n.left+e.x,bottom:n.bottom+e.y,right:n.right+e.x}),FLe=n=>[{x:n.left,y:n.top},{x:n.right,y:n.top},{x:n.left,y:n.bottom},{x:n.right,y:n.bottom}],uXt={top:0,right:0,bottom:0,left:0},dXt=(n,e)=>e?JF(n,e.scroll.diff.displacement):n,hXt=(n,e,t)=>t&&t.increasedBy?{...n,[e.end]:n[e.end]+t.increasedBy[e.line]}:n,fXt=(n,e)=>e&&e.shouldClipSubject?cXt(e.pageMarginBox,n):J_(n);var cA=n=>{let{page:e,withPlaceholder:t,axis:i,frame:r}=n;const o=dXt(e.marginBox,r),s=hXt(o,i,t),a=fXt(s,r);return{page:e,withPlaceholder:t,active:a}},Sve=(n,e)=>{n.frame||Gn(!1);const t=n.frame,i=Yp(e,t.scroll.initial),r=HN(i),o={...t,scroll:{initial:t.scroll.initial,current:e,diff:{value:i,displacement:r},max:t.scroll.max}},s=cA({page:n.subject.page,withPlaceholder:n.subject.withPlaceholder,axis:n.axis,frame:o});return{...n,frame:o,subject:s}};const lje=yu(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),cje=yu(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),nK=yu(n=>Object.values(n)),pXt=yu(n=>Object.values(n));var WN=yu((n,e)=>pXt(e).filter(i=>n===i.descriptor.droppableId).sort((i,r)=>i.descriptor.index-r.descriptor.index));function Eve(n){return n.at&&n.at.type==="REORDER"?n.at.destination:null}function iK(n){return n.at&&n.at.type==="COMBINE"?n.at.combine:null}var rK=yu((n,e)=>e.filter(t=>t.descriptor.id!==n.descriptor.id)),gXt=n=>{let{isMovingForward:e,draggable:t,destination:i,insideDestination:r,previousImpact:o}=n;if(!i.isCombineEnabled||!Eve(o))return null;function a(g){const m={type:"COMBINE",combine:{draggableId:g,droppableId:i.descriptor.id}};return{...o,at:m}}const l=o.displaced.all,c=l.length?l[0]:null;if(e)return c?a(c):null;const u=rK(t,r);if(!c){if(!u.length)return null;const g=u[u.length-1];return a(g.descriptor.id)}const d=u.findIndex(g=>g.descriptor.id===c);d===-1&&Gn(!1);const h=d-1;if(h<0)return null;const f=u[h];return a(f.descriptor.id)},zN=(n,e)=>n.descriptor.droppableId===e.descriptor.id;const uje={point:Xu,value:0},Z4={invisible:{},visible:{},all:[]},mXt={displaced:Z4,displacedBy:uje,at:null};var _Xt=mXt,xm=(n,e)=>t=>n<=t&&t<=e,dje=n=>{const e=xm(n.top,n.bottom),t=xm(n.left,n.right);return i=>{if(e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right))return!0;const o=e(i.top)||e(i.bottom),s=t(i.left)||t(i.right);if(o&&s)return!0;const l=i.top<n.top&&i.bottom>n.bottom,c=i.left<n.left&&i.right>n.right;return l&&c?!0:l&&s||c&&o}},vXt=n=>{const e=xm(n.top,n.bottom),t=xm(n.left,n.right);return i=>e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right)};const xve={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},hje={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var bXt=n=>e=>{const t=xm(e.top,e.bottom),i=xm(e.left,e.right);return r=>n===xve?t(r.top)&&t(r.bottom):i(r.left)&&i(r.right)};const yXt=(n,e)=>{const t=e.frame?e.frame.scroll.diff.displacement:Xu;return JF(n,t)},CXt=(n,e,t)=>e.subject.active?t(e.subject.active)(n):!1,wXt=(n,e,t)=>t(e)(n),Tve=n=>{let{target:e,destination:t,viewport:i,withDroppableDisplacement:r,isVisibleThroughFrameFn:o}=n;const s=r?yXt(e,t):e;return CXt(s,t,o)&&wXt(s,i,o)},SXt=n=>Tve({...n,isVisibleThroughFrameFn:dje}),fje=n=>Tve({...n,isVisibleThroughFrameFn:vXt}),EXt=n=>Tve({...n,isVisibleThroughFrameFn:bXt(n.destination.axis)}),xXt=(n,e,t)=>{if(typeof t=="boolean")return t;if(!e)return!0;const{invisible:i,visible:r}=e;if(i[n])return!1;const o=r[n];return o?o.shouldAnimate:!0};function TXt(n,e){const t=n.page.marginBox,i={top:e.point.y,right:0,bottom:0,left:e.point.x};return J_(Cve(t,i))}function J4(n){let{afterDragging:e,destination:t,displacedBy:i,viewport:r,forceShouldAnimate:o,last:s}=n;return e.reduce(function(l,c){const u=TXt(c,i),d=c.descriptor.id;if(l.all.push(d),!SXt({target:u,destination:t,viewport:r,withDroppableDisplacement:!0}))return l.invisible[c.descriptor.id]=!0,l;const f=xXt(d,s,o),g={draggableId:d,shouldAnimate:f};return l.visible[d]=g,l},{all:[],visible:{},invisible:{}})}function kXt(n,e){if(!n.length)return 0;const t=n[n.length-1].descriptor.index;return e.inHomeList?t:t+1}function BLe(n){let{insideDestination:e,inHomeList:t,displacedBy:i,destination:r}=n;const o=kXt(e,{inHomeList:t});return{displaced:Z4,displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function mW(n){let{draggable:e,insideDestination:t,destination:i,viewport:r,displacedBy:o,last:s,index:a,forceShouldAnimate:l}=n;const c=zN(e,i);if(a==null)return BLe({insideDestination:t,inHomeList:c,displacedBy:o,destination:i});const u=t.find(m=>m.descriptor.index===a);if(!u)return BLe({insideDestination:t,inHomeList:c,displacedBy:o,destination:i});const d=rK(e,t),h=t.indexOf(u),f=d.slice(h);return{displaced:J4({afterDragging:f,destination:i,displacedBy:o,last:s,viewport:r.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:a}}}}function dS(n,e){return!!e.effected[n]}var IXt=n=>{let{isMovingForward:e,destination:t,draggables:i,combine:r,afterCritical:o}=n;if(!t.isCombineEnabled)return null;const s=r.draggableId,l=i[s].descriptor.index;return dS(s,o)?e?l:l-1:e?l+1:l},LXt=n=>{let{isMovingForward:e,isInHomeList:t,insideDestination:i,location:r}=n;if(!i.length)return null;const o=r.index,s=e?o+1:o-1,a=i[0].descriptor.index,l=i[i.length-1].descriptor.index,c=t?l:l+1;return s<a||s>c?null:s},DXt=n=>{let{isMovingForward:e,isInHomeList:t,draggable:i,draggables:r,destination:o,insideDestination:s,previousImpact:a,viewport:l,afterCritical:c}=n;const u=a.at;if(u||Gn(!1),u.type==="REORDER"){const h=LXt({isMovingForward:e,isInHomeList:t,location:u.destination,insideDestination:s});return h==null?null:mW({draggable:i,insideDestination:s,destination:o,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:h})}const d=IXt({isMovingForward:e,destination:o,displaced:a.displaced,draggables:r,combine:u.combine,afterCritical:c});return d==null?null:mW({draggable:i,insideDestination:s,destination:o,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:d})},AXt=n=>{let{displaced:e,afterCritical:t,combineWith:i,displacedBy:r}=n;const o=!!(e.visible[i]||e.invisible[i]);return dS(i,t)?o?Xu:HN(r.point):o?r.point:Xu},NXt=n=>{let{afterCritical:e,impact:t,draggables:i}=n;const r=iK(t);r||Gn(!1);const o=r.draggableId,s=i[o].page.borderBox.center,a=AXt({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return xd(s,a)};const pje=(n,e)=>e.margin[n.start]+e.borderBox[n.size]/2,RXt=(n,e)=>e.margin[n.end]+e.borderBox[n.size]/2,kve=(n,e,t)=>e[n.crossAxisStart]+t.margin[n.crossAxisStart]+t.borderBox[n.crossAxisSize]/2,$Le=n=>{let{axis:e,moveRelativeTo:t,isMoving:i}=n;return WT(e.line,t.marginBox[e.end]+pje(e,i),kve(e,t.marginBox,i))},VLe=n=>{let{axis:e,moveRelativeTo:t,isMoving:i}=n;return WT(e.line,t.marginBox[e.start]-RXt(e,i),kve(e,t.marginBox,i))},OXt=n=>{let{axis:e,moveInto:t,isMoving:i}=n;return WT(e.line,t.contentBox[e.start]+pje(e,i),kve(e,t.contentBox,i))};var PXt=n=>{let{impact:e,draggable:t,draggables:i,droppable:r,afterCritical:o}=n;const s=WN(r.descriptor.id,i),a=t.page,l=r.axis;if(!s.length)return OXt({axis:l,moveInto:r.page,isMoving:a});const{displaced:c,displacedBy:u}=e,d=c.all[0];if(d){const f=i[d];if(dS(d,o))return VLe({axis:l,moveRelativeTo:f.page,isMoving:a});const g=hW(f.page,u.point);return VLe({axis:l,moveRelativeTo:g,isMoving:a})}const h=s[s.length-1];if(h.descriptor.id===t.descriptor.id)return a.borderBox.center;if(dS(h.descriptor.id,o)){const f=hW(h.page,HN(o.displacedBy.point));return $Le({axis:l,moveRelativeTo:f,isMoving:a})}return $Le({axis:l,moveRelativeTo:h.page,isMoving:a})},Jse=(n,e)=>{const t=n.frame;return t?xd(e,t.scroll.diff.displacement):e};const MXt=n=>{let{impact:e,draggable:t,droppable:i,draggables:r,afterCritical:o}=n;const s=t.page.borderBox.center,a=e.at;return!i||!a?s:a.type==="REORDER"?PXt({impact:e,draggable:t,draggables:r,droppable:i,afterCritical:o}):NXt({impact:e,draggables:r,afterCritical:o})};var oK=n=>{const e=MXt(n),t=n.droppable;return t?Jse(t,e):e},gje=(n,e)=>{const t=Yp(e,n.scroll.initial),i=HN(t);return{frame:J_({top:e.y,bottom:e.y+n.frame.height,left:e.x,right:e.x+n.frame.width}),scroll:{initial:n.scroll.initial,max:n.scroll.max,current:e,diff:{value:t,displacement:i}}}};function HLe(n,e){return n.map(t=>e[t])}function FXt(n,e){for(let t=0;t<e.length;t++){const i=e[t].visible[n];if(i)return i}return null}var BXt=n=>{let{impact:e,viewport:t,destination:i,draggables:r,maxScrollChange:o}=n;const s=gje(t,xd(t.scroll.current,o)),a=i.frame?Sve(i,xd(i.frame.scroll.current,o)):i,l=e.displaced,c=J4({afterDragging:HLe(l.all,r),destination:i,displacedBy:e.displacedBy,viewport:s.frame,last:l,forceShouldAnimate:!1}),u=J4({afterDragging:HLe(l.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:l,forceShouldAnimate:!1}),d={},h={},f=[l,c,u];return l.all.forEach(m=>{const v=FXt(m,f);if(v){h[m]=v;return}d[m]=!0}),{...e,displaced:{all:l.all,invisible:d,visible:h}}},$Xt=(n,e)=>xd(n.scroll.diff.displacement,e),Ive=n=>{let{pageBorderBoxCenter:e,draggable:t,viewport:i}=n;const r=$Xt(i,e),o=Yp(r,t.page.borderBox.center);return xd(t.client.borderBox.center,o)},mje=n=>{let{draggable:e,destination:t,newPageBorderBoxCenter:i,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:s=!1}=n;const a=Yp(i,e.page.borderBox.center),c={target:JF(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:r};return s?EXt(c):fje(c)},VXt=n=>{let{isMovingForward:e,draggable:t,destination:i,draggables:r,previousImpact:o,viewport:s,previousPageBorderBoxCenter:a,previousClientSelection:l,afterCritical:c}=n;if(!i.isEnabled)return null;const u=WN(i.descriptor.id,r),d=zN(t,i),h=gXt({isMovingForward:e,draggable:t,destination:i,insideDestination:u,previousImpact:o})||DXt({isMovingForward:e,isInHomeList:d,draggable:t,draggables:r,destination:i,insideDestination:u,previousImpact:o,viewport:s,afterCritical:c});if(!h)return null;const f=oK({impact:h,draggable:t,droppable:i,draggables:r,afterCritical:c});if(mje({draggable:t,destination:i,newPageBorderBoxCenter:f,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Ive({pageBorderBoxCenter:f,draggable:t,viewport:s}),impact:h,scrollJumpRequest:null};const m=Yp(f,a),v=BXt({impact:h,viewport:s,destination:i,draggables:r,maxScrollChange:m});return{clientSelection:l,impact:v,scrollJumpRequest:m}};const Th=n=>{const e=n.subject.active;return e||Gn(!1),e};var HXt=n=>{let{isMovingForward:e,pageBorderBoxCenter:t,source:i,droppables:r,viewport:o}=n;const s=i.subject.active;if(!s)return null;const a=i.axis,l=xm(s[a.start],s[a.end]),c=nK(r).filter(d=>d!==i).filter(d=>d.isEnabled).filter(d=>!!d.subject.active).filter(d=>dje(o.frame)(Th(d))).filter(d=>{const h=Th(d);return e?s[a.crossAxisEnd]<h[a.crossAxisEnd]:h[a.crossAxisStart]<s[a.crossAxisStart]}).filter(d=>{const h=Th(d),f=xm(h[a.start],h[a.end]);return l(h[a.start])||l(h[a.end])||f(s[a.start])||f(s[a.end])}).sort((d,h)=>{const f=Th(d)[a.crossAxisStart],g=Th(h)[a.crossAxisStart];return e?f-g:g-f}).filter((d,h,f)=>Th(d)[a.crossAxisStart]===Th(f[0])[a.crossAxisStart]);if(!c.length)return null;if(c.length===1)return c[0];const u=c.filter(d=>xm(Th(d)[a.start],Th(d)[a.end])(t[a.line]));return u.length===1?u[0]:u.length>1?u.sort((d,h)=>Th(d)[a.start]-Th(h)[a.start])[0]:c.sort((d,h)=>{const f=MLe(t,FLe(Th(d))),g=MLe(t,FLe(Th(h)));return f!==g?f-g:Th(d)[a.start]-Th(h)[a.start]})[0]};const WLe=(n,e)=>{const t=n.page.borderBox.center;return dS(n.descriptor.id,e)?Yp(t,e.displacedBy.point):t},WXt=(n,e)=>{const t=n.page.borderBox;return dS(n.descriptor.id,e)?JF(t,HN(e.displacedBy.point)):t};var zXt=n=>{let{pageBorderBoxCenter:e,viewport:t,destination:i,insideDestination:r,afterCritical:o}=n;return r.filter(a=>fje({target:WXt(a,o),destination:i,viewport:t.frame,withDroppableDisplacement:!0})).sort((a,l)=>{const c=X4(e,Jse(i,WLe(a,o))),u=X4(e,Jse(i,WLe(l,o)));return c<u?-1:u<c?1:a.descriptor.index-l.descriptor.index})[0]||null},e6=yu(function(e,t){const i=t[e.line];return{value:i,point:WT(e.line,i)}});const UXt=(n,e,t)=>{const i=n.axis;if(n.descriptor.mode==="virtual")return WT(i.line,e[i.line]);const r=n.subject.page.contentBox[i.size],l=WN(n.descriptor.id,t).reduce((c,u)=>c+u.client.marginBox[i.size],0)+e[i.line]-r;return l<=0?null:WT(i.line,l)},_je=(n,e)=>({...n,scroll:{...n.scroll,max:e}}),vje=(n,e,t)=>{const i=n.frame;zN(e,n)&&Gn(!1),n.subject.withPlaceholder&&Gn(!1);const r=e6(n.axis,e.displaceBy).point,o=UXt(n,r,t),s={placeholderSize:r,increasedBy:o,oldFrameMaxScroll:n.frame?n.frame.scroll.max:null};if(!i){const u=cA({page:n.subject.page,withPlaceholder:s,axis:n.axis,frame:n.frame});return{...n,subject:u}}const a=o?xd(i.scroll.max,o):i.scroll.max,l=_je(i,a),c=cA({page:n.subject.page,withPlaceholder:s,axis:n.axis,frame:l});return{...n,subject:c,frame:l}},jXt=n=>{const e=n.subject.withPlaceholder;e||Gn(!1);const t=n.frame;if(!t){const s=cA({page:n.subject.page,axis:n.axis,frame:null,withPlaceholder:null});return{...n,subject:s}}const i=e.oldFrameMaxScroll;i||Gn(!1);const r=_je(t,i),o=cA({page:n.subject.page,axis:n.axis,frame:r,withPlaceholder:null});return{...n,subject:o,frame:r}};var qXt=n=>{let{previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:i,draggable:r,draggables:o,destination:s,viewport:a,afterCritical:l}=n;if(!t){if(i.length)return null;const h={displaced:Z4,displacedBy:uje,at:{type:"REORDER",destination:{droppableId:s.descriptor.id,index:0}}},f=oK({impact:h,draggable:r,droppable:s,draggables:o,afterCritical:l}),g=zN(r,s)?s:vje(s,r,o);return mje({draggable:r,destination:g,newPageBorderBoxCenter:f,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?h:null}const c=e[s.axis.line]<=t.page.borderBox.center[s.axis.line],u=(()=>{const h=t.descriptor.index;return t.descriptor.id===r.descriptor.id||c?h:h+1})(),d=e6(s.axis,r.displaceBy);return mW({draggable:r,insideDestination:i,destination:s,viewport:a,displacedBy:d,last:Z4,index:u})},KXt=n=>{let{isMovingForward:e,previousPageBorderBoxCenter:t,draggable:i,isOver:r,draggables:o,droppables:s,viewport:a,afterCritical:l}=n;const c=HXt({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:s,viewport:a});if(!c)return null;const u=WN(c.descriptor.id,o),d=zXt({pageBorderBoxCenter:t,viewport:a,destination:c,insideDestination:u,afterCritical:l}),h=qXt({previousPageBorderBoxCenter:t,destination:c,draggable:i,draggables:o,moveRelativeTo:d,insideDestination:u,viewport:a,afterCritical:l});if(!h)return null;const f=oK({impact:h,draggable:i,droppable:c,draggables:o,afterCritical:l});return{clientSelection:Ive({pageBorderBoxCenter:f,draggable:i,viewport:a}),impact:h,scrollJumpRequest:null}},rg=n=>{const e=n.at;return e?e.type==="REORDER"?e.destination.droppableId:e.combine.droppableId:null};const GXt=(n,e)=>{const t=rg(n);return t?e[t]:null};var YXt=n=>{let{state:e,type:t}=n;const i=GXt(e.impact,e.dimensions.droppables),r=!!i,o=e.dimensions.droppables[e.critical.droppable.id],s=i||o,a=s.axis.direction,l=a==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||a==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(l&&!r)return null;const c=t==="MOVE_DOWN"||t==="MOVE_RIGHT",u=e.dimensions.draggables[e.critical.draggable.id],d=e.current.page.borderBoxCenter,{draggables:h,droppables:f}=e.dimensions;return l?VXt({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:s,draggables:h,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):KXt({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:s,draggables:h,droppables:f,viewport:e.viewport,afterCritical:e.afterCritical})};function ix(n){return n.phase==="DRAGGING"||n.phase==="COLLECTING"}function bje(n){const e=xm(n.top,n.bottom),t=xm(n.left,n.right);return function(r){return e(r.y)&&t(r.x)}}function QXt(n,e){return n.left<e.right&&n.right>e.left&&n.top<e.bottom&&n.bottom>e.top}function XXt(n){let{pageBorderBox:e,draggable:t,candidates:i}=n;const r=t.page.borderBox.center,o=i.map(s=>{const a=s.axis,l=WT(s.axis.line,e.center[a.line],s.page.borderBox.center[a.crossAxisLine]);return{id:s.descriptor.id,distance:X4(r,l)}}).sort((s,a)=>a.distance-s.distance);return o[0]?o[0].id:null}function ZXt(n){let{pageBorderBox:e,draggable:t,droppables:i}=n;const r=nK(i).filter(o=>{if(!o.isEnabled)return!1;const s=o.subject.active;if(!s||!QXt(e,s))return!1;if(bje(s)(e.center))return!0;const a=o.axis,l=s.center[a.crossAxisLine],c=e[a.crossAxisStart],u=e[a.crossAxisEnd],d=xm(s[a.crossAxisStart],s[a.crossAxisEnd]),h=d(c),f=d(u);return!h&&!f?!0:h?c<l:u>l});return r.length?r.length===1?r[0].descriptor.id:XXt({pageBorderBox:e,draggable:t,candidates:r}):null}const yje=(n,e)=>J_(JF(n,e));var JXt=(n,e)=>{const t=n.frame;return t?yje(e,t.scroll.diff.value):e};function Cje(n){let{displaced:e,id:t}=n;return!!(e.visible[t]||e.invisible[t])}function eZt(n){let{draggable:e,closest:t,inHomeList:i}=n;return t?i&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var tZt=n=>{let{pageBorderBoxWithDroppableScroll:e,draggable:t,destination:i,insideDestination:r,last:o,viewport:s,afterCritical:a}=n;const l=i.axis,c=e6(i.axis,t.displaceBy),u=c.value,d=e[l.start],h=e[l.end],g=rK(t,r).find(v=>{const _=v.descriptor.id,b=v.page.borderBox.center[l.line],y=dS(_,a),C=Cje({displaced:o,id:_});return y?C?h<=b:d<b-u:C?h<=b+u:d<b})||null,m=eZt({draggable:t,closest:g,inHomeList:zN(t,i)});return mW({draggable:t,insideDestination:r,destination:i,viewport:s,last:o,displacedBy:c,index:m})};const nZt=4;var iZt=n=>{let{draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:i,destination:r,insideDestination:o,afterCritical:s}=n;if(!r.isCombineEnabled)return null;const a=r.axis,l=e6(r.axis,e.displaceBy),c=l.value,u=t[a.start],d=t[a.end],f=rK(e,o).find(m=>{const v=m.descriptor.id,_=m.page.borderBox,y=_[a.size]/nZt,C=dS(v,s),x=Cje({displaced:i.displaced,id:v});return C?x?d>_[a.start]+y&&d<_[a.end]-y:u>_[a.start]-c+y&&u<_[a.end]-c-y:x?d>_[a.start]+c+y&&d<_[a.end]+c-y:u>_[a.start]+y&&u<_[a.end]-y});return f?{displacedBy:l,displaced:i.displaced,at:{type:"COMBINE",combine:{draggableId:f.descriptor.id,droppableId:r.descriptor.id}}}:null},wje=n=>{let{pageOffset:e,draggable:t,draggables:i,droppables:r,previousImpact:o,viewport:s,afterCritical:a}=n;const l=yje(t.page.borderBox,e),c=ZXt({pageBorderBox:l,draggable:t,droppables:r});if(!c)return _Xt;const u=r[c],d=WN(u.descriptor.id,i),h=JXt(u,l);return iZt({pageBorderBoxWithDroppableScroll:h,draggable:t,previousImpact:o,destination:u,insideDestination:d,afterCritical:a})||tZt({pageBorderBoxWithDroppableScroll:h,draggable:t,destination:u,insideDestination:d,last:o.displaced,viewport:s,afterCritical:a})},Lve=(n,e)=>({...n,[e.descriptor.id]:e});const rZt=n=>{let{previousImpact:e,impact:t,droppables:i}=n;const r=rg(e),o=rg(t);if(!r||r===o)return i;const s=i[r];if(!s.subject.withPlaceholder)return i;const a=jXt(s);return Lve(i,a)};var oZt=n=>{let{draggable:e,draggables:t,droppables:i,previousImpact:r,impact:o}=n;const s=rZt({previousImpact:r,impact:o,droppables:i}),a=rg(o);if(!a)return s;const l=i[a];if(zN(e,l)||l.subject.withPlaceholder)return s;const c=vje(l,e,t);return Lve(s,c)},uM=n=>{let{state:e,clientSelection:t,dimensions:i,viewport:r,impact:o,scrollJumpRequest:s}=n;const a=r||e.viewport,l=i||e.dimensions,c=t||e.current.client.selection,u=Yp(c,e.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:xd(e.initial.client.borderBoxCenter,u)},h={selection:xd(d.selection,a.scroll.current),borderBoxCenter:xd(d.borderBoxCenter,a.scroll.current),offset:xd(d.offset,a.scroll.diff.value)},f={client:d,page:h};if(e.phase==="COLLECTING")return{...e,dimensions:l,viewport:a,current:f};const g=l.draggables[e.critical.draggable.id],m=o||wje({pageOffset:h.offset,draggable:g,draggables:l.draggables,droppables:l.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),v=oZt({draggable:g,impact:m,previousImpact:e.impact,draggables:l.draggables,droppables:l.droppables});return{...e,current:f,dimensions:{draggables:l.draggables,droppables:v},impact:m,viewport:a,scrollJumpRequest:s||null,forceShouldAnimate:s?!1:null}};function sZt(n,e){return n.map(t=>e[t])}var Sje=n=>{let{impact:e,viewport:t,draggables:i,destination:r,forceShouldAnimate:o}=n;const s=e.displaced,a=sZt(s.all,i),l=J4({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:s});return{...e,displaced:l}},Eje=n=>{let{impact:e,draggable:t,droppable:i,draggables:r,viewport:o,afterCritical:s}=n;const a=oK({impact:e,draggable:t,draggables:r,droppable:i,afterCritical:s});return Ive({pageBorderBoxCenter:a,draggable:t,viewport:o})},xje=n=>{let{state:e,dimensions:t,viewport:i}=n;e.movementMode!=="SNAP"&&Gn(!1);const r=e.impact,o=i||e.viewport,s=t||e.dimensions,{draggables:a,droppables:l}=s,c=a[e.critical.draggable.id],u=rg(r);u||Gn(!1);const d=l[u],h=Sje({impact:r,viewport:o,destination:d,draggables:a}),f=Eje({impact:h,draggable:c,droppable:d,draggables:a,viewport:o,afterCritical:e.afterCritical});return uM({impact:h,clientSelection:f,state:e,dimensions:s,viewport:o})},aZt=n=>({index:n.index,droppableId:n.droppableId}),Tje=n=>{let{draggable:e,home:t,draggables:i,viewport:r}=n;const o=e6(t.axis,e.displaceBy),s=WN(t.descriptor.id,i),a=s.indexOf(e);a===-1&&Gn(!1);const l=s.slice(a+1),c=l.reduce((f,g)=>(f[g.descriptor.id]=!0,f),{}),u={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:c};return{impact:{displaced:J4({afterDragging:l,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:aZt(e.descriptor)}},afterCritical:u}},lZt=(n,e)=>({draggables:n.draggables,droppables:Lve(n.droppables,e)}),cZt=n=>{let{draggable:e,offset:t,initialWindowScroll:i}=n;const r=hW(e.client,t),o=fW(r,i);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},uZt=n=>{const e=n.frame;return e||Gn(!1),e},dZt=n=>{let{additions:e,updatedDroppables:t,viewport:i}=n;const r=i.scroll.diff.value;return e.map(o=>{const s=o.descriptor.droppableId,a=t[s],c=uZt(a).scroll.diff.value,u=xd(r,c);return cZt({draggable:o,offset:u,initialWindowScroll:i.scroll.initial})})},hZt=n=>{let{state:e,published:t}=n;const i=t.modified.map(b=>{const y=e.dimensions.droppables[b.droppableId];return Sve(y,b.scroll)}),r={...e.dimensions.droppables,...lje(i)},o=cje(dZt({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),s={...e.dimensions.draggables,...o};t.removals.forEach(b=>{delete s[b]});const a={droppables:r,draggables:s},l=rg(e.impact),c=l?a.droppables[l]:null,u=a.draggables[e.critical.draggable.id],d=a.droppables[e.critical.droppable.id],{impact:h,afterCritical:f}=Tje({draggable:u,home:d,draggables:s,viewport:e.viewport}),g=c&&c.isCombineEnabled?e.impact:h,m=wje({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:g,viewport:e.viewport,afterCritical:f}),v={...e,phase:"DRAGGING",impact:m,onLiftImpact:h,dimensions:a,afterCritical:f,forceShouldAnimate:!1};return e.phase==="COLLECTING"?v:{...v,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const eae=n=>n.movementMode==="SNAP",VJ=(n,e,t)=>{const i=lZt(n.dimensions,e);return!eae(n)||t?uM({state:n,dimensions:i}):xje({state:n,dimensions:i})};function HJ(n){return n.isDragging&&n.movementMode==="SNAP"?{...n,scrollJumpRequest:null}:n}const zLe={phase:"IDLE",completed:null,shouldFlush:!1};var fZt=function(n,e){if(n===void 0&&(n=zLe),e.type==="FLUSH")return{...zLe,shouldFlush:!0};if(e.type==="INITIAL_PUBLISH"){n.phase!=="IDLE"&&Gn(!1);const{critical:t,clientSelection:i,viewport:r,dimensions:o,movementMode:s}=e.payload,a=o.draggables[t.draggable.id],l=o.droppables[t.droppable.id],c={selection:i,borderBoxCenter:a.client.borderBox.center,offset:Xu},u={client:c,page:{selection:xd(c.selection,r.scroll.initial),borderBoxCenter:xd(c.selection,r.scroll.initial),offset:xd(c.selection,r.scroll.diff.value)}},d=nK(o.droppables).every(m=>!m.isFixedOnPage),{impact:h,afterCritical:f}=Tje({draggable:a,home:l,draggables:o.draggables,viewport:r});return{phase:"DRAGGING",isDragging:!0,critical:t,movementMode:s,dimensions:o,initial:u,current:u,isWindowScrollAllowed:d,impact:h,afterCritical:f,onLiftImpact:h,viewport:r,scrollJumpRequest:null,forceShouldAnimate:null}}if(e.type==="COLLECTION_STARTING")return n.phase==="COLLECTING"||n.phase==="DROP_PENDING"?n:(n.phase!=="DRAGGING"&&Gn(!1),{...n,phase:"COLLECTING"});if(e.type==="PUBLISH_WHILE_DRAGGING")return n.phase==="COLLECTING"||n.phase==="DROP_PENDING"||Gn(!1),hZt({state:n,published:e.payload});if(e.type==="MOVE"){if(n.phase==="DROP_PENDING")return n;ix(n)||Gn(!1);const{client:t}=e.payload;return kw(t,n.current.client.selection)?n:uM({state:n,clientSelection:t,impact:eae(n)?n.impact:null})}if(e.type==="UPDATE_DROPPABLE_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="COLLECTING")return HJ(n);ix(n)||Gn(!1);const{id:t,newScroll:i}=e.payload,r=n.dimensions.droppables[t];if(!r)return n;const o=Sve(r,i);return VJ(n,o,!1)}if(e.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(n.phase==="DROP_PENDING")return n;ix(n)||Gn(!1);const{id:t,isEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||Gn(!1),r.isEnabled===i&&Gn(!1);const o={...r,isEnabled:i};return VJ(n,o,!0)}if(e.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(n.phase==="DROP_PENDING")return n;ix(n)||Gn(!1);const{id:t,isCombineEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||Gn(!1),r.isCombineEnabled===i&&Gn(!1);const o={...r,isCombineEnabled:i};return VJ(n,o,!0)}if(e.type==="MOVE_BY_WINDOW_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="DROP_ANIMATING")return n;ix(n)||Gn(!1),n.isWindowScrollAllowed||Gn(!1);const t=e.payload.newScroll;if(kw(n.viewport.scroll.current,t))return HJ(n);const i=gje(n.viewport,t);return eae(n)?xje({state:n,viewport:i}):uM({state:n,viewport:i})}if(e.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!ix(n))return n;const t=e.payload.maxScroll;if(kw(t,n.viewport.scroll.max))return n;const i={...n.viewport,scroll:{...n.viewport.scroll,max:t}};return{...n,viewport:i}}if(e.type==="MOVE_UP"||e.type==="MOVE_DOWN"||e.type==="MOVE_LEFT"||e.type==="MOVE_RIGHT"){if(n.phase==="COLLECTING"||n.phase==="DROP_PENDING")return n;n.phase!=="DRAGGING"&&Gn(!1);const t=YXt({state:n,type:e.type});return t?uM({state:n,impact:t.impact,clientSelection:t.clientSelection,scrollJumpRequest:t.scrollJumpRequest}):n}if(e.type==="DROP_PENDING"){const t=e.payload.reason;return n.phase!=="COLLECTING"&&Gn(!1),{...n,phase:"DROP_PENDING",isWaiting:!0,reason:t}}if(e.type==="DROP_ANIMATE"){const{completed:t,dropDuration:i,newHomeClientOffset:r}=e.payload;return n.phase==="DRAGGING"||n.phase==="DROP_PENDING"||Gn(!1),{phase:"DROP_ANIMATING",completed:t,dropDuration:i,newHomeClientOffset:r,dimensions:n.dimensions}}if(e.type==="DROP_COMPLETE"){const{completed:t}=e.payload;return{phase:"IDLE",completed:t,shouldFlush:!1}}return n};const pZt=n=>({type:"BEFORE_INITIAL_CAPTURE",payload:n}),gZt=n=>({type:"LIFT",payload:n}),mZt=n=>({type:"INITIAL_PUBLISH",payload:n}),_Zt=n=>({type:"PUBLISH_WHILE_DRAGGING",payload:n}),vZt=()=>({type:"COLLECTION_STARTING",payload:null}),bZt=n=>({type:"UPDATE_DROPPABLE_SCROLL",payload:n}),yZt=n=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:n}),CZt=n=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:n}),kje=n=>({type:"MOVE",payload:n}),wZt=n=>({type:"MOVE_BY_WINDOW_SCROLL",payload:n}),SZt=n=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:n}),EZt=()=>({type:"MOVE_UP",payload:null}),xZt=()=>({type:"MOVE_DOWN",payload:null}),TZt=()=>({type:"MOVE_RIGHT",payload:null}),kZt=()=>({type:"MOVE_LEFT",payload:null}),Dve=()=>({type:"FLUSH",payload:null}),IZt=n=>({type:"DROP_ANIMATE",payload:n}),Ave=n=>({type:"DROP_COMPLETE",payload:n}),Ije=n=>({type:"DROP",payload:n}),LZt=n=>({type:"DROP_PENDING",payload:n}),Lje=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var DZt=n=>e=>{let{getState:t,dispatch:i}=e;return r=>o=>{if(o.type!=="LIFT"){r(o);return}const{id:s,clientSelection:a,movementMode:l}=o.payload,c=t();c.phase==="DROP_ANIMATING"&&i(Ave({completed:c.completed})),t().phase!=="IDLE"&&Gn(!1),i(Dve()),i(pZt({draggableId:s,movementMode:l}));const d={draggableId:s,scrollOptions:{shouldPublishImmediately:l==="SNAP"}},{critical:h,dimensions:f,viewport:g}=n.startPublishing(d);i(mZt({critical:h,dimensions:f,clientSelection:a,movementMode:l,viewport:g}))}},AZt=n=>()=>e=>t=>{t.type==="INITIAL_PUBLISH"&&n.dragging(),t.type==="DROP_ANIMATE"&&n.dropping(t.payload.completed.result.reason),(t.type==="FLUSH"||t.type==="DROP_COMPLETE")&&n.resting(),e(t)};const Nve={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},e3={opacity:{drop:0,combining:.7},scale:{drop:.75}},Dje={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ME=`${Dje.outOfTheWay}s ${Nve.outOfTheWay}`,dM={fluid:`opacity ${ME}`,snap:`transform ${ME}, opacity ${ME}`,drop:n=>{const e=`${n}s ${Nve.drop}`;return`transform ${e}, opacity ${e}`},outOfTheWay:`transform ${ME}`,placeholder:`height ${ME}, width ${ME}, margin ${ME}`},ULe=n=>kw(n,Xu)?void 0:`translate(${n.x}px, ${n.y}px)`,tae={moveTo:ULe,drop:(n,e)=>{const t=ULe(n);if(t)return e?`${t} scale(${e3.scale.drop})`:t}},{minDropTime:nae,maxDropTime:Aje}=Dje,NZt=Aje-nae,jLe=1500,RZt=.6;var OZt=n=>{let{current:e,destination:t,reason:i}=n;const r=X4(e,t);if(r<=0)return nae;if(r>=jLe)return Aje;const o=r/jLe,s=nae+NZt*o,a=i==="CANCEL"?s*RZt:s;return Number(a.toFixed(2))},PZt=n=>{let{impact:e,draggable:t,dimensions:i,viewport:r,afterCritical:o}=n;const{draggables:s,droppables:a}=i,l=rg(e),c=l?a[l]:null,u=a[t.descriptor.droppableId],d=Eje({impact:e,draggable:t,draggables:s,afterCritical:o,droppable:c||u,viewport:r});return Yp(d,t.client.borderBox.center)},MZt=n=>{let{draggables:e,reason:t,lastImpact:i,home:r,viewport:o,onLiftImpact:s}=n;return!i.at||t!=="DROP"?{impact:Sje({draggables:e,impact:s,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:i.at.type==="REORDER"?{impact:i,didDropInsideDroppable:!0}:{impact:{...i,displaced:Z4},didDropInsideDroppable:!0}};const FZt=n=>{let{getState:e,dispatch:t}=n;return i=>r=>{if(r.type!=="DROP"){i(r);return}const o=e(),s=r.payload.reason;if(o.phase==="COLLECTING"){t(LZt({reason:s}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&Gn(!1),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||Gn(!1);const l=o.critical,c=o.dimensions,u=c.draggables[o.critical.draggable.id],{impact:d,didDropInsideDroppable:h}=MZt({reason:s,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),f=h?Eve(d):null,g=h?iK(d):null,m={index:l.draggable.index,droppableId:l.droppable.id},v={draggableId:u.descriptor.id,type:u.descriptor.type,source:m,reason:s,mode:o.movementMode,destination:f,combine:g},_=PZt({impact:d,draggable:u,dimensions:c,viewport:o.viewport,afterCritical:o.afterCritical}),b={critical:o.critical,afterCritical:o.afterCritical,result:v,impact:d};if(!(!kw(o.current.client.offset,_)||!!v.combine)){t(Ave({completed:b}));return}const C=OZt({current:o.current.client.offset,destination:_,reason:s});t(IZt({newHomeClientOffset:_,dropDuration:C,completed:b}))}};var BZt=FZt,Nje=()=>({x:window.pageXOffset,y:window.pageYOffset});function $Zt(n){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:e=>{e.target!==window&&e.target!==window.document||n()}}}function VZt(n){let{onWindowScroll:e}=n;function t(){e(Nje())}const i=Q4(t),r=$Zt(i);let o=Tw;function s(){return o!==Tw}function a(){s()&&Gn(!1),o=gm(window,[r])}function l(){s()||Gn(!1),i.cancel(),o(),o=Tw}return{start:a,stop:l,isActive:s}}const HZt=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH",WZt=n=>{const e=VZt({onWindowScroll:t=>{n.dispatch(wZt({newScroll:t}))}});return t=>i=>{!e.isActive()&&i.type==="INITIAL_PUBLISH"&&e.start(),e.isActive()&&HZt(i)&&e.stop(),t(i)}};var zZt=WZt,UZt=n=>{let e=!1,t=!1;const i=setTimeout(()=>{t=!0}),r=o=>{e||t||(e=!0,n(o),clearTimeout(i))};return r.wasCalled=()=>e,r},jZt=()=>{const n=[],e=r=>{const o=n.findIndex(a=>a.timerId===r);o===-1&&Gn(!1);const[s]=n.splice(o,1);s.callback()};return{add:r=>{const o=setTimeout(()=>e(o)),s={timerId:o,callback:r};n.push(s)},flush:()=>{if(!n.length)return;const r=[...n];n.length=0,r.forEach(o=>{clearTimeout(o.timerId),o.callback()})}}};const qZt=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.droppableId===e.droppableId&&n.index===e.index,KZt=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.draggableId===e.draggableId&&n.droppableId===e.droppableId,GZt=(n,e)=>{if(n===e)return!0;const t=n.draggable.id===e.draggable.id&&n.draggable.droppableId===e.draggable.droppableId&&n.draggable.type===e.draggable.type&&n.draggable.index===e.draggable.index,i=n.droppable.id===e.droppable.id&&n.droppable.type===e.droppable.type;return t&&i},cO=(n,e)=>{e()},J8=(n,e)=>({draggableId:n.draggable.id,type:n.droppable.type,source:{droppableId:n.droppable.id,index:n.draggable.index},mode:e});function WJ(n,e,t,i){if(!n){t(i(e));return}const r=UZt(t);n(e,{announce:r}),r.wasCalled()||t(i(e))}var YZt=(n,e)=>{const t=jZt();let i=null;const r=(d,h)=>{i&&Gn(!1),cO("onBeforeCapture",()=>{const f=n().onBeforeCapture;f&&f({draggableId:d,mode:h})})},o=(d,h)=>{i&&Gn(!1),cO("onBeforeDragStart",()=>{const f=n().onBeforeDragStart;f&&f(J8(d,h))})},s=(d,h)=>{i&&Gn(!1);const f=J8(d,h);i={mode:h,lastCritical:d,lastLocation:f.source,lastCombine:null},t.add(()=>{cO("onDragStart",()=>WJ(n().onDragStart,f,e,k$.onDragStart))})},a=(d,h)=>{const f=Eve(h),g=iK(h);i||Gn(!1);const m=!GZt(d,i.lastCritical);m&&(i.lastCritical=d);const v=!qZt(i.lastLocation,f);v&&(i.lastLocation=f);const _=!KZt(i.lastCombine,g);if(_&&(i.lastCombine=g),!m&&!v&&!_)return;const b={...J8(d,i.mode),combine:g,destination:f};t.add(()=>{cO("onDragUpdate",()=>WJ(n().onDragUpdate,b,e,k$.onDragUpdate))})},l=()=>{i||Gn(!1),t.flush()},c=d=>{i||Gn(!1),i=null,cO("onDragEnd",()=>WJ(n().onDragEnd,d,e,k$.onDragEnd))};return{beforeCapture:r,beforeStart:o,start:s,update:a,flush:l,drop:c,abort:()=>{if(!i)return;const d={...J8(i.lastCritical,i.mode),combine:null,destination:null,reason:"CANCEL"};c(d)}}},QZt=(n,e)=>{const t=YZt(n,e);return i=>r=>o=>{if(o.type==="BEFORE_INITIAL_CAPTURE"){t.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(o.type==="INITIAL_PUBLISH"){const a=o.payload.critical;t.beforeStart(a,o.payload.movementMode),r(o),t.start(a,o.payload.movementMode);return}if(o.type==="DROP_COMPLETE"){const a=o.payload.completed.result;t.flush(),r(o),t.drop(a);return}if(r(o),o.type==="FLUSH"){t.abort();return}const s=i.getState();s.phase==="DRAGGING"&&t.update(s.critical,s.impact)}};const XZt=n=>e=>t=>{if(t.type!=="DROP_ANIMATION_FINISHED"){e(t);return}const i=n.getState();i.phase!=="DROP_ANIMATING"&&Gn(!1),n.dispatch(Ave({completed:i.completed}))};var ZZt=XZt;const JZt=n=>{let e=null,t=null;function i(){t&&(cancelAnimationFrame(t),t=null),e&&(e(),e=null)}return r=>o=>{if((o.type==="FLUSH"||o.type==="DROP_COMPLETE"||o.type==="DROP_ANIMATION_FINISHED")&&i(),r(o),o.type!=="DROP_ANIMATE")return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){n.getState().phase==="DROP_ANIMATING"&&n.dispatch(Lje())}};t=requestAnimationFrame(()=>{t=null,e=gm(window,[s])})}};var eJt=JZt,tJt=n=>()=>e=>t=>{(t.type==="DROP_COMPLETE"||t.type==="FLUSH"||t.type==="DROP_ANIMATE")&&n.stopPublishing(),e(t)},nJt=n=>{let e=!1;return()=>t=>i=>{if(i.type==="INITIAL_PUBLISH"){e=!0,n.tryRecordFocus(i.payload.critical.draggable.id),t(i),n.tryRestoreFocusRecorded();return}if(t(i),!!e){if(i.type==="FLUSH"){e=!1,n.tryRestoreFocusRecorded();return}if(i.type==="DROP_COMPLETE"){e=!1;const r=i.payload.completed.result;r.combine&&n.tryShiftRecord(r.draggableId,r.combine.draggableId),n.tryRestoreFocusRecorded()}}}};const iJt=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH";var rJt=n=>e=>t=>i=>{if(iJt(i)){n.stop(),t(i);return}if(i.type==="INITIAL_PUBLISH"){t(i);const r=e.getState();r.phase!=="DRAGGING"&&Gn(!1),n.start(r);return}t(i),n.scroll(e.getState())};const oJt=n=>e=>t=>{if(e(t),t.type!=="PUBLISH_WHILE_DRAGGING")return;const i=n.getState();i.phase==="DROP_PENDING"&&(i.isWaiting||n.dispatch(Ije({reason:i.reason})))};var sJt=oJt;const aJt=PD;var lJt=n=>{let{dimensionMarshal:e,focusMarshal:t,styleMarshal:i,getResponders:r,announce:o,autoScroller:s}=n;return J5(fZt,aJt(Ope(AZt(i),tJt(e),DZt(e),BZt,ZZt,eJt,sJt,rJt(s),zZt,nJt(t),QZt(r,o))))};const zJ=()=>({additions:{},removals:{},modified:{}});function cJt(n){let{registry:e,callbacks:t}=n,i=zJ(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:c,removals:u,modified:d}=i,h=Object.keys(c).map(m=>e.draggable.getById(m).getDimension(Xu)).sort((m,v)=>m.descriptor.index-v.descriptor.index),f=Object.keys(d).map(m=>{const _=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:_}}),g={additions:h,removals:Object.keys(u),modified:f};i=zJ(),t.publish(g)}))};return{add:c=>{const u=c.descriptor.id;i.additions[u]=c,i.modified[c.descriptor.droppableId]=!0,i.removals[u]&&delete i.removals[u],o()},remove:c=>{const u=c.descriptor;i.removals[u.id]=!0,i.modified[u.droppableId]=!0,i.additions[u.id]&&delete i.additions[u.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,i=zJ())}}}var Rje=n=>{let{scrollHeight:e,scrollWidth:t,height:i,width:r}=n;const o=Yp({x:t,y:e},{x:r,y:i});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Oje=()=>{const n=document.documentElement;return n||Gn(!1),n},Pje=()=>{const n=Oje();return Rje({scrollHeight:n.scrollHeight,scrollWidth:n.scrollWidth,width:n.clientWidth,height:n.clientHeight})},uJt=()=>{const n=Nje(),e=Pje(),t=n.y,i=n.x,r=Oje(),o=r.clientWidth,s=r.clientHeight,a=i+o,l=t+s;return{frame:J_({top:t,left:i,right:a,bottom:l}),scroll:{initial:n,current:n,max:e,diff:{value:Xu,displacement:Xu}}}},dJt=n=>{let{critical:e,scrollOptions:t,registry:i}=n;const r=uJt(),o=r.scroll.current,s=e.droppable,a=i.droppable.getAllByType(s.type).map(d=>d.callbacks.getDimensionAndWatchScroll(o,t)),l=i.draggable.getAllByType(e.draggable.type).map(d=>d.getDimension(o));return{dimensions:{draggables:cje(l),droppables:lje(a)},critical:e,viewport:r}};function qLe(n,e,t){return!(t.descriptor.id===e.id||t.descriptor.type!==e.type||n.droppable.getById(t.descriptor.droppableId).descriptor.mode!=="virtual")}var hJt=(n,e)=>{let t=null;const i=cJt({callbacks:{publish:e.publishWhileDragging,collectionStarting:e.collectionStarting},registry:n}),r=(h,f)=>{n.droppable.exists(h)||Gn(!1),t&&e.updateDroppableIsEnabled({id:h,isEnabled:f})},o=(h,f)=>{t&&(n.droppable.exists(h)||Gn(!1),e.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:f}))},s=(h,f)=>{t&&(n.droppable.exists(h)||Gn(!1),e.updateDroppableScroll({id:h,newScroll:f}))},a=(h,f)=>{t&&n.droppable.getById(h).callbacks.scroll(f)},l=()=>{if(!t)return;i.stop();const h=t.critical.droppable;n.droppable.getAllByType(h.type).forEach(f=>f.callbacks.dragStopped()),t.unsubscribe(),t=null},c=h=>{t||Gn(!1);const f=t.critical.draggable;h.type==="ADDITION"&&qLe(n,f,h.value)&&i.add(h.value),h.type==="REMOVAL"&&qLe(n,f,h.value)&&i.remove(h.value)};return{updateDroppableIsEnabled:r,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:s,startPublishing:h=>{t&&Gn(!1);const f=n.draggable.getById(h.draggableId),g=n.droppable.getById(f.descriptor.droppableId),m={draggable:f.descriptor,droppable:g.descriptor},v=n.subscribe(c);return t={critical:m,unsubscribe:v},dJt({critical:m,registry:n,scrollOptions:h.scrollOptions})},stopPublishing:l}},Mje=(n,e)=>n.phase==="IDLE"?!0:n.phase!=="DROP_ANIMATING"||n.completed.result.draggableId===e?!1:n.completed.result.reason==="DROP",fJt=n=>{window.scrollBy(n.x,n.y)};const pJt=yu(n=>nK(n).filter(e=>!(!e.isEnabled||!e.frame))),gJt=(n,e)=>pJt(e).find(i=>(i.frame||Gn(!1),bje(i.frame.pageMarginBox)(n)))||null;var mJt=n=>{let{center:e,destination:t,droppables:i}=n;if(t){const o=i[t];return o.frame?o:null}return gJt(e,i)};const t3={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var _Jt=function(n,e,t){t===void 0&&(t=()=>t3);const i=t(),r=n[e.size]*i.startFromPercentage,o=n[e.size]*i.maxScrollAtPercentage;return{startScrollingFrom:r,maxScrollValueAt:o}},Fje=n=>{let{startOfRange:e,endOfRange:t,current:i}=n;const r=t-e;return r===0?0:(i-e)/r},Rve=1,vJt=function(n,e,t){t===void 0&&(t=()=>t3);const i=t();if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return i.maxPixelScroll;if(n===e.startScrollingFrom)return Rve;const o=1-Fje({startOfRange:e.maxScrollValueAt,endOfRange:e.startScrollingFrom,current:n}),s=i.maxPixelScroll*i.ease(o);return Math.ceil(s)},bJt=(n,e,t)=>{const i=t(),r=i.durationDampening.accelerateAt,o=i.durationDampening.stopDampeningAt,s=e,a=o,c=Date.now()-s;if(c>=o)return n;if(c<r)return Rve;const u=Fje({startOfRange:r,endOfRange:a,current:c}),d=n*i.ease(u);return Math.ceil(d)},KLe=n=>{let{distanceToEdge:e,thresholds:t,dragStartTime:i,shouldUseTimeDampening:r,getAutoScrollerOptions:o}=n;const s=vJt(e,t,o);return s===0?0:r?Math.max(bJt(s,i,o),Rve):s},GLe=n=>{let{container:e,distanceToEdges:t,dragStartTime:i,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=_Jt(e,r,s);return t[r.end]<t[r.start]?KLe({distanceToEdge:t[r.end],thresholds:a,dragStartTime:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s}):-1*KLe({distanceToEdge:t[r.start],thresholds:a,dragStartTime:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s})},yJt=n=>{let{container:e,subject:t,proposedScroll:i}=n;const r=t.height>e.height,o=t.width>e.width;return!o&&!r?i:o&&r?null:{x:o?0:i.x,y:r?0:i.y}};const CJt=aje(n=>n===0?0:n);var Bje=n=>{let{dragStartTime:e,container:t,subject:i,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},l=GLe({container:t,distanceToEdges:a,dragStartTime:e,axis:xve,shouldUseTimeDampening:o,getAutoScrollerOptions:s}),c=GLe({container:t,distanceToEdges:a,dragStartTime:e,axis:hje,shouldUseTimeDampening:o,getAutoScrollerOptions:s}),u=CJt({x:c,y:l});if(kw(u,Xu))return null;const d=yJt({container:t,subject:i,proposedScroll:u});return d?kw(d,Xu)?null:d:null};const wJt=aje(n=>n===0?0:n>0?1:-1),Ove=(()=>{const n=(e,t)=>e<0?e:e>t?e-t:0;return e=>{let{current:t,max:i,change:r}=e;const o=xd(t,r),s={x:n(o.x,i.x),y:n(o.y,i.y)};return kw(s,Xu)?null:s}})(),$je=n=>{let{max:e,current:t,change:i}=n;const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=wJt(i),s=Ove({max:r,current:t,change:o});return!s||o.x!==0&&s.x===0||o.y!==0&&s.y===0},Pve=(n,e)=>$je({current:n.scroll.current,max:n.scroll.max,change:e}),SJt=(n,e)=>{if(!Pve(n,e))return null;const t=n.scroll.max,i=n.scroll.current;return Ove({current:i,max:t,change:e})},Mve=(n,e)=>{const t=n.frame;return t?$je({current:t.scroll.current,max:t.scroll.max,change:e}):!1},EJt=(n,e)=>{const t=n.frame;return!t||!Mve(n,e)?null:Ove({current:t.scroll.current,max:t.scroll.max,change:e})};var xJt=n=>{let{viewport:e,subject:t,center:i,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=Bje({dragStartTime:r,container:e.frame,subject:t,center:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s});return a&&Pve(e,a)?a:null},TJt=n=>{let{droppable:e,subject:t,center:i,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=e.frame;if(!a)return null;const l=Bje({dragStartTime:r,container:a.pageMarginBox,subject:t,center:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s});return l&&Mve(e,l)?l:null},YLe=n=>{let{state:e,dragStartTime:t,shouldUseTimeDampening:i,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:s}=n;const a=e.current.page.borderBoxCenter,c=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const h=e.viewport,f=xJt({dragStartTime:t,viewport:h,subject:c,center:a,shouldUseTimeDampening:i,getAutoScrollerOptions:s});if(f){r(f);return}}const u=mJt({center:a,destination:rg(e.impact),droppables:e.dimensions.droppables});if(!u)return;const d=TJt({dragStartTime:t,droppable:u,subject:c,center:a,shouldUseTimeDampening:i,getAutoScrollerOptions:s});d&&o(u.descriptor.id,d)},kJt=n=>{let{scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:i=()=>t3}=n;const r=Q4(e),o=Q4(t);let s=null;const a=u=>{s||Gn(!1);const{shouldUseTimeDampening:d,dragStartTime:h}=s;YLe({state:u,scrollWindow:r,scrollDroppable:o,dragStartTime:h,shouldUseTimeDampening:d,getAutoScrollerOptions:i})};return{start:u=>{s&&Gn(!1);const d=Date.now();let h=!1;const f=()=>{h=!0};YLe({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:f,scrollDroppable:f,getAutoScrollerOptions:i}),s={dragStartTime:d,shouldUseTimeDampening:h},h&&a(u)},stop:()=>{s&&(r.cancel(),o.cancel(),s=null)},scroll:a}},IJt=n=>{let{move:e,scrollDroppable:t,scrollWindow:i}=n;const r=(l,c)=>{const u=xd(l.current.client.selection,c);e({client:u})},o=(l,c)=>{if(!Mve(l,c))return c;const u=EJt(l,c);if(!u)return t(l.descriptor.id,c),null;const d=Yp(c,u);return t(l.descriptor.id,d),Yp(c,d)},s=(l,c,u)=>{if(!l||!Pve(c,u))return u;const d=SJt(c,u);if(!d)return i(u),null;const h=Yp(u,d);return i(h),Yp(u,h)};return l=>{const c=l.scrollJumpRequest;if(!c)return;const u=rg(l.impact);u||Gn(!1);const d=o(l.dimensions.droppables[u],c);if(!d)return;const h=l.viewport,f=s(l.isWindowScrollAllowed,h,d);f&&r(l,f)}},LJt=n=>{let{scrollDroppable:e,scrollWindow:t,move:i,getAutoScrollerOptions:r}=n;const o=kJt({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),s=IJt({move:i,scrollWindow:t,scrollDroppable:e});return{scroll:c=>{if(!(r().disabled||c.phase!=="DRAGGING")){if(c.movementMode==="FLUID"){o.scroll(c);return}c.scrollJumpRequest&&s(c)}},start:o.start,stop:o.stop}};const uA="data-rfd",dA=(()=>{const n=`${uA}-drag-handle`;return{base:n,draggableId:`${n}-draggable-id`,contextId:`${n}-context-id`}})(),iae=(()=>{const n=`${uA}-draggable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),DJt=(()=>{const n=`${uA}-droppable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),QLe={contextId:`${uA}-scroll-container-context-id`},AJt=n=>e=>`[${e}="${n}"]`,uO=(n,e)=>n.map(t=>{const i=t.styles[e];return i?`${t.selector} { ${i} }`:""}).join(" "),NJt="pointer-events: none;";var RJt=n=>{const e=AJt(n),t=(()=>{const a=` cursor: -webkit-grab; cursor: grab; `;return{selector:e(dA.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:a,dragging:NJt,dropAnimating:a}}})(),i=(()=>{const a=` transition: ${dM.outOfTheWay}; `;return{selector:e(iae.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}})(),r={selector:e(DJt.contextId),styles:{always:"overflow-anchor: none;"}},s=[i,t,r,{selector:"body",styles:{dragging:` cursor: grabbing; cursor: -webkit-grabbing; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; overflow-anchor: none; `}}];return{always:uO(s,"always"),resting:uO(s,"resting"),dragging:uO(s,"dragging"),dropAnimating:uO(s,"dropAnimating"),userCancel:uO(s,"userCancel")}};const OJt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;var og=OJt;const UJ=()=>{const n=document.querySelector("head");return n||Gn(!1),n},XLe=n=>{const e=document.createElement("style");return n&&e.setAttribute("nonce",n),e.type="text/css",e};function PJt(n,e){const t=cs(()=>RJt(n),[n]),i=w.useRef(null),r=w.useRef(null),o=Xi(yu(d=>{const h=r.current;h||Gn(!1),h.textContent=d}),[]),s=Xi(d=>{const h=i.current;h||Gn(!1),h.textContent=d},[]);og(()=>{!i.current&&!r.current||Gn(!1);const d=XLe(e),h=XLe(e);return i.current=d,r.current=h,d.setAttribute(`${uA}-always`,n),h.setAttribute(`${uA}-dynamic`,n),UJ().appendChild(d),UJ().appendChild(h),s(t.always),o(t.resting),()=>{const f=g=>{const m=g.current;m||Gn(!1),UJ().removeChild(m),g.current=null};f(i),f(r)}},[e,s,o,t.always,t.resting,n]);const a=Xi(()=>o(t.dragging),[o,t.dragging]),l=Xi(d=>{if(d==="DROP"){o(t.dropAnimating);return}o(t.userCancel)},[o,t.dropAnimating,t.userCancel]),c=Xi(()=>{r.current&&o(t.resting)},[o,t.resting]);return cs(()=>({dragging:a,dropping:l,resting:c}),[a,l,c])}function Vje(n,e){return Array.from(n.querySelectorAll(e))}var Hje=n=>{var e;return((e=n==null?void 0:n.ownerDocument)==null?void 0:e.defaultView)||window};function sK(n){return n instanceof Hje(n).HTMLElement}function MJt(n,e){const t=`[${dA.contextId}="${n}"]`,i=Vje(document,t);if(!i.length)return null;const r=i.find(o=>o.getAttribute(dA.draggableId)===e);return!r||!sK(r)?null:r}function FJt(n){const e=w.useRef({}),t=w.useRef(null),i=w.useRef(null),r=w.useRef(!1),o=Xi(function(h,f){const g={id:h,focus:f};return e.current[h]=g,function(){const v=e.current;v[h]!==g&&delete v[h]}},[]),s=Xi(function(h){const f=MJt(n,h);f&&f!==document.activeElement&&f.focus()},[n]),a=Xi(function(h,f){t.current===h&&(t.current=f)},[]),l=Xi(function(){i.current||r.current&&(i.current=requestAnimationFrame(()=>{i.current=null;const h=t.current;h&&s(h)}))},[s]),c=Xi(function(h){t.current=null;const f=document.activeElement;f&&f.getAttribute(dA.draggableId)===h&&(t.current=h)},[]);return og(()=>(r.current=!0,function(){r.current=!1;const h=i.current;h&&cancelAnimationFrame(h)}),[]),cs(()=>({register:o,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}),[o,c,l,a])}function BJt(){const n={draggables:{},droppables:{}},e=[];function t(d){return e.push(d),function(){const f=e.indexOf(d);f!==-1&&e.splice(f,1)}}function i(d){e.length&&e.forEach(h=>h(d))}function r(d){return n.draggables[d]||null}function o(d){const h=r(d);return h||Gn(!1),h}const s={register:d=>{n.draggables[d.descriptor.id]=d,i({type:"ADDITION",value:d})},update:(d,h)=>{const f=n.draggables[h.descriptor.id];f&&f.uniqueId===d.uniqueId&&(delete n.draggables[h.descriptor.id],n.draggables[d.descriptor.id]=d)},unregister:d=>{const h=d.descriptor.id,f=r(h);f&&d.uniqueId===f.uniqueId&&(delete n.draggables[h],n.droppables[d.descriptor.droppableId]&&i({type:"REMOVAL",value:d}))},getById:o,findById:r,exists:d=>!!r(d),getAllByType:d=>Object.values(n.draggables).filter(h=>h.descriptor.type===d)};function a(d){return n.droppables[d]||null}function l(d){const h=a(d);return h||Gn(!1),h}const c={register:d=>{n.droppables[d.descriptor.id]=d},unregister:d=>{const h=a(d.descriptor.id);h&&d.uniqueId===h.uniqueId&&delete n.droppables[d.descriptor.id]},getById:l,findById:a,exists:d=>!!a(d),getAllByType:d=>Object.values(n.droppables).filter(h=>h.descriptor.type===d)};function u(){n.draggables={},n.droppables={},e.length=0}return{draggable:s,droppable:c,subscribe:t,clean:u}}function $Jt(){const n=cs(BJt,[]);return w.useEffect(()=>function(){ae.version.startsWith("16")||ae.version.startsWith("17")?requestAnimationFrame(n.clean):n.clean()},[n]),n}var Fve=ae.createContext(null),_W=()=>{const n=document.body;return n||Gn(!1),n};const VJt={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};var HJt=VJt;const WJt=n=>`rfd-announcement-${n}`;function zJt(n){const e=cs(()=>WJt(n),[n]),t=w.useRef(null);return w.useEffect(function(){const o=document.createElement("div");return t.current=o,o.id=e,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),Ct(o.style,HJt),_W().appendChild(o),function(){setTimeout(function(){const l=_W();l.contains(o)&&l.removeChild(o),o===t.current&&(t.current=null)})}},[e]),Xi(r=>{const o=t.current;if(o){o.textContent=r;return}},[])}let UJt=0;const Wje={separator:"::"};function jJt(n,e){return e===void 0&&(e=Wje),cs(()=>`${n}${e.separator}${UJt++}`,[e.separator,n])}function qJt(n,e){e===void 0&&(e=Wje);const t=ae.useId();return cs(()=>`${n}${e.separator}${t}`,[e.separator,n,t])}var Bve="useId"in ae?qJt:jJt;function KJt(n){let{contextId:e,uniqueId:t}=n;return`rfd-hidden-text-${e}-${t}`}function GJt(n){let{contextId:e,text:t}=n;const i=Bve("hidden-text",{separator:"-"}),r=cs(()=>KJt({contextId:e,uniqueId:i}),[i,e]);return w.useEffect(function(){const s=document.createElement("div");return s.id=r,s.textContent=t,s.style.display="none",_W().appendChild(s),function(){const l=_W();l.contains(s)&&l.removeChild(s)}},[r,t]),r}var aK=ae.createContext(null);function zje(n){const e=w.useRef(n);return w.useEffect(()=>{e.current=n}),e}function YJt(){let n=null;function e(){return!!n}function t(s){return s===n}function i(s){n&&Gn(!1);const a={abandon:s};return n=a,a}function r(){n||Gn(!1),n=null}function o(){n&&(n.abandon(),r())}return{isClaimed:e,isActive:t,claim:i,release:r,tryAbandon:o}}function n3(n){return n.phase==="IDLE"||n.phase==="DROP_ANIMATING"?!1:n.isDragging}const QJt=9,XJt=13,$ve=27,Uje=32,ZJt=33,JJt=34,een=35,ten=36,nen=37,ien=38,ren=39,oen=40,sen={[XJt]:!0,[QJt]:!0};var jje=n=>{sen[n.keyCode]&&n.preventDefault()};const aen=(()=>{const n="visibilitychange";return typeof document>"u"?n:[n,`ms${n}`,`webkit${n}`,`moz${n}`,`o${n}`].find(i=>`on${i}`in document)||n})();var lK=aen;const qje=0,ZLe=5;function len(n,e){return Math.abs(e.x-n.x)>=ZLe||Math.abs(e.y-n.y)>=ZLe}const JLe={type:"IDLE"};function cen(n){let{cancel:e,completed:t,getPhase:i,setPhase:r}=n;return[{eventName:"mousemove",fn:o=>{const{button:s,clientX:a,clientY:l}=o;if(s!==qje)return;const c={x:a,y:l},u=i();if(u.type==="DRAGGING"){o.preventDefault(),u.actions.move(c);return}u.type!=="PENDING"&&Gn(!1);const d=u.point;if(!len(d,c))return;o.preventDefault();const h=u.actions.fluidLift(c);r({type:"DRAGGING",actions:h})}},{eventName:"mouseup",fn:o=>{const s=i();if(s.type!=="DRAGGING"){e();return}o.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{i().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(i().type==="PENDING"){e();return}if(o.keyCode===$ve){o.preventDefault(),e();return}jje(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{i().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const s=i();if(s.type==="IDLE"&&Gn(!1),s.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:lK,fn:e}]}function uen(n){const e=w.useRef(JLe),t=w.useRef(Tw),i=cs(()=>({eventName:"mousedown",fn:function(d){if(d.defaultPrevented||d.button!==qje||d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)return;const h=n.findClosestDraggableId(d);if(!h)return;const f=n.tryGetLock(h,s,{sourceEvent:d});if(!f)return;d.preventDefault();const g={x:d.clientX,y:d.clientY};t.current(),c(f,g)}}),[n]),r=cs(()=>({eventName:"webkitmouseforcewillbegin",fn:u=>{if(u.defaultPrevented)return;const d=n.findClosestDraggableId(u);if(!d)return;const h=n.findOptionsForDraggable(d);h&&(h.shouldRespectForcePress||n.canGetLock(d)&&u.preventDefault())}}),[n]),o=Xi(function(){const d={passive:!1,capture:!0};t.current=gm(window,[r,i],d)},[r,i]),s=Xi(()=>{e.current.type!=="IDLE"&&(e.current=JLe,t.current(),o())},[o]),a=Xi(()=>{const u=e.current;s(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[s]),l=Xi(function(){const d={capture:!0,passive:!1},h=cen({cancel:a,completed:s,getPhase:()=>e.current,setPhase:f=>{e.current=f}});t.current=gm(window,h,d)},[a,s]),c=Xi(function(d,h){e.current.type!=="IDLE"&&Gn(!1),e.current={type:"PENDING",point:h,actions:d},l()},[l]);og(function(){return o(),function(){t.current()}},[o])}function den(){}const hen={[JJt]:!0,[ZJt]:!0,[ten]:!0,[een]:!0};function fen(n,e){function t(){e(),n.cancel()}function i(){e(),n.drop()}return[{eventName:"keydown",fn:r=>{if(r.keyCode===$ve){r.preventDefault(),t();return}if(r.keyCode===Uje){r.preventDefault(),i();return}if(r.keyCode===oen){r.preventDefault(),n.moveDown();return}if(r.keyCode===ien){r.preventDefault(),n.moveUp();return}if(r.keyCode===ren){r.preventDefault(),n.moveRight();return}if(r.keyCode===nen){r.preventDefault(),n.moveLeft();return}if(hen[r.keyCode]){r.preventDefault();return}jje(r)}},{eventName:"mousedown",fn:t},{eventName:"mouseup",fn:t},{eventName:"click",fn:t},{eventName:"touchstart",fn:t},{eventName:"resize",fn:t},{eventName:"wheel",fn:t,options:{passive:!0}},{eventName:lK,fn:t}]}function pen(n){const e=w.useRef(den),t=cs(()=>({eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==Uje)return;const s=n.findClosestDraggableId(o);if(!s)return;const a=n.tryGetLock(s,u,{sourceEvent:o});if(!a)return;o.preventDefault();let l=!0;const c=a.snapLift();e.current();function u(){l||Gn(!1),l=!1,e.current(),i()}e.current=gm(window,fen(c,u),{capture:!0,passive:!1})}}),[n]),i=Xi(function(){const o={passive:!1,capture:!0};e.current=gm(window,[t],o)},[t]);og(function(){return i(),function(){e.current()}},[i])}const jJ={type:"IDLE"},gen=120,men=.15;function _en(n){let{cancel:e,getPhase:t}=n;return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:i=>{i.preventDefault()}},{eventName:"keydown",fn:i=>{if(t().type!=="DRAGGING"){e();return}i.keyCode===$ve&&i.preventDefault(),e()}},{eventName:lK,fn:e}]}function ven(n){let{cancel:e,completed:t,getPhase:i}=n;return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=i();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:s,clientY:a}=r.touches[0],l={x:s,y:a};r.preventDefault(),o.actions.move(l)}},{eventName:"touchend",fn:r=>{const o=i();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(i().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=i();o.type==="IDLE"&&Gn(!1);const s=r.touches[0];if(!s||!(s.force>=men))return;const l=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){l&&e();return}if(l){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:lK,fn:e}]}function ben(n){const e=w.useRef(jJ),t=w.useRef(Tw),i=Xi(function(){return e.current},[]),r=Xi(function(f){e.current=f},[]),o=cs(()=>({eventName:"touchstart",fn:function(f){if(f.defaultPrevented)return;const g=n.findClosestDraggableId(f);if(!g)return;const m=n.tryGetLock(g,a,{sourceEvent:f});if(!m)return;const v=f.touches[0],{clientX:_,clientY:b}=v,y={x:_,y:b};t.current(),d(m,y)}}),[n]),s=Xi(function(){const f={capture:!0,passive:!1};t.current=gm(window,[o],f)},[o]),a=Xi(()=>{const h=e.current;h.type!=="IDLE"&&(h.type==="PENDING"&&clearTimeout(h.longPressTimerId),r(jJ),t.current(),s())},[s,r]),l=Xi(()=>{const h=e.current;a(),h.type==="DRAGGING"&&h.actions.cancel({shouldBlockNextClick:!0}),h.type==="PENDING"&&h.actions.abort()},[a]),c=Xi(function(){const f={capture:!0,passive:!1},g={cancel:l,completed:a,getPhase:i},m=gm(window,ven(g),f),v=gm(window,_en(g),f);t.current=function(){m(),v()}},[l,i,a]),u=Xi(function(){const f=i();f.type!=="PENDING"&&Gn(!1);const g=f.actions.fluidLift(f.point);r({type:"DRAGGING",actions:g,hasMoved:!1})},[i,r]),d=Xi(function(f,g){i().type!=="IDLE"&&Gn(!1);const m=setTimeout(u,gen);r({type:"PENDING",point:g,actions:f,longPressTimerId:m}),c()},[c,i,r,u]);og(function(){return s(),function(){t.current();const g=i();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),r(jJ))}},[i,s,r]),og(function(){return gm(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const yen=["input","button","textarea","select","option","optgroup","video","audio"];function Kje(n,e){if(e==null)return!1;if(yen.includes(e.tagName.toLowerCase()))return!0;const i=e.getAttribute("contenteditable");return i==="true"||i===""?!0:e===n?!1:Kje(n,e.parentElement)}function Cen(n,e){const t=e.target;return sK(t)?Kje(n,t):!1}var wen=n=>J_(n.getBoundingClientRect()).center;function Sen(n){return n instanceof Hje(n).Element}const Een=(()=>{const n="matches";return typeof document>"u"?n:[n,"msMatchesSelector","webkitMatchesSelector"].find(i=>i in Element.prototype)||n})();function Gje(n,e){return n==null?null:n[Een](e)?n:Gje(n.parentElement,e)}function xen(n,e){return n.closest?n.closest(e):Gje(n,e)}function Ten(n){return`[${dA.contextId}="${n}"]`}function ken(n,e){const t=e.target;if(!Sen(t))return null;const i=Ten(n),r=xen(t,i);return!r||!sK(r)?null:r}function Ien(n,e){const t=ken(n,e);return t?t.getAttribute(dA.draggableId):null}function Len(n,e){const t=`[${iae.contextId}="${n}"]`,r=Vje(document,t).find(o=>o.getAttribute(iae.id)===e);return!r||!sK(r)?null:r}function Den(n){n.preventDefault()}function e9(n){let{expected:e,phase:t,isLockActive:i,shouldWarn:r}=n;return!(!i()||e!==t)}function Yje(n){let{lockAPI:e,store:t,registry:i,draggableId:r}=n;if(e.isClaimed())return!1;const o=i.draggable.findById(r);return!(!o||!o.options.isEnabled||!Mje(t.getState(),r))}function Aen(n){let{lockAPI:e,contextId:t,store:i,registry:r,draggableId:o,forceSensorStop:s,sourceEvent:a}=n;if(!Yje({lockAPI:e,store:i,registry:r,draggableId:o}))return null;const c=r.draggable.getById(o),u=Len(t,c.descriptor.id);if(!u||a&&!c.options.canDragInteractiveElements&&Cen(u,a))return null;const d=e.claim(s||Tw);let h="PRE_DRAG";function f(){return c.options.shouldRespectForcePress}function g(){return e.isActive(d)}function m(E,k){e9({expected:E,phase:h,isLockActive:g,shouldWarn:!0})&&i.dispatch(k())}const v=m.bind(null,"DRAGGING");function _(E){function k(){e.release(),h="COMPLETED"}h!=="PRE_DRAG"&&(k(),Gn(!1)),i.dispatch(gZt(E.liftActionArgs)),h="DRAGGING";function L(D,A){if(A===void 0&&(A={shouldBlockNextClick:!1}),E.cleanup(),A.shouldBlockNextClick){const O=gm(window,[{eventName:"click",fn:Den,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(O)}k(),i.dispatch(Ije({reason:D}))}return{isActive:()=>e9({expected:"DRAGGING",phase:h,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:f,drop:D=>L("DROP",D),cancel:D=>L("CANCEL",D),...E.actions}}function b(E){const k=Q4(D=>{v(()=>kje({client:D}))});return{..._({liftActionArgs:{id:o,clientSelection:E,movementMode:"FLUID"},cleanup:()=>k.cancel(),actions:{move:k}}),move:k}}function y(){const E={moveUp:()=>v(EZt),moveRight:()=>v(TZt),moveDown:()=>v(xZt),moveLeft:()=>v(kZt)};return _({liftActionArgs:{id:o,clientSelection:wen(u),movementMode:"SNAP"},cleanup:Tw,actions:E})}function C(){e9({expected:"PRE_DRAG",phase:h,isLockActive:g,shouldWarn:!0})&&e.release()}return{isActive:()=>e9({expected:"PRE_DRAG",phase:h,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:f,fluidLift:b,snapLift:y,abort:C}}const Nen=[uen,pen,ben];function Ren(n){let{contextId:e,store:t,registry:i,customSensors:r,enableDefaultSensors:o}=n;const s=[...o?Nen:[],...r||[]],a=w.useState(()=>YJt())[0],l=Xi(function(_,b){n3(_)&&!n3(b)&&a.tryAbandon()},[a]);og(function(){let _=t.getState();return t.subscribe(()=>{const y=t.getState();l(_,y),_=y})},[a,t,l]),og(()=>a.tryAbandon,[a.tryAbandon]);const c=Xi(v=>Yje({lockAPI:a,registry:i,store:t,draggableId:v}),[a,i,t]),u=Xi((v,_,b)=>Aen({lockAPI:a,registry:i,contextId:e,store:t,draggableId:v,forceSensorStop:_||null,sourceEvent:b&&b.sourceEvent?b.sourceEvent:null}),[e,a,i,t]),d=Xi(v=>Ien(e,v),[e]),h=Xi(v=>{const _=i.draggable.findById(v);return _?_.options:null},[i.draggable]),f=Xi(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Dve()))},[a,t]),g=Xi(()=>a.isClaimed(),[a]),m=cs(()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:h,tryReleaseLock:f,isLockClaimed:g}),[c,u,d,h,f,g]);for(let v=0;v<s.length;v++)s[v](m)}const Oen=n=>({onBeforeCapture:e=>{const t=()=>{n.onBeforeCapture&&n.onBeforeCapture(e)};ae.version.startsWith("16")||ae.version.startsWith("17")?t():sp.flushSync(t)},onBeforeDragStart:n.onBeforeDragStart,onDragStart:n.onDragStart,onDragEnd:n.onDragEnd,onDragUpdate:n.onDragUpdate}),Pen=n=>({...t3,...n.autoScrollerOptions,durationDampening:{...t3.durationDampening,...n.autoScrollerOptions}});function dO(n){return n.current||Gn(!1),n.current}function Men(n){const{contextId:e,setCallbacks:t,sensors:i,nonce:r,dragHandleUsageInstructions:o}=n,s=w.useRef(null),a=zje(n),l=Xi(()=>Oen(a.current),[a]),c=Xi(()=>Pen(a.current),[a]),u=zJt(e),d=GJt({contextId:e,text:o}),h=PJt(e,r),f=Xi(A=>{dO(s).dispatch(A)},[]),g=cs(()=>Nie({publishWhileDragging:_Zt,updateDroppableScroll:bZt,updateDroppableIsEnabled:yZt,updateDroppableIsCombineEnabled:CZt,collectionStarting:vZt},f),[f]),m=$Jt(),v=cs(()=>hJt(m,g),[m,g]),_=cs(()=>LJt({scrollWindow:fJt,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:c,...Nie({move:kje},f)}),[v.scrollDroppable,f,c]),b=FJt(e),y=cs(()=>lJt({announce:u,autoScroller:_,dimensionMarshal:v,focusMarshal:b,getResponders:l,styleMarshal:h}),[u,_,v,b,l,h]);s.current=y;const C=Xi(()=>{const A=dO(s);A.getState().phase!=="IDLE"&&A.dispatch(Dve())},[]),x=Xi(()=>{const A=dO(s).getState();return A.phase==="DROP_ANIMATING"?!0:A.phase==="IDLE"?!1:A.isDragging},[]),E=cs(()=>({isDragging:x,tryAbort:C}),[x,C]);t(E);const k=Xi(A=>Mje(dO(s).getState(),A),[]),L=Xi(()=>ix(dO(s).getState()),[]),D=cs(()=>({marshal:v,focus:b,contextId:e,canLift:k,isMovementAllowed:L,dragHandleUsageInstructionsId:d,registry:m}),[e,v,d,b,k,L,m]);return Ren({contextId:e,store:y,registry:m,customSensors:i||null,enableDefaultSensors:n.enableDefaultSensors!==!1}),w.useEffect(()=>C,[C]),ae.createElement(aK.Provider,{value:D},ae.createElement(W6e,{context:Fve,store:y},n.children))}let Fen=0;function Ben(){return cs(()=>`${Fen++}`,[])}function $en(){return ae.useId()}var Ven="useId"in ae?$en:Ben;function cK(n){const e=Ven(),t=n.dragHandleUsageInstructions||k$.dragHandleUsageInstructions;return ae.createElement(iXt,null,i=>ae.createElement(Men,{nonce:n.nonce,contextId:e,setCallbacks:i,dragHandleUsageInstructions:t,enableDefaultSensors:n.enableDefaultSensors,sensors:n.sensors,onBeforeCapture:n.onBeforeCapture,onBeforeDragStart:n.onBeforeDragStart,onDragStart:n.onDragStart,onDragUpdate:n.onDragUpdate,onDragEnd:n.onDragEnd,autoScrollerOptions:n.autoScrollerOptions},n.children))}const eDe={dragging:5e3,dropAnimating:4500},Hen=(n,e)=>e?dM.drop(e.duration):n?dM.snap:dM.fluid,Wen=(n,e)=>{if(n)return e?e3.opacity.drop:e3.opacity.combining},zen=n=>n.forceShouldAnimate!=null?n.forceShouldAnimate:n.mode==="SNAP";function Uen(n){const t=n.dimension.client,{offset:i,combineWith:r,dropping:o}=n,s=!!r,a=zen(n),l=!!o,c=l?tae.drop(i,s):tae.moveTo(i);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:Hen(a,o),transform:c,opacity:Wen(s,l),zIndex:l?eDe.dropAnimating:eDe.dragging,pointerEvents:"none"}}function jen(n){return{transform:tae.moveTo(n.offset),transition:n.shouldAnimateDisplacement?void 0:"none"}}function qen(n){return n.type==="DRAGGING"?Uen(n):jen(n)}function Ken(n,e,t){t===void 0&&(t=Xu);const i=window.getComputedStyle(e),r=e.getBoundingClientRect(),o=nje(r,i),s=fW(o,t),a={client:o,tagName:e.tagName.toLowerCase(),display:i.display},l={x:o.marginBox.width,y:o.marginBox.height};return{descriptor:n,placeholder:a,displaceBy:l,client:o,page:s}}function Gen(n){const e=Bve("draggable"),{descriptor:t,registry:i,getDraggableRef:r,canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}=n,l=cs(()=>({canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}),[o,a,s]),c=Xi(f=>{const g=r();return g||Gn(!1),Ken(t,g,f)},[t,r]),u=cs(()=>({uniqueId:e,descriptor:t,options:l,getDimension:c}),[t,c,l,e]),d=w.useRef(u),h=w.useRef(!0);og(()=>(i.draggable.register(d.current),()=>i.draggable.unregister(d.current)),[i.draggable]),og(()=>{if(h.current){h.current=!1;return}const f=d.current;d.current=u,i.draggable.update(u,f)},[u,i.draggable])}var Vve=ae.createContext(null);function vW(n){const e=w.useContext(n);return e||Gn(!1),e}function Yen(n){n.preventDefault()}const Qen=n=>{const e=w.useRef(null),t=Xi(function(E){E===void 0&&(E=null),e.current=E},[]),i=Xi(()=>e.current,[]),{contextId:r,dragHandleUsageInstructionsId:o,registry:s}=vW(aK),{type:a,droppableId:l}=vW(Vve),c=cs(()=>({id:n.draggableId,index:n.index,type:a,droppableId:l}),[n.draggableId,n.index,a,l]),{children:u,draggableId:d,isEnabled:h,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:v,dropAnimationFinished:_}=n;if(!m){const E=cs(()=>({descriptor:c,registry:s,getDraggableRef:i,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:h}),[c,s,i,g,f,h]);Gen(E)}const b=cs(()=>h?{tabIndex:0,role:"button","aria-describedby":o,"data-rfd-drag-handle-draggable-id":d,"data-rfd-drag-handle-context-id":r,draggable:!1,onDragStart:Yen}:null,[r,o,d,h]),y=Xi(E=>{v.type==="DRAGGING"&&v.dropping&&E.propertyName==="transform"&&(ae.version.startsWith("16")||ae.version.startsWith("17")?_():sp.flushSync(_))},[_,v]),C=cs(()=>{const E=qen(v),k=v.type==="DRAGGING"&&v.dropping?y:void 0;return{innerRef:t,draggableProps:{"data-rfd-draggable-context-id":r,"data-rfd-draggable-id":d,style:E,onTransitionEnd:k},dragHandleProps:b}},[r,b,d,v,y,t]),x=cs(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return ae.createElement(ae.Fragment,null,u(C,v.snapshot,x))};var Xen=Qen,Qje=(n,e)=>n===e,Xje=n=>{const{combine:e,destination:t}=n;return t?t.droppableId:e?e.droppableId:null};const Zen=n=>n.combine?n.combine.draggableId:null,Jen=n=>n.at&&n.at.type==="COMBINE"?n.at.combine.draggableId:null;function etn(){const n=yu((r,o)=>({x:r,y:o})),e=yu(function(r,o,s,a,l){return s===void 0&&(s=null),a===void 0&&(a=null),l===void 0&&(l=null),{isDragging:!0,isClone:o,isDropAnimating:!!l,dropAnimation:l,mode:r,draggingOver:s,combineWith:a,combineTargetFor:null}}),t=yu(function(r,o,s,a,l,c,u){return l===void 0&&(l=null),c===void 0&&(c=null),u===void 0&&(u=null),{mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:c,mode:o,offset:r,dimension:s,forceShouldAnimate:u,snapshot:e(o,a,l,c,null)}}});return(r,o)=>{if(n3(r)){if(r.critical.draggable.id!==o.draggableId)return null;const s=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],l=rg(r.impact),c=Jen(r.impact),u=r.forceShouldAnimate;return t(n(s.x,s.y),r.movementMode,a,o.isClone,l,c,u)}if(r.phase==="DROP_ANIMATING"){const s=r.completed;if(s.result.draggableId!==o.draggableId)return null;const a=o.isClone,l=r.dimensions.draggables[o.draggableId],c=s.result,u=c.mode,d=Xje(c),h=Zen(c),g={duration:r.dropDuration,curve:Nve.drop,moveTo:r.newHomeClientOffset,opacity:h?e3.opacity.drop:null,scale:h?e3.scale.drop:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:l,dropping:g,draggingOver:d,combineWith:h,mode:u,forceShouldAnimate:null,snapshot:e(u,a,d,h,g)}}}return null}}function Zje(n){return n===void 0&&(n=null),{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:n,combineWith:null}}const ttn={mapped:{type:"SECONDARY",offset:Xu,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Zje(null)}};function ntn(){const n=yu((s,a)=>({x:s,y:a})),e=yu(Zje),t=yu(function(s,a,l){return a===void 0&&(a=null),{mapped:{type:"SECONDARY",offset:s,combineTargetFor:a,shouldAnimateDisplacement:l,snapshot:e(a)}}}),i=s=>s?t(Xu,s,!0):null,r=(s,a,l,c)=>{const u=l.displaced.visible[s],d=!!(c.inVirtualList&&c.effected[s]),h=iK(l),f=h&&h.draggableId===s?a:null;if(!u){if(!d)return i(f);if(l.displaced.invisible[s])return null;const v=HN(c.displacedBy.point),_=n(v.x,v.y);return t(_,f,!0)}if(d)return i(f);const g=l.displacedBy.point,m=n(g.x,g.y);return t(m,f,u.shouldAnimate)};return(s,a)=>{if(n3(s))return s.critical.draggable.id===a.draggableId?null:r(a.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const l=s.completed;return l.result.draggableId===a.draggableId?null:r(a.draggableId,l.result.draggableId,l.impact,l.afterCritical)}return null}}const itn=()=>{const n=etn(),e=ntn();return(i,r)=>n(i,r)||e(i,r)||ttn},rtn={dropAnimationFinished:Lje},otn=H6e(itn,rtn,null,{context:Fve,areStatePropsEqual:Qje})(Xen);var stn=otn;function Jje(n){return vW(Vve).isUsingCloneFor===n.draggableId&&!n.isClone?null:ae.createElement(stn,n)}function uK(n){const e=typeof n.isDragDisabled=="boolean"?!n.isDragDisabled:!0,t=!!n.disableInteractiveElementBlocking,i=!!n.shouldRespectForcePress;return ae.createElement(Jje,Ct({},n,{isClone:!1,isEnabled:e,canDragInteractiveElements:t,shouldRespectForcePress:i}))}const eqe=n=>e=>n===e,atn=eqe("scroll"),ltn=eqe("auto"),tDe=(n,e)=>e(n.overflowX)||e(n.overflowY),ctn=n=>{const e=window.getComputedStyle(n),t={overflowX:e.overflowX,overflowY:e.overflowY};return tDe(t,atn)||tDe(t,ltn)},utn=()=>!1,tqe=n=>n==null?null:n===document.body?utn()?n:null:n===document.documentElement?null:ctn(n)?n:tqe(n.parentElement);var dtn=tqe,rae=n=>({x:n.scrollLeft,y:n.scrollTop});const nqe=n=>n?window.getComputedStyle(n).position==="fixed"?!0:nqe(n.parentElement):!1;var htn=n=>{const e=dtn(n),t=nqe(n);return{closestScrollable:e,isFixedOnPage:t}},ftn=n=>{let{descriptor:e,isEnabled:t,isCombineEnabled:i,isFixedOnPage:r,direction:o,client:s,page:a,closest:l}=n;const c=(()=>{if(!l)return null;const{scrollSize:f,client:g}=l,m=Rje({scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:g,scrollSize:f,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:m,diff:{value:Xu,displacement:Xu}}}})(),u=o==="vertical"?xve:hje,d=cA({page:a,withPlaceholder:null,axis:u,frame:c});return{descriptor:e,isCombineEnabled:i,isFixedOnPage:r,axis:u,isEnabled:t,client:s,page:a,frame:c,subject:d}};const ptn=(n,e)=>{const t=ije(n);if(!e||n!==e)return t;const i=t.paddingBox.top-e.scrollTop,r=t.paddingBox.left-e.scrollLeft,o=i+e.scrollHeight,s=r+e.scrollWidth,l=Cve({top:i,right:s,bottom:o,left:r},t.border);return wve({borderBox:l,margin:t.margin,border:t.border,padding:t.padding})};var gtn=n=>{let{ref:e,descriptor:t,env:i,windowScroll:r,direction:o,isDropDisabled:s,isCombineEnabled:a,shouldClipSubject:l}=n;const c=i.closestScrollable,u=ptn(e,c),d=fW(u,r),h=(()=>{if(!c)return null;const g=ije(c),m={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:g,page:fW(g,r),scroll:rae(c),scrollSize:m,shouldClipSubject:l}})();return ftn({descriptor:t,isEnabled:!s,isCombineEnabled:a,isFixedOnPage:i.isFixedOnPage,direction:o,client:u,page:d,closest:h})};const mtn={passive:!1},_tn={passive:!0};var nDe=n=>n.shouldPublishImmediately?mtn:_tn;const t9=n=>n&&n.env.closestScrollable||null;function vtn(n){const e=w.useRef(null),t=vW(aK),i=Bve("droppable"),{registry:r,marshal:o}=t,s=zje(n),a=cs(()=>({id:n.droppableId,type:n.type,mode:n.mode}),[n.droppableId,n.mode,n.type]),l=w.useRef(a),c=cs(()=>yu((C,x)=>{e.current||Gn(!1);const E={x:C,y:x};o.updateDroppableScroll(a.id,E)}),[a.id,o]),u=Xi(()=>{const C=e.current;return!C||!C.env.closestScrollable?Xu:rae(C.env.closestScrollable)},[]),d=Xi(()=>{const C=u();c(C.x,C.y)},[u,c]),h=cs(()=>Q4(d),[d]),f=Xi(()=>{const C=e.current,x=t9(C);if(C&&x||Gn(!1),C.scrollOptions.shouldPublishImmediately){d();return}h()},[h,d]),g=Xi((C,x)=>{e.current&&Gn(!1);const E=s.current,k=E.getDroppableRef();k||Gn(!1);const L=htn(k),D={ref:k,descriptor:a,env:L,scrollOptions:x};e.current=D;const A=gtn({ref:k,descriptor:a,env:L,windowScroll:C,direction:E.direction,isDropDisabled:E.isDropDisabled,isCombineEnabled:E.isCombineEnabled,shouldClipSubject:!E.ignoreContainerClipping}),O=L.closestScrollable;return O&&(O.setAttribute(QLe.contextId,t.contextId),O.addEventListener("scroll",f,nDe(D.scrollOptions))),A},[t.contextId,a,f,s]),m=Xi(()=>{const C=e.current,x=t9(C);return C&&x||Gn(!1),rae(x)},[]),v=Xi(()=>{const C=e.current;C||Gn(!1);const x=t9(C);e.current=null,x&&(h.cancel(),x.removeAttribute(QLe.contextId),x.removeEventListener("scroll",f,nDe(C.scrollOptions)))},[f,h]),_=Xi(C=>{const x=e.current;x||Gn(!1);const E=t9(x);E||Gn(!1),E.scrollTop+=C.y,E.scrollLeft+=C.x},[]),b=cs(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:v,scroll:_}),[v,g,m,_]),y=cs(()=>({uniqueId:i,descriptor:a,callbacks:b}),[b,a,i]);og(()=>(l.current=y.descriptor,r.droppable.register(y),()=>{e.current&&v(),r.droppable.unregister(y)}),[b,a,v,y,o,r.droppable]),og(()=>{e.current&&o.updateDroppableIsEnabled(l.current.id,!n.isDropDisabled)},[n.isDropDisabled,o]),og(()=>{e.current&&o.updateDroppableIsCombineEnabled(l.current.id,n.isCombineEnabled)},[n.isCombineEnabled,o])}function qJ(){}const iDe={width:0,height:0,margin:uXt},btn=n=>{let{isAnimatingOpenOnMount:e,placeholder:t,animate:i}=n;return e||i==="close"?iDe:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}},ytn=n=>{let{isAnimatingOpenOnMount:e,placeholder:t,animate:i}=n;const r=btn({isAnimatingOpenOnMount:e,placeholder:t,animate:i});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:i!=="none"?dM.placeholder:null}},Ctn=n=>{const e=w.useRef(null),t=Xi(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),{animate:i,onTransitionEnd:r,onClose:o,contextId:s}=n,[a,l]=w.useState(n.animate==="open");w.useEffect(()=>a?i!=="open"?(t(),l(!1),qJ):e.current?qJ:(e.current=setTimeout(()=>{e.current=null,l(!1)}),t):qJ,[i,a,t]);const c=Xi(d=>{d.propertyName==="height"&&(r(),i==="close"&&o())},[i,o,r]),u=ytn({isAnimatingOpenOnMount:a,animate:n.animate,placeholder:n.placeholder});return ae.createElement(n.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":s,onTransitionEnd:c,ref:n.innerRef})};var wtn=ae.memo(Ctn);class Stn extends ae.PureComponent{constructor(){super(...arguments),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!e.on,data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}const Etn=n=>{const e=w.useContext(aK);e||Gn(!1);const{contextId:t,isMovementAllowed:i}=e,r=w.useRef(null),o=w.useRef(null),{children:s,droppableId:a,type:l,mode:c,direction:u,ignoreContainerClipping:d,isDropDisabled:h,isCombineEnabled:f,snapshot:g,useClone:m,updateViewportMaxScroll:v,getContainerForClone:_}=n,b=Xi(()=>r.current,[]),y=Xi(function(O){O===void 0&&(O=null),r.current=O},[]);Xi(()=>o.current,[]);const C=Xi(function(O){O===void 0&&(O=null),o.current=O},[]),x=Xi(()=>{i()&&v({maxScroll:Pje()})},[i,v]);vtn({droppableId:a,type:l,mode:c,direction:u,isDropDisabled:h,isCombineEnabled:f,ignoreContainerClipping:d,getDroppableRef:b});const E=cs(()=>ae.createElement(Stn,{on:n.placeholder,shouldAnimate:n.shouldAnimatePlaceholder},O=>{let{onClose:P,data:F,animate:B}=O;return ae.createElement(wtn,{placeholder:F,onClose:P,innerRef:C,animate:B,contextId:t,onTransitionEnd:x})}),[t,x,n.placeholder,n.shouldAnimatePlaceholder,C]),k=cs(()=>({innerRef:y,placeholder:E,droppableProps:{"data-rfd-droppable-id":a,"data-rfd-droppable-context-id":t}}),[t,a,E,y]),L=m?m.dragging.draggableId:null,D=cs(()=>({droppableId:a,type:l,isUsingCloneFor:L}),[a,L,l]);function A(){if(!m)return null;const{dragging:O,render:P}=m,F=ae.createElement(Jje,{draggableId:O.draggableId,index:O.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(B,M)=>P(B,M,O));return ij.createPortal(F,_())}return ae.createElement(Vve.Provider,{value:D},s(k,g),A())};var xtn=Etn;function Ttn(){return document.body||Gn(!1),document.body}const rDe={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:Ttn},iqe=n=>{let e={...n},t;for(t in rDe)n[t]===void 0&&(e={...e,[t]:rDe[t]});return e},KJ=(n,e)=>n===e.droppable.type,oDe=(n,e)=>e.draggables[n.draggable.id],ktn=()=>{const n={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},e={...n,shouldAnimatePlaceholder:!1},t=yu(o=>({draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}})),i=yu((o,s,a,l,c,u)=>{const d=c.descriptor.id;if(c.descriptor.droppableId===o){const g=u?{render:u,dragging:t(c.descriptor)}:null,m={isDraggingOver:a,draggingOverWith:a?d:null,draggingFromThisWith:d,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!1,snapshot:m,useClone:g}}if(!s)return e;if(!l)return n;const f={isDraggingOver:a,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:f,useClone:null}});return(o,s)=>{const a=iqe(s),l=a.droppableId,c=a.type,u=!a.isDropDisabled,d=a.renderClone;if(n3(o)){const h=o.critical;if(!KJ(c,h))return e;const f=oDe(h,o.dimensions),g=rg(o.impact)===l;return i(l,u,g,g,f,d)}if(o.phase==="DROP_ANIMATING"){const h=o.completed;if(!KJ(c,h.critical))return e;const f=oDe(h.critical,o.dimensions);return i(l,u,Xje(h.result)===l,rg(h.impact)===l,f,d)}if(o.phase==="IDLE"&&o.completed&&!o.shouldFlush){const h=o.completed;if(!KJ(c,h.critical))return e;const f=rg(h.impact)===l,g=!!(h.impact.at&&h.impact.at.type==="COMBINE"),m=h.critical.droppable.id===l;return f?g?n:e:m?n:e}return e}},Itn={updateViewportMaxScroll:SZt},Ltn=H6e(ktn,Itn,(n,e,t)=>({...iqe(t),...n,...e}),{context:Fve,areStatePropsEqual:Qje})(xtn);var dK=Ltn;function Dtn(n,e,t){const i=e<0?n.length+e:e;if(i>=0&&i<n.length){const r=t<0?n.length+t:t,[o]=n.splice(e,1);n.splice(r,0,o)}}function Hve(n,e,t){return n=[...n],Dtn(n,e,t),n}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Atn(n){const{isCompanySettingsActive:e}=ea(),{currentGateways:t,setCurrentGateways:i}=n,r=ji(),o=So(),[s,a]=w.useState([]),[l,c]=w.useState("active"),{data:u}=wWe({status:l}),d=m=>{const v=m.map(_=>_.value);c(v.join(","))},h=m=>{const v=t.filter(({id:_})=>_!==m);i(v),v.length?o("settings.company_gateway_ids",v.map(({id:_})=>_).join(",")):o("settings.company_gateway_ids","0")},f=()=>{const m=(u==null?void 0:u.data.data)||[];m&&(i(m),o("settings.company_gateway_ids",m.map(({id:v})=>v).join(",")))},g=m=>{const v={};return m.forEach(_=>{v[_.id]||(v[_.id]=_)}),Object.values(v)};return w.useEffect(()=>{if(u)if((r==null?void 0:r.settings.company_gateway_ids)!=="0")if(r!=null&&r.settings.company_gateway_ids){let m=r.settings.company_gateway_ids.split(",").map(v=>u.data.data.find(_=>_.id===v));m=m.filter(v=>v),e&&u.data.data.forEach(v=>{m.some(b=>b.id===v.id)||m.push(v)}),a(g(m))}else a(g(u.data.data));else a([])},[u]),{gateways:s,handleRemoveGateway:h,handleReset:f,onStatusChange:d}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Yk(){const n=ni();return{multiValue:(t,{data:i})=>({...t,backgroundColor:i.backgroundColor,color:i.color,borderRadius:"3px"}),multiValueLabel:(t,{data:i})=>({...t,color:i.color}),multiValueRemove:t=>({...t,":hover":{color:"white"},color:"#999999"}),menu:t=>({...t,width:"max-content",minWidth:"100%",backgroundColor:n.$4,borderColor:n.$4}),control:t=>({...t,borderRadius:"3px",backgroundColor:n.$1,color:n.$3,borderColor:n.$5}),option:t=>({...t,backgroundColor:n.$1,":hover":{backgroundColor:n.$7}})}}function Ntn(n){return xn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5 8.186 1.113zM15 4.239l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464L7.443.184z"}}]})(n)}function tLr(n){return xn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.5 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h11zm-11-1a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2h-11z"}},{tag:"path",attr:{d:"M6.5 3a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V3zm-4 0a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V3zm8 0a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V3z"}}]})(n)}function Rtn(n){return xn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}},{tag:"path",attr:{d:"M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286zm1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94z"}}]})(n)}function nLr(n){return xn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z"}}]})(n)}function Otn(n){const[e]=pe(),t=Yk(),{isCompanySettingsActive:i}=ea(),r=So(),{includeRemoveAction:o,includeResetAction:s}=n,a=SWe(),l=ji(),c=Tu(),u=w.useRef(null),[d,h]=w.useState([]),[f,g]=w.useState(!1),[m,v]=w.useState([]),[_,b]=w.useState([]),{gateways:y,handleRemoveGateway:C,handleReset:x,onStatusChange:E}=Atn({currentGateways:d,setCurrentGateways:h}),k=()=>{v([]),u.current&&(u.current.checked=!1)},L=()=>_.every(F=>Sr(F)!==Zi.Active),D=F=>{var M;const B=Hve(d,F.source.index,(M=F.destination)==null?void 0:M.index);r("settings.company_gateway_ids",B.map(({id:V})=>V).join(",")),h(B)},A=F=>{const B=JSON.parse(F.config);return Ptn===F.gateway_key&&!B.account_id},O=F=>{l!=null&&l.settings.company_gateway_ids&&((l==null?void 0:l.settings).company_gateway_ids.split(",").length>1||i?r("settings.company_gateway_ids",d.filter(({id:M})=>!F.includes(M)).map(({id:M})=>M).join(",")):r("settings.company_gateway_ids","0"),g(!0))},P=[{value:"active",label:e("active"),color:"black",backgroundColor:"#e4e4e4"},{value:"archived",label:e("archived"),color:"white",backgroundColor:"#e6b05c"},{value:"deleted",label:e("deleted"),color:"white",backgroundColor:"#c95f53"}];return w.useEffect(()=>{f&&(c(f),g(!1))},[f]),w.useEffect(()=>{y&&h(y.filter(F=>F))},[y]),w.useEffect(()=>{if(y){const F=y.filter(B=>B&&m.includes(B.id));b(F)}},[m]),N("div",{className:"flex flex-col",children:[N("div",{className:"flex justify-between",children:[N("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-4 lg:space-y-0",children:[N($m,{label:e("more_actions"),disabled:!m.length,children:[p(tn,{onClick:()=>{a(m,"archive").then(()=>O(m)),k()},icon:p(vt,{element:Ac}),children:e("archive")}),p(tn,{onClick:()=>{a(m,"delete").then(()=>O(m)),k()},icon:p(vt,{element:gl}),children:e("delete")}),L()&&p(tn,{onClick:()=>{a(m,"restore"),k()},icon:p(vt,{element:Dc}),children:e("restore")})]}),p(mv,{styles:t,defaultValue:P[0],onChange:F=>E(F),placeholder:e("status"),options:P,isMulti:!0})]}),N("div",{className:"flex space-x-5",children:[s&&p(Gt,{behavior:"button",type:"secondary",onClick:x,children:e("reset")}),p(Gt,{to:"/settings/gateways/create",children:e("add_gateway")})]})]}),N(eE,{children:[N(nE,{children:[p(Fa,{children:p(Ph,{innerRef:u,onChange:F=>{Array.from(document.querySelectorAll(".child-checkbox")).forEach(B=>{B.checked=F.target.checked,F.target.checked?v(M=>[...M,B.id]):v(M=>M.filter(V=>V!==B.id))})}})}),p(Fa,{children:e("status")}),p(Fa,{children:e("label")}),p(Fa,{children:e("test_mode")}),p(Fa,{disableUppercase:!0,children:p(wu,{placement:"top",message:e("priority"),width:"auto",children:p(vt,{element:Rtn,color:"white",size:20})})})]}),p(cK,{onDragEnd:D,children:p(dK,{droppableId:"gateways-table",children:F=>N(tE,{...F.droppableProps,innerRef:F.innerRef,children:[d.map((B,M)=>p(uK,{draggableId:M.toString(),index:M,children:V=>w.createElement(Ec,{...V.draggableProps,...V.dragHandleProps,innerRef:V.innerRef,key:M},p(ko,{width:"10%",children:p(Ph,{checked:m.includes(B.id),className:"child-checkbox",value:B.id,id:B.id,onValueChange:U=>m.includes(U)?v(W=>W.filter(q=>q!==U)):v(W=>[...W,U])})}),p(ko,{width:"30%",children:p(Hm,{entity:B})}),p(ko,{width:o?"30%":"35%",children:N("div",{className:"flex items-center space-x-2",children:[p(Li,{to:bt("/settings/gateways/:id/edit?tab=:tab",{id:B.id,tab:A(B)?1:0}),children:B.label}),A(B)&&p(wu,{message:e("stripe_connect_migration_title"),width:"auto",placement:"top",children:N("div",{className:"flex space-x-2",children:[p(Tb,{color:"red",size:22}),p(Tb,{color:"red",size:22})]})})]})}),p(ko,{width:o?"20%":"25%",children:B.test_mode?p(MD,{size:20}):""}),p(ko,{width:"25%",children:N("div",{className:"flex items-center space-x-7 py-1",children:[o&&p(Gt,{behavior:"button",type:"minimal",onClick:()=>C(B.id),children:e("remove")}),p(vt,{element:O9e,size:25})]})}))},M)),d.length?p(w.Fragment,{}):p(Ec,{children:N(ko,{colSpan:100,children:[e("no_records_found"),"."]})}),F.placeholder]})})})]})]})}const Ptn="d14dd26a47cecc30fdd65700bfb67b34";function Mtn(){const{isGroupSettingsActive:n,isClientSettingsActive:e}=ea();return p(Otn,{includeRemoveAction:n||e,includeResetAction:n||e})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function rqe(n){return Ti(["/api/v1/payment_terms",n],()=>Ae("GET",Te("/api/v1/payment_terms?per_page=:perPage&page=:currentPage&sort=:sort",{perPage:n.perPage??1e3,currentPage:n.currentPage,sort:n.sort??"id|asc"})),{staleTime:1/0})}function Ftn(n){return Ti(["/api/v1/payment_terms",n],()=>Ae("GET",Te("/api/v1/payment_terms/:id",n),{headers:nS()}),{staleTime:1/0})}function Wve(n,e){return Ae("POST",Te("/api/v1/payment_terms/bulk"),{action:e,ids:n})}function Btn(){const{isAdmin:n}=Po();return Ti(["/api/v1/payment_terms/create"],()=>Ae("GET",Te("/api/v1/payment_terms/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function $tn(){var m,v,_,b,y;Pi("online_payments");const[n]=pe(),e=Qi(),t=ma(),{isCompanySettingsActive:i}=ea(),{data:r}=ed(),o=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"}],[s,a]=w.useState(),{data:l}=rqe({}),c=Fi($s),u=Pc(),d=So(),h=Tu(),f=lp(),g=(C,x)=>{e(Go({object:"company",property:C,value:x}))};return w.useEffect(()=>{l&&a(l.data.data)},[l]),N(ir,{title:n("online_payments"),breadcrumbs:o,docsLink:"en/basic-settings/#online_payments",onSaveClick:h,onCancelClick:f,children:[p(Mtn,{}),N(Qt,{title:n("settings"),children:[p(K,{leftSide:p(Bt,{propertyKey:"auto_bill_standard_invoices",labelElement:p($t,{label:n("auto_bill_standard_invoices"),helpLabel:n("auto_bill_standard_invoices_help")}),defaultValue:!1}),children:p(ft,{checked:!!((m=u==null?void 0:u.settings)!=null&&m.auto_bill_standard_invoices),onChange:C=>d("settings.auto_bill_standard_invoices",C),disabled:t("auto_bill_standard_invoices")})}),p(K,{leftSide:p(Bt,{propertyKey:"auto_bill",labelElement:p($t,{label:`${n("auto_bill")} ${n("recurring_invoices")}`}),defaultValue:"off"}),children:N(Cn,{value:(u==null?void 0:u.settings.auto_bill)||"off",onValueChange:C=>d("settings.auto_bill",C),disabled:t("auto_bill"),errorMessage:c==null?void 0:c.errors["settings.auto_bill"],customSelector:!0,dismissable:!1,children:[N("option",{value:"always",children:[n("enabled")," (",n("auto_bill_help_always"),")"]}),N("option",{value:"optout",children:[n("optout")," (",n("auto_bill_help_optout"),")"]}),N("option",{value:"optin",children:[n("optin")," (",n("auto_bill_help_optin"),")"]}),N("option",{value:"off",children:[n("disabled")," (",n("auto_bill_help_off"),")"]})]})}),p(K,{leftSide:p(Bt,{propertyKey:"auto_bill_date",labelElement:p($t,{label:n("auto_bill_on"),helpLabel:n("auto_bill_on_help")}),defaultValue:"on_send_date"}),children:N(Cn,{value:(u==null?void 0:u.settings.auto_bill_date)||"on_send_date",onValueChange:C=>d("settings.auto_bill_date",C),disabled:t("auto_bill_date"),errorMessage:c==null?void 0:c.errors["settings.auto_bill_date"],customSelector:!0,dismissable:!1,children:[p("option",{value:"on_send_date",children:n("send_date")}),p("option",{value:"on_due_date",children:n("due_date")})]})}),p(K,{leftSide:p(Bt,{propertyKey:"use_credits_payment",labelElement:p($t,{label:n("use_available_credits"),helpLabel:n("use_available_credits_help")}),defaultValue:"off"}),children:N(Cn,{value:(u==null?void 0:u.settings.use_credits_payment)||"off",onValueChange:C=>d("settings.use_credits_payment",C),disabled:t("use_credits_payment"),errorMessage:c==null?void 0:c.errors["settings.use_credits_payment"],customSelector:!0,dismissable:!1,children:[p("option",{value:"always",children:n("enabled")}),p("option",{value:"option",children:n("show_option")}),p("option",{value:"off",children:n("off")})]})}),p(K,{leftSide:p(Bt,{propertyKey:"use_unapplied_payment",labelElement:p($t,{label:n("use_unapplied_payments"),helpLabel:n("use_unapplied_payments_help")}),defaultValue:"off"}),children:N(Cn,{value:(u==null?void 0:u.settings.use_unapplied_payment)||"off",onValueChange:C=>d("settings.use_unapplied_payment",C),disabled:t("use_unapplied_payment"),errorMessage:c==null?void 0:c.errors["settings.use_unapplied_payment"],customSelector:!0,dismissable:!1,children:[p("option",{value:"always",children:n("enabled")}),p("option",{value:"option",children:n("show_option")}),p("option",{value:"off",children:n("off")})]})}),s&&N(dt,{children:[p(K,{leftSide:p(Bt,{propertyKey:"payment_terms",labelElement:p($t,{label:n("payment_terms"),helpLabel:n("payment_terms_help")})}),children:p(Cn,{value:((v=u==null?void 0:u.settings)==null?void 0:v.payment_terms)||"",onValueChange:C=>d("settings.payment_terms",C),disabled:t("payment_terms"),errorMessage:c==null?void 0:c.errors["settings.payment_terms"],customSelector:!0,withBlank:!0,children:s.map(C=>p("option",{value:C.num_days.toString(),children:C.name},C.id))})}),p(K,{className:"py-0 sm:py-0",children:p(Li,{to:"/settings/payment_terms",children:n("configure_payment_terms")})})]}),p(K,{leftSide:p(Bt,{propertyKey:"payment_type_id",labelElement:p($t,{label:n("payment_type"),helpLabel:n("payment_type_help")})}),children:p(Cn,{value:((_=u==null?void 0:u.settings)==null?void 0:_.payment_type_id)||"0",onValueChange:C=>d("settings.payment_type_id",C),blankOptionValue:"0",disabled:t("payment_type_id"),withBlank:!0,errorMessage:c==null?void 0:c.errors["settings.payment_type_id"],customSelector:!0,children:r==null?void 0:r.payment_types.map(C=>p("option",{value:C.id,children:C.name},C.id))})}),p(K,{leftSide:p(Bt,{propertyKey:"valid_until",labelElement:p($t,{label:n("quote_valid_until"),helpLabel:n("quote_valid_until_help")})}),children:p(Cn,{value:((b=u==null?void 0:u.settings)==null?void 0:b.valid_until)||"",onValueChange:C=>d("settings.valid_until",C),disabled:t("valid_until"),withBlank:!0,errorMessage:c==null?void 0:c.errors["settings.valid_until"],customSelector:!0,children:s==null?void 0:s.map(C=>p("option",{value:C.num_days.toString(),children:C.name},C.id))})}),p(K,{leftSide:p(Bt,{propertyKey:"default_expense_payment_type_id",labelElement:p($t,{label:n("expense_payment_type"),helpLabel:n("expense_payment_type_help")})}),children:p(Cn,{value:((y=u==null?void 0:u.settings)==null?void 0:y.default_expense_payment_type_id)||"",onValueChange:C=>d("settings.default_expense_payment_type_id",C),disabled:t("default_expense_payment_type_id"),blankOptionValue:"0",withBlank:!0,errorMessage:c==null?void 0:c.errors["settings.default_expense_payment_type_id"],customSelector:!0,children:r==null?void 0:r.payment_types.map(C=>p("option",{value:C.id,children:C.name},C.id))})}),p(K,{leftSideHelp:n("manual_payment_email_help"),leftSide:p(Bt,{propertyKey:"client_manual_payment_notification",labelElement:p($t,{label:n("manual_payment_email")}),defaultValue:!1}),children:p(ft,{checked:!!(u!=null&&u.settings.client_manual_payment_notification),onChange:C=>g("settings.client_manual_payment_notification",C),disabled:t("client_manual_payment_notification")})}),p(K,{leftSideHelp:n("online_payment_email_help"),leftSide:p(Bt,{propertyKey:"client_online_payment_notification",labelElement:p($t,{label:n("online_payment_email")}),defaultValue:!1}),children:p(ft,{checked:!!(u!=null&&u.settings.client_online_payment_notification),onChange:C=>g("settings.client_online_payment_notification",C),disabled:t("client_online_payment_notification")})}),p(K,{leftSide:p(Bt,{propertyKey:"send_email_on_mark_paid",labelElement:p($t,{label:n("mark_paid_payment_email"),helpLabel:n("mark_paid_payment_email_help")}),defaultValue:!1}),children:p(ft,{checked:!!(u!=null&&u.settings.send_email_on_mark_paid),onChange:C=>g("settings.send_email_on_mark_paid",C),disabled:t("send_email_on_mark_paid")})}),i&&p(K,{leftSide:n("enable_applying_payments"),leftSideHelp:n("enable_applying_payments_help"),children:p(ft,{id:"allow_over_payment",checked:!!(u!=null&&u.enable_applying_payments),onChange:C=>d("enable_applying_payments",C)})}),p(K,{leftSide:p(Bt,{propertyKey:"client_portal_allow_over_payment",labelElement:p($t,{label:n("allow_over_payment")}),defaultValue:!1}),leftSideHelp:n("allow_over_payment_help"),children:p(ft,{id:"allow_over_payment",checked:!!(u!=null&&u.settings.client_portal_allow_over_payment),onChange:C=>d("settings.client_portal_allow_over_payment",C),disabled:t("client_portal_allow_over_payment")})}),p(K,{leftSide:p(Bt,{propertyKey:"client_portal_allow_under_payment",labelElement:p($t,{label:n("allow_under_payment")}),defaultValue:!1}),leftSideHelp:n("allow_under_payment_help"),children:p(ft,{id:"allow_under_payment",checked:!!(u!=null&&u.settings.client_portal_allow_under_payment),onChange:C=>d("settings.client_portal_allow_under_payment",C),disabled:t("client_portal_allow_under_payment")})}),(u==null?void 0:u.settings.client_portal_allow_under_payment)&&p(K,{leftSide:p(Bt,{propertyKey:"client_portal_under_payment_minimum",labelElement:p($t,{label:n("minimum_under_payment_amount")})}),children:p(wo,{value:(u==null?void 0:u.settings.client_portal_under_payment_minimum)||"",onValueChange:C=>d("settings.client_portal_under_payment_minimum",parseFloat(C)||0),disabled:t("client_portal_under_payment_minimum"),errorMessage:c==null?void 0:c.errors["settings.client_portal_under_payment_minimum"]})}),p(K,{leftSide:p(Bt,{propertyKey:"client_initiated_payments",labelElement:p($t,{label:n("client_initiated_payments")}),defaultValue:!1}),leftSideHelp:n("client_initiated_payments_help"),children:p(ft,{id:"client_initiated_payments",checked:!!(u!=null&&u.settings.client_initiated_payments),onChange:C=>d("settings.client_initiated_payments",C),disabled:t("client_initiated_payments")})}),(u==null?void 0:u.settings.client_initiated_payments)&&p(K,{leftSide:p(Bt,{propertyKey:"client_initiated_payments_minimum",labelElement:p($t,{label:n("minimum_payment_amount")})}),children:p(wo,{value:(u==null?void 0:u.settings.client_initiated_payments_minimum)||"",onValueChange:C=>d("settings.client_initiated_payments_minimum",parseFloat(C)),disabled:t("client_initiated_payments_minimum"),errorMessage:c==null?void 0:c.errors["settings.client_initiated_payments_minimum"]})}),p(K,{leftSide:p(Bt,{propertyKey:"payment_email_all_contacts",labelElement:p($t,{label:n("payment_email_all_contacts")}),defaultValue:!1}),leftSideHelp:n("payment_email_all_contacts_help"),children:p(ft,{id:"payment_email_all_contacts",checked:!!(u!=null&&u.settings.payment_email_all_contacts),onChange:C=>d("settings.payment_email_all_contacts",C),disabled:t("payment_email_all_contacts")})}),p(K,{leftSide:p(Bt,{propertyKey:"payment_flow",labelElement:p($t,{label:n("one_page_checkout")}),defaultValue:!1}),leftSideHelp:n("one_page_checkout_help"),children:p(ft,{id:"payment_flow",checked:(u==null?void 0:u.settings.payment_flow)==="smooth",onChange:C=>d("settings.payment_flow",C?"smooth":"default"),disabled:t("payment_flow")})})]})]})}function sDe(n){var u,d,h;const[e]=pe(),t=ji(),i=So(),r=ma(),{title:o}=n,s=Fi($s),{data:a}=TWe({perPage:100,status:["active"]}),l=f=>{const g=f.target.options[f.target.selectedIndex];i(f.target.id,parseFloat(g.dataset.rate||"0")),i(g.dataset.rateName,f.target.value)},c=f=>{const g=un.cloneDeep(t==null?void 0:t.settings);delete g[f],i("settings",g)};return p(dt,{children:(t==null?void 0:t.enabled_tax_rates)>0&&N(Qt,{title:o?e(o):void 0,children:[(t==null?void 0:t.enabled_tax_rates)>0&&p(K,{leftSide:p(Bt,{propertyKey:"tax_name1",labelElement:p($t,{label:e("default_tax_rate")}),onCheckboxChange:f=>{f?i("settings.tax_rate1",0):c("tax_rate1")}}),children:N(Cn,{id:"settings.tax_rate1",onChange:l,value:((u=t==null?void 0:t.settings)==null?void 0:u.tax_name1)||0,disabled:r("tax_name1"),errorMessage:s==null?void 0:s.errors["settings.tax_rate1"],children:[p("option",{"data-rate":0,"data-rate-name":"settings.tax_name1",value:""}),a&&a.data.data.map(f=>N("option",{"data-rate":f.rate,"data-rate-name":"settings.tax_name1",value:f.name,children:[f.rate,"% — ",f.name]},f.id))]})}),(t==null?void 0:t.enabled_tax_rates)>1&&p(K,{leftSide:p(Bt,{propertyKey:"tax_name2",labelElement:p($t,{label:e("default_tax_rate")}),onCheckboxChange:f=>{f?i("settings.tax_rate2",0):c("tax_rate2")}}),children:N(Cn,{id:"settings.tax_rate2",onChange:l,value:((d=t==null?void 0:t.settings)==null?void 0:d.tax_name2)||0,disabled:r("tax_name2"),errorMessage:s==null?void 0:s.errors["settings.tax_rate2"],children:[p("option",{"data-rate":0,"data-rate-name":"settings.tax_name2",value:""}),a&&a.data.data.map(f=>N("option",{"data-rate":f.rate,"data-rate-name":"settings.tax_name2",value:f.name,children:[f.rate,"% — ",f.name]},f.id))]})}),(t==null?void 0:t.enabled_tax_rates)>2&&p(K,{leftSide:p(Bt,{propertyKey:"tax_name3",labelElement:p($t,{label:e("default_tax_rate")}),onCheckboxChange:f=>{f?i("settings.tax_rate3",0):c("tax_rate3")}}),children:N(Cn,{id:"settings.tax_rate3",onChange:l,value:((h=t==null?void 0:t.settings)==null?void 0:h.tax_name3)||0,disabled:r("tax_name3"),errorMessage:s==null?void 0:s.errors["settings.tax_rate3"],children:[p("option",{"data-rate":0,"data-rate-name":"settings.tax_name3",value:""}),a&&a.data.data.map(f=>N("option",{"data-rate":f.rate,"data-rate-name":"settings.tax_name3",value:f.name,children:[f.rate,"% — ",f.name]},f.id))]})})]})})}function hK(n){const[e]=pe(),{visible:t,setVisible:i,region:r,subregion:o,taxSetting:s}=n,a=So(),l=()=>{i(!1)};return N(Ui,{title:`${r} - ${o}`,visible:t,onClose:l,children:[p(We,{label:e("tax_name"),value:s.tax_name,onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.tax_name`,c)}),p(wo,{label:e("tax_rate"),value:s.tax_rate||"",onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.tax_rate`,parseFloat(c))}),p(wo,{label:e("reduced_rate"),value:s.reduced_tax_rate||"",onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.reduced_tax_rate`,parseFloat(c))}),p(Gt,{className:"self-end",behavior:"button",onClick:l,disableWithoutIcon:!0,children:e("save")})]})}function Vtn(){const[n]=pe(),e=So(),t=ji(),[i,r]=w.useState(!1),[o,s]=w.useState(!1),a=Object.entries(t.tax_data.regions.AU.subregions),[l,c]=w.useState(a[0][1]),[u,d]=w.useState(a[0][0]),h=w.useMemo(()=>a.filter(([,m])=>m.apply_tax).length,[a]),f=(m,v)=>{e(m,v),r(!v)},g=m=>{const v=document.getElementById(m.replace(".apply_tax",""));v==null||v.click()};return N(dt,{children:[p(K,{leftSide:"Australia",children:N("div",{className:"grid grid-cols-5 gap-4",children:[p("div",{className:"col-span-4",children:N(Cn,{id:"tax_data.regions.AU.tax_all_subregions",className:"",value:t.tax_data.regions.AU.tax_all_subregions,onValueChange:m=>f("tax_data.regions.AU.tax_all_subregions",m==="true"),children:[p("option",{value:"true",children:n("tax_all")}),N("option",{value:"false",children:[n("tax_selected")," - [ ",h," ",n("selected")," ]"]})]})}),!t.tax_data.regions.AU.tax_all_subregions&&p("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:p(Gt,{type:"primary",className:"",onClick:m=>{m.preventDefault(),r(v=>!v)},children:n(i?"hide":"show")})})]})},"AU"),i&&(a==null?void 0:a.map((m,v)=>N("div",{className:"border py-4 sm:py-3 sm:grid sm:grid-cols-3 sm:gap-10 flex flex-col lg:flex-row undefined px-5 sm:px-6 lg:items-center",children:[N("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:_=>{_.target instanceof HTMLInputElement||g(`tax_data.regions.AU.subregions.${m[0]}.apply_tax`)},children:[p(Ph,{id:`tax_data.regions.AU.subregions.${m[0]}`,value:`tax_data.regions.AU.subregions.${m[0]}.apply_tax`,checked:!!m[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.AU.tax_all_subregions,onValueChange:(_,b)=>e(_,b)}),p("div",{className:"",children:m[0]})]}),N("div",{onClick:()=>g(`tax_data.regions.AU.subregions.${m[0]}.apply_tax`),children:[m[1].tax_name," ",m[1].tax_rate,"%"," ",m[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${m[1].reduced_tax_rate}%`:""]}),p("div",{className:"flex justify-end",children:p(Gt,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.AU.tax_all_subregions,onClick:_=>{_.preventDefault(),c(m[1]),d(m[0]),s(!0)},children:n("edit")})})]},v))),p(hK,{visible:o,setVisible:s,region:"AU",subregion:u,taxSetting:l})]})}function Htn(){var v,_,b;const[n]=pe(),e=So(),t=ji(),[i,r]=w.useState(!1),[o,s]=w.useState(!1),a=Object.entries(t.tax_data.regions.EU.subregions),[l,c]=w.useState(a[0][1]),[u,d]=w.useState(a[0][0]),h=y=>!!y,f=w.useMemo(()=>a.filter(([,y])=>h(y.apply_tax)).length,[a]),g=(y,C)=>{e(y,C),r(!C)},m=y=>{console.log(y);const C=document.getElementById(y.replace(".apply_tax",""));C==null||C.click()};return N(dt,{children:[p(K,{leftSide:"Europe",children:N("div",{className:"grid grid-cols-5 gap-4",children:[p("div",{className:"col-span-4",children:N(Cn,{id:"tax_data.regions.EU.tax_all_subregions",className:"",value:t.tax_data.regions.EU.tax_all_subregions,onValueChange:y=>g("tax_data.regions.EU.tax_all_subregions",y==="true"),children:[p("option",{value:"true",children:n("tax_all")}),N("option",{value:"false",children:[n("tax_selected")," - [ ",f," ",n("selected")," ]"]})]})}),!t.tax_data.regions.EU.tax_all_subregions&&p("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:p(Gt,{type:"primary",className:"",onClick:y=>{y.preventDefault(),r(C=>!C)},children:n(i?"hide":"show")})})]})},"EU"),i&&(a==null?void 0:a.map((y,C)=>N("div",{className:"border py-4 sm:py-3 sm:grid sm:grid-cols-3 sm:gap-10 flex flex-col lg:flex-row undefined px-5 sm:px-6 lg:items-center text-sm",children:[N("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:x=>{x.target instanceof HTMLInputElement||m(`tax_data.regions.EU.subregions.${y[0]}.apply_tax`)},children:[p(Ph,{id:`tax_data.regions.EU.subregions.${y[0]}`,value:`tax_data.regions.EU.subregions.${y[0]}.apply_tax`,checked:!!y[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.EU.tax_all_subregions,onValueChange:(x,E)=>e(x,E)}),p("div",{className:"",children:y[0]})]}),N("div",{onClick:()=>m(`tax_data.regions.EU.subregions.${y[0]}.apply_tax`),children:[y[1].tax_name," ",y[1].tax_rate,"%"," ",y[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${y[1].reduced_tax_rate}%`:""]}),p("div",{className:"flex justify-end",children:p(Gt,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.EU.tax_all_subregions,onClick:x=>{x.preventDefault(),c(y[1]),d(y[0]),s(!0)},children:n("edit")})})]},C))),p(hK,{visible:o,setVisible:s,region:"EU",subregion:u,taxSetting:l}),p(K,{leftSide:N("p",{className:"lg:pl-5",children:["(EU) ",n("sales_above_threshold")]}),children:p(ft,{id:"tax_data.regions.EU.has_sales_above_threshold",checked:(b=(_=(v=t==null?void 0:t.tax_data)==null?void 0:v.regions)==null?void 0:_.EU)==null?void 0:b.has_sales_above_threshold,onValueChange:y=>e("tax_data.regions.EU.has_sales_above_threshold",y)})})]})}function Wtn(){var v,_,b;const[n]=pe(),e=So(),t=ji(),[i,r]=w.useState(!1),[o,s]=w.useState(!1),a=Object.entries(t==null?void 0:t.tax_data.regions.UK.subregions),[l,c]=w.useState(a[0][1]),[u,d]=w.useState(a[0][0]),h=y=>!!y,f=w.useMemo(()=>a.filter(([,y])=>h(y.apply_tax)).length,[a]),g=(y,C)=>{e(y,C),r(!C)},m=y=>{console.log(y);const C=document.getElementById(y.replace(".apply_tax",""));C==null||C.click()};return N(dt,{children:[p(K,{leftSide:"United Kingdom",children:N("div",{className:"grid grid-cols-5 gap-4",children:[p("div",{className:"col-span-4",children:N(Cn,{id:"tax_data.regions.UK.tax_all_subregions",className:"",value:t.tax_data.regions.UK.tax_all_subregions,onValueChange:y=>g("tax_data.regions.UK.tax_all_subregions",y==="true"),children:[p("option",{value:"true",children:n("tax_all")}),N("option",{value:"false",children:[n("tax_selected")," - [ ",f," ",n("selected")," ]"]})]})}),!t.tax_data.regions.UK.tax_all_subregions&&p("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:p(Gt,{type:"primary",className:"",onClick:y=>{y.preventDefault(),r(C=>!C)},children:n(i?"hide":"show")})})]})},"EU"),i&&(a==null?void 0:a.map((y,C)=>{var x,E,k,L,D,A;return N("div",{className:"border py-4 sm:py-3 sm:grid sm:grid-cols-3 sm:gap-10 flex flex-col lg:flex-row undefined px-5 sm:px-6 lg:items-center text-sm",children:[N("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:O=>{O.target instanceof HTMLInputElement||m(`tax_data.regions.UK.subregions.${y[0]}.apply_tax`)},children:[p(Ph,{id:`tax_data.regions.UK.subregions.${y[0]}`,value:`tax_data.regions.UK.subregions.${y[0]}.apply_tax`,checked:!!y[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:(k=(E=(x=t==null?void 0:t.tax_data)==null?void 0:x.regions)==null?void 0:E.UK)==null?void 0:k.tax_all_subregions,onValueChange:(O,P)=>e(O,P)}),p("div",{className:"",children:y[0]})]}),N("div",{onClick:()=>m(`tax_data.regions.UK.subregions.${y[0]}.apply_tax`),children:[y[1].tax_name," ",y[1].tax_rate,"%"," ",y[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${(L=y[1])==null?void 0:L.reduced_tax_rate}%`:""]}),p("div",{className:"flex justify-end",children:p(Gt,{type:"primary",className:"",disableWithoutIcon:!0,disabled:(A=(D=t==null?void 0:t.tax_data.regions)==null?void 0:D.UK)==null?void 0:A.tax_all_subregions,onClick:O=>{O.preventDefault(),c(y[1]),d(y[0]),s(!0)},children:n("edit")})})]},C)})),p(hK,{visible:o,setVisible:s,region:"UK",subregion:u,taxSetting:l}),p(K,{leftSide:N("p",{className:"lg:pl-5",children:["(UK) ",n("sales_above_threshold")]}),children:p(ft,{id:"tax_data.regions.UK.has_sales_above_threshold",checked:(b=(_=(v=t==null?void 0:t.tax_data)==null?void 0:v.regions)==null?void 0:_.UK)==null?void 0:b.has_sales_above_threshold,onValueChange:y=>e("tax_data.regions.UK.has_sales_above_threshold",y)})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const ztn={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District Of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"};function Utn(n){return p(YS,{value:n.value,label:n.label,disabled:n.disabled,onValueChange:n.onChange,errorMessage:n.errorMessage,dismissable:!0,children:Object.entries(ztn).map((e,t)=>p("option",{value:e[0],children:e[1]},t))})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const oqe={AT:"Austria",BE:"Belgium",BG:"Bulgaria",HR:"Croatia",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",EE:"Estonia",FI:"Finland",FR:"France",DE:"Germany",GR:"Greece",HU:"Hungary",IE:"Ireland",IT:"Italy",LV:"Latvia",LT:"Lithuania",LU:"Luxembourg",NO:"Norway",IS:"Iceland",LI:"Liechtenstein",MT:"Malta",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SK:"Slovakia",SI:"Slovenia",ES:"Spain","ES-CN":"Canary Islands","ES-ML":"Melilla","ES-CE":"Ceuta",SE:"Sweden"};function jtn(n){return p(YS,{value:n.value,label:n.label,disabled:n.disabled,onValueChange:n.onChange,errorMessage:n.errorMessage,dismissable:!0,children:Object.entries(oqe).map((e,t)=>p("option",{value:e[0],children:e[1]},t))})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function qtn(){const n=R_e();return e=>{const t=n.find(i=>i.id===e);return!!(t&&oqe[t.iso_3166_2])}}function Ktn(){var o,s,a,l,c,u,d;const[n]=pe(),e=ji(),t=So(),i=ZS(),r=qtn();return w.useEffect(()=>{(e==null?void 0:e.settings.country_id)==="36"&&t("tax_data.seller_subregion","AU")},[e==null?void 0:e.settings.country_id,e.tax_data.seller_subregion]),N(K,{leftSide:n("seller_subregion"),children:[((o=i(e==null?void 0:e.settings.country_id))==null?void 0:o.iso_3166_2)==="US"&&p(Utn,{value:(s=e.tax_data)==null?void 0:s.seller_subregion,onChange:h=>t("tax_data.seller_subregion",h)}),r(e==null?void 0:e.settings.country_id)&&p(jtn,{value:(a=e.tax_data)!=null&&a.seller_subregion?(l=e.tax_data)==null?void 0:l.seller_subregion:(c=i(e==null?void 0:e.settings.country_id))==null?void 0:c.iso_3166_2,onChange:h=>t("tax_data.seller_subregion",h)}),((u=i(e==null?void 0:e.settings.country_id))==null?void 0:u.iso_3166_2)==="AU"&&p(We,{type:"text",disabled:!0,name:"tax_data.seller_subregion",value:"AU"}),((d=i(e==null?void 0:e.settings.country_id))==null?void 0:d.iso_3166_2)==="GB"&&p(We,{type:"text",disabled:!0,name:"tax_data.seller_subregion",value:"GB"})]})}function Gtn(){const[n]=pe(),e=So(),t=ji(),[i,r]=w.useState(!1),[o,s]=w.useState(!1),a=Object.entries(t.tax_data.regions.US.subregions),[l,c]=w.useState(a[0][1]),[u,d]=w.useState(a[0][0]),h=v=>!!v,f=w.useMemo(()=>a.filter(([,v])=>h(v.apply_tax)).length,[a]),g=(v,_)=>{e(v,_),r(!_)},m=v=>{const _=document.getElementById(v.replace(".apply_tax",""));_==null||_.click()};return N(dt,{children:[p(K,{leftSide:n("united_states"),children:N("div",{className:"grid grid-cols-5 gap-4",children:[p("div",{className:"col-span-4",children:N(Cn,{id:"tax_data.regions.US.tax_all_subregions",className:"",value:t.tax_data.regions.US.tax_all_subregions,onValueChange:v=>g("tax_data.regions.US.tax_all_subregions",v==="true"),children:[p("option",{value:"true",children:n("tax_all")}),N("option",{value:"false",children:[n("tax_selected")," - [ ",f," ",n("selected")," ]"]})]})}),!t.tax_data.regions.US.tax_all_subregions&&p("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:p(Gt,{type:"primary",className:"",onClick:v=>{v.preventDefault(),r(_=>!_)},children:n(i?"hide":"show")})})]})},"US"),i&&(a==null?void 0:a.map((v,_)=>N("div",{className:"border py-4 sm:py-3 sm:grid sm:grid-cols-3 sm:gap-10 flex flex-col lg:flex-row undefined px-5 sm:px-6 lg:items-center",children:[N("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:b=>{b.target instanceof HTMLInputElement||m(`tax_data.regions.US.subregions.${v[0]}.apply_tax`)},children:[p(Ph,{id:`tax_data.regions.US.subregions.${v[0]}`,value:`tax_data.regions.US.subregions.${v[0]}.apply_tax`,checked:!!v[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.US.tax_all_subregions,onValueChange:(b,y)=>e(b,y)}),p("div",{className:"",children:v[0]})]}),N("div",{onClick:()=>m(`tax_data.regions.US.subregions.${v[0]}.apply_tax`),children:[v[1].tax_name," ",v[1].tax_rate,"%"," ",v[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${v[1].reduced_tax_rate}%`:""]}),p("div",{className:"flex justify-end",children:p(Gt,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.US.tax_all_subregions,onClick:b=>{b.preventDefault(),c(v[1]),d(v[0]),s(!0)},children:n("edit")})})]},_))),p(hK,{visible:o,setVisible:s,region:"US",subregion:u,taxSetting:l})]})}function Ytn(){return N(dt,{children:[p(Ktn,{}),p(Gtn,{}),p(Htn,{}),p(Wtn,{}),p(Vtn,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Qtn(){const n=["AU","US","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK","GB","NO","IS","LI"],e=ZS();return t=>{var i;return n.includes(((i=e(t))==null?void 0:i.iso_3166_2)||"")}}function aDe(n){const e=[],t=String(n||"");let i=t.indexOf(","),r=0,o=!1;for(;!o;){i===-1&&(i=t.length,o=!0);const s=t.slice(r,i).trim();(s||!o)&&e.push(s),r=i+1,i=t.indexOf(",",r)}return e}function sqe(n,e){const t=e||{};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Xtn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ztn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jtn={};function lDe(n,e){return((e||Jtn).jsx?Ztn:Xtn).test(n)}const enn=/[ \t\n\f\r]/g;function tnn(n){return typeof n=="object"?n.type==="text"?cDe(n.value):!1:cDe(n)}function cDe(n){return n.replace(enn,"")===""}class t6{constructor(e,t,i){this.property=e,this.normal=t,i&&(this.space=i)}}t6.prototype.property={};t6.prototype.normal={};t6.prototype.space=null;function aqe(n,e){const t={},i={};let r=-1;for(;++r<n.length;)Object.assign(t,n[r].property),Object.assign(i,n[r].normal);return new t6(t,i,e)}function i3(n){return n.toLowerCase()}class Qm{constructor(e,t){this.property=e,this.attribute=t}}Qm.prototype.space=null;Qm.prototype.boolean=!1;Qm.prototype.booleanish=!1;Qm.prototype.overloadedBoolean=!1;Qm.prototype.number=!1;Qm.prototype.commaSeparated=!1;Qm.prototype.spaceSeparated=!1;Qm.prototype.commaOrSpaceSeparated=!1;Qm.prototype.mustUseProperty=!1;Qm.prototype.defined=!1;let nnn=0;const fo=Qk(),Vc=Qk(),lqe=Qk(),Pn=Qk(),Ka=Qk(),jL=Qk(),Ip=Qk();function Qk(){return 2**++nnn}const oae=Object.freeze(Object.defineProperty({__proto__:null,boolean:fo,booleanish:Vc,commaOrSpaceSeparated:Ip,commaSeparated:jL,number:Pn,overloadedBoolean:lqe,spaceSeparated:Ka},Symbol.toStringTag,{value:"Module"})),GJ=Object.keys(oae);class zve extends Qm{constructor(e,t,i,r){let o=-1;if(super(e,t),uDe(this,"space",r),typeof i=="number")for(;++o<GJ.length;){const s=GJ[o];uDe(this,GJ[o],(i&oae[s])===oae[s])}}}zve.prototype.defined=!0;function uDe(n,e,t){t&&(n[e]=t)}const inn={}.hasOwnProperty;function UN(n){const e={},t={};let i;for(i in n.properties)if(inn.call(n.properties,i)){const r=n.properties[i],o=new zve(i,n.transform(n.attributes||{},i),r,n.space);n.mustUseProperty&&n.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),e[i]=o,t[i3(i)]=i,t[i3(o.attribute)]=i}return new t6(e,t,n.space)}const cqe=UN({space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),uqe=UN({space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function dqe(n,e){return e in n?n[e]:e}function hqe(n,e){return dqe(n,e.toLowerCase())}const fqe=UN({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:hqe,properties:{xmlns:null,xmlnsXLink:null}}),pqe=UN({transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Vc,ariaAutoComplete:null,ariaBusy:Vc,ariaChecked:Vc,ariaColCount:Pn,ariaColIndex:Pn,ariaColSpan:Pn,ariaControls:Ka,ariaCurrent:null,ariaDescribedBy:Ka,ariaDetails:null,ariaDisabled:Vc,ariaDropEffect:Ka,ariaErrorMessage:null,ariaExpanded:Vc,ariaFlowTo:Ka,ariaGrabbed:Vc,ariaHasPopup:null,ariaHidden:Vc,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ka,ariaLevel:Pn,ariaLive:null,ariaModal:Vc,ariaMultiLine:Vc,ariaMultiSelectable:Vc,ariaOrientation:null,ariaOwns:Ka,ariaPlaceholder:null,ariaPosInSet:Pn,ariaPressed:Vc,ariaReadOnly:Vc,ariaRelevant:null,ariaRequired:Vc,ariaRoleDescription:Ka,ariaRowCount:Pn,ariaRowIndex:Pn,ariaRowSpan:Pn,ariaSelected:Vc,ariaSetSize:Pn,ariaSort:null,ariaValueMax:Pn,ariaValueMin:Pn,ariaValueNow:Pn,ariaValueText:null,role:null}}),rnn=UN({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:hqe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jL,acceptCharset:Ka,accessKey:Ka,action:null,allow:null,allowFullScreen:fo,allowPaymentRequest:fo,allowUserMedia:fo,alt:null,as:null,async:fo,autoCapitalize:null,autoComplete:Ka,autoFocus:fo,autoPlay:fo,blocking:Ka,capture:null,charSet:null,checked:fo,cite:null,className:Ka,cols:Pn,colSpan:null,content:null,contentEditable:Vc,controls:fo,controlsList:Ka,coords:Pn|jL,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fo,defer:fo,dir:null,dirName:null,disabled:fo,download:lqe,draggable:Vc,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fo,formTarget:null,headers:Ka,height:Pn,hidden:fo,high:Pn,href:null,hrefLang:null,htmlFor:Ka,httpEquiv:Ka,id:null,imageSizes:null,imageSrcSet:null,inert:fo,inputMode:null,integrity:null,is:null,isMap:fo,itemId:null,itemProp:Ka,itemRef:Ka,itemScope:fo,itemType:Ka,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fo,low:Pn,manifest:null,max:null,maxLength:Pn,media:null,method:null,min:null,minLength:Pn,multiple:fo,muted:fo,name:null,nonce:null,noModule:fo,noValidate:fo,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fo,optimum:Pn,pattern:null,ping:Ka,placeholder:null,playsInline:fo,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fo,referrerPolicy:null,rel:Ka,required:fo,reversed:fo,rows:Pn,rowSpan:Pn,sandbox:Ka,scope:null,scoped:fo,seamless:fo,selected:fo,shadowRootClonable:fo,shadowRootDelegatesFocus:fo,shadowRootMode:null,shape:null,size:Pn,sizes:null,slot:null,span:Pn,spellCheck:Vc,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pn,step:null,style:null,tabIndex:Pn,target:null,title:null,translate:null,type:null,typeMustMatch:fo,useMap:null,value:Vc,width:Pn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ka,axis:null,background:null,bgColor:null,border:Pn,borderColor:null,bottomMargin:Pn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fo,declare:fo,event:null,face:null,frame:null,frameBorder:null,hSpace:Pn,leftMargin:Pn,link:null,longDesc:null,lowSrc:null,marginHeight:Pn,marginWidth:Pn,noResize:fo,noHref:fo,noShade:fo,noWrap:fo,object:null,profile:null,prompt:null,rev:null,rightMargin:Pn,rules:null,scheme:null,scrolling:Vc,standby:null,summary:null,text:null,topMargin:Pn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fo,disableRemotePlayback:fo,prefix:null,property:null,results:Pn,security:null,unselectable:null}}),onn=UN({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:dqe,properties:{about:Ip,accentHeight:Pn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pn,amplitude:Pn,arabicForm:null,ascent:Pn,attributeName:null,attributeType:null,azimuth:Pn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pn,by:null,calcMode:null,capHeight:Pn,className:Ka,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pn,diffuseConstant:Pn,direction:null,display:null,dur:null,divisor:Pn,dominantBaseline:null,download:fo,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pn,enableBackground:null,end:null,event:null,exponent:Pn,externalResourcesRequired:null,fill:null,fillOpacity:Pn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jL,g2:jL,glyphName:jL,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pn,horizOriginX:Pn,horizOriginY:Pn,id:null,ideographic:Pn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pn,k:Pn,k1:Pn,k2:Pn,k3:Pn,k4:Pn,kernelMatrix:Ip,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pn,overlineThickness:Pn,paintOrder:null,panose1:null,path:null,pathLength:Pn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ka,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pn,pointsAtY:Pn,pointsAtZ:Pn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ip,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ip,rev:Ip,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ip,requiredFeatures:Ip,requiredFonts:Ip,requiredFormats:Ip,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pn,specularExponent:Pn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pn,strikethroughThickness:Pn,string:null,stroke:null,strokeDashArray:Ip,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pn,strokeOpacity:Pn,strokeWidth:null,style:null,surfaceScale:Pn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ip,tabIndex:Pn,tableValues:null,target:null,targetX:Pn,targetY:Pn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ip,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pn,underlineThickness:Pn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pn,values:null,vAlphabetic:Pn,vMathematical:Pn,vectorEffect:null,vHanging:Pn,vIdeographic:Pn,version:null,vertAdvY:Pn,vertOriginX:Pn,vertOriginY:Pn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),snn=/^data[-\w.:]+$/i,dDe=/-[a-z]/g,ann=/[A-Z]/g;function fK(n,e){const t=i3(e);let i=e,r=Qm;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&snn.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(dDe,cnn);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!dDe.test(o)){let s=o.replace(ann,lnn);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}r=zve}return new r(i,e)}function lnn(n){return"-"+n.toLowerCase()}function cnn(n){return n.charAt(1).toUpperCase()}const unn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},n6=aqe([uqe,cqe,fqe,pqe,rnn],"html"),iE=aqe([uqe,cqe,fqe,pqe,onn],"svg");function hDe(n){const e=String(n||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function gqe(n){return n.join(" ").trim()}var mqe={},fDe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dnn=/\n/g,hnn=/^\s*/,fnn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pnn=/^:\s*/,gnn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mnn=/^[;\s]*/,_nn=/^\s+|\s+$/g,vnn=` `,pDe="/",gDe="*",_x="",bnn="comment",ynn="declaration",Cnn=function(n,e){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];e=e||{};var t=1,i=1;function r(g){var m=g.match(dnn);m&&(t+=m.length);var v=g.lastIndexOf(vnn);i=~v?g.length-v:i+g.length}function o(){var g={line:t,column:i};return function(m){return m.position=new s(g),c(),m}}function s(g){this.start=g,this.end={line:t,column:i},this.source=e.source}s.prototype.content=n;function a(g){var m=new Error(e.source+":"+t+":"+i+": "+g);if(m.reason=g,m.filename=e.source,m.line=t,m.column=i,m.source=n,!e.silent)throw m}function l(g){var m=g.exec(n);if(m){var v=m[0];return r(v),n=n.slice(v.length),m}}function c(){l(hnn)}function u(g){var m;for(g=g||[];m=d();)m!==!1&&g.push(m);return g}function d(){var g=o();if(!(pDe!=n.charAt(0)||gDe!=n.charAt(1))){for(var m=2;_x!=n.charAt(m)&&(gDe!=n.charAt(m)||pDe!=n.charAt(m+1));)++m;if(m+=2,_x===n.charAt(m-1))return a("End of comment missing");var v=n.slice(2,m-2);return i+=2,r(v),n=n.slice(m),i+=2,g({type:bnn,comment:v})}}function h(){var g=o(),m=l(fnn);if(m){if(d(),!l(pnn))return a("property missing ':'");var v=l(gnn),_=g({type:ynn,property:mDe(m[0].replace(fDe,_x)),value:v?mDe(v[0].replace(fDe,_x)):_x});return l(mnn),_}}function f(){var g=[];u(g);for(var m;m=h();)m!==!1&&(g.push(m),u(g));return g}return c(),f()};function mDe(n){return n?n.replace(_nn,_x):_x}var wnn=Bo&&Bo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(mqe,"__esModule",{value:!0});var _De=mqe.default=Enn,Snn=wnn(Cnn);function Enn(n,e){var t=null;if(!n||typeof n!="string")return t;var i=(0,Snn.default)(n),r=typeof e=="function";return i.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;r?e(s,a,o):a&&(t=t||{},t[s]=a)}}),t}const xnn=_De.default||_De,pK=_qe("end"),k0=_qe("start");function _qe(n){return e;function e(t){const i=t&&t.position&&t.position[n]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Tnn(n){const e=k0(n),t=pK(n);if(e&&t)return{start:e,end:t}}function hM(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?vDe(n.position):"start"in n||"end"in n?vDe(n):"line"in n||"column"in n?sae(n):""}function sae(n){return bDe(n&&n.line)+":"+bDe(n&&n.column)}function vDe(n){return sae(n&&n.start)+"-"+sae(n&&n.end)}function bDe(n){return n&&typeof n=="number"?n:1}class _h extends Error{constructor(e,t,i){super(),typeof t=="string"&&(i=t,t=void 0);let r="",o={},s=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof e=="string"?r=e:!o.cause&&e&&(s=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?o.ruleId=i:(o.source=i.slice(0,l),o.ruleId=i.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=hM(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}_h.prototype.file="";_h.prototype.name="";_h.prototype.reason="";_h.prototype.message="";_h.prototype.stack="";_h.prototype.column=void 0;_h.prototype.line=void 0;_h.prototype.ancestors=void 0;_h.prototype.cause=void 0;_h.prototype.fatal=void 0;_h.prototype.place=void 0;_h.prototype.ruleId=void 0;_h.prototype.source=void 0;const Uve={}.hasOwnProperty,knn=new Map,Inn=/[A-Z]/g,Lnn=/-([a-z])/g,Dnn=new Set(["table","tbody","thead","tfoot","tr"]),Ann=new Set(["td","th"]),vqe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Nnn(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Vnn(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=$nn(t,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?iE:n6,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},o=bqe(r,n,void 0);return o&&typeof o!="string"?o:r.create(n,r.Fragment,{children:o||void 0},void 0)}function bqe(n,e,t){if(e.type==="element")return Rnn(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Onn(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Mnn(n,e,t);if(e.type==="mdxjsEsm")return Pnn(n,e);if(e.type==="root")return Fnn(n,e,t);if(e.type==="text")return Bnn(n,e)}function Rnn(n,e,t){const i=n.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=iE,n.schema=r),n.ancestors.push(e);const o=Cqe(n,e.tagName,!1),s=Hnn(n,e);let a=qve(n,e);return Dnn.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!tnn(l):!0})),yqe(n,s,o,e),jve(s,a),n.ancestors.pop(),n.schema=i,n.create(e,o,s,t)}function Onn(n,e){if(e.data&&e.data.estree&&n.evaluater){const i=e.data.estree.body[0];return i.type,n.evaluater.evaluateExpression(i.expression)}r3(n,e.position)}function Pnn(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);r3(n,e.position)}function Mnn(n,e,t){const i=n.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=iE,n.schema=r),n.ancestors.push(e);const o=e.name===null?n.Fragment:Cqe(n,e.name,!0),s=Wnn(n,e),a=qve(n,e);return yqe(n,s,o,e),jve(s,a),n.ancestors.pop(),n.schema=i,n.create(e,o,s,t)}function Fnn(n,e,t){const i={};return jve(i,qve(n,e)),n.create(e,n.Fragment,i,t)}function Bnn(n,e){return e.value}function yqe(n,e,t,i){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=i)}function jve(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function $nn(n,e,t){return i;function i(r,o,s,a){const c=Array.isArray(s.children)?t:e;return a?c(o,s,a):c(o,s)}}function Vnn(n,e){return t;function t(i,r,o,s){const a=Array.isArray(o.children),l=k0(i);return e(r,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:n,lineNumber:l?l.line:void 0},void 0)}}function Hnn(n,e){const t={};let i,r;for(r in e.properties)if(r!=="children"&&Uve.call(e.properties,r)){const o=znn(n,r,e.properties[r]);if(o){const[s,a]=o;n.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Ann.has(e.tagName)?i=a:t[s]=a}}if(i){const o=t.style||(t.style={});o[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return t}function Wnn(n,e){const t={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&n.evaluater){const o=i.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(t,n.evaluater.evaluateExpression(a.argument))}else r3(n,e.position);else{const r=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&n.evaluater){const a=i.value.data.estree.body[0];a.type,o=n.evaluater.evaluateExpression(a.expression)}else r3(n,e.position);else o=i.value===null?!0:i.value;t[r]=o}return t}function qve(n,e){const t=[];let i=-1;const r=n.passKeys?new Map:knn;for(;++i<e.children.length;){const o=e.children[i];let s;if(n.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=r.get(l)||0;s=l+"-"+c,r.set(l,c+1)}}const a=bqe(n,o,s);a!==void 0&&t.push(a)}return t}function znn(n,e,t){const i=fK(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=i.commaSeparated?sqe(t):gqe(t)),i.property==="style"){let r=typeof t=="object"?t:Unn(n,String(t));return n.stylePropertyNameCase==="css"&&(r=jnn(r)),["style",r]}return[n.elementAttributeNameCase==="react"&&i.space?unn[i.property]||i.property:i.attribute,t]}}function Unn(n,e){const t={};try{xnn(e,i)}catch(r){if(!n.ignoreInvalidStyle){const o=r,s=new _h("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=vqe+"#cannot-parse-style-attribute",s}}return t;function i(r,o){let s=r;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(Lnn,Knn)),t[s]=o}}function Cqe(n,e,t){let i;if(!t)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let o=-1,s;for(;++o<r.length;){const a=lDe(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}i=s}else i=lDe(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return Uve.call(n.components,r)?n.components[r]:r}if(n.evaluater)return n.evaluater.evaluateExpression(i);r3(n)}function r3(n,e){const t=new _h("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=n.filePath||void 0,t.url=vqe+"#cannot-handle-mdx-estrees-without-createevaluater",t}function jnn(n){const e={};let t;for(t in n)Uve.call(n,t)&&(e[qnn(t)]=n[t]);return e}function qnn(n){let e=n.replace(Inn,Gnn);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Knn(n,e){return e.toUpperCase()}function Gnn(n){return"-"+n.toLowerCase()}const YJ={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Ynn={};function Qnn(n,e){const t=e||Ynn,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,r=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return wqe(n,i,r)}function wqe(n,e,t){if(Xnn(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return yDe(n.children,e,t)}return Array.isArray(n)?yDe(n,e,t):""}function yDe(n,e,t){const i=[];let r=-1;for(;++r<n.length;)i[r]=wqe(n[r],e,t);return i.join("")}function Xnn(n){return!!(n&&typeof n=="object")}const CDe=document.createElement("i");function Kve(n){const e="&"+n+";";CDe.innerHTML=e;const t=CDe.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function _1(n,e,t,i){const r=n.length;let o=0,s;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,t=t>0?t:0,i.length<1e4)s=Array.from(i),s.unshift(e,t),n.splice(...s);else for(t&&n.splice(e,t);o<i.length;)s=i.slice(o,o+1e4),s.unshift(e,0),n.splice(...s),o+=1e4,e+=1e4}function dm(n,e){return n.length>0?(_1(n,n.length,0,e),n):e}const wDe={}.hasOwnProperty;function Znn(n){const e={};let t=-1;for(;++t<n.length;)Jnn(e,n[t]);return e}function Jnn(n,e){let t;for(t in e){const r=(wDe.call(n,t)?n[t]:void 0)||(n[t]={}),o=e[t];let s;if(o)for(s in o){wDe.call(r,s)||(r[s]=[]);const a=o[s];ein(r[s],Array.isArray(a)?a:a?[a]:[])}}}function ein(n,e){let t=-1;const i=[];for(;++t<e.length;)(e[t].add==="after"?n:i).push(e[t]);_1(n,0,0,i)}function Sqe(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function qL(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pb=rE(/[A-Za-z]/),Qp=rE(/[\dA-Za-z]/),tin=rE(/[#-'*+\--9=?A-Z^-~]/);function aae(n){return n!==null&&(n<32||n===127)}const lae=rE(/\d/),nin=rE(/[\dA-Fa-f]/),iin=rE(/[!-/:-@[-`{-~]/);function jr(n){return n!==null&&n<-2}function Uf(n){return n!==null&&(n<0||n===32)}function Fs(n){return n===-2||n===-1||n===32}const rin=rE(/\p{P}|\p{S}/u),oin=rE(/\s/);function rE(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function jN(n){const e=[];let t=-1,i=0,r=0;for(;++t<n.length;){const o=n.charCodeAt(t);let s="";if(o===37&&Qp(n.charCodeAt(t+1))&&Qp(n.charCodeAt(t+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=n.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),r=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(n.slice(i,t),encodeURIComponent(s)),i=t+r+1,s=""),r&&(t+=r,r=0)}return e.join("")+n.slice(i)}function Ja(n,e,t,i){const r=i?i-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Fs(l)?(n.enter(t),a(l)):e(l)}function a(l){return Fs(l)&&o++<r?(n.consume(l),a):(n.exit(t),e(l))}}const sin={tokenize:ain};function ain(n){const e=n.attempt(this.parser.constructs.contentInitial,i,r);let t;return e;function i(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),Ja(n,e,"linePrefix")}function r(a){return n.enter("paragraph"),o(a)}function o(a){const l=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,s(a)}function s(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return jr(a)?(n.consume(a),n.exit("chunkText"),o):(n.consume(a),s)}}const lin={tokenize:cin},SDe={tokenize:uin};function cin(n){const e=this,t=[];let i=0,r,o,s;return a;function a(y){if(i<t.length){const C=t[i];return e.containerState=C[1],n.attempt(C[0].continuation,l,c)(y)}return c(y)}function l(y){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&b();const C=e.events.length;let x=C,E;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){E=e.events[x][1].end;break}_(i);let k=C;for(;k<e.events.length;)e.events[k][1].end=Object.assign({},E),k++;return _1(e.events,x+1,0,e.events.slice(C)),e.events.length=k,c(y)}return a(y)}function c(y){if(i===t.length){if(!r)return h(y);if(r.currentConstruct&&r.currentConstruct.concrete)return g(y);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(SDe,u,d)(y)}function u(y){return r&&b(),_(i),h(y)}function d(y){return e.parser.lazy[e.now().line]=i!==t.length,s=e.now().offset,g(y)}function h(y){return e.containerState={},n.attempt(SDe,f,g)(y)}function f(y){return i++,t.push([e.currentConstruct,e.containerState]),h(y)}function g(y){if(y===null){r&&b(),_(0),n.consume(y);return}return r=r||e.parser.flow(e.now()),n.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),m(y)}function m(y){if(y===null){v(n.exit("chunkFlow"),!0),_(0),n.consume(y);return}return jr(y)?(n.consume(y),v(n.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(n.consume(y),m)}function v(y,C){const x=e.sliceStream(y);if(C&&x.push(null),y.previous=o,o&&(o.next=y),o=y,r.defineSkip(y.start),r.write(x),e.parser.lazy[y.start.line]){let E=r.events.length;for(;E--;)if(r.events[E][1].start.offset<s&&(!r.events[E][1].end||r.events[E][1].end.offset>s))return;const k=e.events.length;let L=k,D,A;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(D){A=e.events[L][1].end;break}D=!0}for(_(i),E=k;E<e.events.length;)e.events[E][1].end=Object.assign({},A),E++;_1(e.events,L+1,0,e.events.slice(k)),e.events.length=E}}function _(y){let C=t.length;for(;C-- >y;){const x=t[C];e.containerState=x[1],x[0].exit.call(e,n)}t.length=y}function b(){r.write([null]),o=void 0,r=void 0,e.containerState._closeFlow=void 0}}function uin(n,e,t){return Ja(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function EDe(n){if(n===null||Uf(n)||oin(n))return 1;if(rin(n))return 2}function Gve(n,e,t){const i=[];let r=-1;for(;++r<n.length;){const o=n[r].resolveAll;o&&!i.includes(o)&&(e=o(e,t),i.push(o))}return e}const cae={name:"attention",tokenize:hin,resolveAll:din};function din(n,e){let t=-1,i,r,o,s,a,l,c,u;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(i=t;i--;)if(n[i][0]==="exit"&&n[i][1].type==="attentionSequence"&&n[i][1]._open&&e.sliceSerialize(n[i][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[i][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[i][1].end.offset-n[i][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;l=n[i][1].end.offset-n[i][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const d=Object.assign({},n[i][1].end),h=Object.assign({},n[t][1].start);xDe(d,-l),xDe(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},n[i][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},n[t][1].start),end:h},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},n[i][1].end),end:Object.assign({},n[t][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},n[i][1].end=Object.assign({},s.start),n[t][1].start=Object.assign({},a.end),c=[],n[i][1].end.offset-n[i][1].start.offset&&(c=dm(c,[["enter",n[i][1],e],["exit",n[i][1],e]])),c=dm(c,[["enter",r,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=dm(c,Gve(e.parser.constructs.insideSpan.null,n.slice(i+1,t),e)),c=dm(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",r,e]]),n[t][1].end.offset-n[t][1].start.offset?(u=2,c=dm(c,[["enter",n[t][1],e],["exit",n[t][1],e]])):u=0,_1(n,i-1,t-i+3,c),t=i+c.length-u-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function hin(n,e){const t=this.parser.constructs.attentionMarkers.null,i=this.previous,r=EDe(i);let o;return s;function s(l){return o=l,n.enter("attentionSequence"),a(l)}function a(l){if(l===o)return n.consume(l),a;const c=n.exit("attentionSequence"),u=EDe(l),d=!u||u===2&&r||t.includes(l),h=!r||r===2&&u||t.includes(i);return c._open=!!(o===42?d:d&&(r||!h)),c._close=!!(o===42?h:h&&(u||!d)),e(l)}}function xDe(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const fin={name:"autolink",tokenize:pin};function pin(n,e,t){let i=0;return r;function r(f){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(f),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),o}function o(f){return pb(f)?(n.consume(f),s):f===64?t(f):c(f)}function s(f){return f===43||f===45||f===46||Qp(f)?(i=1,a(f)):c(f)}function a(f){return f===58?(n.consume(f),i=0,l):(f===43||f===45||f===46||Qp(f))&&i++<32?(n.consume(f),a):(i=0,c(f))}function l(f){return f===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(f),n.exit("autolinkMarker"),n.exit("autolink"),e):f===null||f===32||f===60||aae(f)?t(f):(n.consume(f),l)}function c(f){return f===64?(n.consume(f),u):tin(f)?(n.consume(f),c):t(f)}function u(f){return Qp(f)?d(f):t(f)}function d(f){return f===46?(n.consume(f),i=0,u):f===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(f),n.exit("autolinkMarker"),n.exit("autolink"),e):h(f)}function h(f){if((f===45||Qp(f))&&i++<63){const g=f===45?h:d;return n.consume(f),g}return t(f)}}const gK={tokenize:gin,partial:!0};function gin(n,e,t){return i;function i(o){return Fs(o)?Ja(n,r,"linePrefix")(o):r(o)}function r(o){return o===null||jr(o)?e(o):t(o)}}const Eqe={name:"blockQuote",tokenize:min,continuation:{tokenize:_in},exit:vin};function min(n,e,t){const i=this;return r;function r(s){if(s===62){const a=i.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(s),n.exit("blockQuoteMarker"),o}return t(s)}function o(s){return Fs(s)?(n.enter("blockQuotePrefixWhitespace"),n.consume(s),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(s))}}function _in(n,e,t){const i=this;return r;function r(s){return Fs(s)?Ja(n,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return n.attempt(Eqe,e,t)(s)}}function vin(n){n.exit("blockQuote")}const xqe={name:"characterEscape",tokenize:bin};function bin(n,e,t){return i;function i(o){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(o),n.exit("escapeMarker"),r}function r(o){return iin(o)?(n.enter("characterEscapeValue"),n.consume(o),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(o)}}const Tqe={name:"characterReference",tokenize:yin};function yin(n,e,t){const i=this;let r=0,o,s;return a;function a(d){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(d),n.exit("characterReferenceMarker"),l}function l(d){return d===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(d),n.exit("characterReferenceMarkerNumeric"),c):(n.enter("characterReferenceValue"),o=31,s=Qp,u(d))}function c(d){return d===88||d===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(d),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),o=6,s=nin,u):(n.enter("characterReferenceValue"),o=7,s=lae,u(d))}function u(d){if(d===59&&r){const h=n.exit("characterReferenceValue");return s===Qp&&!Kve(i.sliceSerialize(h))?t(d):(n.enter("characterReferenceMarker"),n.consume(d),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return s(d)&&r++<o?(n.consume(d),u):t(d)}}const TDe={tokenize:win,partial:!0},kDe={name:"codeFenced",tokenize:Cin,concrete:!0};function Cin(n,e,t){const i=this,r={tokenize:x,partial:!0};let o=0,s=0,a;return l;function l(E){return c(E)}function c(E){const k=i.events[i.events.length-1];return o=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,a=E,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===a?(s++,n.consume(E),u):s<3?t(E):(n.exit("codeFencedFenceSequence"),Fs(E)?Ja(n,d,"whitespace")(E):d(E))}function d(E){return E===null||jr(E)?(n.exit("codeFencedFence"),i.interrupt?e(E):n.check(TDe,m,C)(E)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||jr(E)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),d(E)):Fs(E)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Ja(n,f,"whitespace")(E)):E===96&&E===a?t(E):(n.consume(E),h)}function f(E){return E===null||jr(E)?d(E):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||jr(E)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),d(E)):E===96&&E===a?t(E):(n.consume(E),g)}function m(E){return n.attempt(r,C,v)(E)}function v(E){return n.enter("lineEnding"),n.consume(E),n.exit("lineEnding"),_}function _(E){return o>0&&Fs(E)?Ja(n,b,"linePrefix",o+1)(E):b(E)}function b(E){return E===null||jr(E)?n.check(TDe,m,C)(E):(n.enter("codeFlowValue"),y(E))}function y(E){return E===null||jr(E)?(n.exit("codeFlowValue"),b(E)):(n.consume(E),y)}function C(E){return n.exit("codeFenced"),e(E)}function x(E,k,L){let D=0;return A;function A(M){return E.enter("lineEnding"),E.consume(M),E.exit("lineEnding"),O}function O(M){return E.enter("codeFencedFence"),Fs(M)?Ja(E,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):P(M)}function P(M){return M===a?(E.enter("codeFencedFenceSequence"),F(M)):L(M)}function F(M){return M===a?(D++,E.consume(M),F):D>=s?(E.exit("codeFencedFenceSequence"),Fs(M)?Ja(E,B,"whitespace")(M):B(M)):L(M)}function B(M){return M===null||jr(M)?(E.exit("codeFencedFence"),k(M)):L(M)}}}function win(n,e,t){const i=this;return r;function r(s){return s===null?t(s):(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),o)}function o(s){return i.parser.lazy[i.now().line]?t(s):e(s)}}const QJ={name:"codeIndented",tokenize:Ein},Sin={tokenize:xin,partial:!0};function Ein(n,e,t){const i=this;return r;function r(c){return n.enter("codeIndented"),Ja(n,o,"linePrefix",4+1)(c)}function o(c){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):t(c)}function s(c){return c===null?l(c):jr(c)?n.attempt(Sin,s,l)(c):(n.enter("codeFlowValue"),a(c))}function a(c){return c===null||jr(c)?(n.exit("codeFlowValue"),s(c)):(n.consume(c),a)}function l(c){return n.exit("codeIndented"),e(c)}}function xin(n,e,t){const i=this;return r;function r(s){return i.parser.lazy[i.now().line]?t(s):jr(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),r):Ja(n,o,"linePrefix",4+1)(s)}function o(s){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):jr(s)?r(s):t(s)}}const Tin={name:"codeText",tokenize:Lin,resolve:kin,previous:Iin};function kin(n){let e=n.length-4,t=3,i,r;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(i=t;++i<e;)if(n[i][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(i=t-1,e++;++i<=e;)r===void 0?i!==e&&n[i][1].type!=="lineEnding"&&(r=i):(i===e||n[i][1].type==="lineEnding")&&(n[r][1].type="codeTextData",i!==r+2&&(n[r][1].end=n[i-1][1].end,n.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return n}function Iin(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Lin(n,e,t){let i=0,r,o;return s;function s(d){return n.enter("codeText"),n.enter("codeTextSequence"),a(d)}function a(d){return d===96?(n.consume(d),i++,a):(n.exit("codeTextSequence"),l(d))}function l(d){return d===null?t(d):d===32?(n.enter("space"),n.consume(d),n.exit("space"),l):d===96?(o=n.enter("codeTextSequence"),r=0,u(d)):jr(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),l):(n.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||jr(d)?(n.exit("codeTextData"),l(d)):(n.consume(d),c)}function u(d){return d===96?(n.consume(d),r++,u):r===i?(n.exit("codeTextSequence"),n.exit("codeText"),e(d)):(o.type="codeTextData",c(d))}}class Din{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const i=t??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,t,i){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&hO(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),hO(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hO(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);hO(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);hO(this.left,t.reverse())}}}function hO(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function kqe(n){const e={};let t=-1,i,r,o,s,a,l,c;const u=new Din(n);for(;++t<u.length;){for(;t in e;)t=e[t];if(i=u.get(t),t&&i[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,Ain(u,t)),t=e[t],c=!0);else if(i[1]._container){for(o=t,r=void 0;o--&&(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(r&&(u.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=o);r&&(i[1].end=Object.assign({},u.get(r)[1].start),a=u.slice(r,t),a.unshift(i),u.splice(r,t-r+1,a))}}return _1(n,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Ain(n,e){const t=n.get(e)[1],i=n.get(e)[2];let r=e-1;const o=[],s=t._tokenizer||i.parser[t.contentType](t.start),a=s.events,l=[],c={};let u,d,h=-1,f=t,g=0,m=0;const v=[m];for(;f;){for(;n.get(++r)[1]!==f;);o.push(r),f._tokenizer||(u=i.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=t;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,v.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),h=v.length;h--;){const _=a.slice(v[h],v[h+1]),b=o.pop();l.push([b,b+_.length-1]),n.splice(b,2,_)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const Nin={tokenize:Pin,resolve:Oin},Rin={tokenize:Min,partial:!0};function Oin(n){return kqe(n),n}function Pin(n,e){let t;return i;function i(a){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),r(a)}function r(a){return a===null?o(a):jr(a)?n.check(Rin,s,o)(a):(n.consume(a),r)}function o(a){return n.exit("chunkContent"),n.exit("content"),e(a)}function s(a){return n.consume(a),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}}function Min(n,e,t){const i=this;return r;function r(s){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),Ja(n,o,"linePrefix")}function o(s){if(s===null||jr(s))return t(s);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):n.interrupt(i.parser.constructs.flow,t,e)(s)}}function Iqe(n,e,t,i,r,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(_){return _===60?(n.enter(i),n.enter(r),n.enter(o),n.consume(_),n.exit(o),h):_===null||_===32||_===41||aae(_)?t(_):(n.enter(i),n.enter(s),n.enter(a),n.enter("chunkString",{contentType:"string"}),m(_))}function h(_){return _===62?(n.enter(o),n.consume(_),n.exit(o),n.exit(r),n.exit(i),e):(n.enter(a),n.enter("chunkString",{contentType:"string"}),f(_))}function f(_){return _===62?(n.exit("chunkString"),n.exit(a),h(_)):_===null||_===60||jr(_)?t(_):(n.consume(_),_===92?g:f)}function g(_){return _===60||_===62||_===92?(n.consume(_),f):f(_)}function m(_){return!u&&(_===null||_===41||Uf(_))?(n.exit("chunkString"),n.exit(a),n.exit(s),n.exit(i),e(_)):u<c&&_===40?(n.consume(_),u++,m):_===41?(n.consume(_),u--,m):_===null||_===32||_===40||aae(_)?t(_):(n.consume(_),_===92?v:m)}function v(_){return _===40||_===41||_===92?(n.consume(_),m):m(_)}}function Lqe(n,e,t,i,r,o){const s=this;let a=0,l;return c;function c(f){return n.enter(i),n.enter(r),n.consume(f),n.exit(r),n.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?t(f):f===93?(n.exit(o),n.enter(r),n.consume(f),n.exit(r),n.exit(i),e):jr(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):(n.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||jr(f)||a++>999?(n.exit("chunkString"),u(f)):(n.consume(f),l||(l=!Fs(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(n.consume(f),a++,d):d(f)}}function Dqe(n,e,t,i,r,o){let s;return a;function a(h){return h===34||h===39||h===40?(n.enter(i),n.enter(r),n.consume(h),n.exit(r),s=h===40?41:h,l):t(h)}function l(h){return h===s?(n.enter(r),n.consume(h),n.exit(r),n.exit(i),e):(n.enter(o),c(h))}function c(h){return h===s?(n.exit(o),l(s)):h===null?t(h):jr(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),Ja(n,c,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||jr(h)?(n.exit("chunkString"),c(h)):(n.consume(h),h===92?d:u)}function d(h){return h===s||h===92?(n.consume(h),u):u(h)}}function fM(n,e){let t;return i;function i(r){return jr(r)?(n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),t=!0,i):Fs(r)?Ja(n,i,t?"linePrefix":"lineSuffix")(r):e(r)}}const Fin={name:"definition",tokenize:$in},Bin={tokenize:Vin,partial:!0};function $in(n,e,t){const i=this;let r;return o;function o(f){return n.enter("definition"),s(f)}function s(f){return Lqe.call(i,n,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return r=qL(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),f===58?(n.enter("definitionMarker"),n.consume(f),n.exit("definitionMarker"),l):t(f)}function l(f){return Uf(f)?fM(n,c)(f):c(f)}function c(f){return Iqe(n,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return n.attempt(Bin,d,d)(f)}function d(f){return Fs(f)?Ja(n,h,"whitespace")(f):h(f)}function h(f){return f===null||jr(f)?(n.exit("definition"),i.parser.defined.push(r),e(f)):t(f)}}function Vin(n,e,t){return i;function i(a){return Uf(a)?fM(n,r)(a):t(a)}function r(a){return Dqe(n,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Fs(a)?Ja(n,s,"whitespace")(a):s(a)}function s(a){return a===null||jr(a)?e(a):t(a)}}const Hin={name:"hardBreakEscape",tokenize:Win};function Win(n,e,t){return i;function i(o){return n.enter("hardBreakEscape"),n.consume(o),r}function r(o){return jr(o)?(n.exit("hardBreakEscape"),e(o)):t(o)}}const zin={name:"headingAtx",tokenize:jin,resolve:Uin};function Uin(n,e){let t=n.length-2,i=3,r,o;return n[i][1].type==="whitespace"&&(i+=2),t-2>i&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(i===t-1||t-4>i&&n[t-2][1].type==="whitespace")&&(t-=i+1===t?2:4),t>i&&(r={type:"atxHeadingText",start:n[i][1].start,end:n[t][1].end},o={type:"chunkText",start:n[i][1].start,end:n[t][1].end,contentType:"text"},_1(n,i,t-i+1,[["enter",r,e],["enter",o,e],["exit",o,e],["exit",r,e]])),n}function jin(n,e,t){let i=0;return r;function r(u){return n.enter("atxHeading"),o(u)}function o(u){return n.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&i++<6?(n.consume(u),s):u===null||Uf(u)?(n.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(n.enter("atxHeadingSequence"),l(u)):u===null||jr(u)?(n.exit("atxHeading"),e(u)):Fs(u)?Ja(n,a,"whitespace")(u):(n.enter("atxHeadingText"),c(u))}function l(u){return u===35?(n.consume(u),l):(n.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Uf(u)?(n.exit("atxHeadingText"),a(u)):(n.consume(u),c)}}const qin=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],IDe=["pre","script","style","textarea"],Kin={name:"htmlFlow",tokenize:Xin,resolveTo:Qin,concrete:!0},Gin={tokenize:Jin,partial:!0},Yin={tokenize:Zin,partial:!0};function Qin(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function Xin(n,e,t){const i=this;let r,o,s,a,l;return c;function c(Q){return u(Q)}function u(Q){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(Q),d}function d(Q){return Q===33?(n.consume(Q),h):Q===47?(n.consume(Q),o=!0,m):Q===63?(n.consume(Q),r=3,i.interrupt?e:H):pb(Q)?(n.consume(Q),s=String.fromCharCode(Q),v):t(Q)}function h(Q){return Q===45?(n.consume(Q),r=2,f):Q===91?(n.consume(Q),r=5,a=0,g):pb(Q)?(n.consume(Q),r=4,i.interrupt?e:H):t(Q)}function f(Q){return Q===45?(n.consume(Q),i.interrupt?e:H):t(Q)}function g(Q){const Ee="CDATA[";return Q===Ee.charCodeAt(a++)?(n.consume(Q),a===Ee.length?i.interrupt?e:P:g):t(Q)}function m(Q){return pb(Q)?(n.consume(Q),s=String.fromCharCode(Q),v):t(Q)}function v(Q){if(Q===null||Q===47||Q===62||Uf(Q)){const Ee=Q===47,Fe=s.toLowerCase();return!Ee&&!o&&IDe.includes(Fe)?(r=1,i.interrupt?e(Q):P(Q)):qin.includes(s.toLowerCase())?(r=6,Ee?(n.consume(Q),_):i.interrupt?e(Q):P(Q)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(Q):o?b(Q):y(Q))}return Q===45||Qp(Q)?(n.consume(Q),s+=String.fromCharCode(Q),v):t(Q)}function _(Q){return Q===62?(n.consume(Q),i.interrupt?e:P):t(Q)}function b(Q){return Fs(Q)?(n.consume(Q),b):A(Q)}function y(Q){return Q===47?(n.consume(Q),A):Q===58||Q===95||pb(Q)?(n.consume(Q),C):Fs(Q)?(n.consume(Q),y):A(Q)}function C(Q){return Q===45||Q===46||Q===58||Q===95||Qp(Q)?(n.consume(Q),C):x(Q)}function x(Q){return Q===61?(n.consume(Q),E):Fs(Q)?(n.consume(Q),x):y(Q)}function E(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?t(Q):Q===34||Q===39?(n.consume(Q),l=Q,k):Fs(Q)?(n.consume(Q),E):L(Q)}function k(Q){return Q===l?(n.consume(Q),l=null,D):Q===null||jr(Q)?t(Q):(n.consume(Q),k)}function L(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Uf(Q)?x(Q):(n.consume(Q),L)}function D(Q){return Q===47||Q===62||Fs(Q)?y(Q):t(Q)}function A(Q){return Q===62?(n.consume(Q),O):t(Q)}function O(Q){return Q===null||jr(Q)?P(Q):Fs(Q)?(n.consume(Q),O):t(Q)}function P(Q){return Q===45&&r===2?(n.consume(Q),V):Q===60&&r===1?(n.consume(Q),U):Q===62&&r===4?(n.consume(Q),ie):Q===63&&r===3?(n.consume(Q),H):Q===93&&r===5?(n.consume(Q),q):jr(Q)&&(r===6||r===7)?(n.exit("htmlFlowData"),n.check(Gin,se,F)(Q)):Q===null||jr(Q)?(n.exit("htmlFlowData"),F(Q)):(n.consume(Q),P)}function F(Q){return n.check(Yin,B,se)(Q)}function B(Q){return n.enter("lineEnding"),n.consume(Q),n.exit("lineEnding"),M}function M(Q){return Q===null||jr(Q)?F(Q):(n.enter("htmlFlowData"),P(Q))}function V(Q){return Q===45?(n.consume(Q),H):P(Q)}function U(Q){return Q===47?(n.consume(Q),s="",W):P(Q)}function W(Q){if(Q===62){const Ee=s.toLowerCase();return IDe.includes(Ee)?(n.consume(Q),ie):P(Q)}return pb(Q)&&s.length<8?(n.consume(Q),s+=String.fromCharCode(Q),W):P(Q)}function q(Q){return Q===93?(n.consume(Q),H):P(Q)}function H(Q){return Q===62?(n.consume(Q),ie):Q===45&&r===2?(n.consume(Q),H):P(Q)}function ie(Q){return Q===null||jr(Q)?(n.exit("htmlFlowData"),se(Q)):(n.consume(Q),ie)}function se(Q){return n.exit("htmlFlow"),e(Q)}}function Zin(n,e,t){const i=this;return r;function r(s){return jr(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),o):t(s)}function o(s){return i.parser.lazy[i.now().line]?t(s):e(s)}}function Jin(n,e,t){return i;function i(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),n.attempt(gK,e,t)}}const ern={name:"htmlText",tokenize:trn};function trn(n,e,t){const i=this;let r,o,s;return a;function a(H){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(H),l}function l(H){return H===33?(n.consume(H),c):H===47?(n.consume(H),x):H===63?(n.consume(H),y):pb(H)?(n.consume(H),L):t(H)}function c(H){return H===45?(n.consume(H),u):H===91?(n.consume(H),o=0,g):pb(H)?(n.consume(H),b):t(H)}function u(H){return H===45?(n.consume(H),f):t(H)}function d(H){return H===null?t(H):H===45?(n.consume(H),h):jr(H)?(s=d,U(H)):(n.consume(H),d)}function h(H){return H===45?(n.consume(H),f):d(H)}function f(H){return H===62?V(H):H===45?h(H):d(H)}function g(H){const ie="CDATA[";return H===ie.charCodeAt(o++)?(n.consume(H),o===ie.length?m:g):t(H)}function m(H){return H===null?t(H):H===93?(n.consume(H),v):jr(H)?(s=m,U(H)):(n.consume(H),m)}function v(H){return H===93?(n.consume(H),_):m(H)}function _(H){return H===62?V(H):H===93?(n.consume(H),_):m(H)}function b(H){return H===null||H===62?V(H):jr(H)?(s=b,U(H)):(n.consume(H),b)}function y(H){return H===null?t(H):H===63?(n.consume(H),C):jr(H)?(s=y,U(H)):(n.consume(H),y)}function C(H){return H===62?V(H):y(H)}function x(H){return pb(H)?(n.consume(H),E):t(H)}function E(H){return H===45||Qp(H)?(n.consume(H),E):k(H)}function k(H){return jr(H)?(s=k,U(H)):Fs(H)?(n.consume(H),k):V(H)}function L(H){return H===45||Qp(H)?(n.consume(H),L):H===47||H===62||Uf(H)?D(H):t(H)}function D(H){return H===47?(n.consume(H),V):H===58||H===95||pb(H)?(n.consume(H),A):jr(H)?(s=D,U(H)):Fs(H)?(n.consume(H),D):V(H)}function A(H){return H===45||H===46||H===58||H===95||Qp(H)?(n.consume(H),A):O(H)}function O(H){return H===61?(n.consume(H),P):jr(H)?(s=O,U(H)):Fs(H)?(n.consume(H),O):D(H)}function P(H){return H===null||H===60||H===61||H===62||H===96?t(H):H===34||H===39?(n.consume(H),r=H,F):jr(H)?(s=P,U(H)):Fs(H)?(n.consume(H),P):(n.consume(H),B)}function F(H){return H===r?(n.consume(H),r=void 0,M):H===null?t(H):jr(H)?(s=F,U(H)):(n.consume(H),F)}function B(H){return H===null||H===34||H===39||H===60||H===61||H===96?t(H):H===47||H===62||Uf(H)?D(H):(n.consume(H),B)}function M(H){return H===47||H===62||Uf(H)?D(H):t(H)}function V(H){return H===62?(n.consume(H),n.exit("htmlTextData"),n.exit("htmlText"),e):t(H)}function U(H){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(H),n.exit("lineEnding"),W}function W(H){return Fs(H)?Ja(n,q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):q(H)}function q(H){return n.enter("htmlTextData"),s(H)}}const Yve={name:"labelEnd",tokenize:arn,resolveTo:srn,resolveAll:orn},nrn={tokenize:lrn},irn={tokenize:crn},rrn={tokenize:urn};function orn(n){let e=-1;for(;++e<n.length;){const t=n[e][1];(t.type==="labelImage"||t.type==="labelLink"||t.type==="labelEnd")&&(n.splice(e+1,t.type==="labelImage"?4:2),t.type="data",e++)}return n}function srn(n,e){let t=n.length,i=0,r,o,s,a;for(;t--;)if(r=n[t][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;n[t][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(n[t][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=t,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(s=t);const l={type:n[o][1].type==="labelLink"?"link":"image",start:Object.assign({},n[o][1].start),end:Object.assign({},n[n.length-1][1].end)},c={type:"label",start:Object.assign({},n[o][1].start),end:Object.assign({},n[s][1].end)},u={type:"labelText",start:Object.assign({},n[o+i+2][1].end),end:Object.assign({},n[s-2][1].start)};return a=[["enter",l,e],["enter",c,e]],a=dm(a,n.slice(o+1,o+i+3)),a=dm(a,[["enter",u,e]]),a=dm(a,Gve(e.parser.constructs.insideSpan.null,n.slice(o+i+4,s-3),e)),a=dm(a,[["exit",u,e],n[s-2],n[s-1],["exit",c,e]]),a=dm(a,n.slice(s+1)),a=dm(a,[["exit",l,e]]),_1(n,o,n.length,a),n}function arn(n,e,t){const i=this;let r=i.events.length,o,s;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){o=i.events[r][1];break}return a;function a(h){return o?o._inactive?d(h):(s=i.parser.defined.includes(qL(i.sliceSerialize({start:o.end,end:i.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(h),n.exit("labelMarker"),n.exit("labelEnd"),l):t(h)}function l(h){return h===40?n.attempt(nrn,u,s?u:d)(h):h===91?n.attempt(irn,u,s?c:d)(h):s?u(h):d(h)}function c(h){return n.attempt(rrn,u,d)(h)}function u(h){return e(h)}function d(h){return o._balanced=!0,t(h)}}function lrn(n,e,t){return i;function i(d){return n.enter("resource"),n.enter("resourceMarker"),n.consume(d),n.exit("resourceMarker"),r}function r(d){return Uf(d)?fM(n,o)(d):o(d)}function o(d){return d===41?u(d):Iqe(n,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Uf(d)?fM(n,l)(d):u(d)}function a(d){return t(d)}function l(d){return d===34||d===39||d===40?Dqe(n,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Uf(d)?fM(n,u)(d):u(d)}function u(d){return d===41?(n.enter("resourceMarker"),n.consume(d),n.exit("resourceMarker"),n.exit("resource"),e):t(d)}}function crn(n,e,t){const i=this;return r;function r(a){return Lqe.call(i,n,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return i.parser.defined.includes(qL(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(a):t(a)}function s(a){return t(a)}}function urn(n,e,t){return i;function i(o){return n.enter("reference"),n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),r}function r(o){return o===93?(n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),n.exit("reference"),e):t(o)}}const drn={name:"labelStartImage",tokenize:hrn,resolveAll:Yve.resolveAll};function hrn(n,e,t){const i=this;return r;function r(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),o}function o(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),s):t(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(a):e(a)}}const frn={name:"labelStartLink",tokenize:prn,resolveAll:Yve.resolveAll};function prn(n,e,t){const i=this;return r;function r(s){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(s),n.exit("labelMarker"),n.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(s):e(s)}}const XJ={name:"lineEnding",tokenize:grn};function grn(n,e){return t;function t(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),Ja(n,e,"linePrefix")}}const I$={name:"thematicBreak",tokenize:mrn};function mrn(n,e,t){let i=0,r;return o;function o(c){return n.enter("thematicBreak"),s(c)}function s(c){return r=c,a(c)}function a(c){return c===r?(n.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||jr(c))?(n.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===r?(n.consume(c),i++,l):(n.exit("thematicBreakSequence"),Fs(c)?Ja(n,a,"whitespace")(c):a(c))}}const gf={name:"list",tokenize:brn,continuation:{tokenize:yrn},exit:wrn},_rn={tokenize:Srn,partial:!0},vrn={tokenize:Crn,partial:!0};function brn(n,e,t){const i=this,r=i.events[i.events.length-1];let o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(f){const g=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:lae(f)){if(i.containerState.type||(i.containerState.type=g,n.enter(g,{_container:!0})),g==="listUnordered")return n.enter("listItemPrefix"),f===42||f===45?n.check(I$,t,c)(f):c(f);if(!i.interrupt||f===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),l(f)}return t(f)}function l(f){return lae(f)&&++s<10?(n.consume(f),l):(!i.interrupt||s<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(n.exit("listItemValue"),c(f)):t(f)}function c(f){return n.enter("listItemMarker"),n.consume(f),n.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,n.check(gK,i.interrupt?t:u,n.attempt(_rn,h,d))}function u(f){return i.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Fs(f)?(n.enter("listItemPrefixWhitespace"),n.consume(f),n.exit("listItemPrefixWhitespace"),h):t(f)}function h(f){return i.containerState.size=o+i.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(f)}}function yrn(n,e,t){const i=this;return i.containerState._closeFlow=void 0,n.check(gK,r,o);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ja(n,e,"listItemIndent",i.containerState.size+1)(a)}function o(a){return i.containerState.furtherBlankLines||!Fs(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,n.attempt(vrn,e,s)(a))}function s(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ja(n,n.attempt(gf,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Crn(n,e,t){const i=this;return Ja(n,r,"listItemIndent",i.containerState.size+1);function r(o){const s=i.events[i.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?e(o):t(o)}}function wrn(n){n.exit(this.containerState.type)}function Srn(n,e,t){const i=this;return Ja(n,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function r(o){const s=i.events[i.events.length-1];return!Fs(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):t(o)}}const LDe={name:"setextUnderline",tokenize:xrn,resolveTo:Ern};function Ern(n,e){let t=n.length,i,r,o;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){i=t;break}n[t][1].type==="paragraph"&&(r=t)}else n[t][1].type==="content"&&n.splice(t,1),!o&&n[t][1].type==="definition"&&(o=t);const s={type:"setextHeading",start:Object.assign({},n[r][1].start),end:Object.assign({},n[n.length-1][1].end)};return n[r][1].type="setextHeadingText",o?(n.splice(r,0,["enter",s,e]),n.splice(o+1,0,["exit",n[i][1],e]),n[i][1].end=Object.assign({},n[o][1].end)):n[i][1]=s,n.push(["exit",s,e]),n}function xrn(n,e,t){const i=this;let r;return o;function o(c){let u=i.events.length,d;for(;u--;)if(i.events[u][1].type!=="lineEnding"&&i.events[u][1].type!=="linePrefix"&&i.events[u][1].type!=="content"){d=i.events[u][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(n.enter("setextHeadingLine"),r=c,s(c)):t(c)}function s(c){return n.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===r?(n.consume(c),a):(n.exit("setextHeadingLineSequence"),Fs(c)?Ja(n,l,"lineSuffix")(c):l(c))}function l(c){return c===null||jr(c)?(n.exit("setextHeadingLine"),e(c)):t(c)}}const Trn={tokenize:krn};function krn(n){const e=this,t=n.attempt(gK,i,n.attempt(this.parser.constructs.flowInitial,r,Ja(n,n.attempt(this.parser.constructs.flow,r,n.attempt(Nin,r)),"linePrefix")));return t;function i(o){if(o===null){n.consume(o);return}return n.enter("lineEndingBlank"),n.consume(o),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function r(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const Irn={resolveAll:Nqe()},Lrn=Aqe("string"),Drn=Aqe("text");function Aqe(n){return{tokenize:e,resolveAll:Nqe(n==="text"?Arn:void 0)};function e(t){const i=this,r=this.parser.constructs[n],o=t.attempt(r,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),l}function l(u){return c(u)?(t.exit("data"),o(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const d=r[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(i,i.previous))return!0}return!1}}}function Nqe(n){return e;function e(t,i){let r=-1,o;for(;++r<=t.length;)o===void 0?t[r]&&t[r][1].type==="data"&&(o=r,r++):(!t[r]||t[r][1].type!=="data")&&(r!==o+2&&(t[o][1].end=t[r-1][1].end,t.splice(o+2,r-o-2),r=o+2),o=void 0);return n?n(t,i):t}}function Arn(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const i=n[t-1][1],r=e.sliceStream(i);let o=r.length,s=-1,a=0,l;for(;o--;){const c=r[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:t===n.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:i.end.line,column:i.end.column-a,offset:i.end.offset-a,_index:i.start._index+o,_bufferIndex:o?s:i.start._bufferIndex+s},end:Object.assign({},i.end)};i.end=Object.assign({},c.start),i.start.offset===i.end.offset?Object.assign(i,c):(n.splice(t,0,["enter",c,e],["exit",c,e]),t+=2)}t++}return n}function Nrn(n,e,t){let i=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const r={},o=[];let s=[],a=[];const l={consume:b,enter:y,exit:C,attempt:k(x),check:k(E),interrupt:k(E,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:n,sliceStream:f,sliceSerialize:h,now:g,defineSkip:m,write:d};let u=e.tokenize.call(c,l);return e.resolveAll&&o.push(e),c;function d(O){return s=dm(s,O),v(),s[s.length-1]!==null?[]:(L(e,0),c.events=Gve(o,c.events,c),c.events)}function h(O,P){return Orn(f(O),P)}function f(O){return Rrn(s,O)}function g(){const{line:O,column:P,offset:F,_index:B,_bufferIndex:M}=i;return{line:O,column:P,offset:F,_index:B,_bufferIndex:M}}function m(O){r[O.line]=O.column,A()}function v(){let O;for(;i._index<s.length;){const P=s[i._index];if(typeof P=="string")for(O=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===O&&i._bufferIndex<P.length;)_(P.charCodeAt(i._bufferIndex));else _(P)}}function _(O){u=u(O)}function b(O){jr(O)?(i.line++,i.column=1,i.offset+=O===-3?2:1,A()):O!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=O}function y(O,P){const F=P||{};return F.type=O,F.start=g(),c.events.push(["enter",F,c]),a.push(F),F}function C(O){const P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function x(O,P){L(O,P.from)}function E(O,P){P.restore()}function k(O,P){return F;function F(B,M,V){let U,W,q,H;return Array.isArray(B)?se(B):"tokenize"in B?se([B]):ie(B);function ie(He){return ke;function ke(Me){const je=Me!==null&&He[Me],qe=Me!==null&&He.null,Be=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(qe)?qe:qe?[qe]:[]];return se(Be)(Me)}}function se(He){return U=He,W=0,He.length===0?V:Q(He[W])}function Q(He){return ke;function ke(Me){return H=D(),q=He,He.partial||(c.currentConstruct=He),He.name&&c.parser.constructs.disable.null.includes(He.name)?Fe():He.tokenize.call(P?Object.assign(Object.create(c),P):c,l,Ee,Fe)(Me)}}function Ee(He){return O(q,H),M}function Fe(He){return H.restore(),++W<U.length?Q(U[W]):V}}}function L(O,P){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&_1(c.events,P,c.events.length-P,O.resolve(c.events.slice(P),c)),O.resolveTo&&(c.events=O.resolveTo(c.events,c))}function D(){const O=g(),P=c.previous,F=c.currentConstruct,B=c.events.length,M=Array.from(a);return{restore:V,from:B};function V(){i=O,c.previous=P,c.currentConstruct=F,c.events.length=B,a=M,A()}}function A(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function Rrn(n,e){const t=e.start._index,i=e.start._bufferIndex,r=e.end._index,o=e.end._bufferIndex;let s;if(t===r)s=[n[t].slice(i,o)];else{if(s=n.slice(t,r),i>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(i):s.shift()}o>0&&s.push(n[r].slice(0,o))}return s}function Orn(n,e){let t=-1;const i=[];let r;for(;++t<n.length;){const o=n[t];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=` `;break}case-3:{s=`\r `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&r)continue;s=" ";break}default:s=String.fromCharCode(o)}r=o===-2,i.push(s)}return i.join("")}const Prn={42:gf,43:gf,45:gf,48:gf,49:gf,50:gf,51:gf,52:gf,53:gf,54:gf,55:gf,56:gf,57:gf,62:Eqe},Mrn={91:Fin},Frn={[-2]:QJ,[-1]:QJ,32:QJ},Brn={35:zin,42:I$,45:[LDe,I$],60:Kin,61:LDe,95:I$,96:kDe,126:kDe},$rn={38:Tqe,92:xqe},Vrn={[-5]:XJ,[-4]:XJ,[-3]:XJ,33:drn,38:Tqe,42:cae,60:[fin,ern],91:frn,92:[Hin,xqe],93:Yve,95:cae,96:Tin},Hrn={null:[cae,Irn]},Wrn={null:[42,95]},zrn={null:[]},Urn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Wrn,contentInitial:Mrn,disable:zrn,document:Prn,flow:Brn,flowInitial:Frn,insideSpan:Hrn,string:$rn,text:Vrn},Symbol.toStringTag,{value:"Module"}));function jrn(n){const t=Znn([Urn,...(n||{}).extensions||[]]),i={defined:[],lazy:{},constructs:t,content:r(sin),document:r(lin),flow:r(Trn),string:r(Lrn),text:r(Drn)};return i;function r(o){return s;function s(a){return Nrn(i,o,a)}}}function qrn(n){for(;!kqe(n););return n}const DDe=/[\0\t\n\r]/g;function Krn(){let n=1,e="",t=!0,i;return r;function r(o,s,a){const l=[];let c,u,d,h,f;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,e="",t&&(o.charCodeAt(0)===65279&&d++,t=void 0);d<o.length;){if(DDe.lastIndex=d,c=DDe.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){e=o.slice(d);break}if(f===10&&d===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),d<h&&(l.push(o.slice(d,h)),n+=h-d),f){case 0:{l.push(65533),n++;break}case 9:{for(u=Math.ceil(n/4)*4,l.push(-2);n++<u;)l.push(-1);break}case 10:{l.push(-4),n=1;break}default:i=!0,n=1}d=h+1}return a&&(i&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Grn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Yrn(n){return n.replace(Grn,Qrn)}function Qrn(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const r=t.charCodeAt(1),o=r===120||r===88;return Sqe(t.slice(o?2:1),o?16:10)}return Kve(t)||n}const Rqe={}.hasOwnProperty;function Xrn(n,e,t){return typeof e!="string"&&(t=e,e=void 0),Zrn(t)(qrn(jrn(t).document().write(Krn()(n,e,!0))))}function Zrn(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ot),autolinkProtocol:D,autolinkEmail:D,atxHeading:o(rn),blockQuote:o(qe),characterEscape:D,characterReference:D,codeFenced:o(Be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Be,s),codeText:o(_t,s),codeTextData:D,data:D,codeFlowValue:D,definition:o(Wt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Tt),hardBreakEscape:o(_n),hardBreakTrailing:o(_n),htmlFlow:o(wt,s),htmlFlowData:D,htmlText:o(wt,s),htmlTextData:D,image:o(pt),label:s,link:o(ot),listItem:o(Se),listItemValue:h,listOrdered:o(we,d),listUnordered:o(we),paragraph:o(re),reference:Q,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(rn),strong:o(Y),thematicBreak:o(le)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:je,autolinkProtocol:Me,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:Fe,characterReferenceMarkerNumeric:Fe,characterReferenceValue:He,characterReference:ke,codeFenced:l(v),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:l(_),codeText:l(M),codeTextData:A,data:A,definition:l(),definitionDestinationString:C,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(P),hardBreakTrailing:l(P),htmlFlow:l(F),htmlFlowData:A,htmlText:l(B),htmlTextData:A,image:l(U),label:q,labelText:W,lineEnding:O,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ee,resourceDestinationString:H,resourceTitleString:ie,resource:se,setextHeading:l(L),setextHeadingLineSequence:k,setextHeadingText:E,strong:l(),thematicBreak:l()}};Oqe(e,(n||{}).mdastExtensions||[]);const t={};return i;function i(te){let me={type:"root",children:[]};const Oe={stack:[me],tokenStack:[],config:e,enter:a,exit:c,buffer:s,resume:u,data:t},et=[];let Et=-1;for(;++Et<te.length;)if(te[Et][1].type==="listOrdered"||te[Et][1].type==="listUnordered")if(te[Et][0]==="enter")et.push(Et);else{const Qe=et.pop();Et=r(te,Qe,Et)}for(Et=-1;++Et<te.length;){const Qe=e[te[Et][0]];Rqe.call(Qe,te[Et][1].type)&&Qe[te[Et][1].type].call(Object.assign({sliceSerialize:te[Et][2].sliceSerialize},Oe),te[Et][1])}if(Oe.tokenStack.length>0){const Qe=Oe.tokenStack[Oe.tokenStack.length-1];(Qe[1]||ADe).call(Oe,void 0,Qe[0])}for(me.position={start:tC(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:tC(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Et=-1;++Et<e.transforms.length;)me=e.transforms[Et](me)||me;return me}function r(te,me,Oe){let et=me-1,Et=-1,Qe=!1,At,Ut,fe,Re;for(;++et<=Oe;){const Je=te[et];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?Et++:Et--,Re=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(At&&!Re&&!Et&&!fe&&(fe=et),Re=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Re=void 0}if(!Et&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||Et===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(At){let Ot=et;for(Ut=void 0;Ot--;){const Ft=te[Ot];if(Ft[1].type==="lineEnding"||Ft[1].type==="lineEndingBlank"){if(Ft[0]==="exit")continue;Ut&&(te[Ut][1].type="lineEndingBlank",Qe=!0),Ft[1].type="lineEnding",Ut=Ot}else if(!(Ft[1].type==="linePrefix"||Ft[1].type==="blockQuotePrefix"||Ft[1].type==="blockQuotePrefixWhitespace"||Ft[1].type==="blockQuoteMarker"||Ft[1].type==="listItemIndent"))break}fe&&(!Ut||fe<Ut)&&(At._spread=!0),At.end=Object.assign({},Ut?te[Ut][1].start:Je[1].end),te.splice(Ut||et,0,["exit",At,Je[2]]),et++,Oe++}if(Je[1].type==="listItemPrefix"){const Ot={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};At=Ot,te.splice(et,0,["enter",Ot,Je[2]]),et++,Oe++,fe=void 0,Re=!0}}}return te[me][1]._spread=Qe,Oe}function o(te,me){return Oe;function Oe(et){a.call(this,te(et),et),me&&me.call(this,et)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(te,me,Oe){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([me,Oe]),te.position={start:tC(me.start),end:void 0}}function l(te){return me;function me(Oe){te&&te.call(this,Oe),c.call(this,Oe)}}function c(te,me){const Oe=this.stack.pop(),et=this.tokenStack.pop();if(et)et[0].type!==te.type&&(me?me.call(this,te,et[0]):(et[1]||ADe).call(this,te,et[0]));else throw new Error("Cannot close `"+te.type+"` ("+hM({start:te.start,end:te.end})+"): it’s not open");Oe.position.end=tC(te.end)}function u(){return Qnn(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(te){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function f(){const te=this.resume(),me=this.stack[this.stack.length-1];me.lang=te}function g(){const te=this.resume(),me=this.stack[this.stack.length-1];me.meta=te}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te.replace(/(\r?\n|\r)$/g,"")}function b(te){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=qL(this.sliceSerialize(te)).toLowerCase()}function y(){const te=this.resume(),me=this.stack[this.stack.length-1];me.title=te}function C(){const te=this.resume(),me=this.stack[this.stack.length-1];me.url=te}function x(te){const me=this.stack[this.stack.length-1];if(!me.depth){const Oe=this.sliceSerialize(te).length;me.depth=Oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function k(te){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function D(te){const Oe=this.stack[this.stack.length-1].children;let et=Oe[Oe.length-1];(!et||et.type!=="text")&&(et=Z(),et.position={start:tC(te.start),end:void 0},Oe.push(et)),this.stack.push(et)}function A(te){const me=this.stack.pop();me.value+=this.sliceSerialize(te),me.position.end=tC(te.end)}function O(te){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=me.children[me.children.length-1];Oe.position.end=tC(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(D.call(this,te),A.call(this,te))}function P(){this.data.atHardBreak=!0}function F(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function B(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function M(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function V(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=me,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function U(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=me,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function W(te){const me=this.sliceSerialize(te),Oe=this.stack[this.stack.length-2];Oe.label=Yrn(me),Oe.identifier=qL(me).toLowerCase()}function q(){const te=this.stack[this.stack.length-1],me=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const et=te.children;Oe.children=et}else Oe.alt=me}function H(){const te=this.resume(),me=this.stack[this.stack.length-1];me.url=te}function ie(){const te=this.resume(),me=this.stack[this.stack.length-1];me.title=te}function se(){this.data.inReference=void 0}function Q(){this.data.referenceType="collapsed"}function Ee(te){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=qL(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function Fe(te){this.data.characterReferenceType=te.type}function He(te){const me=this.sliceSerialize(te),Oe=this.data.characterReferenceType;let et;Oe?(et=Sqe(me,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):et=Kve(me);const Et=this.stack[this.stack.length-1];Et.value+=et}function ke(te){const me=this.stack.pop();me.position.end=tC(te.end)}function Me(te){A.call(this,te);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(te)}function je(te){A.call(this,te);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(te)}function qe(){return{type:"blockquote",children:[]}}function Be(){return{type:"code",lang:null,meta:null,value:""}}function _t(){return{type:"inlineCode",value:""}}function Wt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Tt(){return{type:"emphasis",children:[]}}function rn(){return{type:"heading",depth:0,children:[]}}function _n(){return{type:"break"}}function wt(){return{type:"html",value:""}}function pt(){return{type:"image",title:null,url:"",alt:null}}function ot(){return{type:"link",title:null,url:"",children:[]}}function we(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Se(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function re(){return{type:"paragraph",children:[]}}function Y(){return{type:"strong",children:[]}}function Z(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function tC(n){return{line:n.line,column:n.column,offset:n.offset}}function Oqe(n,e){let t=-1;for(;++t<e.length;){const i=e[t];Array.isArray(i)?Oqe(n,i):Jrn(n,i)}}function Jrn(n,e){let t;for(t in e)if(Rqe.call(e,t))switch(t){case"canContainEols":{const i=e[t];i&&n[t].push(...i);break}case"transforms":{const i=e[t];i&&n[t].push(...i);break}case"enter":case"exit":{const i=e[t];i&&Object.assign(n[t],i);break}}}function ADe(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+hM({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+hM({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+hM({start:e.start,end:e.end})+") is still open")}function eon(n){const e=this;e.parser=t;function t(i){return Xrn(i,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function ton(n,e){const t={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(e),!0)};return n.patch(e,t),n.applyData(e,t)}function non(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:` `}]}function ion(n,e){const t=e.value?e.value+` `:"",i={};e.lang&&(i.className=["language-"+e.lang]);let r={type:"element",tagName:"code",properties:i,children:[{type:"text",value:t}]};return e.meta&&(r.data={meta:e.meta}),n.patch(e,r),r=n.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},n.patch(e,r),r}function ron(n,e){const t={type:"element",tagName:"del",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function oon(n,e){const t={type:"element",tagName:"em",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function son(n,e){const t=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=jN(i.toLowerCase()),o=n.footnoteOrder.indexOf(i);let s,a=n.footnoteCounts.get(i);a===void 0?(a=0,n.footnoteOrder.push(i),s=n.footnoteOrder.length):s=o+1,a+=1,n.footnoteCounts.set(i,a);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+r,id:t+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};n.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return n.patch(e,c),n.applyData(e,c)}function aon(n,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function lon(n,e){if(n.options.allowDangerousHtml){const t={type:"raw",value:e.value};return n.patch(e,t),n.applyData(e,t)}}function Pqe(n,e){const t=e.referenceType;let i="]";if(t==="collapsed"?i+="[]":t==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=n.all(e),o=r[0];o&&o.type==="text"?o.value="["+o.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&s.type==="text"?s.value+=i:r.push({type:"text",value:i}),r}function con(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return Pqe(n,e);const r={src:jN(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"img",properties:r,children:[]};return n.patch(e,o),n.applyData(e,o)}function uon(n,e){const t={src:jN(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"img",properties:t,children:[]};return n.patch(e,i),n.applyData(e,i)}function don(n,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};n.patch(e,t);const i={type:"element",tagName:"code",properties:{},children:[t]};return n.patch(e,i),n.applyData(e,i)}function hon(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return Pqe(n,e);const r={href:jN(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"a",properties:r,children:n.all(e)};return n.patch(e,o),n.applyData(e,o)}function fon(n,e){const t={href:jN(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"a",properties:t,children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function pon(n,e,t){const i=n.all(e),r=t?gon(t):Mqe(e),o={},s=[];if(typeof e.checked=="boolean"){const u=i[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},i.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<i.length;){const u=i[a];(r||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:` `}),u.type==="element"&&u.tagName==="p"&&!r?s.push(...u.children):s.push(u)}const l=i[i.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:` `});const c={type:"element",tagName:"li",properties:o,children:s};return n.patch(e,c),n.applyData(e,c)}function gon(n){let e=!1;if(n.type==="list"){e=n.spread||!1;const t=n.children;let i=-1;for(;!e&&++i<t.length;)e=Mqe(t[i])}return e}function Mqe(n){const e=n.spread;return e??n.children.length>1}function mon(n,e){const t={},i=n.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++r<i.length;){const s=i[r];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:n.wrap(i,!0)};return n.patch(e,o),n.applyData(e,o)}function _on(n,e){const t={type:"element",tagName:"p",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function von(n,e){const t={type:"root",children:n.wrap(n.all(e))};return n.patch(e,t),n.applyData(e,t)}function bon(n,e){const t={type:"element",tagName:"strong",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function yon(n,e){const t=n.all(e),i=t.shift(),r=[];if(i){const s={type:"element",tagName:"thead",properties:{},children:n.wrap([i],!0)};n.patch(e.children[0],s),r.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:n.wrap(t,!0)},a=k0(e.children[1]),l=pK(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),r.push(s)}const o={type:"element",tagName:"table",properties:{},children:n.wrap(r,!0)};return n.patch(e,o),n.applyData(e,o)}function Con(n,e,t){const i=t?t.children:void 0,o=(i?i.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,a=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<a;){const d=e.children[l],h={},f=s?s[l]:void 0;f&&(h.align=f);let g={type:"element",tagName:o,properties:h,children:[]};d&&(g.children=n.all(d),n.patch(d,g),g=n.applyData(d,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:n.wrap(c,!0)};return n.patch(e,u),n.applyData(e,u)}function won(n,e){const t={type:"element",tagName:"td",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}const NDe=9,RDe=32;function Son(n){const e=String(n),t=/\r?\n|\r/g;let i=t.exec(e),r=0;const o=[];for(;i;)o.push(ODe(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return o.push(ODe(e.slice(r),r>0,!1)),o.join("")}function ODe(n,e,t){let i=0,r=n.length;if(e){let o=n.codePointAt(i);for(;o===NDe||o===RDe;)i++,o=n.codePointAt(i)}if(t){let o=n.codePointAt(r-1);for(;o===NDe||o===RDe;)r--,o=n.codePointAt(r-1)}return r>i?n.slice(i,r):""}function Eon(n,e){const t={type:"text",value:Son(String(e.value))};return n.patch(e,t),n.applyData(e,t)}function xon(n,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(e,t),n.applyData(e,t)}const Ton={blockquote:ton,break:non,code:ion,delete:ron,emphasis:oon,footnoteReference:son,heading:aon,html:lon,imageReference:con,image:uon,inlineCode:don,linkReference:hon,link:fon,listItem:pon,list:mon,paragraph:_on,root:von,strong:bon,table:yon,tableCell:won,tableRow:Con,text:Eon,thematicBreak:xon,toml:n9,yaml:n9,definition:n9,footnoteDefinition:n9};function n9(){}const Fqe=-1,mK=0,bW=1,yW=2,Qve=3,Xve=4,Zve=5,Jve=6,Bqe=7,$qe=8,PDe=typeof self=="object"?self:globalThis,kon=(n,e)=>{const t=(r,o)=>(n.set(o,r),r),i=r=>{if(n.has(r))return n.get(r);const[o,s]=e[r];switch(o){case mK:case Fqe:return t(s,r);case bW:{const a=t([],r);for(const l of s)a.push(i(l));return a}case yW:{const a=t({},r);for(const[l,c]of s)a[i(l)]=i(c);return a}case Qve:return t(new Date(s),r);case Xve:{const{source:a,flags:l}=s;return t(new RegExp(a,l),r)}case Zve:{const a=t(new Map,r);for(const[l,c]of s)a.set(i(l),i(c));return a}case Jve:{const a=t(new Set,r);for(const l of s)a.add(i(l));return a}case Bqe:{const{name:a,message:l}=s;return t(new PDe[a](l),r)}case $qe:return t(BigInt(s),r);case"BigInt":return t(Object(BigInt(s)),r)}return t(new PDe[o](s),r)};return i},MDe=n=>kon(new Map,n)(0),KI="",{toString:Ion}={},{keys:Lon}=Object,fO=n=>{const e=typeof n;if(e!=="object"||!n)return[mK,e];const t=Ion.call(n).slice(8,-1);switch(t){case"Array":return[bW,KI];case"Object":return[yW,KI];case"Date":return[Qve,KI];case"RegExp":return[Xve,KI];case"Map":return[Zve,KI];case"Set":return[Jve,KI]}return t.includes("Array")?[bW,t]:t.includes("Error")?[Bqe,t]:[yW,t]},i9=([n,e])=>n===mK&&(e==="function"||e==="symbol"),Don=(n,e,t,i)=>{const r=(s,a)=>{const l=i.push(s)-1;return t.set(a,l),l},o=s=>{if(t.has(s))return t.get(s);let[a,l]=fO(s);switch(a){case mK:{let u=s;switch(l){case"bigint":a=$qe,u=s.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return r([Fqe],s)}return r([a,u],s)}case bW:{if(l)return r([l,[...s]],s);const u=[],d=r([a,u],s);for(const h of s)u.push(o(h));return d}case yW:{if(l)switch(l){case"BigInt":return r([l,s.toString()],s);case"Boolean":case"Number":case"String":return r([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const u=[],d=r([a,u],s);for(const h of Lon(s))(n||!i9(fO(s[h])))&&u.push([o(h),o(s[h])]);return d}case Qve:return r([a,s.toISOString()],s);case Xve:{const{source:u,flags:d}=s;return r([a,{source:u,flags:d}],s)}case Zve:{const u=[],d=r([a,u],s);for(const[h,f]of s)(n||!(i9(fO(h))||i9(fO(f))))&&u.push([o(h),o(f)]);return d}case Jve:{const u=[],d=r([a,u],s);for(const h of s)(n||!i9(fO(h)))&&u.push(o(h));return d}}const{message:c}=s;return r([a,{name:l,message:c}],s)};return o},FDe=(n,{json:e,lossy:t}={})=>{const i=[];return Don(!(e||t),!!e,new Map,i)(n),i},hA=typeof structuredClone=="function"?(n,e)=>e&&("json"in e||"lossy"in e)?MDe(FDe(n,e)):structuredClone(n):(n,e)=>MDe(FDe(n,e));function Aon(n,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function Non(n,e){return"Back to reference "+(n+1)+(e>1?"-"+e:"")}function Ron(n){const e=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",t=n.options.footnoteBackContent||Aon,i=n.options.footnoteBackLabel||Non,r=n.options.footnoteLabel||"Footnotes",o=n.options.footnoteLabelTagName||"h2",s=n.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<n.footnoteOrder.length;){const c=n.footnoteById.get(n.footnoteOrder[l]);if(!c)continue;const u=n.all(c),d=String(c.identifier).toUpperCase(),h=jN(d.toLowerCase());let f=0;const g=[],m=n.footnoteCounts.get(d);for(;m!==void 0&&++f<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof t=="string"?t:t(l,f);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(l,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else u.push(...g);const _={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:n.wrap(u,!0)};n.patch(c,_),a.push(_)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...hA(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:n.wrap(a,!0)},{type:"text",value:` `}]}}const Vqe=function(n){if(n==null)return Fon;if(typeof n=="function")return _K(n);if(typeof n=="object")return Array.isArray(n)?Oon(n):Pon(n);if(typeof n=="string")return Mon(n);throw new Error("Expected function, string, or object as test")};function Oon(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=Vqe(n[t]);return _K(i);function i(...r){let o=-1;for(;++o<e.length;)if(e[o].apply(this,r))return!0;return!1}}function Pon(n){const e=n;return _K(t);function t(i){const r=i;let o;for(o in n)if(r[o]!==e[o])return!1;return!0}}function Mon(n){return _K(e);function e(t){return t&&t.type===n}}function _K(n){return e;function e(t,i,r){return!!(Bon(t)&&n.call(this,t,typeof i=="number"?i:void 0,r||void 0))}}function Fon(){return!0}function Bon(n){return n!==null&&typeof n=="object"&&"type"in n}const Hqe=[],$on=!0,BDe=!1,Von="skip";function Hon(n,e,t,i){let r;typeof e=="function"&&typeof t!="function"?(i=t,t=e):r=e;const o=Vqe(r),s=i?-1:1;a(n,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=Hqe,g,m,v;if((!e||o(l,c,u[u.length-1]||void 0))&&(f=Won(t(l,u)),f[0]===BDe))return f;if("children"in l&&l.children){const _=l;if(_.children&&f[0]!==Von)for(m=(i?_.children.length:-1)+s,v=u.concat(_);m>-1&&m<_.children.length;){const b=_.children[m];if(g=a(b,m,v)(),g[0]===BDe)return g;m=typeof g[1]=="number"?g[1]:m+s}}return f}}}function Won(n){return Array.isArray(n)?n:typeof n=="number"?[$on,n]:n==null?Hqe:[n]}function ebe(n,e,t,i){let r,o,s;typeof e=="function"&&typeof t!="function"?(o=void 0,s=e,r=t):(o=e,s=t,r=i),Hon(n,o,a,r);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const uae={}.hasOwnProperty,zon={};function Uon(n,e){const t=e||zon,i=new Map,r=new Map,o=new Map,s={...Ton,...t.handlers},a={all:c,applyData:qon,definitionById:i,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:t,patch:jon,wrap:Gon};return ebe(n,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?i:r,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,f=a.handlers[h];if(uae.call(a.handlers,h)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:m,...v}=u,_=hA(v);return _.children=a.all(u),_}return hA(u)}return(a.options.unknownHandler||Kon)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const g=a.one(h[f],u);if(g){if(f&&h[f-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=$De(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=$De(m.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function jon(n,e){n.position&&(e.position=Tnn(n))}function qon(n,e){let t=e;if(n&&n.data){const i=n.data.hName,r=n.data.hChildren,o=n.data.hProperties;if(typeof i=="string")if(t.type==="element")t.tagName=i;else{const s="children"in t?t.children:[t];t={type:"element",tagName:i,properties:{},children:s}}t.type==="element"&&o&&Object.assign(t.properties,hA(o)),"children"in t&&t.children&&r!==null&&r!==void 0&&(t.children=r)}return t}function Kon(n,e){const t=e.data||{},i="value"in e&&!(uae.call(t,"hProperties")||uae.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function Gon(n,e){const t=[];let i=-1;for(e&&t.push({type:"text",value:` `});++i<n.length;)i&&t.push({type:"text",value:` `}),t.push(n[i]);return e&&n.length>0&&t.push({type:"text",value:` `}),t}function $De(n){let e=0,t=n.charCodeAt(e);for(;t===9||t===32;)e++,t=n.charCodeAt(e);return n.slice(e)}function VDe(n,e){const t=Uon(n,e),i=t.one(n,void 0),r=Ron(t),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&o.children.push({type:"text",value:` `},r),o}function Yon(n,e){return n&&"run"in n?async function(t,i){const r=VDe(t,{file:i,...e});await n.run(r,i)}:function(t,i){return VDe(t,{file:i,...n||e})}}function HDe(n){if(n)throw n}var L$=Object.prototype.hasOwnProperty,Wqe=Object.prototype.toString,WDe=Object.defineProperty,zDe=Object.getOwnPropertyDescriptor,UDe=function(e){return typeof Array.isArray=="function"?Array.isArray(e):Wqe.call(e)==="[object Array]"},jDe=function(e){if(!e||Wqe.call(e)!=="[object Object]")return!1;var t=L$.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&L$.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!i)return!1;var r;for(r in e);return typeof r>"u"||L$.call(e,r)},qDe=function(e,t){WDe&&t.name==="__proto__"?WDe(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},KDe=function(e,t){if(t==="__proto__")if(L$.call(e,t)){if(zDe)return zDe(e,t).value}else return;return e[t]},Qon=function n(){var e,t,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(e=arguments[l],e!=null)for(t in e)i=KDe(a,t),r=KDe(e,t),a!==r&&(u&&r&&(jDe(r)||(o=UDe(r)))?(o?(o=!1,s=i&&UDe(i)?i:[]):s=i&&jDe(i)?i:{},qDe(a,{name:t,newValue:n(u,s,r)})):typeof r<"u"&&qDe(a,{name:t,newValue:r}));return a};const ZJ=nl(Qon);function dae(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function Xon(){const n=[],e={run:t,use:i};return e;function t(...r){let o=-1;const s=r.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...r);function a(l,...c){const u=n[++o];let d=-1;if(l){s(l);return}for(;++d<r.length;)(c[d]===null||c[d]===void 0)&&(c[d]=r[d]);r=c,u?Zon(u,a)(...c):s(null,...c)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return n.push(r),e}}function Zon(n,e){let t;return i;function i(...s){const a=n.length>s.length;let l;a&&s.push(r);try{l=n.apply(this,s)}catch(c){const u=c;if(a&&t)throw u;return r(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,r):l instanceof Error?r(l):o(l))}function r(s,...a){t||(t=!0,e(s,...a))}function o(s){r(null,s)}}const Yv={basename:Jon,dirname:esn,extname:tsn,join:nsn,sep:"/"};function Jon(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');i6(n);let t=0,i=-1,r=n.length,o;if(e===void 0||e.length===0||e.length>n.length){for(;r--;)if(n.codePointAt(r)===47){if(o){t=r+1;break}}else i<0&&(o=!0,i=r+1);return i<0?"":n.slice(t,i)}if(e===n)return"";let s=-1,a=e.length-1;for(;r--;)if(n.codePointAt(r)===47){if(o){t=r+1;break}}else s<0&&(o=!0,s=r+1),a>-1&&(n.codePointAt(r)===e.codePointAt(a--)?a<0&&(i=r):(a=-1,i=s));return t===i?i=s:i<0&&(i=n.length),n.slice(t,i)}function esn(n){if(i6(n),n.length===0)return".";let e=-1,t=n.length,i;for(;--t;)if(n.codePointAt(t)===47){if(i){e=t;break}}else i||(i=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function tsn(n){i6(n);let e=n.length,t=-1,i=0,r=-1,o=0,s;for(;e--;){const a=n.codePointAt(e);if(a===47){if(s){i=e+1;break}continue}t<0&&(s=!0,t=e+1),a===46?r<0?r=e:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||t<0||o===0||o===1&&r===t-1&&r===i+1?"":n.slice(r,t)}function nsn(...n){let e=-1,t;for(;++e<n.length;)i6(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":isn(t)}function isn(n){i6(n);const e=n.codePointAt(0)===47;let t=rsn(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function rsn(n,e){let t="",i=0,r=-1,o=0,s=-1,a,l;for(;++s<=n.length;){if(s<n.length)a=n.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(r===s-1||o===1))if(r!==s-1&&o===2){if(t.length<2||i!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",i=0):(t=t.slice(0,l),i=t.length-1-t.lastIndexOf("/")),r=s,o=0;continue}}else if(t.length>0){t="",i=0,r=s,o=0;continue}}e&&(t=t.length>0?t+"/..":"..",i=2)}else t.length>0?t+="/"+n.slice(r+1,s):t=n.slice(r+1,s),i=s-r-1;r=s,o=0}else a===46&&o>-1?o++:o=-1}return t}function i6(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const osn={cwd:ssn};function ssn(){return"/"}function hae(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function asn(n){if(typeof n=="string")n=new URL(n);else if(!hae(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return lsn(n)}function lsn(n){if(n.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const i=e.codePointAt(t+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const JJ=["history","path","basename","stem","extname","dirname"];class zqe{constructor(e){let t;e?hae(e)?t={path:e}:typeof e=="string"||csn(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":osn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<JJ.length;){const o=JJ[i];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let r;for(r in t)JJ.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path=="string"?Yv.basename(this.path):void 0}set basename(e){tee(e,"basename"),eee(e,"basename"),this.path=Yv.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Yv.dirname(this.path):void 0}set dirname(e){GDe(this.basename,"dirname"),this.path=Yv.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Yv.extname(this.path):void 0}set extname(e){if(eee(e,"extname"),GDe(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yv.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){hae(e)&&(e=asn(e)),tee(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Yv.basename(this.path,this.extname):void 0}set stem(e){tee(e,"stem"),eee(e,"stem"),this.path=Yv.join(this.dirname||"",e+(this.extname||""))}fail(e,t,i){const r=this.message(e,t,i);throw r.fatal=!0,r}info(e,t,i){const r=this.message(e,t,i);return r.fatal=void 0,r}message(e,t,i){const r=new _h(e,t,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function eee(n,e){if(n&&n.includes(Yv.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Yv.sep+"`")}function tee(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function GDe(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function csn(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const usn=function(n){const i=this.constructor.prototype,r=i[n],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,i),o},dsn={}.hasOwnProperty;class tbe extends usn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Xon()}copy(){const e=new tbe;let t=-1;for(;++t<this.attachers.length;){const i=this.attachers[t];e.use(...i)}return e.data(ZJ(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(ree("data",this.frozen),this.namespace[e]=t,this):dsn.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ree("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=t.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=r9(e),i=this.parser||this.Parser;return nee("parse",i),i(String(t),t)}process(e,t){const i=this;return this.freeze(),nee("process",this.parser||this.Parser),iee("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(o,s){const a=r9(e),l=i.parse(a);i.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,g=i.stringify(f,h);psn(g)?h.value=g:h.result=g,c(u,h)});function c(u,d){u||!d?s(u):o?o(d):t(void 0,d)}}}processSync(e){let t=!1,i;return this.freeze(),nee("processSync",this.parser||this.Parser),iee("processSync",this.compiler||this.Compiler),this.process(e,r),QDe("processSync","process",t),i;function r(o,s){t=!0,HDe(o),i=s}}run(e,t,i){YDe(e),this.freeze();const r=this.transformers;return!i&&typeof t=="function"&&(i=t,t=void 0),i?o(void 0,i):new Promise(o);function o(s,a){const l=r9(t);r.run(e,l,c);function c(u,d,h){const f=d||e;u?a(u):s?s(f):i(void 0,f,h)}}}runSync(e,t){let i=!1,r;return this.run(e,t,o),QDe("runSync","run",i),r;function o(s,a){HDe(s),r=a,i=!0}}stringify(e,t){this.freeze();const i=r9(t),r=this.compiler||this.Compiler;return iee("stringify",r),YDe(e),r(e,i)}use(e,...t){const i=this.attachers,r=this.namespace;if(ree("use",this.frozen),e!=null)if(typeof e=="function")l(e,t);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(r.settings=ZJ(!0,r.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<i.length;)if(i[d][0]===c){h=d;break}if(h===-1)i.push([c,...u]);else if(u.length>0){let[f,...g]=u;const m=i[h][1];dae(m)&&dae(f)&&(f=ZJ(!0,m,f)),i[h]=[c,f,...g]}}}}const hsn=new tbe().freeze();function nee(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function iee(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function ree(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function YDe(n){if(!dae(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function QDe(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function r9(n){return fsn(n)?n:new zqe(n)}function fsn(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function psn(n){return typeof n=="string"||gsn(n)}function gsn(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const msn="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",XDe=[],ZDe={allowDangerousHtml:!0},_sn=/^(https?|ircs?|mailto|xmpp)$/i,vsn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function bsn(n){const e=n.allowedElements,t=n.allowElement,i=n.children||"",r=n.className,o=n.components,s=n.disallowedElements,a=n.rehypePlugins||XDe,l=n.remarkPlugins||XDe,c=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...ZDe}:ZDe,u=n.skipHtml,d=n.unwrapDisallowed,h=n.urlTransform||ysn,f=hsn().use(eon).use(l).use(Yon,c).use(a),g=new zqe;typeof i=="string"&&(g.value=i);for(const b of vsn)Object.hasOwn(n,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+msn+b.id,void 0);const m=f.parse(g);let v=f.runSync(m,g);return r&&(v={type:"element",tagName:"div",properties:{className:r},children:v.type==="root"?v.children:[v]}),ebe(v,_),Nnn(v,{Fragment:dt,components:o,ignoreInvalidStyle:!0,jsx:p,jsxs:N,passKeys:!0,passNode:!0});function _(b,y,C){if(b.type==="raw"&&C&&typeof y=="number")return u?C.children.splice(y,1):C.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let x;for(x in YJ)if(Object.hasOwn(YJ,x)&&Object.hasOwn(b.properties,x)){const E=b.properties[x],k=YJ[x];(k===null||k.includes(b.tagName))&&(b.properties[x]=h(String(E||""),x,b))}}if(b.type==="element"){let x=e?!e.includes(b.tagName):s?s.includes(b.tagName):!1;if(!x&&t&&typeof y=="number"&&(x=!t(b,y,C)),x&&C&&typeof y=="number")return d&&b.children?C.children.splice(y,1,...b.children):C.children.splice(y,1),y}}}function ysn(n){const e=n.indexOf(":"),t=n.indexOf("?"),i=n.indexOf("#"),r=n.indexOf("/");return e<0||r>-1&&e>r||t>-1&&e>t||i>-1&&e>i||_sn.test(n.slice(0,e))?n:""}const JDe=/[#.]/g;function Csn(n,e){const t=n||"",i={};let r=0,o,s;for(;r<t.length;){JDe.lastIndex=r;const a=JDe.exec(t),l=t.slice(r,a?a.index:t.length);l&&(o?o==="#"?i.id=l:Array.isArray(i.className)?i.className.push(l):i.className=[l]:s=l,r+=l.length),a&&(o=a[0],r++)}return{type:"element",tagName:s||e||"div",properties:i,children:[]}}const wsn=new Set(["button","menu","reset","submit"]),fae={}.hasOwnProperty;function Uqe(n,e,t){const i=t&&Tsn(t);function r(o,s,...a){let l=-1,c;if(o==null){c={type:"root",children:[]};const u=s;a.unshift(u)}else if(c=Csn(o,e),c.tagName=c.tagName.toLowerCase(),i&&fae.call(i,c.tagName)&&(c.tagName=i[c.tagName]),Ssn(s,c.tagName)){let u;for(u in s)fae.call(s,u)&&Esn(n,c.properties,u,s[u])}else a.unshift(s);for(;++l<a.length;)pae(c.children,a[l]);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return r}function Ssn(n,e){return n==null||typeof n!="object"||Array.isArray(n)?!1:e==="input"||!n.type||typeof n.type!="string"?!0:"children"in n&&Array.isArray(n.children)?!1:e==="button"?wsn.has(n.type.toLowerCase()):!("value"in n)}function Esn(n,e,t,i){const r=fK(n,t);let o=-1,s;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;s=i}else typeof i=="boolean"?s=i:typeof i=="string"?r.spaceSeparated?s=hDe(i):r.commaSeparated?s=aDe(i):r.commaOrSpaceSeparated?s=hDe(aDe(i).join(" ")):s=eAe(r,r.property,i):Array.isArray(i)?s=i.concat():s=r.property==="style"?xsn(i):String(i);if(Array.isArray(s)){const a=[];for(;++o<s.length;){const l=eAe(r,r.property,s[o]);a[o]=l}s=a}if(r.property==="className"&&Array.isArray(e.className)){const a=s;s=e.className.concat(a)}e[r.property]=s}}function pae(n,e){let t=-1;if(e!=null)if(typeof e=="string"||typeof e=="number")n.push({type:"text",value:String(e)});else if(Array.isArray(e))for(;++t<e.length;)pae(n,e[t]);else if(typeof e=="object"&&"type"in e)e.type==="root"?pae(n,e.children):n.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function eAe(n,e,t){if(typeof t=="string"){if(n.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((n.boolean||n.overloadedBoolean)&&(t===""||i3(t)===i3(e)))return!0}return t}function xsn(n){const e=[];let t;for(t in n)fae.call(n,t)&&e.push([t,n[t]].join(": "));return e.join("; ")}function Tsn(n){const e={};let t=-1;for(;++t<n.length;)e[n[t].toLowerCase()]=n[t];return e}const ksn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Isn=Uqe(n6,"div"),Lsn=Uqe(iE,"g",ksn);function Dsn(n){const e=String(n),t=[];return{toOffset:r,toPoint:i};function i(o){if(typeof o=="number"&&o>-1&&o<=e.length){let s=0;for(;;){let a=t[s];if(a===void 0){const l=tAe(e,t[s-1]);a=l===-1?e.length+1:l+1,t[s]=a}if(a>o)return{line:s+1,column:o-(s>0?t[s-1]:0)+1,offset:o};s++}}}function r(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;t.length<o.line;){const a=t[t.length-1],l=tAe(e,a),c=l===-1?e.length+1:l+1;if(a===c)break;t.push(c)}const s=(o.line>1?t[o.line-2]:0)+o.column-1;if(s<t[o.line-1])return s}}}function tAe(n,e){const t=n.indexOf("\r",e),i=n.indexOf(` `,e);return i===-1?t:t===-1||t+1===i?i:t<i?t:i}const Wx={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},jqe={}.hasOwnProperty,Asn=Object.prototype;function Nsn(n,e){const t=e||{};return nbe({file:t.file||void 0,location:!1,schema:t.space==="svg"?iE:n6,verbose:t.verbose||!1},n)}function nbe(n,e){let t;switch(e.nodeName){case"#comment":{const i=e;return t={type:"comment",value:i.data},D$(n,i,t),t}case"#document":case"#document-fragment":{const i=e,r="mode"in i?i.mode==="quirks"||i.mode==="limited-quirks":!1;if(t={type:"root",children:qqe(n,e.childNodes),data:{quirksMode:r}},n.file&&n.location){const o=String(n.file),s=Dsn(o),a=s.toPoint(0),l=s.toPoint(o.length);t.position={start:a,end:l}}return t}case"#documentType":{const i=e;return t={type:"doctype"},D$(n,i,t),t}case"#text":{const i=e;return t={type:"text",value:i.value},D$(n,i,t),t}default:return t=Rsn(n,e),t}}function qqe(n,e){let t=-1;const i=[];for(;++t<e.length;){const r=nbe(n,e[t]);i.push(r)}return i}function Rsn(n,e){const t=n.schema;n.schema=e.namespaceURI===Wx.svg?iE:n6;let i=-1;const r={};for(;++i<e.attrs.length;){const a=e.attrs[i],l=(a.prefix?a.prefix+":":"")+a.name;jqe.call(Asn,l)||(r[l]=a.value)}const s=(n.schema.space==="svg"?Lsn:Isn)(e.tagName,r,qqe(n,e.childNodes));if(D$(n,e,s),s.tagName==="template"){const a=e,l=a.sourceCodeLocation,c=l&&l.startTag&&J2(l.startTag),u=l&&l.endTag&&J2(l.endTag),d=nbe(n,a.content);c&&u&&n.file&&(d.position={start:c.end,end:u.start}),s.content=d}return n.schema=t,s}function D$(n,e,t){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&n.file){const i=Osn(n,t,e.sourceCodeLocation);i&&(n.location=!0,t.position=i)}}function Osn(n,e,t){const i=J2(t);if(e.type==="element"){const r=e.children[e.children.length-1];if(i&&!t.endTag&&r&&r.position&&r.position.end&&(i.end=Object.assign({},r.position.end)),n.verbose){const o={};let s;if(t.attrs)for(s in t.attrs)jqe.call(t.attrs,s)&&(o[fK(n.schema,s).property]=J2(t.attrs[s]));t.startTag;const a=J2(t.startTag),l=t.endTag?J2(t.endTag):void 0,c={opening:a};l&&(c.closing=l),c.properties=o,e.data={position:c}}}return i}function J2(n){const e=nAe({line:n.startLine,column:n.startCol,offset:n.startOffset}),t=nAe({line:n.endLine,column:n.endCol,offset:n.endOffset});return e||t?{start:e,end:t}:void 0}function nAe(n){return n.line&&n.column?n:void 0}const iAe={}.hasOwnProperty;function Kqe(n,e){const t=e||{};function i(r,...o){let s=i.invalid;const a=i.handlers;if(r&&iAe.call(r,n)){const l=String(r[n]);s=iAe.call(a,l)?a[l]:i.unknown}if(s)return s.call(this,r,...o)}return i.handlers=t.handlers||{},i.invalid=t.invalid,i.unknown=t.unknown,i}const Psn={},Msn={}.hasOwnProperty,Gqe=Kqe("type",{handlers:{root:Bsn,element:zsn,text:Hsn,comment:Wsn,doctype:Vsn}});function Fsn(n,e){const i=(e||Psn).space;return Gqe(n,i==="svg"?iE:n6)}function Bsn(n,e){const t={nodeName:"#document",mode:(n.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return t.childNodes=ibe(n.children,t,e),qN(n,t),t}function $sn(n,e){const t={nodeName:"#document-fragment",childNodes:[]};return t.childNodes=ibe(n.children,t,e),qN(n,t),t}function Vsn(n){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return qN(n,e),e}function Hsn(n){const e={nodeName:"#text",value:n.value,parentNode:null};return qN(n,e),e}function Wsn(n){const e={nodeName:"#comment",data:n.value,parentNode:null};return qN(n,e),e}function zsn(n,e){const t=e;let i=t;n.type==="element"&&n.tagName.toLowerCase()==="svg"&&t.space==="html"&&(i=iE);const r=[];let o;if(n.properties){for(o in n.properties)if(o!=="children"&&Msn.call(n.properties,o)){const l=Usn(i,o,n.properties[o]);l&&r.push(l)}}const s=i.space,a={nodeName:n.tagName,tagName:n.tagName,attrs:r,namespaceURI:Wx[s],childNodes:[],parentNode:null};return a.childNodes=ibe(n.children,a,i),qN(n,a),n.tagName==="template"&&n.content&&(a.content=$sn(n.content,i)),a}function Usn(n,e,t){const i=fK(n,e);if(t===!1||t===null||t===void 0||typeof t=="number"&&Number.isNaN(t)||!t&&i.boolean)return;Array.isArray(t)&&(t=i.commaSeparated?sqe(t):gqe(t));const r={name:i.attribute,value:t===!0?"":String(t)};if(i.space&&i.space!=="html"&&i.space!=="svg"){const o=r.name.indexOf(":");o<0?r.prefix="":(r.name=r.name.slice(o+1),r.prefix=i.attribute.slice(0,o)),r.namespace=Wx[i.space]}return r}function ibe(n,e,t){let i=-1;const r=[];if(n)for(;++i<n.length;){const o=Gqe(n[i],t);o.parentNode=e,r.push(o)}return r}function qN(n,e){const t=n.position;t&&t.start&&t.end&&(t.start.offset,t.end.offset,e.sourceCodeLocation={startLine:t.start.line,startCol:t.start.column,startOffset:t.start.offset,endLine:t.end.line,endCol:t.end.column,endOffset:t.end.offset})}const jsn=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],qsn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),bl="�";var be;(function(n){n[n.EOF=-1]="EOF",n[n.NULL=0]="NULL",n[n.TABULATION=9]="TABULATION",n[n.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",n[n.LINE_FEED=10]="LINE_FEED",n[n.FORM_FEED=12]="FORM_FEED",n[n.SPACE=32]="SPACE",n[n.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",n[n.QUOTATION_MARK=34]="QUOTATION_MARK",n[n.NUMBER_SIGN=35]="NUMBER_SIGN",n[n.AMPERSAND=38]="AMPERSAND",n[n.APOSTROPHE=39]="APOSTROPHE",n[n.HYPHEN_MINUS=45]="HYPHEN_MINUS",n[n.SOLIDUS=47]="SOLIDUS",n[n.DIGIT_0=48]="DIGIT_0",n[n.DIGIT_9=57]="DIGIT_9",n[n.SEMICOLON=59]="SEMICOLON",n[n.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",n[n.EQUALS_SIGN=61]="EQUALS_SIGN",n[n.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",n[n.QUESTION_MARK=63]="QUESTION_MARK",n[n.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",n[n.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",n[n.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",n[n.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",n[n.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",n[n.GRAVE_ACCENT=96]="GRAVE_ACCENT",n[n.LATIN_SMALL_A=97]="LATIN_SMALL_A",n[n.LATIN_SMALL_F=102]="LATIN_SMALL_F",n[n.LATIN_SMALL_X=120]="LATIN_SMALL_X",n[n.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",n[n.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER"})(be=be||(be={}));const df={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Yqe(n){return n>=55296&&n<=57343}function Ksn(n){return n>=56320&&n<=57343}function Gsn(n,e){return(n-55296)*1024+9216+e}function Qqe(n){return n!==32&&n!==10&&n!==13&&n!==9&&n!==12&&n>=1&&n<=31||n>=127&&n<=159}function Xqe(n){return n>=64976&&n<=65007||qsn.has(n)}var Vt;(function(n){n.controlCharacterInInputStream="control-character-in-input-stream",n.noncharacterInInputStream="noncharacter-in-input-stream",n.surrogateInInputStream="surrogate-in-input-stream",n.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",n.endTagWithAttributes="end-tag-with-attributes",n.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",n.unexpectedSolidusInTag="unexpected-solidus-in-tag",n.unexpectedNullCharacter="unexpected-null-character",n.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",n.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",n.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",n.missingEndTagName="missing-end-tag-name",n.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",n.unknownNamedCharacterReference="unknown-named-character-reference",n.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",n.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",n.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",n.eofBeforeTagName="eof-before-tag-name",n.eofInTag="eof-in-tag",n.missingAttributeValue="missing-attribute-value",n.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",n.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",n.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",n.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",n.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",n.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",n.missingDoctypePublicIdentifier="missing-doctype-public-identifier",n.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",n.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",n.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",n.cdataInHtmlContent="cdata-in-html-content",n.incorrectlyOpenedComment="incorrectly-opened-comment",n.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",n.eofInDoctype="eof-in-doctype",n.nestedComment="nested-comment",n.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",n.eofInComment="eof-in-comment",n.incorrectlyClosedComment="incorrectly-closed-comment",n.eofInCdata="eof-in-cdata",n.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",n.nullCharacterReference="null-character-reference",n.surrogateCharacterReference="surrogate-character-reference",n.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",n.controlCharacterReference="control-character-reference",n.noncharacterCharacterReference="noncharacter-character-reference",n.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",n.missingDoctypeName="missing-doctype-name",n.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",n.duplicateAttribute="duplicate-attribute",n.nonConformingDoctype="non-conforming-doctype",n.missingDoctype="missing-doctype",n.misplacedDoctype="misplaced-doctype",n.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",n.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",n.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",n.openElementsLeftAfterEof="open-elements-left-after-eof",n.abandonedHeadElementChild="abandoned-head-element-child",n.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",n.nestedNoscriptInHead="nested-noscript-in-head",n.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Vt=Vt||(Vt={}));const Ysn=65536;class Qsn{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Ysn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e){const{line:t,col:i,offset:r}=this;return{code:e,startLine:t,endLine:t,startCol:i,endCol:i,startOffset:r,endOffset:r}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(Ksn(t))return this.pos++,this._addGap(),Gsn(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,be.EOF;return this._err(Vt.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let i=0;i<e.length;i++)if((this.html.charCodeAt(this.pos+i)|32)!==e.charCodeAt(i))return!1;return!0}peek(e){const t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,be.EOF;const i=this.html.charCodeAt(t);return i===be.CARRIAGE_RETURN?be.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,be.EOF;let e=this.html.charCodeAt(this.pos);return e===be.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,be.LINE_FEED):e===be.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Yqe(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===be.LINE_FEED||e===be.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Qqe(e)?this._err(Vt.controlCharacterInInputStream):Xqe(e)&&this._err(Vt.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Ao;(function(n){n[n.CHARACTER=0]="CHARACTER",n[n.NULL_CHARACTER=1]="NULL_CHARACTER",n[n.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",n[n.START_TAG=3]="START_TAG",n[n.END_TAG=4]="END_TAG",n[n.COMMENT=5]="COMMENT",n[n.DOCTYPE=6]="DOCTYPE",n[n.EOF=7]="EOF",n[n.HIBERNATION=8]="HIBERNATION"})(Ao=Ao||(Ao={}));function Zqe(n,e){for(let t=n.attrs.length-1;t>=0;t--)if(n.attrs[t].name===e)return n.attrs[t].value;return null}const hC=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(n=>n.charCodeAt(0))),Xsn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(n=>n.charCodeAt(0)));var oee;const Zsn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Jsn=(oee=String.fromCodePoint)!==null&&oee!==void 0?oee:function(n){let e="";return n>65535&&(n-=65536,e+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),e+=String.fromCharCode(n),e};function ean(n){var e;return n>=55296&&n<=57343||n>1114111?65533:(e=Zsn.get(n))!==null&&e!==void 0?e:n}var ju;(function(n){n[n.NUM=35]="NUM",n[n.SEMI=59]="SEMI",n[n.EQUALS=61]="EQUALS",n[n.ZERO=48]="ZERO",n[n.NINE=57]="NINE",n[n.LOWER_A=97]="LOWER_A",n[n.LOWER_F=102]="LOWER_F",n[n.LOWER_X=120]="LOWER_X",n[n.LOWER_Z=122]="LOWER_Z",n[n.UPPER_A=65]="UPPER_A",n[n.UPPER_F=70]="UPPER_F",n[n.UPPER_Z=90]="UPPER_Z"})(ju||(ju={}));const tan=32;var Db;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(Db||(Db={}));function gae(n){return n>=ju.ZERO&&n<=ju.NINE}function nan(n){return n>=ju.UPPER_A&&n<=ju.UPPER_F||n>=ju.LOWER_A&&n<=ju.LOWER_F}function ian(n){return n>=ju.UPPER_A&&n<=ju.UPPER_Z||n>=ju.LOWER_A&&n<=ju.LOWER_Z||gae(n)}function ran(n){return n===ju.EQUALS||ian(n)}var Nu;(function(n){n[n.EntityStart=0]="EntityStart",n[n.NumericStart=1]="NumericStart",n[n.NumericDecimal=2]="NumericDecimal",n[n.NumericHex=3]="NumericHex",n[n.NamedEntity=4]="NamedEntity"})(Nu||(Nu={}));var vx;(function(n){n[n.Legacy=0]="Legacy",n[n.Strict=1]="Strict",n[n.Attribute=2]="Attribute"})(vx||(vx={}));class oan{constructor(e,t,i){this.decodeTree=e,this.emitCodePoint=t,this.errors=i,this.state=Nu.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vx.Strict}startEntity(e){this.decodeMode=e,this.state=Nu.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Nu.EntityStart:return e.charCodeAt(t)===ju.NUM?(this.state=Nu.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Nu.NamedEntity,this.stateNamedEntity(e,t));case Nu.NumericStart:return this.stateNumericStart(e,t);case Nu.NumericDecimal:return this.stateNumericDecimal(e,t);case Nu.NumericHex:return this.stateNumericHex(e,t);case Nu.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|tan)===ju.LOWER_X?(this.state=Nu.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Nu.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,i,r){if(t!==i){const o=i-t;this.result=this.result*Math.pow(r,o)+parseInt(e.substr(t,o),r),this.consumed+=o}}stateNumericHex(e,t){const i=t;for(;t<e.length;){const r=e.charCodeAt(t);if(gae(r)||nan(r))t+=1;else return this.addToNumericResult(e,i,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,i,t,16),-1}stateNumericDecimal(e,t){const i=t;for(;t<e.length;){const r=e.charCodeAt(t);if(gae(r))t+=1;else return this.addToNumericResult(e,i,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,i,t,10),-1}emitNumericEntity(e,t){var i;if(this.consumed<=t)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ju.SEMI)this.consumed+=1;else if(this.decodeMode===vx.Strict)return 0;return this.emitCodePoint(ean(this.result),this.consumed),this.errors&&(e!==ju.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:i}=this;let r=i[this.treeIndex],o=(r&Db.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const s=e.charCodeAt(t);if(this.treeIndex=eKe(i,r,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===vx.Attribute&&(o===0||ran(s))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],o=(r&Db.VALUE_LENGTH)>>14,o!==0){if(s===ju.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==vx.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:i}=this,r=(i[t]&Db.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,i){const{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Db.VALUE_LENGTH:r[e+1],i),t===3&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case Nu.NamedEntity:return this.result!==0&&(this.decodeMode!==vx.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Nu.NumericDecimal:return this.emitNumericEntity(0,2);case Nu.NumericHex:return this.emitNumericEntity(0,3);case Nu.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Nu.EntityStart:return 0}}}function Jqe(n){let e="";const t=new oan(n,i=>e+=Jsn(i));return function(r,o){let s=0,a=0;for(;(a=r.indexOf("&",a))>=0;){e+=r.slice(s,a),t.startEntity(o);const c=t.write(r,a+1);if(c<0){s=a+t.end();break}s=a+c,a=c===0?s+1:s}const l=e+r.slice(s);return e="",l}}function eKe(n,e,t,i){const r=(e&Db.BRANCH_LENGTH)>>7,o=e&Db.JUMP_TABLE;if(r===0)return o!==0&&i===o?t:-1;if(o){const l=i-o;return l<0||l>=r?-1:n[t+l]-1}let s=t,a=s+r-1;for(;s<=a;){const l=s+a>>>1,c=n[l];if(c<i)s=l+1;else if(c>i)a=l-1;else return n[l+r]}return-1}Jqe(hC);Jqe(Xsn);var en;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.MATHML="http://www.w3.org/1998/Math/MathML",n.SVG="http://www.w3.org/2000/svg",n.XLINK="http://www.w3.org/1999/xlink",n.XML="http://www.w3.org/XML/1998/namespace",n.XMLNS="http://www.w3.org/2000/xmlns/"})(en=en||(en={}));var Iw;(function(n){n.TYPE="type",n.ACTION="action",n.ENCODING="encoding",n.PROMPT="prompt",n.NAME="name",n.COLOR="color",n.FACE="face",n.SIZE="size"})(Iw=Iw||(Iw={}));var Pp;(function(n){n.NO_QUIRKS="no-quirks",n.QUIRKS="quirks",n.LIMITED_QUIRKS="limited-quirks"})(Pp=Pp||(Pp={}));var ht;(function(n){n.A="a",n.ADDRESS="address",n.ANNOTATION_XML="annotation-xml",n.APPLET="applet",n.AREA="area",n.ARTICLE="article",n.ASIDE="aside",n.B="b",n.BASE="base",n.BASEFONT="basefont",n.BGSOUND="bgsound",n.BIG="big",n.BLOCKQUOTE="blockquote",n.BODY="body",n.BR="br",n.BUTTON="button",n.CAPTION="caption",n.CENTER="center",n.CODE="code",n.COL="col",n.COLGROUP="colgroup",n.DD="dd",n.DESC="desc",n.DETAILS="details",n.DIALOG="dialog",n.DIR="dir",n.DIV="div",n.DL="dl",n.DT="dt",n.EM="em",n.EMBED="embed",n.FIELDSET="fieldset",n.FIGCAPTION="figcaption",n.FIGURE="figure",n.FONT="font",n.FOOTER="footer",n.FOREIGN_OBJECT="foreignObject",n.FORM="form",n.FRAME="frame",n.FRAMESET="frameset",n.H1="h1",n.H2="h2",n.H3="h3",n.H4="h4",n.H5="h5",n.H6="h6",n.HEAD="head",n.HEADER="header",n.HGROUP="hgroup",n.HR="hr",n.HTML="html",n.I="i",n.IMG="img",n.IMAGE="image",n.INPUT="input",n.IFRAME="iframe",n.KEYGEN="keygen",n.LABEL="label",n.LI="li",n.LINK="link",n.LISTING="listing",n.MAIN="main",n.MALIGNMARK="malignmark",n.MARQUEE="marquee",n.MATH="math",n.MENU="menu",n.META="meta",n.MGLYPH="mglyph",n.MI="mi",n.MO="mo",n.MN="mn",n.MS="ms",n.MTEXT="mtext",n.NAV="nav",n.NOBR="nobr",n.NOFRAMES="noframes",n.NOEMBED="noembed",n.NOSCRIPT="noscript",n.OBJECT="object",n.OL="ol",n.OPTGROUP="optgroup",n.OPTION="option",n.P="p",n.PARAM="param",n.PLAINTEXT="plaintext",n.PRE="pre",n.RB="rb",n.RP="rp",n.RT="rt",n.RTC="rtc",n.RUBY="ruby",n.S="s",n.SCRIPT="script",n.SECTION="section",n.SELECT="select",n.SOURCE="source",n.SMALL="small",n.SPAN="span",n.STRIKE="strike",n.STRONG="strong",n.STYLE="style",n.SUB="sub",n.SUMMARY="summary",n.SUP="sup",n.TABLE="table",n.TBODY="tbody",n.TEMPLATE="template",n.TEXTAREA="textarea",n.TFOOT="tfoot",n.TD="td",n.TH="th",n.THEAD="thead",n.TITLE="title",n.TR="tr",n.TRACK="track",n.TT="tt",n.U="u",n.UL="ul",n.SVG="svg",n.VAR="var",n.WBR="wbr",n.XMP="xmp"})(ht=ht||(ht={}));var $;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.A=1]="A",n[n.ADDRESS=2]="ADDRESS",n[n.ANNOTATION_XML=3]="ANNOTATION_XML",n[n.APPLET=4]="APPLET",n[n.AREA=5]="AREA",n[n.ARTICLE=6]="ARTICLE",n[n.ASIDE=7]="ASIDE",n[n.B=8]="B",n[n.BASE=9]="BASE",n[n.BASEFONT=10]="BASEFONT",n[n.BGSOUND=11]="BGSOUND",n[n.BIG=12]="BIG",n[n.BLOCKQUOTE=13]="BLOCKQUOTE",n[n.BODY=14]="BODY",n[n.BR=15]="BR",n[n.BUTTON=16]="BUTTON",n[n.CAPTION=17]="CAPTION",n[n.CENTER=18]="CENTER",n[n.CODE=19]="CODE",n[n.COL=20]="COL",n[n.COLGROUP=21]="COLGROUP",n[n.DD=22]="DD",n[n.DESC=23]="DESC",n[n.DETAILS=24]="DETAILS",n[n.DIALOG=25]="DIALOG",n[n.DIR=26]="DIR",n[n.DIV=27]="DIV",n[n.DL=28]="DL",n[n.DT=29]="DT",n[n.EM=30]="EM",n[n.EMBED=31]="EMBED",n[n.FIELDSET=32]="FIELDSET",n[n.FIGCAPTION=33]="FIGCAPTION",n[n.FIGURE=34]="FIGURE",n[n.FONT=35]="FONT",n[n.FOOTER=36]="FOOTER",n[n.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",n[n.FORM=38]="FORM",n[n.FRAME=39]="FRAME",n[n.FRAMESET=40]="FRAMESET",n[n.H1=41]="H1",n[n.H2=42]="H2",n[n.H3=43]="H3",n[n.H4=44]="H4",n[n.H5=45]="H5",n[n.H6=46]="H6",n[n.HEAD=47]="HEAD",n[n.HEADER=48]="HEADER",n[n.HGROUP=49]="HGROUP",n[n.HR=50]="HR",n[n.HTML=51]="HTML",n[n.I=52]="I",n[n.IMG=53]="IMG",n[n.IMAGE=54]="IMAGE",n[n.INPUT=55]="INPUT",n[n.IFRAME=56]="IFRAME",n[n.KEYGEN=57]="KEYGEN",n[n.LABEL=58]="LABEL",n[n.LI=59]="LI",n[n.LINK=60]="LINK",n[n.LISTING=61]="LISTING",n[n.MAIN=62]="MAIN",n[n.MALIGNMARK=63]="MALIGNMARK",n[n.MARQUEE=64]="MARQUEE",n[n.MATH=65]="MATH",n[n.MENU=66]="MENU",n[n.META=67]="META",n[n.MGLYPH=68]="MGLYPH",n[n.MI=69]="MI",n[n.MO=70]="MO",n[n.MN=71]="MN",n[n.MS=72]="MS",n[n.MTEXT=73]="MTEXT",n[n.NAV=74]="NAV",n[n.NOBR=75]="NOBR",n[n.NOFRAMES=76]="NOFRAMES",n[n.NOEMBED=77]="NOEMBED",n[n.NOSCRIPT=78]="NOSCRIPT",n[n.OBJECT=79]="OBJECT",n[n.OL=80]="OL",n[n.OPTGROUP=81]="OPTGROUP",n[n.OPTION=82]="OPTION",n[n.P=83]="P",n[n.PARAM=84]="PARAM",n[n.PLAINTEXT=85]="PLAINTEXT",n[n.PRE=86]="PRE",n[n.RB=87]="RB",n[n.RP=88]="RP",n[n.RT=89]="RT",n[n.RTC=90]="RTC",n[n.RUBY=91]="RUBY",n[n.S=92]="S",n[n.SCRIPT=93]="SCRIPT",n[n.SECTION=94]="SECTION",n[n.SELECT=95]="SELECT",n[n.SOURCE=96]="SOURCE",n[n.SMALL=97]="SMALL",n[n.SPAN=98]="SPAN",n[n.STRIKE=99]="STRIKE",n[n.STRONG=100]="STRONG",n[n.STYLE=101]="STYLE",n[n.SUB=102]="SUB",n[n.SUMMARY=103]="SUMMARY",n[n.SUP=104]="SUP",n[n.TABLE=105]="TABLE",n[n.TBODY=106]="TBODY",n[n.TEMPLATE=107]="TEMPLATE",n[n.TEXTAREA=108]="TEXTAREA",n[n.TFOOT=109]="TFOOT",n[n.TD=110]="TD",n[n.TH=111]="TH",n[n.THEAD=112]="THEAD",n[n.TITLE=113]="TITLE",n[n.TR=114]="TR",n[n.TRACK=115]="TRACK",n[n.TT=116]="TT",n[n.U=117]="U",n[n.UL=118]="UL",n[n.SVG=119]="SVG",n[n.VAR=120]="VAR",n[n.WBR=121]="WBR",n[n.XMP=122]="XMP"})($=$||($={}));const san=new Map([[ht.A,$.A],[ht.ADDRESS,$.ADDRESS],[ht.ANNOTATION_XML,$.ANNOTATION_XML],[ht.APPLET,$.APPLET],[ht.AREA,$.AREA],[ht.ARTICLE,$.ARTICLE],[ht.ASIDE,$.ASIDE],[ht.B,$.B],[ht.BASE,$.BASE],[ht.BASEFONT,$.BASEFONT],[ht.BGSOUND,$.BGSOUND],[ht.BIG,$.BIG],[ht.BLOCKQUOTE,$.BLOCKQUOTE],[ht.BODY,$.BODY],[ht.BR,$.BR],[ht.BUTTON,$.BUTTON],[ht.CAPTION,$.CAPTION],[ht.CENTER,$.CENTER],[ht.CODE,$.CODE],[ht.COL,$.COL],[ht.COLGROUP,$.COLGROUP],[ht.DD,$.DD],[ht.DESC,$.DESC],[ht.DETAILS,$.DETAILS],[ht.DIALOG,$.DIALOG],[ht.DIR,$.DIR],[ht.DIV,$.DIV],[ht.DL,$.DL],[ht.DT,$.DT],[ht.EM,$.EM],[ht.EMBED,$.EMBED],[ht.FIELDSET,$.FIELDSET],[ht.FIGCAPTION,$.FIGCAPTION],[ht.FIGURE,$.FIGURE],[ht.FONT,$.FONT],[ht.FOOTER,$.FOOTER],[ht.FOREIGN_OBJECT,$.FOREIGN_OBJECT],[ht.FORM,$.FORM],[ht.FRAME,$.FRAME],[ht.FRAMESET,$.FRAMESET],[ht.H1,$.H1],[ht.H2,$.H2],[ht.H3,$.H3],[ht.H4,$.H4],[ht.H5,$.H5],[ht.H6,$.H6],[ht.HEAD,$.HEAD],[ht.HEADER,$.HEADER],[ht.HGROUP,$.HGROUP],[ht.HR,$.HR],[ht.HTML,$.HTML],[ht.I,$.I],[ht.IMG,$.IMG],[ht.IMAGE,$.IMAGE],[ht.INPUT,$.INPUT],[ht.IFRAME,$.IFRAME],[ht.KEYGEN,$.KEYGEN],[ht.LABEL,$.LABEL],[ht.LI,$.LI],[ht.LINK,$.LINK],[ht.LISTING,$.LISTING],[ht.MAIN,$.MAIN],[ht.MALIGNMARK,$.MALIGNMARK],[ht.MARQUEE,$.MARQUEE],[ht.MATH,$.MATH],[ht.MENU,$.MENU],[ht.META,$.META],[ht.MGLYPH,$.MGLYPH],[ht.MI,$.MI],[ht.MO,$.MO],[ht.MN,$.MN],[ht.MS,$.MS],[ht.MTEXT,$.MTEXT],[ht.NAV,$.NAV],[ht.NOBR,$.NOBR],[ht.NOFRAMES,$.NOFRAMES],[ht.NOEMBED,$.NOEMBED],[ht.NOSCRIPT,$.NOSCRIPT],[ht.OBJECT,$.OBJECT],[ht.OL,$.OL],[ht.OPTGROUP,$.OPTGROUP],[ht.OPTION,$.OPTION],[ht.P,$.P],[ht.PARAM,$.PARAM],[ht.PLAINTEXT,$.PLAINTEXT],[ht.PRE,$.PRE],[ht.RB,$.RB],[ht.RP,$.RP],[ht.RT,$.RT],[ht.RTC,$.RTC],[ht.RUBY,$.RUBY],[ht.S,$.S],[ht.SCRIPT,$.SCRIPT],[ht.SECTION,$.SECTION],[ht.SELECT,$.SELECT],[ht.SOURCE,$.SOURCE],[ht.SMALL,$.SMALL],[ht.SPAN,$.SPAN],[ht.STRIKE,$.STRIKE],[ht.STRONG,$.STRONG],[ht.STYLE,$.STYLE],[ht.SUB,$.SUB],[ht.SUMMARY,$.SUMMARY],[ht.SUP,$.SUP],[ht.TABLE,$.TABLE],[ht.TBODY,$.TBODY],[ht.TEMPLATE,$.TEMPLATE],[ht.TEXTAREA,$.TEXTAREA],[ht.TFOOT,$.TFOOT],[ht.TD,$.TD],[ht.TH,$.TH],[ht.THEAD,$.THEAD],[ht.TITLE,$.TITLE],[ht.TR,$.TR],[ht.TRACK,$.TRACK],[ht.TT,$.TT],[ht.U,$.U],[ht.UL,$.UL],[ht.SVG,$.SVG],[ht.VAR,$.VAR],[ht.WBR,$.WBR],[ht.XMP,$.XMP]]);function KN(n){var e;return(e=san.get(n))!==null&&e!==void 0?e:$.UNKNOWN}const Ln=$,aan={[en.HTML]:new Set([Ln.ADDRESS,Ln.APPLET,Ln.AREA,Ln.ARTICLE,Ln.ASIDE,Ln.BASE,Ln.BASEFONT,Ln.BGSOUND,Ln.BLOCKQUOTE,Ln.BODY,Ln.BR,Ln.BUTTON,Ln.CAPTION,Ln.CENTER,Ln.COL,Ln.COLGROUP,Ln.DD,Ln.DETAILS,Ln.DIR,Ln.DIV,Ln.DL,Ln.DT,Ln.EMBED,Ln.FIELDSET,Ln.FIGCAPTION,Ln.FIGURE,Ln.FOOTER,Ln.FORM,Ln.FRAME,Ln.FRAMESET,Ln.H1,Ln.H2,Ln.H3,Ln.H4,Ln.H5,Ln.H6,Ln.HEAD,Ln.HEADER,Ln.HGROUP,Ln.HR,Ln.HTML,Ln.IFRAME,Ln.IMG,Ln.INPUT,Ln.LI,Ln.LINK,Ln.LISTING,Ln.MAIN,Ln.MARQUEE,Ln.MENU,Ln.META,Ln.NAV,Ln.NOEMBED,Ln.NOFRAMES,Ln.NOSCRIPT,Ln.OBJECT,Ln.OL,Ln.P,Ln.PARAM,Ln.PLAINTEXT,Ln.PRE,Ln.SCRIPT,Ln.SECTION,Ln.SELECT,Ln.SOURCE,Ln.STYLE,Ln.SUMMARY,Ln.TABLE,Ln.TBODY,Ln.TD,Ln.TEMPLATE,Ln.TEXTAREA,Ln.TFOOT,Ln.TH,Ln.THEAD,Ln.TITLE,Ln.TR,Ln.TRACK,Ln.UL,Ln.WBR,Ln.XMP]),[en.MATHML]:new Set([Ln.MI,Ln.MO,Ln.MN,Ln.MS,Ln.MTEXT,Ln.ANNOTATION_XML]),[en.SVG]:new Set([Ln.TITLE,Ln.FOREIGN_OBJECT,Ln.DESC]),[en.XLINK]:new Set,[en.XML]:new Set,[en.XMLNS]:new Set};function tKe(n){return n===Ln.H1||n===Ln.H2||n===Ln.H3||n===Ln.H4||n===Ln.H5||n===Ln.H6}ht.STYLE,ht.SCRIPT,ht.XMP,ht.IFRAME,ht.NOEMBED,ht.NOFRAMES,ht.PLAINTEXT;const lan=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var xe;(function(n){n[n.DATA=0]="DATA",n[n.RCDATA=1]="RCDATA",n[n.RAWTEXT=2]="RAWTEXT",n[n.SCRIPT_DATA=3]="SCRIPT_DATA",n[n.PLAINTEXT=4]="PLAINTEXT",n[n.TAG_OPEN=5]="TAG_OPEN",n[n.END_TAG_OPEN=6]="END_TAG_OPEN",n[n.TAG_NAME=7]="TAG_NAME",n[n.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",n[n.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",n[n.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",n[n.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",n[n.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",n[n.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",n[n.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",n[n.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",n[n.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",n[n.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",n[n.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",n[n.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",n[n.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",n[n.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",n[n.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",n[n.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",n[n.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",n[n.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",n[n.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",n[n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",n[n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",n[n.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",n[n.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",n[n.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",n[n.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",n[n.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",n[n.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",n[n.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",n[n.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",n[n.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",n[n.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",n[n.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",n[n.BOGUS_COMMENT=40]="BOGUS_COMMENT",n[n.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",n[n.COMMENT_START=42]="COMMENT_START",n[n.COMMENT_START_DASH=43]="COMMENT_START_DASH",n[n.COMMENT=44]="COMMENT",n[n.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",n[n.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",n[n.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",n[n.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",n[n.COMMENT_END_DASH=49]="COMMENT_END_DASH",n[n.COMMENT_END=50]="COMMENT_END",n[n.COMMENT_END_BANG=51]="COMMENT_END_BANG",n[n.DOCTYPE=52]="DOCTYPE",n[n.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",n[n.DOCTYPE_NAME=54]="DOCTYPE_NAME",n[n.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",n[n.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",n[n.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",n[n.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",n[n.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",n[n.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",n[n.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",n[n.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",n[n.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",n[n.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",n[n.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",n[n.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",n[n.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",n[n.CDATA_SECTION=68]="CDATA_SECTION",n[n.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",n[n.CDATA_SECTION_END=70]="CDATA_SECTION_END",n[n.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",n[n.NAMED_CHARACTER_REFERENCE=72]="NAMED_CHARACTER_REFERENCE",n[n.AMBIGUOUS_AMPERSAND=73]="AMBIGUOUS_AMPERSAND",n[n.NUMERIC_CHARACTER_REFERENCE=74]="NUMERIC_CHARACTER_REFERENCE",n[n.HEXADEMICAL_CHARACTER_REFERENCE_START=75]="HEXADEMICAL_CHARACTER_REFERENCE_START",n[n.HEXADEMICAL_CHARACTER_REFERENCE=76]="HEXADEMICAL_CHARACTER_REFERENCE",n[n.DECIMAL_CHARACTER_REFERENCE=77]="DECIMAL_CHARACTER_REFERENCE",n[n.NUMERIC_CHARACTER_REFERENCE_END=78]="NUMERIC_CHARACTER_REFERENCE_END"})(xe||(xe={}));const Sc={DATA:xe.DATA,RCDATA:xe.RCDATA,RAWTEXT:xe.RAWTEXT,SCRIPT_DATA:xe.SCRIPT_DATA,PLAINTEXT:xe.PLAINTEXT,CDATA_SECTION:xe.CDATA_SECTION};function pM(n){return n>=be.DIGIT_0&&n<=be.DIGIT_9}function cP(n){return n>=be.LATIN_CAPITAL_A&&n<=be.LATIN_CAPITAL_Z}function can(n){return n>=be.LATIN_SMALL_A&&n<=be.LATIN_SMALL_Z}function fC(n){return can(n)||cP(n)}function mae(n){return fC(n)||pM(n)}function nKe(n){return n>=be.LATIN_CAPITAL_A&&n<=be.LATIN_CAPITAL_F}function iKe(n){return n>=be.LATIN_SMALL_A&&n<=be.LATIN_SMALL_F}function uan(n){return pM(n)||nKe(n)||iKe(n)}function o9(n){return n+32}function rKe(n){return n===be.SPACE||n===be.LINE_FEED||n===be.TABULATION||n===be.FORM_FEED}function dan(n){return n===be.EQUALS_SIGN||mae(n)}function rAe(n){return rKe(n)||n===be.SOLIDUS||n===be.GREATER_THAN_SIGN}class han{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=xe.DATA,this.returnState=xe.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Qsn(t),this.currentLocation=this.getCurrentLocation(-1)}_err(e){var t,i;(i=(t=this.handler).onParseError)===null||i===void 0||i.call(t,this.preprocessor.getError(e))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,t,i){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this._unconsume(this.consumedAfterSnapshot),this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(e){this.consumedAfterSnapshot-=e,this.preprocessor.retreat(e)}_reconsumeInState(e,t){this.state=e,this._callState(t)}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Ao.START_TAG,tagName:"",tagID:$.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ao.END_TAG,tagName:"",tagID:$.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Ao.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Ao.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,t;const i=this.currentToken;if(Zqe(i,this.currentAttr.name)===null){if(i.attrs.push(this.currentAttr),i.location&&this.currentLocation){const r=(e=(t=i.location).attrs)!==null&&e!==void 0?e:t.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Vt.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=KN(e.tagName),e.type===Ao.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(Vt.endTagWithAttributes),e.selfClosing&&this._err(Vt.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Ao.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ao.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ao.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Ao.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type!==e)this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();else{this.currentCharacterToken.chars+=t;return}this._createCharacterToken(e,t)}_emitCodePoint(e){const t=rKe(e)?Ao.WHITESPACE_CHARACTER:e===be.NULL?Ao.NULL_CHARACTER:Ao.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Ao.CHARACTER,e)}_matchNamedCharacterReference(e){let t=null,i=0,r=!1;for(let o=0,s=hC[0];o>=0&&(o=eKe(hC,s,o+1,e),!(o<0));e=this._consume()){i+=1,s=hC[o];const a=s&Db.VALUE_LENGTH;if(a){const l=(a>>14)-1;if(e!==be.SEMICOLON&&this._isCharacterReferenceInAttribute()&&dan(this.preprocessor.peek(1))?(t=[be.AMPERSAND],o+=l):(t=l===0?[hC[o]&~Db.VALUE_LENGTH]:l===1?[hC[++o]]:[hC[++o],hC[++o]],i=0,r=e!==be.SEMICOLON),l===0){this._consume();break}}}return this._unconsume(i),r&&!this.preprocessor.endOfChunkHit&&this._err(Vt.missingSemicolonAfterCharacterReference),this._unconsume(1),t}_isCharacterReferenceInAttribute(){return this.returnState===xe.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===xe.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===xe.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case xe.DATA:{this._stateData(e);break}case xe.RCDATA:{this._stateRcdata(e);break}case xe.RAWTEXT:{this._stateRawtext(e);break}case xe.SCRIPT_DATA:{this._stateScriptData(e);break}case xe.PLAINTEXT:{this._statePlaintext(e);break}case xe.TAG_OPEN:{this._stateTagOpen(e);break}case xe.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case xe.TAG_NAME:{this._stateTagName(e);break}case xe.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case xe.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case xe.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case xe.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case xe.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case xe.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case xe.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case xe.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case xe.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case xe.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case xe.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case xe.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case xe.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case xe.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case xe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case xe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case xe.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case xe.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case xe.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case xe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case xe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case xe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case xe.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case xe.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case xe.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case xe.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case xe.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case xe.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case xe.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case xe.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case xe.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case xe.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case xe.BOGUS_COMMENT:{this._stateBogusComment(e);break}case xe.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case xe.COMMENT_START:{this._stateCommentStart(e);break}case xe.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case xe.COMMENT:{this._stateComment(e);break}case xe.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case xe.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case xe.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case xe.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case xe.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case xe.COMMENT_END:{this._stateCommentEnd(e);break}case xe.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case xe.DOCTYPE:{this._stateDoctype(e);break}case xe.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case xe.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case xe.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case xe.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case xe.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case xe.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case xe.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case xe.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case xe.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case xe.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case xe.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case xe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case xe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case xe.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case xe.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case xe.CDATA_SECTION:{this._stateCdataSection(e);break}case xe.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case xe.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case xe.CHARACTER_REFERENCE:{this._stateCharacterReference(e);break}case xe.NAMED_CHARACTER_REFERENCE:{this._stateNamedCharacterReference(e);break}case xe.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}case xe.NUMERIC_CHARACTER_REFERENCE:{this._stateNumericCharacterReference(e);break}case xe.HEXADEMICAL_CHARACTER_REFERENCE_START:{this._stateHexademicalCharacterReferenceStart(e);break}case xe.HEXADEMICAL_CHARACTER_REFERENCE:{this._stateHexademicalCharacterReference(e);break}case xe.DECIMAL_CHARACTER_REFERENCE:{this._stateDecimalCharacterReference(e);break}case xe.NUMERIC_CHARACTER_REFERENCE_END:{this._stateNumericCharacterReferenceEnd(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case be.LESS_THAN_SIGN:{this.state=xe.TAG_OPEN;break}case be.AMPERSAND:{this.returnState=xe.DATA,this.state=xe.CHARACTER_REFERENCE;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._emitCodePoint(e);break}case be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case be.AMPERSAND:{this.returnState=xe.RCDATA,this.state=xe.CHARACTER_REFERENCE;break}case be.LESS_THAN_SIGN:{this.state=xe.RCDATA_LESS_THAN_SIGN;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._emitChars(bl);break}case be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case be.LESS_THAN_SIGN:{this.state=xe.RAWTEXT_LESS_THAN_SIGN;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._emitChars(bl);break}case be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case be.LESS_THAN_SIGN:{this.state=xe.SCRIPT_DATA_LESS_THAN_SIGN;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._emitChars(bl);break}case be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._emitChars(bl);break}case be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(fC(e))this._createStartTagToken(),this.state=xe.TAG_NAME,this._stateTagName(e);else switch(e){case be.EXCLAMATION_MARK:{this.state=xe.MARKUP_DECLARATION_OPEN;break}case be.SOLIDUS:{this.state=xe.END_TAG_OPEN;break}case be.QUESTION_MARK:{this._err(Vt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=xe.BOGUS_COMMENT,this._stateBogusComment(e);break}case be.EOF:{this._err(Vt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Vt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=xe.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(fC(e))this._createEndTagToken(),this.state=xe.TAG_NAME,this._stateTagName(e);else switch(e){case be.GREATER_THAN_SIGN:{this._err(Vt.missingEndTagName),this.state=xe.DATA;break}case be.EOF:{this._err(Vt.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Vt.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=xe.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this.state=xe.BEFORE_ATTRIBUTE_NAME;break}case be.SOLIDUS:{this.state=xe.SELF_CLOSING_START_TAG;break}case be.GREATER_THAN_SIGN:{this.state=xe.DATA,this.emitCurrentTagToken();break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.tagName+=bl;break}case be.EOF:{this._err(Vt.eofInTag),this._emitEOFToken();break}default:t.tagName+=String.fromCodePoint(cP(e)?o9(e):e)}}_stateRcdataLessThanSign(e){e===be.SOLIDUS?this.state=xe.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=xe.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){fC(e)?(this.state=xe.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=xe.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=xe.BEFORE_ATTRIBUTE_NAME,!1;case be.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=xe.SELF_CLOSING_START_TAG,!1;case be.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=xe.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=xe.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===be.SOLIDUS?this.state=xe.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=xe.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){fC(e)?(this.state=xe.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=xe.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=xe.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case be.SOLIDUS:{this.state=xe.SCRIPT_DATA_END_TAG_OPEN;break}case be.EXCLAMATION_MARK:{this.state=xe.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=xe.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){fC(e)?(this.state=xe.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=xe.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=xe.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===be.HYPHEN_MINUS?(this.state=xe.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=xe.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===be.HYPHEN_MINUS?(this.state=xe.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=xe.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case be.HYPHEN_MINUS:{this.state=xe.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case be.LESS_THAN_SIGN:{this.state=xe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._emitChars(bl);break}case be.EOF:{this._err(Vt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case be.HYPHEN_MINUS:{this.state=xe.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case be.LESS_THAN_SIGN:{this.state=xe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.state=xe.SCRIPT_DATA_ESCAPED,this._emitChars(bl);break}case be.EOF:{this._err(Vt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=xe.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case be.HYPHEN_MINUS:{this._emitChars("-");break}case be.LESS_THAN_SIGN:{this.state=xe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case be.GREATER_THAN_SIGN:{this.state=xe.SCRIPT_DATA,this._emitChars(">");break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.state=xe.SCRIPT_DATA_ESCAPED,this._emitChars(bl);break}case be.EOF:{this._err(Vt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=xe.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===be.SOLIDUS?this.state=xe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:fC(e)?(this._emitChars("<"),this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=xe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){fC(e)?(this.state=xe.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=xe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=xe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(df.SCRIPT,!1)&&rAe(this.preprocessor.peek(df.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<df.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=xe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case be.HYPHEN_MINUS:{this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case be.LESS_THAN_SIGN:{this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._emitChars(bl);break}case be.EOF:{this._err(Vt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case be.HYPHEN_MINUS:{this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case be.LESS_THAN_SIGN:{this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bl);break}case be.EOF:{this._err(Vt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case be.HYPHEN_MINUS:{this._emitChars("-");break}case be.LESS_THAN_SIGN:{this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case be.GREATER_THAN_SIGN:{this.state=xe.SCRIPT_DATA,this._emitChars(">");break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bl);break}case be.EOF:{this._err(Vt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===be.SOLIDUS?(this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(df.SCRIPT,!1)&&rAe(this.preprocessor.peek(df.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<df.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=xe.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=xe.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.SOLIDUS:case be.GREATER_THAN_SIGN:case be.EOF:{this.state=xe.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case be.EQUALS_SIGN:{this._err(Vt.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=xe.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=xe.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:case be.SOLIDUS:case be.GREATER_THAN_SIGN:case be.EOF:{this._leaveAttrName(),this.state=xe.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case be.EQUALS_SIGN:{this._leaveAttrName(),this.state=xe.BEFORE_ATTRIBUTE_VALUE;break}case be.QUOTATION_MARK:case be.APOSTROPHE:case be.LESS_THAN_SIGN:{this._err(Vt.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.currentAttr.name+=bl;break}default:this.currentAttr.name+=String.fromCodePoint(cP(e)?o9(e):e)}}_stateAfterAttributeName(e){switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.SOLIDUS:{this.state=xe.SELF_CLOSING_START_TAG;break}case be.EQUALS_SIGN:{this.state=xe.BEFORE_ATTRIBUTE_VALUE;break}case be.GREATER_THAN_SIGN:{this.state=xe.DATA,this.emitCurrentTagToken();break}case be.EOF:{this._err(Vt.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=xe.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.QUOTATION_MARK:{this.state=xe.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case be.APOSTROPHE:{this.state=xe.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case be.GREATER_THAN_SIGN:{this._err(Vt.missingAttributeValue),this.state=xe.DATA,this.emitCurrentTagToken();break}default:this.state=xe.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case be.QUOTATION_MARK:{this.state=xe.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case be.AMPERSAND:{this.returnState=xe.ATTRIBUTE_VALUE_DOUBLE_QUOTED,this.state=xe.CHARACTER_REFERENCE;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.currentAttr.value+=bl;break}case be.EOF:{this._err(Vt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case be.APOSTROPHE:{this.state=xe.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case be.AMPERSAND:{this.returnState=xe.ATTRIBUTE_VALUE_SINGLE_QUOTED,this.state=xe.CHARACTER_REFERENCE;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.currentAttr.value+=bl;break}case be.EOF:{this._err(Vt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this._leaveAttrValue(),this.state=xe.BEFORE_ATTRIBUTE_NAME;break}case be.AMPERSAND:{this.returnState=xe.ATTRIBUTE_VALUE_UNQUOTED,this.state=xe.CHARACTER_REFERENCE;break}case be.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=xe.DATA,this.emitCurrentTagToken();break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),this.currentAttr.value+=bl;break}case be.QUOTATION_MARK:case be.APOSTROPHE:case be.LESS_THAN_SIGN:case be.EQUALS_SIGN:case be.GRAVE_ACCENT:{this._err(Vt.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case be.EOF:{this._err(Vt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this._leaveAttrValue(),this.state=xe.BEFORE_ATTRIBUTE_NAME;break}case be.SOLIDUS:{this._leaveAttrValue(),this.state=xe.SELF_CLOSING_START_TAG;break}case be.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=xe.DATA,this.emitCurrentTagToken();break}case be.EOF:{this._err(Vt.eofInTag),this._emitEOFToken();break}default:this._err(Vt.missingWhitespaceBetweenAttributes),this.state=xe.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case be.GREATER_THAN_SIGN:{const t=this.currentToken;t.selfClosing=!0,this.state=xe.DATA,this.emitCurrentTagToken();break}case be.EOF:{this._err(Vt.eofInTag),this._emitEOFToken();break}default:this._err(Vt.unexpectedSolidusInTag),this.state=xe.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const t=this.currentToken;switch(e){case be.GREATER_THAN_SIGN:{this.state=xe.DATA,this.emitCurrentComment(t);break}case be.EOF:{this.emitCurrentComment(t),this._emitEOFToken();break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.data+=bl;break}default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(df.DASH_DASH,!0)?(this._createCommentToken(df.DASH_DASH.length+1),this.state=xe.COMMENT_START):this._consumeSequenceIfMatch(df.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(df.DOCTYPE.length+1),this.state=xe.DOCTYPE):this._consumeSequenceIfMatch(df.CDATA_START,!0)?this.inForeignNode?this.state=xe.CDATA_SECTION:(this._err(Vt.cdataInHtmlContent),this._createCommentToken(df.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=xe.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Vt.incorrectlyOpenedComment),this._createCommentToken(2),this.state=xe.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case be.HYPHEN_MINUS:{this.state=xe.COMMENT_START_DASH;break}case be.GREATER_THAN_SIGN:{this._err(Vt.abruptClosingOfEmptyComment),this.state=xe.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=xe.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case be.HYPHEN_MINUS:{this.state=xe.COMMENT_END;break}case be.GREATER_THAN_SIGN:{this._err(Vt.abruptClosingOfEmptyComment),this.state=xe.DATA,this.emitCurrentComment(t);break}case be.EOF:{this._err(Vt.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=xe.COMMENT,this._stateComment(e)}}_stateComment(e){const t=this.currentToken;switch(e){case be.HYPHEN_MINUS:{this.state=xe.COMMENT_END_DASH;break}case be.LESS_THAN_SIGN:{t.data+="<",this.state=xe.COMMENT_LESS_THAN_SIGN;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.data+=bl;break}case be.EOF:{this._err(Vt.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case be.EXCLAMATION_MARK:{t.data+="!",this.state=xe.COMMENT_LESS_THAN_SIGN_BANG;break}case be.LESS_THAN_SIGN:{t.data+="<";break}default:this.state=xe.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===be.HYPHEN_MINUS?this.state=xe.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=xe.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===be.HYPHEN_MINUS?this.state=xe.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=xe.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==be.GREATER_THAN_SIGN&&e!==be.EOF&&this._err(Vt.nestedComment),this.state=xe.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case be.HYPHEN_MINUS:{this.state=xe.COMMENT_END;break}case be.EOF:{this._err(Vt.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=xe.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case be.GREATER_THAN_SIGN:{this.state=xe.DATA,this.emitCurrentComment(t);break}case be.EXCLAMATION_MARK:{this.state=xe.COMMENT_END_BANG;break}case be.HYPHEN_MINUS:{t.data+="-";break}case be.EOF:{this._err(Vt.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--",this.state=xe.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case be.HYPHEN_MINUS:{t.data+="--!",this.state=xe.COMMENT_END_DASH;break}case be.GREATER_THAN_SIGN:{this._err(Vt.incorrectlyClosedComment),this.state=xe.DATA,this.emitCurrentComment(t);break}case be.EOF:{this._err(Vt.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--!",this.state=xe.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this.state=xe.BEFORE_DOCTYPE_NAME;break}case be.GREATER_THAN_SIGN:{this.state=xe.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case be.EOF:{this._err(Vt.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.missingWhitespaceBeforeDoctypeName),this.state=xe.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(cP(e))this._createDoctypeToken(String.fromCharCode(o9(e))),this.state=xe.DOCTYPE_NAME;else switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.NULL:{this._err(Vt.unexpectedNullCharacter),this._createDoctypeToken(bl),this.state=xe.DOCTYPE_NAME;break}case be.GREATER_THAN_SIGN:{this._err(Vt.missingDoctypeName),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.EOF:{this._err(Vt.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=xe.DOCTYPE_NAME}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this.state=xe.AFTER_DOCTYPE_NAME;break}case be.GREATER_THAN_SIGN:{this.state=xe.DATA,this.emitCurrentDoctype(t);break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.name+=bl;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.name+=String.fromCodePoint(cP(e)?o9(e):e)}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.GREATER_THAN_SIGN:{this.state=xe.DATA,this.emitCurrentDoctype(t);break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(df.PUBLIC,!1)?this.state=xe.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(df.SYSTEM,!1)?this.state=xe.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Vt.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this.state=xe.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case be.QUOTATION_MARK:{this._err(Vt.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=xe.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case be.APOSTROPHE:{this._err(Vt.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=xe.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case be.GREATER_THAN_SIGN:{this._err(Vt.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=xe.DATA,this.emitCurrentDoctype(t);break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.QUOTATION_MARK:{t.publicId="",this.state=xe.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case be.APOSTROPHE:{t.publicId="",this.state=xe.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case be.GREATER_THAN_SIGN:{this._err(Vt.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=xe.DATA,this.emitCurrentDoctype(t);break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case be.QUOTATION_MARK:{this.state=xe.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.publicId+=bl;break}case be.GREATER_THAN_SIGN:{this._err(Vt.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case be.APOSTROPHE:{this.state=xe.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.publicId+=bl;break}case be.GREATER_THAN_SIGN:{this._err(Vt.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this.state=xe.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case be.GREATER_THAN_SIGN:{this.state=xe.DATA,this.emitCurrentDoctype(t);break}case be.QUOTATION_MARK:{this._err(Vt.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case be.APOSTROPHE:{this._err(Vt.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.QUOTATION_MARK:{t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case be.APOSTROPHE:{t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:{this.state=xe.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case be.QUOTATION_MARK:{this._err(Vt.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case be.APOSTROPHE:{this._err(Vt.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case be.GREATER_THAN_SIGN:{this._err(Vt.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=xe.DATA,this.emitCurrentDoctype(t);break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.QUOTATION_MARK:{t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case be.APOSTROPHE:{t.systemId="",this.state=xe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case be.GREATER_THAN_SIGN:{this._err(Vt.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=xe.DATA,this.emitCurrentDoctype(t);break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case be.QUOTATION_MARK:{this.state=xe.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.systemId+=bl;break}case be.GREATER_THAN_SIGN:{this._err(Vt.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case be.APOSTROPHE:{this.state=xe.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter),t.systemId+=bl;break}case be.GREATER_THAN_SIGN:{this._err(Vt.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case be.SPACE:case be.LINE_FEED:case be.TABULATION:case be.FORM_FEED:break;case be.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.EOF:{this._err(Vt.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Vt.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=xe.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case be.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=xe.DATA;break}case be.NULL:{this._err(Vt.unexpectedNullCharacter);break}case be.EOF:{this.emitCurrentDoctype(t),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case be.RIGHT_SQUARE_BRACKET:{this.state=xe.CDATA_SECTION_BRACKET;break}case be.EOF:{this._err(Vt.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===be.RIGHT_SQUARE_BRACKET?this.state=xe.CDATA_SECTION_END:(this._emitChars("]"),this.state=xe.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case be.GREATER_THAN_SIGN:{this.state=xe.DATA;break}case be.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=xe.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(e){e===be.NUMBER_SIGN?this.state=xe.NUMERIC_CHARACTER_REFERENCE:mae(e)?(this.state=xe.NAMED_CHARACTER_REFERENCE,this._stateNamedCharacterReference(e)):(this._flushCodePointConsumedAsCharacterReference(be.AMPERSAND),this._reconsumeInState(this.returnState,e))}_stateNamedCharacterReference(e){const t=this._matchNamedCharacterReference(e);if(!this._ensureHibernation())if(t){for(let i=0;i<t.length;i++)this._flushCodePointConsumedAsCharacterReference(t[i]);this.state=this.returnState}else this._flushCodePointConsumedAsCharacterReference(be.AMPERSAND),this.state=xe.AMBIGUOUS_AMPERSAND}_stateAmbiguousAmpersand(e){mae(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===be.SEMICOLON&&this._err(Vt.unknownNamedCharacterReference),this._reconsumeInState(this.returnState,e))}_stateNumericCharacterReference(e){this.charRefCode=0,e===be.LATIN_SMALL_X||e===be.LATIN_CAPITAL_X?this.state=xe.HEXADEMICAL_CHARACTER_REFERENCE_START:pM(e)?(this.state=xe.DECIMAL_CHARACTER_REFERENCE,this._stateDecimalCharacterReference(e)):(this._err(Vt.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(be.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(be.NUMBER_SIGN),this._reconsumeInState(this.returnState,e))}_stateHexademicalCharacterReferenceStart(e){uan(e)?(this.state=xe.HEXADEMICAL_CHARACTER_REFERENCE,this._stateHexademicalCharacterReference(e)):(this._err(Vt.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(be.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(be.NUMBER_SIGN),this._unconsume(2),this.state=this.returnState)}_stateHexademicalCharacterReference(e){nKe(e)?this.charRefCode=this.charRefCode*16+e-55:iKe(e)?this.charRefCode=this.charRefCode*16+e-87:pM(e)?this.charRefCode=this.charRefCode*16+e-48:e===be.SEMICOLON?this.state=xe.NUMERIC_CHARACTER_REFERENCE_END:(this._err(Vt.missingSemicolonAfterCharacterReference),this.state=xe.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e))}_stateDecimalCharacterReference(e){pM(e)?this.charRefCode=this.charRefCode*10+e-48:e===be.SEMICOLON?this.state=xe.NUMERIC_CHARACTER_REFERENCE_END:(this._err(Vt.missingSemicolonAfterCharacterReference),this.state=xe.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e))}_stateNumericCharacterReferenceEnd(e){if(this.charRefCode===be.NULL)this._err(Vt.nullCharacterReference),this.charRefCode=be.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(Vt.characterReferenceOutsideUnicodeRange),this.charRefCode=be.REPLACEMENT_CHARACTER;else if(Yqe(this.charRefCode))this._err(Vt.surrogateCharacterReference),this.charRefCode=be.REPLACEMENT_CHARACTER;else if(Xqe(this.charRefCode))this._err(Vt.noncharacterCharacterReference);else if(Qqe(this.charRefCode)||this.charRefCode===be.CARRIAGE_RETURN){this._err(Vt.controlCharacterReference);const t=lan.get(this.charRefCode);t!==void 0&&(this.charRefCode=t)}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,e)}}const oKe=new Set([$.DD,$.DT,$.LI,$.OPTGROUP,$.OPTION,$.P,$.RB,$.RP,$.RT,$.RTC]),oAe=new Set([...oKe,$.CAPTION,$.COLGROUP,$.TBODY,$.TD,$.TFOOT,$.TH,$.THEAD,$.TR]),s9=new Map([[$.APPLET,en.HTML],[$.CAPTION,en.HTML],[$.HTML,en.HTML],[$.MARQUEE,en.HTML],[$.OBJECT,en.HTML],[$.TABLE,en.HTML],[$.TD,en.HTML],[$.TEMPLATE,en.HTML],[$.TH,en.HTML],[$.ANNOTATION_XML,en.MATHML],[$.MI,en.MATHML],[$.MN,en.MATHML],[$.MO,en.MATHML],[$.MS,en.MATHML],[$.MTEXT,en.MATHML],[$.DESC,en.SVG],[$.FOREIGN_OBJECT,en.SVG],[$.TITLE,en.SVG]]),fan=[$.H1,$.H2,$.H3,$.H4,$.H5,$.H6],pan=[$.TR,$.TEMPLATE,$.HTML],gan=[$.TBODY,$.TFOOT,$.THEAD,$.TEMPLATE,$.HTML],man=[$.TABLE,$.TEMPLATE,$.HTML],_an=[$.TD,$.TH];class van{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,i){this.treeAdapter=t,this.handler=i,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=$.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===$.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===en.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const i=this._indexOf(e);this.items[i]=t,i===this.stackTop&&(this.current=t)}insertAfter(e,t,i){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==en.HTML);this.shortenToLength(t<0?0:t)}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){const t=this._indexOf(e);this.shortenToLength(t<0?0:t)}popUntilPopped(e,t){const i=this._indexOfTagNames(e,t);this.shortenToLength(i<0?0:i)}popUntilNumberedHeaderPopped(){this.popUntilPopped(fan,en.HTML)}popUntilTableCellPopped(){this.popUntilPopped(_an,en.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let i=this.stackTop;i>=0;i--)if(e.includes(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===t)return i;return-1}clearBackTo(e,t){const i=this._indexOfTagNames(e,t);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(man,en.HTML)}clearBackToTableBodyContext(){this.clearBackTo(gan,en.HTML)}clearBackToTableRowContext(){this.clearBackTo(pan,en.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===$.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===$.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(i===e&&r===en.HTML)return!0;if(s9.get(i)===r)return!1}return!0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e],i=this.treeAdapter.getNamespaceURI(this.items[e]);if(tKe(t)&&i===en.HTML)return!0;if(s9.get(t)===i)return!1}return!0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(i===e&&r===en.HTML)return!0;if((i===$.UL||i===$.OL)&&r===en.HTML||s9.get(i)===r)return!1}return!0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(i===e&&r===en.HTML)return!0;if(i===$.BUTTON&&r===en.HTML||s9.get(i)===r)return!1}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===en.HTML){if(i===e)return!0;if(i===$.TABLE||i===$.TEMPLATE||i===$.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];if(this.treeAdapter.getNamespaceURI(this.items[e])===en.HTML){if(t===$.TBODY||t===$.THEAD||t===$.TFOOT)return!0;if(t===$.TABLE||t===$.HTML)return!1}}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===en.HTML){if(i===e)return!0;if(i!==$.OPTION&&i!==$.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;oKe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;oAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==e&&oAe.has(this.currentTagId);)this.pop()}}const see=3;var $_;(function(n){n[n.Marker=0]="Marker",n[n.Element=1]="Element"})($_=$_||($_={}));const sAe={type:$_.Marker};class ban{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const i=[],r=t.length,o=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let a=0;a<this.entries.length;a++){const l=this.entries[a];if(l.type===$_.Marker)break;const{element:c}=l;if(this.treeAdapter.getTagName(c)===o&&this.treeAdapter.getNamespaceURI(c)===s){const u=this.treeAdapter.getAttrList(c);u.length===r&&i.push({idx:a,attrs:u})}}return i}_ensureNoahArkCondition(e){if(this.entries.length<see)return;const t=this.treeAdapter.getAttrList(e),i=this._getNoahArkConditionCandidates(e,t);if(i.length<see)return;const r=new Map(t.map(s=>[s.name,s.value]));let o=0;for(let s=0;s<i.length;s++){const a=i[s];a.attrs.every(l=>r.get(l.name)===l.value)&&(o+=1,o>=see&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(sAe)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:$_.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:$_.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);t>=0&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(sAe);e>=0?this.entries.splice(0,e+1):this.entries.length=0}getElementEntryInScopeWithTagName(e){const t=this.entries.find(i=>i.type===$_.Marker||this.treeAdapter.getTagName(i.element)===e);return t&&t.type===$_.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===$_.Element&&t.element===e)}}function aAe(n){return{nodeName:"#text",value:n,parentNode:null}}const S2={createDocument(){return{nodeName:"#document",mode:Pp.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(n,e,t){return{nodeName:n,tagName:n,attrs:t,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(n){return{nodeName:"#comment",data:n,parentNode:null}},appendChild(n,e){n.childNodes.push(e),e.parentNode=n},insertBefore(n,e,t){const i=n.childNodes.indexOf(t);n.childNodes.splice(i,0,e),e.parentNode=n},setTemplateContent(n,e){n.content=e},getTemplateContent(n){return n.content},setDocumentType(n,e,t,i){const r=n.childNodes.find(o=>o.nodeName==="#documentType");if(r)r.name=e,r.publicId=t,r.systemId=i;else{const o={nodeName:"#documentType",name:e,publicId:t,systemId:i,parentNode:null};S2.appendChild(n,o)}},setDocumentMode(n,e){n.mode=e},getDocumentMode(n){return n.mode},detachNode(n){if(n.parentNode){const e=n.parentNode.childNodes.indexOf(n);n.parentNode.childNodes.splice(e,1),n.parentNode=null}},insertText(n,e){if(n.childNodes.length>0){const t=n.childNodes[n.childNodes.length-1];if(S2.isTextNode(t)){t.value+=e;return}}S2.appendChild(n,aAe(e))},insertTextBefore(n,e,t){const i=n.childNodes[n.childNodes.indexOf(t)-1];i&&S2.isTextNode(i)?i.value+=e:S2.insertBefore(n,aAe(e),t)},adoptAttributes(n,e){const t=new Set(n.attrs.map(i=>i.name));for(let i=0;i<e.length;i++)t.has(e[i].name)||n.attrs.push(e[i])},getFirstChild(n){return n.childNodes[0]},getChildNodes(n){return n.childNodes},getParentNode(n){return n.parentNode},getAttrList(n){return n.attrs},getTagName(n){return n.tagName},getNamespaceURI(n){return n.namespaceURI},getTextNodeContent(n){return n.value},getCommentNodeContent(n){return n.data},getDocumentTypeNodeName(n){return n.name},getDocumentTypeNodePublicId(n){return n.publicId},getDocumentTypeNodeSystemId(n){return n.systemId},isTextNode(n){return n.nodeName==="#text"},isCommentNode(n){return n.nodeName==="#comment"},isDocumentTypeNode(n){return n.nodeName==="#documentType"},isElementNode(n){return Object.prototype.hasOwnProperty.call(n,"tagName")},setNodeSourceCodeLocation(n,e){n.sourceCodeLocation=e},getNodeSourceCodeLocation(n){return n.sourceCodeLocation},updateNodeSourceCodeLocation(n,e){n.sourceCodeLocation={...n.sourceCodeLocation,...e}}},sKe="html",yan="about:legacy-compat",Can="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",aKe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],wan=[...aKe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],San=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),lKe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Ean=[...lKe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function lAe(n,e){return e.some(t=>n.startsWith(t))}function xan(n){return n.name===sKe&&n.publicId===null&&(n.systemId===null||n.systemId===yan)}function Tan(n){if(n.name!==sKe)return Pp.QUIRKS;const{systemId:e}=n;if(e&&e.toLowerCase()===Can)return Pp.QUIRKS;let{publicId:t}=n;if(t!==null){if(t=t.toLowerCase(),San.has(t))return Pp.QUIRKS;let i=e===null?wan:aKe;if(lAe(t,i))return Pp.QUIRKS;if(i=e===null?lKe:Ean,lAe(t,i))return Pp.LIMITED_QUIRKS}return Pp.NO_QUIRKS}const cAe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},kan="definitionurl",Ian="definitionURL",Lan=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(n=>[n.toLowerCase(),n])),Dan=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:en.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:en.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:en.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:en.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:en.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:en.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:en.XLINK}],["xml:base",{prefix:"xml",name:"base",namespace:en.XML}],["xml:lang",{prefix:"xml",name:"lang",namespace:en.XML}],["xml:space",{prefix:"xml",name:"space",namespace:en.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:en.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:en.XMLNS}]]),Aan=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(n=>[n.toLowerCase(),n])),Nan=new Set([$.B,$.BIG,$.BLOCKQUOTE,$.BODY,$.BR,$.CENTER,$.CODE,$.DD,$.DIV,$.DL,$.DT,$.EM,$.EMBED,$.H1,$.H2,$.H3,$.H4,$.H5,$.H6,$.HEAD,$.HR,$.I,$.IMG,$.LI,$.LISTING,$.MENU,$.META,$.NOBR,$.OL,$.P,$.PRE,$.RUBY,$.S,$.SMALL,$.SPAN,$.STRONG,$.STRIKE,$.SUB,$.SUP,$.TABLE,$.TT,$.U,$.UL,$.VAR]);function Ran(n){const e=n.tagID;return e===$.FONT&&n.attrs.some(({name:i})=>i===Iw.COLOR||i===Iw.SIZE||i===Iw.FACE)||Nan.has(e)}function cKe(n){for(let e=0;e<n.attrs.length;e++)if(n.attrs[e].name===kan){n.attrs[e].name=Ian;break}}function uKe(n){for(let e=0;e<n.attrs.length;e++){const t=Lan.get(n.attrs[e].name);t!=null&&(n.attrs[e].name=t)}}function rbe(n){for(let e=0;e<n.attrs.length;e++){const t=Dan.get(n.attrs[e].name);t&&(n.attrs[e].prefix=t.prefix,n.attrs[e].name=t.name,n.attrs[e].namespace=t.namespace)}}function Oan(n){const e=Aan.get(n.tagName);e!=null&&(n.tagName=e,n.tagID=KN(n.tagName))}function Pan(n,e){return e===en.MATHML&&(n===$.MI||n===$.MO||n===$.MN||n===$.MS||n===$.MTEXT)}function Man(n,e,t){if(e===en.MATHML&&n===$.ANNOTATION_XML){for(let i=0;i<t.length;i++)if(t[i].name===Iw.ENCODING){const r=t[i].value.toLowerCase();return r===cAe.TEXT_HTML||r===cAe.APPLICATION_XML}}return e===en.SVG&&(n===$.FOREIGN_OBJECT||n===$.DESC||n===$.TITLE)}function Fan(n,e,t,i){return(!i||i===en.HTML)&&Man(n,e,t)||(!i||i===en.MATHML)&&Pan(n,e)}const Ban="hidden",$an=8,Van=3;var $e;(function(n){n[n.INITIAL=0]="INITIAL",n[n.BEFORE_HTML=1]="BEFORE_HTML",n[n.BEFORE_HEAD=2]="BEFORE_HEAD",n[n.IN_HEAD=3]="IN_HEAD",n[n.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",n[n.AFTER_HEAD=5]="AFTER_HEAD",n[n.IN_BODY=6]="IN_BODY",n[n.TEXT=7]="TEXT",n[n.IN_TABLE=8]="IN_TABLE",n[n.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",n[n.IN_CAPTION=10]="IN_CAPTION",n[n.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",n[n.IN_TABLE_BODY=12]="IN_TABLE_BODY",n[n.IN_ROW=13]="IN_ROW",n[n.IN_CELL=14]="IN_CELL",n[n.IN_SELECT=15]="IN_SELECT",n[n.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",n[n.IN_TEMPLATE=17]="IN_TEMPLATE",n[n.AFTER_BODY=18]="AFTER_BODY",n[n.IN_FRAMESET=19]="IN_FRAMESET",n[n.AFTER_FRAMESET=20]="AFTER_FRAMESET",n[n.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",n[n.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})($e||($e={}));const Han={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},dKe=new Set([$.TABLE,$.TBODY,$.TFOOT,$.THEAD,$.TR]),uAe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:S2,onParseError:null};let dAe=class{constructor(e,t,i=null,r=null){this.fragmentContext=i,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=$e.INITIAL,this.originalInsertionMode=$e.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...uAe,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new han(this.options,this),this.activeFormattingElements=new ban(this.treeAdapter),this.fragmentContextID=i?KN(this.treeAdapter.getTagName(i)):$.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new van(this.document,this.treeAdapter,this)}static parse(e,t){const i=new this(t);return i.tokenizer.write(e,!0),i.document}static getFragmentParser(e,t){const i={...uAe,...t};e??(e=i.treeAdapter.createElement(ht.TEMPLATE,en.HTML,[]));const r=i.treeAdapter.createElement("documentmock",en.HTML,[]),o=new this(i,r,e);return o.fragmentContextID===$.TEMPLATE&&o.tmplInsertionModeStack.unshift($e.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,i){var r;if(!this.onParseError)return;const o=(r=e.location)!==null&&r!==void 0?r:Han,s={code:t,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:i?o.startLine:o.endLine,endCol:i?o.startCol:o.endCol,endOffset:i?o.startOffset:o.endOffset};this.onParseError(s)}onItemPush(e,t,i){var r,o;(o=(r=this.treeAdapter).onItemPush)===null||o===void 0||o.call(r,e),i&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,e,this.openElements.current),t){let o,s;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,s=this.fragmentContextID):{current:o,currentTagId:s}=this.openElements,this._setContextModes(o,s)}}_setContextModes(e,t){const i=e===this.document||this.treeAdapter.getNamespaceURI(e)===en.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,en.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$e.TEXT}switchToPlaintextParsing(){this.insertionMode=$e.TEXT,this.originalInsertionMode=$e.IN_BODY,this.tokenizer.state=Sc.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===ht.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==en.HTML))switch(this.fragmentContextID){case $.TITLE:case $.TEXTAREA:{this.tokenizer.state=Sc.RCDATA;break}case $.STYLE:case $.XMP:case $.IFRAME:case $.NOEMBED:case $.NOFRAMES:case $.NOSCRIPT:{this.tokenizer.state=Sc.RAWTEXT;break}case $.SCRIPT:{this.tokenizer.state=Sc.SCRIPT_DATA;break}case $.PLAINTEXT:{this.tokenizer.state=Sc.PLAINTEXT;break}}}_setDocumentType(e){const t=e.name||"",i=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,i,r),e.location){const s=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));s&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const i=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i,e)}}_appendElement(e,t){const i=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(i,e.location)}_insertElement(e,t){const i=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(i,e.location),this.openElements.push(i,e.tagID)}_insertFakeElement(e,t){const i=this.treeAdapter.createElement(e,en.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,en.HTML,e.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,i),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(ht.HTML,en.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,$.HTML)}_appendCommentNode(e,t){const i=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_insertCharacters(e){let t,i;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(t,e.chars,i):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),o=i?r.lastIndexOf(i):r.length,s=r[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:c,endOffset:u}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:c,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}_adoptNodes(e,t){for(let i=this.treeAdapter.getFirstChild(e);i;i=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(t,i)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const i=t.location,r=this.treeAdapter.getTagName(e),o=t.type===Ao.END_TAG&&r===t.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,o)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,i;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,i=this.fragmentContextID):{current:t,currentTagId:i}=this.openElements,e.tagID===$.SVG&&this.treeAdapter.getTagName(t)===ht.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===en.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===$.MGLYPH||e.tagID===$.MALIGNMARK)&&!this._isIntegrationPoint(i,t,en.HTML)}_processToken(e){switch(e.type){case Ao.CHARACTER:{this.onCharacter(e);break}case Ao.NULL_CHARACTER:{this.onNullCharacter(e);break}case Ao.COMMENT:{this.onComment(e);break}case Ao.DOCTYPE:{this.onDoctype(e);break}case Ao.START_TAG:{this._processStartTag(e);break}case Ao.END_TAG:{this.onEndTag(e);break}case Ao.EOF:{this.onEof(e);break}case Ao.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,t,i){const r=this.treeAdapter.getNamespaceURI(t),o=this.treeAdapter.getAttrList(t);return Fan(e,r,o,i)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(r=>r.type===$_.Marker||this.openElements.contains(r.element)),i=t<0?e-1:t-1;for(let r=i;r>=0;r--){const o=this.activeFormattingElements.entries[r];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$e.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion($.P),this.openElements.popUntilTagNamePopped($.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case $.TR:{this.insertionMode=$e.IN_ROW;return}case $.TBODY:case $.THEAD:case $.TFOOT:{this.insertionMode=$e.IN_TABLE_BODY;return}case $.CAPTION:{this.insertionMode=$e.IN_CAPTION;return}case $.COLGROUP:{this.insertionMode=$e.IN_COLUMN_GROUP;return}case $.TABLE:{this.insertionMode=$e.IN_TABLE;return}case $.BODY:{this.insertionMode=$e.IN_BODY;return}case $.FRAMESET:{this.insertionMode=$e.IN_FRAMESET;return}case $.SELECT:{this._resetInsertionModeForSelect(e);return}case $.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case $.HTML:{this.insertionMode=this.headElement?$e.AFTER_HEAD:$e.BEFORE_HEAD;return}case $.TD:case $.TH:{if(e>0){this.insertionMode=$e.IN_CELL;return}break}case $.HEAD:{if(e>0){this.insertionMode=$e.IN_HEAD;return}break}}this.insertionMode=$e.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const i=this.openElements.tagIDs[t];if(i===$.TEMPLATE)break;if(i===$.TABLE){this.insertionMode=$e.IN_SELECT_IN_TABLE;return}}this.insertionMode=$e.IN_SELECT}_isElementCausesFosterParenting(e){return dKe.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case $.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(t)===en.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break}case $.TABLE:{const i=this.treeAdapter.getParentNode(t);return i?{parent:i,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const i=this.treeAdapter.getNamespaceURI(e);return aan[i].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_cn(this,e);return}switch(this.insertionMode){case $e.INITIAL:{pO(this,e);break}case $e.BEFORE_HTML:{gM(this,e);break}case $e.BEFORE_HEAD:{mM(this,e);break}case $e.IN_HEAD:{_M(this,e);break}case $e.IN_HEAD_NO_SCRIPT:{vM(this,e);break}case $e.AFTER_HEAD:{bM(this,e);break}case $e.IN_BODY:case $e.IN_CAPTION:case $e.IN_CELL:case $e.IN_TEMPLATE:{fKe(this,e);break}case $e.TEXT:case $e.IN_SELECT:case $e.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case $e.IN_TABLE:case $e.IN_TABLE_BODY:case $e.IN_ROW:{aee(this,e);break}case $e.IN_TABLE_TEXT:{bKe(this,e);break}case $e.IN_COLUMN_GROUP:{CW(this,e);break}case $e.AFTER_BODY:{wW(this,e);break}case $e.AFTER_AFTER_BODY:{A$(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mcn(this,e);return}switch(this.insertionMode){case $e.INITIAL:{pO(this,e);break}case $e.BEFORE_HTML:{gM(this,e);break}case $e.BEFORE_HEAD:{mM(this,e);break}case $e.IN_HEAD:{_M(this,e);break}case $e.IN_HEAD_NO_SCRIPT:{vM(this,e);break}case $e.AFTER_HEAD:{bM(this,e);break}case $e.TEXT:{this._insertCharacters(e);break}case $e.IN_TABLE:case $e.IN_TABLE_BODY:case $e.IN_ROW:{aee(this,e);break}case $e.IN_COLUMN_GROUP:{CW(this,e);break}case $e.AFTER_BODY:{wW(this,e);break}case $e.AFTER_AFTER_BODY:{A$(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){_ae(this,e);return}switch(this.insertionMode){case $e.INITIAL:case $e.BEFORE_HTML:case $e.BEFORE_HEAD:case $e.IN_HEAD:case $e.IN_HEAD_NO_SCRIPT:case $e.AFTER_HEAD:case $e.IN_BODY:case $e.IN_TABLE:case $e.IN_CAPTION:case $e.IN_COLUMN_GROUP:case $e.IN_TABLE_BODY:case $e.IN_ROW:case $e.IN_CELL:case $e.IN_SELECT:case $e.IN_SELECT_IN_TABLE:case $e.IN_TEMPLATE:case $e.IN_FRAMESET:case $e.AFTER_FRAMESET:{_ae(this,e);break}case $e.IN_TABLE_TEXT:{gO(this,e);break}case $e.AFTER_BODY:{Gan(this,e);break}case $e.AFTER_AFTER_BODY:case $e.AFTER_AFTER_FRAMESET:{Yan(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $e.INITIAL:{Qan(this,e);break}case $e.BEFORE_HEAD:case $e.IN_HEAD:case $e.IN_HEAD_NO_SCRIPT:case $e.AFTER_HEAD:{this._err(e,Vt.misplacedDoctype);break}case $e.IN_TABLE_TEXT:{gO(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,Vt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?vcn(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $e.INITIAL:{pO(this,e);break}case $e.BEFORE_HTML:{Xan(this,e);break}case $e.BEFORE_HEAD:{Jan(this,e);break}case $e.IN_HEAD:{Tv(this,e);break}case $e.IN_HEAD_NO_SCRIPT:{nln(this,e);break}case $e.AFTER_HEAD:{rln(this,e);break}case $e.IN_BODY:{vh(this,e);break}case $e.IN_TABLE:{fA(this,e);break}case $e.IN_TABLE_TEXT:{gO(this,e);break}case $e.IN_CAPTION:{ecn(this,e);break}case $e.IN_COLUMN_GROUP:{abe(this,e);break}case $e.IN_TABLE_BODY:{yK(this,e);break}case $e.IN_ROW:{CK(this,e);break}case $e.IN_CELL:{icn(this,e);break}case $e.IN_SELECT:{wKe(this,e);break}case $e.IN_SELECT_IN_TABLE:{ocn(this,e);break}case $e.IN_TEMPLATE:{acn(this,e);break}case $e.AFTER_BODY:{ccn(this,e);break}case $e.IN_FRAMESET:{ucn(this,e);break}case $e.AFTER_FRAMESET:{hcn(this,e);break}case $e.AFTER_AFTER_BODY:{pcn(this,e);break}case $e.AFTER_AFTER_FRAMESET:{gcn(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?bcn(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $e.INITIAL:{pO(this,e);break}case $e.BEFORE_HTML:{Zan(this,e);break}case $e.BEFORE_HEAD:{eln(this,e);break}case $e.IN_HEAD:{tln(this,e);break}case $e.IN_HEAD_NO_SCRIPT:{iln(this,e);break}case $e.AFTER_HEAD:{oln(this,e);break}case $e.IN_BODY:{bK(this,e);break}case $e.TEXT:{Uln(this,e);break}case $e.IN_TABLE:{o3(this,e);break}case $e.IN_TABLE_TEXT:{gO(this,e);break}case $e.IN_CAPTION:{tcn(this,e);break}case $e.IN_COLUMN_GROUP:{ncn(this,e);break}case $e.IN_TABLE_BODY:{vae(this,e);break}case $e.IN_ROW:{CKe(this,e);break}case $e.IN_CELL:{rcn(this,e);break}case $e.IN_SELECT:{SKe(this,e);break}case $e.IN_SELECT_IN_TABLE:{scn(this,e);break}case $e.IN_TEMPLATE:{lcn(this,e);break}case $e.AFTER_BODY:{xKe(this,e);break}case $e.IN_FRAMESET:{dcn(this,e);break}case $e.AFTER_FRAMESET:{fcn(this,e);break}case $e.AFTER_AFTER_BODY:{A$(this,e);break}}}onEof(e){switch(this.insertionMode){case $e.INITIAL:{pO(this,e);break}case $e.BEFORE_HTML:{gM(this,e);break}case $e.BEFORE_HEAD:{mM(this,e);break}case $e.IN_HEAD:{_M(this,e);break}case $e.IN_HEAD_NO_SCRIPT:{vM(this,e);break}case $e.AFTER_HEAD:{bM(this,e);break}case $e.IN_BODY:case $e.IN_TABLE:case $e.IN_CAPTION:case $e.IN_COLUMN_GROUP:case $e.IN_TABLE_BODY:case $e.IN_ROW:case $e.IN_CELL:case $e.IN_SELECT:case $e.IN_SELECT_IN_TABLE:{_Ke(this,e);break}case $e.TEXT:{jln(this,e);break}case $e.IN_TABLE_TEXT:{gO(this,e);break}case $e.IN_TEMPLATE:{EKe(this,e);break}case $e.AFTER_BODY:case $e.IN_FRAMESET:case $e.AFTER_FRAMESET:case $e.AFTER_AFTER_BODY:case $e.AFTER_AFTER_FRAMESET:{sbe(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===be.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case $e.IN_HEAD:case $e.IN_HEAD_NO_SCRIPT:case $e.AFTER_HEAD:case $e.TEXT:case $e.IN_COLUMN_GROUP:case $e.IN_SELECT:case $e.IN_SELECT_IN_TABLE:case $e.IN_FRAMESET:case $e.AFTER_FRAMESET:{this._insertCharacters(e);break}case $e.IN_BODY:case $e.IN_CAPTION:case $e.IN_CELL:case $e.IN_TEMPLATE:case $e.AFTER_BODY:case $e.AFTER_AFTER_BODY:case $e.AFTER_AFTER_FRAMESET:{hKe(this,e);break}case $e.IN_TABLE:case $e.IN_TABLE_BODY:case $e.IN_ROW:{aee(this,e);break}case $e.IN_TABLE_TEXT:{vKe(this,e);break}}}};function Wan(n,e){let t=n.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return t?n.openElements.contains(t.element)?n.openElements.hasInScope(e.tagID)||(t=null):(n.activeFormattingElements.removeEntry(t),t=null):mKe(n,e),t}function zan(n,e){let t=null,i=n.openElements.stackTop;for(;i>=0;i--){const r=n.openElements.items[i];if(r===e.element)break;n._isSpecialElement(r,n.openElements.tagIDs[i])&&(t=r)}return t||(n.openElements.shortenToLength(i<0?0:i),n.activeFormattingElements.removeEntry(e)),t}function Uan(n,e,t){let i=e,r=n.openElements.getCommonAncestor(e);for(let o=0,s=r;s!==t;o++,s=r){r=n.openElements.getCommonAncestor(s);const a=n.activeFormattingElements.getElementEntry(s),l=a&&o>=Van;!a||l?(l&&n.activeFormattingElements.removeEntry(a),n.openElements.remove(s)):(s=jan(n,a),i===e&&(n.activeFormattingElements.bookmark=a),n.treeAdapter.detachNode(i),n.treeAdapter.appendChild(s,i),i=s)}return i}function jan(n,e){const t=n.treeAdapter.getNamespaceURI(e.element),i=n.treeAdapter.createElement(e.token.tagName,t,e.token.attrs);return n.openElements.replace(e.element,i),e.element=i,i}function qan(n,e,t){const i=n.treeAdapter.getTagName(e),r=KN(i);if(n._isElementCausesFosterParenting(r))n._fosterParentElement(t);else{const o=n.treeAdapter.getNamespaceURI(e);r===$.TEMPLATE&&o===en.HTML&&(e=n.treeAdapter.getTemplateContent(e)),n.treeAdapter.appendChild(e,t)}}function Kan(n,e,t){const i=n.treeAdapter.getNamespaceURI(t.element),{token:r}=t,o=n.treeAdapter.createElement(r.tagName,i,r.attrs);n._adoptNodes(e,o),n.treeAdapter.appendChild(e,o),n.activeFormattingElements.insertElementAfterBookmark(o,r),n.activeFormattingElements.removeEntry(t),n.openElements.remove(t.element),n.openElements.insertAfter(e,o,r.tagID)}function obe(n,e){for(let t=0;t<$an;t++){const i=Wan(n,e);if(!i)break;const r=zan(n,i);if(!r)break;n.activeFormattingElements.bookmark=i;const o=Uan(n,r,i.element),s=n.openElements.getCommonAncestor(i.element);n.treeAdapter.detachNode(o),s&&qan(n,s,o),Kan(n,r,i)}}function _ae(n,e){n._appendCommentNode(e,n.openElements.currentTmplContentOrNode)}function Gan(n,e){n._appendCommentNode(e,n.openElements.items[0])}function Yan(n,e){n._appendCommentNode(e,n.document)}function sbe(n,e){if(n.stopped=!0,e.location){const t=n.fragmentContext?0:2;for(let i=n.openElements.stackTop;i>=t;i--)n._setEndLocation(n.openElements.items[i],e);if(!n.fragmentContext&&n.openElements.stackTop>=0){const i=n.openElements.items[0],r=n.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(n._setEndLocation(i,e),n.openElements.stackTop>=1)){const o=n.openElements.items[1],s=n.treeAdapter.getNodeSourceCodeLocation(o);s&&!s.endTag&&n._setEndLocation(o,e)}}}}function Qan(n,e){n._setDocumentType(e);const t=e.forceQuirks?Pp.QUIRKS:Tan(e);xan(e)||n._err(e,Vt.nonConformingDoctype),n.treeAdapter.setDocumentMode(n.document,t),n.insertionMode=$e.BEFORE_HTML}function pO(n,e){n._err(e,Vt.missingDoctype,!0),n.treeAdapter.setDocumentMode(n.document,Pp.QUIRKS),n.insertionMode=$e.BEFORE_HTML,n._processToken(e)}function Xan(n,e){e.tagID===$.HTML?(n._insertElement(e,en.HTML),n.insertionMode=$e.BEFORE_HEAD):gM(n,e)}function Zan(n,e){const t=e.tagID;(t===$.HTML||t===$.HEAD||t===$.BODY||t===$.BR)&&gM(n,e)}function gM(n,e){n._insertFakeRootElement(),n.insertionMode=$e.BEFORE_HEAD,n._processToken(e)}function Jan(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.HEAD:{n._insertElement(e,en.HTML),n.headElement=n.openElements.current,n.insertionMode=$e.IN_HEAD;break}default:mM(n,e)}}function eln(n,e){const t=e.tagID;t===$.HEAD||t===$.BODY||t===$.HTML||t===$.BR?mM(n,e):n._err(e,Vt.endTagWithoutMatchingOpenElement)}function mM(n,e){n._insertFakeElement(ht.HEAD,$.HEAD),n.headElement=n.openElements.current,n.insertionMode=$e.IN_HEAD,n._processToken(e)}function Tv(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:{n._appendElement(e,en.HTML),e.ackSelfClosing=!0;break}case $.TITLE:{n._switchToTextParsing(e,Sc.RCDATA);break}case $.NOSCRIPT:{n.options.scriptingEnabled?n._switchToTextParsing(e,Sc.RAWTEXT):(n._insertElement(e,en.HTML),n.insertionMode=$e.IN_HEAD_NO_SCRIPT);break}case $.NOFRAMES:case $.STYLE:{n._switchToTextParsing(e,Sc.RAWTEXT);break}case $.SCRIPT:{n._switchToTextParsing(e,Sc.SCRIPT_DATA);break}case $.TEMPLATE:{n._insertTemplate(e),n.activeFormattingElements.insertMarker(),n.framesetOk=!1,n.insertionMode=$e.IN_TEMPLATE,n.tmplInsertionModeStack.unshift($e.IN_TEMPLATE);break}case $.HEAD:{n._err(e,Vt.misplacedStartTagForHeadElement);break}default:_M(n,e)}}function tln(n,e){switch(e.tagID){case $.HEAD:{n.openElements.pop(),n.insertionMode=$e.AFTER_HEAD;break}case $.BODY:case $.BR:case $.HTML:{_M(n,e);break}case $.TEMPLATE:{Xk(n,e);break}default:n._err(e,Vt.endTagWithoutMatchingOpenElement)}}function Xk(n,e){n.openElements.tmplCount>0?(n.openElements.generateImpliedEndTagsThoroughly(),n.openElements.currentTagId!==$.TEMPLATE&&n._err(e,Vt.closingOfElementWithOpenChildElements),n.openElements.popUntilTagNamePopped($.TEMPLATE),n.activeFormattingElements.clearToLastMarker(),n.tmplInsertionModeStack.shift(),n._resetInsertionMode()):n._err(e,Vt.endTagWithoutMatchingOpenElement)}function _M(n,e){n.openElements.pop(),n.insertionMode=$e.AFTER_HEAD,n._processToken(e)}function nln(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.BASEFONT:case $.BGSOUND:case $.HEAD:case $.LINK:case $.META:case $.NOFRAMES:case $.STYLE:{Tv(n,e);break}case $.NOSCRIPT:{n._err(e,Vt.nestedNoscriptInHead);break}default:vM(n,e)}}function iln(n,e){switch(e.tagID){case $.NOSCRIPT:{n.openElements.pop(),n.insertionMode=$e.IN_HEAD;break}case $.BR:{vM(n,e);break}default:n._err(e,Vt.endTagWithoutMatchingOpenElement)}}function vM(n,e){const t=e.type===Ao.EOF?Vt.openElementsLeftAfterEof:Vt.disallowedContentInNoscriptInHead;n._err(e,t),n.openElements.pop(),n.insertionMode=$e.IN_HEAD,n._processToken(e)}function rln(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.BODY:{n._insertElement(e,en.HTML),n.framesetOk=!1,n.insertionMode=$e.IN_BODY;break}case $.FRAMESET:{n._insertElement(e,en.HTML),n.insertionMode=$e.IN_FRAMESET;break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{n._err(e,Vt.abandonedHeadElementChild),n.openElements.push(n.headElement,$.HEAD),Tv(n,e),n.openElements.remove(n.headElement);break}case $.HEAD:{n._err(e,Vt.misplacedStartTagForHeadElement);break}default:bM(n,e)}}function oln(n,e){switch(e.tagID){case $.BODY:case $.HTML:case $.BR:{bM(n,e);break}case $.TEMPLATE:{Xk(n,e);break}default:n._err(e,Vt.endTagWithoutMatchingOpenElement)}}function bM(n,e){n._insertFakeElement(ht.BODY,$.BODY),n.insertionMode=$e.IN_BODY,vK(n,e)}function vK(n,e){switch(e.type){case Ao.CHARACTER:{fKe(n,e);break}case Ao.WHITESPACE_CHARACTER:{hKe(n,e);break}case Ao.COMMENT:{_ae(n,e);break}case Ao.START_TAG:{vh(n,e);break}case Ao.END_TAG:{bK(n,e);break}case Ao.EOF:{_Ke(n,e);break}}}function hKe(n,e){n._reconstructActiveFormattingElements(),n._insertCharacters(e)}function fKe(n,e){n._reconstructActiveFormattingElements(),n._insertCharacters(e),n.framesetOk=!1}function sln(n,e){n.openElements.tmplCount===0&&n.treeAdapter.adoptAttributes(n.openElements.items[0],e.attrs)}function aln(n,e){const t=n.openElements.tryPeekProperlyNestedBodyElement();t&&n.openElements.tmplCount===0&&(n.framesetOk=!1,n.treeAdapter.adoptAttributes(t,e.attrs))}function lln(n,e){const t=n.openElements.tryPeekProperlyNestedBodyElement();n.framesetOk&&t&&(n.treeAdapter.detachNode(t),n.openElements.popAllUpToHtmlElement(),n._insertElement(e,en.HTML),n.insertionMode=$e.IN_FRAMESET)}function cln(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,en.HTML)}function uln(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),tKe(n.openElements.currentTagId)&&n.openElements.pop(),n._insertElement(e,en.HTML)}function dln(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,en.HTML),n.skipNextNewLine=!0,n.framesetOk=!1}function hln(n,e){const t=n.openElements.tmplCount>0;(!n.formElement||t)&&(n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,en.HTML),t||(n.formElement=n.openElements.current))}function fln(n,e){n.framesetOk=!1;const t=e.tagID;for(let i=n.openElements.stackTop;i>=0;i--){const r=n.openElements.tagIDs[i];if(t===$.LI&&r===$.LI||(t===$.DD||t===$.DT)&&(r===$.DD||r===$.DT)){n.openElements.generateImpliedEndTagsWithExclusion(r),n.openElements.popUntilTagNamePopped(r);break}if(r!==$.ADDRESS&&r!==$.DIV&&r!==$.P&&n._isSpecialElement(n.openElements.items[i],r))break}n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,en.HTML)}function pln(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,en.HTML),n.tokenizer.state=Sc.PLAINTEXT}function gln(n,e){n.openElements.hasInScope($.BUTTON)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped($.BUTTON)),n._reconstructActiveFormattingElements(),n._insertElement(e,en.HTML),n.framesetOk=!1}function mln(n,e){const t=n.activeFormattingElements.getElementEntryInScopeWithTagName(ht.A);t&&(obe(n,e),n.openElements.remove(t.element),n.activeFormattingElements.removeEntry(t)),n._reconstructActiveFormattingElements(),n._insertElement(e,en.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function _ln(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,en.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function vln(n,e){n._reconstructActiveFormattingElements(),n.openElements.hasInScope($.NOBR)&&(obe(n,e),n._reconstructActiveFormattingElements()),n._insertElement(e,en.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function bln(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,en.HTML),n.activeFormattingElements.insertMarker(),n.framesetOk=!1}function yln(n,e){n.treeAdapter.getDocumentMode(n.document)!==Pp.QUIRKS&&n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,en.HTML),n.framesetOk=!1,n.insertionMode=$e.IN_TABLE}function pKe(n,e){n._reconstructActiveFormattingElements(),n._appendElement(e,en.HTML),n.framesetOk=!1,e.ackSelfClosing=!0}function gKe(n){const e=Zqe(n,Iw.TYPE);return e!=null&&e.toLowerCase()===Ban}function Cln(n,e){n._reconstructActiveFormattingElements(),n._appendElement(e,en.HTML),gKe(e)||(n.framesetOk=!1),e.ackSelfClosing=!0}function wln(n,e){n._appendElement(e,en.HTML),e.ackSelfClosing=!0}function Sln(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._appendElement(e,en.HTML),n.framesetOk=!1,e.ackSelfClosing=!0}function Eln(n,e){e.tagName=ht.IMG,e.tagID=$.IMG,pKe(n,e)}function xln(n,e){n._insertElement(e,en.HTML),n.skipNextNewLine=!0,n.tokenizer.state=Sc.RCDATA,n.originalInsertionMode=n.insertionMode,n.framesetOk=!1,n.insertionMode=$e.TEXT}function Tln(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._reconstructActiveFormattingElements(),n.framesetOk=!1,n._switchToTextParsing(e,Sc.RAWTEXT)}function kln(n,e){n.framesetOk=!1,n._switchToTextParsing(e,Sc.RAWTEXT)}function hAe(n,e){n._switchToTextParsing(e,Sc.RAWTEXT)}function Iln(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,en.HTML),n.framesetOk=!1,n.insertionMode=n.insertionMode===$e.IN_TABLE||n.insertionMode===$e.IN_CAPTION||n.insertionMode===$e.IN_TABLE_BODY||n.insertionMode===$e.IN_ROW||n.insertionMode===$e.IN_CELL?$e.IN_SELECT_IN_TABLE:$e.IN_SELECT}function Lln(n,e){n.openElements.currentTagId===$.OPTION&&n.openElements.pop(),n._reconstructActiveFormattingElements(),n._insertElement(e,en.HTML)}function Dln(n,e){n.openElements.hasInScope($.RUBY)&&n.openElements.generateImpliedEndTags(),n._insertElement(e,en.HTML)}function Aln(n,e){n.openElements.hasInScope($.RUBY)&&n.openElements.generateImpliedEndTagsWithExclusion($.RTC),n._insertElement(e,en.HTML)}function Nln(n,e){n._reconstructActiveFormattingElements(),cKe(e),rbe(e),e.selfClosing?n._appendElement(e,en.MATHML):n._insertElement(e,en.MATHML),e.ackSelfClosing=!0}function Rln(n,e){n._reconstructActiveFormattingElements(),uKe(e),rbe(e),e.selfClosing?n._appendElement(e,en.SVG):n._insertElement(e,en.SVG),e.ackSelfClosing=!0}function fAe(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,en.HTML)}function vh(n,e){switch(e.tagID){case $.I:case $.S:case $.B:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.SMALL:case $.STRIKE:case $.STRONG:{_ln(n,e);break}case $.A:{mln(n,e);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{uln(n,e);break}case $.P:case $.DL:case $.OL:case $.UL:case $.DIV:case $.DIR:case $.NAV:case $.MAIN:case $.MENU:case $.ASIDE:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.DETAILS:case $.ADDRESS:case $.ARTICLE:case $.SECTION:case $.SUMMARY:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{cln(n,e);break}case $.LI:case $.DD:case $.DT:{fln(n,e);break}case $.BR:case $.IMG:case $.WBR:case $.AREA:case $.EMBED:case $.KEYGEN:{pKe(n,e);break}case $.HR:{Sln(n,e);break}case $.RB:case $.RTC:{Dln(n,e);break}case $.RT:case $.RP:{Aln(n,e);break}case $.PRE:case $.LISTING:{dln(n,e);break}case $.XMP:{Tln(n,e);break}case $.SVG:{Rln(n,e);break}case $.HTML:{sln(n,e);break}case $.BASE:case $.LINK:case $.META:case $.STYLE:case $.TITLE:case $.SCRIPT:case $.BGSOUND:case $.BASEFONT:case $.TEMPLATE:{Tv(n,e);break}case $.BODY:{aln(n,e);break}case $.FORM:{hln(n,e);break}case $.NOBR:{vln(n,e);break}case $.MATH:{Nln(n,e);break}case $.TABLE:{yln(n,e);break}case $.INPUT:{Cln(n,e);break}case $.PARAM:case $.TRACK:case $.SOURCE:{wln(n,e);break}case $.IMAGE:{Eln(n,e);break}case $.BUTTON:{gln(n,e);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{bln(n,e);break}case $.IFRAME:{kln(n,e);break}case $.SELECT:{Iln(n,e);break}case $.OPTION:case $.OPTGROUP:{Lln(n,e);break}case $.NOEMBED:{hAe(n,e);break}case $.FRAMESET:{lln(n,e);break}case $.TEXTAREA:{xln(n,e);break}case $.NOSCRIPT:{n.options.scriptingEnabled?hAe(n,e):fAe(n,e);break}case $.PLAINTEXT:{pln(n,e);break}case $.COL:case $.TH:case $.TD:case $.TR:case $.HEAD:case $.FRAME:case $.TBODY:case $.TFOOT:case $.THEAD:case $.CAPTION:case $.COLGROUP:break;default:fAe(n,e)}}function Oln(n,e){if(n.openElements.hasInScope($.BODY)&&(n.insertionMode=$e.AFTER_BODY,n.options.sourceCodeLocationInfo)){const t=n.openElements.tryPeekProperlyNestedBodyElement();t&&n._setEndLocation(t,e)}}function Pln(n,e){n.openElements.hasInScope($.BODY)&&(n.insertionMode=$e.AFTER_BODY,xKe(n,e))}function Mln(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t))}function Fln(n){const e=n.openElements.tmplCount>0,{formElement:t}=n;e||(n.formElement=null),(t||e)&&n.openElements.hasInScope($.FORM)&&(n.openElements.generateImpliedEndTags(),e?n.openElements.popUntilTagNamePopped($.FORM):t&&n.openElements.remove(t))}function Bln(n){n.openElements.hasInButtonScope($.P)||n._insertFakeElement(ht.P,$.P),n._closePElement()}function $ln(n){n.openElements.hasInListItemScope($.LI)&&(n.openElements.generateImpliedEndTagsWithExclusion($.LI),n.openElements.popUntilTagNamePopped($.LI))}function Vln(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTagsWithExclusion(t),n.openElements.popUntilTagNamePopped(t))}function Hln(n){n.openElements.hasNumberedHeaderInScope()&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilNumberedHeaderPopped())}function Wln(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t),n.activeFormattingElements.clearToLastMarker())}function zln(n){n._reconstructActiveFormattingElements(),n._insertFakeElement(ht.BR,$.BR),n.openElements.pop(),n.framesetOk=!1}function mKe(n,e){const t=e.tagName,i=e.tagID;for(let r=n.openElements.stackTop;r>0;r--){const o=n.openElements.items[r],s=n.openElements.tagIDs[r];if(i===s&&(i!==$.UNKNOWN||n.treeAdapter.getTagName(o)===t)){n.openElements.generateImpliedEndTagsWithExclusion(i),n.openElements.stackTop>=r&&n.openElements.shortenToLength(r);break}if(n._isSpecialElement(o,s))break}}function bK(n,e){switch(e.tagID){case $.A:case $.B:case $.I:case $.S:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.NOBR:case $.SMALL:case $.STRIKE:case $.STRONG:{obe(n,e);break}case $.P:{Bln(n);break}case $.DL:case $.UL:case $.OL:case $.DIR:case $.DIV:case $.NAV:case $.PRE:case $.MAIN:case $.MENU:case $.ASIDE:case $.BUTTON:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.ADDRESS:case $.ARTICLE:case $.DETAILS:case $.SECTION:case $.SUMMARY:case $.LISTING:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{Mln(n,e);break}case $.LI:{$ln(n);break}case $.DD:case $.DT:{Vln(n,e);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{Hln(n);break}case $.BR:{zln(n);break}case $.BODY:{Oln(n,e);break}case $.HTML:{Pln(n,e);break}case $.FORM:{Fln(n);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{Wln(n,e);break}case $.TEMPLATE:{Xk(n,e);break}default:mKe(n,e)}}function _Ke(n,e){n.tmplInsertionModeStack.length>0?EKe(n,e):sbe(n,e)}function Uln(n,e){var t;e.tagID===$.SCRIPT&&((t=n.scriptHandler)===null||t===void 0||t.call(n,n.openElements.current)),n.openElements.pop(),n.insertionMode=n.originalInsertionMode}function jln(n,e){n._err(e,Vt.eofInElementThatCanContainOnlyText),n.openElements.pop(),n.insertionMode=n.originalInsertionMode,n.onEof(e)}function aee(n,e){if(dKe.has(n.openElements.currentTagId))switch(n.pendingCharacterTokens.length=0,n.hasNonWhitespacePendingCharacterToken=!1,n.originalInsertionMode=n.insertionMode,n.insertionMode=$e.IN_TABLE_TEXT,e.type){case Ao.CHARACTER:{bKe(n,e);break}case Ao.WHITESPACE_CHARACTER:{vKe(n,e);break}}else r6(n,e)}function qln(n,e){n.openElements.clearBackToTableContext(),n.activeFormattingElements.insertMarker(),n._insertElement(e,en.HTML),n.insertionMode=$e.IN_CAPTION}function Kln(n,e){n.openElements.clearBackToTableContext(),n._insertElement(e,en.HTML),n.insertionMode=$e.IN_COLUMN_GROUP}function Gln(n,e){n.openElements.clearBackToTableContext(),n._insertFakeElement(ht.COLGROUP,$.COLGROUP),n.insertionMode=$e.IN_COLUMN_GROUP,abe(n,e)}function Yln(n,e){n.openElements.clearBackToTableContext(),n._insertElement(e,en.HTML),n.insertionMode=$e.IN_TABLE_BODY}function Qln(n,e){n.openElements.clearBackToTableContext(),n._insertFakeElement(ht.TBODY,$.TBODY),n.insertionMode=$e.IN_TABLE_BODY,yK(n,e)}function Xln(n,e){n.openElements.hasInTableScope($.TABLE)&&(n.openElements.popUntilTagNamePopped($.TABLE),n._resetInsertionMode(),n._processStartTag(e))}function Zln(n,e){gKe(e)?n._appendElement(e,en.HTML):r6(n,e),e.ackSelfClosing=!0}function Jln(n,e){!n.formElement&&n.openElements.tmplCount===0&&(n._insertElement(e,en.HTML),n.formElement=n.openElements.current,n.openElements.pop())}function fA(n,e){switch(e.tagID){case $.TD:case $.TH:case $.TR:{Qln(n,e);break}case $.STYLE:case $.SCRIPT:case $.TEMPLATE:{Tv(n,e);break}case $.COL:{Gln(n,e);break}case $.FORM:{Jln(n,e);break}case $.TABLE:{Xln(n,e);break}case $.TBODY:case $.TFOOT:case $.THEAD:{Yln(n,e);break}case $.INPUT:{Zln(n,e);break}case $.CAPTION:{qln(n,e);break}case $.COLGROUP:{Kln(n,e);break}default:r6(n,e)}}function o3(n,e){switch(e.tagID){case $.TABLE:{n.openElements.hasInTableScope($.TABLE)&&(n.openElements.popUntilTagNamePopped($.TABLE),n._resetInsertionMode());break}case $.TEMPLATE:{Xk(n,e);break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TBODY:case $.TD:case $.TFOOT:case $.TH:case $.THEAD:case $.TR:break;default:r6(n,e)}}function r6(n,e){const t=n.fosterParentingEnabled;n.fosterParentingEnabled=!0,vK(n,e),n.fosterParentingEnabled=t}function vKe(n,e){n.pendingCharacterTokens.push(e)}function bKe(n,e){n.pendingCharacterTokens.push(e),n.hasNonWhitespacePendingCharacterToken=!0}function gO(n,e){let t=0;if(n.hasNonWhitespacePendingCharacterToken)for(;t<n.pendingCharacterTokens.length;t++)r6(n,n.pendingCharacterTokens[t]);else for(;t<n.pendingCharacterTokens.length;t++)n._insertCharacters(n.pendingCharacterTokens[t]);n.insertionMode=n.originalInsertionMode,n._processToken(e)}const yKe=new Set([$.CAPTION,$.COL,$.COLGROUP,$.TBODY,$.TD,$.TFOOT,$.TH,$.THEAD,$.TR]);function ecn(n,e){const t=e.tagID;yKe.has(t)?n.openElements.hasInTableScope($.CAPTION)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped($.CAPTION),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=$e.IN_TABLE,fA(n,e)):vh(n,e)}function tcn(n,e){const t=e.tagID;switch(t){case $.CAPTION:case $.TABLE:{n.openElements.hasInTableScope($.CAPTION)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped($.CAPTION),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=$e.IN_TABLE,t===$.TABLE&&o3(n,e));break}case $.BODY:case $.COL:case $.COLGROUP:case $.HTML:case $.TBODY:case $.TD:case $.TFOOT:case $.TH:case $.THEAD:case $.TR:break;default:bK(n,e)}}function abe(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.COL:{n._appendElement(e,en.HTML),e.ackSelfClosing=!0;break}case $.TEMPLATE:{Tv(n,e);break}default:CW(n,e)}}function ncn(n,e){switch(e.tagID){case $.COLGROUP:{n.openElements.currentTagId===$.COLGROUP&&(n.openElements.pop(),n.insertionMode=$e.IN_TABLE);break}case $.TEMPLATE:{Xk(n,e);break}case $.COL:break;default:CW(n,e)}}function CW(n,e){n.openElements.currentTagId===$.COLGROUP&&(n.openElements.pop(),n.insertionMode=$e.IN_TABLE,n._processToken(e))}function yK(n,e){switch(e.tagID){case $.TR:{n.openElements.clearBackToTableBodyContext(),n._insertElement(e,en.HTML),n.insertionMode=$e.IN_ROW;break}case $.TH:case $.TD:{n.openElements.clearBackToTableBodyContext(),n._insertFakeElement(ht.TR,$.TR),n.insertionMode=$e.IN_ROW,CK(n,e);break}case $.CAPTION:case $.COL:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:{n.openElements.hasTableBodyContextInTableScope()&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=$e.IN_TABLE,fA(n,e));break}default:fA(n,e)}}function vae(n,e){const t=e.tagID;switch(e.tagID){case $.TBODY:case $.TFOOT:case $.THEAD:{n.openElements.hasInTableScope(t)&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=$e.IN_TABLE);break}case $.TABLE:{n.openElements.hasTableBodyContextInTableScope()&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=$e.IN_TABLE,o3(n,e));break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TD:case $.TH:case $.TR:break;default:o3(n,e)}}function CK(n,e){switch(e.tagID){case $.TH:case $.TD:{n.openElements.clearBackToTableRowContext(),n._insertElement(e,en.HTML),n.insertionMode=$e.IN_CELL,n.activeFormattingElements.insertMarker();break}case $.CAPTION:case $.COL:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:case $.TR:{n.openElements.hasInTableScope($.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=$e.IN_TABLE_BODY,yK(n,e));break}default:fA(n,e)}}function CKe(n,e){switch(e.tagID){case $.TR:{n.openElements.hasInTableScope($.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=$e.IN_TABLE_BODY);break}case $.TABLE:{n.openElements.hasInTableScope($.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=$e.IN_TABLE_BODY,vae(n,e));break}case $.TBODY:case $.TFOOT:case $.THEAD:{(n.openElements.hasInTableScope(e.tagID)||n.openElements.hasInTableScope($.TR))&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=$e.IN_TABLE_BODY,vae(n,e));break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TD:case $.TH:break;default:o3(n,e)}}function icn(n,e){const t=e.tagID;yKe.has(t)?(n.openElements.hasInTableScope($.TD)||n.openElements.hasInTableScope($.TH))&&(n._closeTableCell(),CK(n,e)):vh(n,e)}function rcn(n,e){const t=e.tagID;switch(t){case $.TD:case $.TH:{n.openElements.hasInTableScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=$e.IN_ROW);break}case $.TABLE:case $.TBODY:case $.TFOOT:case $.THEAD:case $.TR:{n.openElements.hasInTableScope(t)&&(n._closeTableCell(),CKe(n,e));break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:break;default:bK(n,e)}}function wKe(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.OPTION:{n.openElements.currentTagId===$.OPTION&&n.openElements.pop(),n._insertElement(e,en.HTML);break}case $.OPTGROUP:{n.openElements.currentTagId===$.OPTION&&n.openElements.pop(),n.openElements.currentTagId===$.OPTGROUP&&n.openElements.pop(),n._insertElement(e,en.HTML);break}case $.INPUT:case $.KEYGEN:case $.TEXTAREA:case $.SELECT:{n.openElements.hasInSelectScope($.SELECT)&&(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode(),e.tagID!==$.SELECT&&n._processStartTag(e));break}case $.SCRIPT:case $.TEMPLATE:{Tv(n,e);break}}}function SKe(n,e){switch(e.tagID){case $.OPTGROUP:{n.openElements.stackTop>0&&n.openElements.currentTagId===$.OPTION&&n.openElements.tagIDs[n.openElements.stackTop-1]===$.OPTGROUP&&n.openElements.pop(),n.openElements.currentTagId===$.OPTGROUP&&n.openElements.pop();break}case $.OPTION:{n.openElements.currentTagId===$.OPTION&&n.openElements.pop();break}case $.SELECT:{n.openElements.hasInSelectScope($.SELECT)&&(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode());break}case $.TEMPLATE:{Xk(n,e);break}}}function ocn(n,e){const t=e.tagID;t===$.CAPTION||t===$.TABLE||t===$.TBODY||t===$.TFOOT||t===$.THEAD||t===$.TR||t===$.TD||t===$.TH?(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode(),n._processStartTag(e)):wKe(n,e)}function scn(n,e){const t=e.tagID;t===$.CAPTION||t===$.TABLE||t===$.TBODY||t===$.TFOOT||t===$.THEAD||t===$.TR||t===$.TD||t===$.TH?n.openElements.hasInTableScope(t)&&(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode(),n.onEndTag(e)):SKe(n,e)}function acn(n,e){switch(e.tagID){case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{Tv(n,e);break}case $.CAPTION:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:{n.tmplInsertionModeStack[0]=$e.IN_TABLE,n.insertionMode=$e.IN_TABLE,fA(n,e);break}case $.COL:{n.tmplInsertionModeStack[0]=$e.IN_COLUMN_GROUP,n.insertionMode=$e.IN_COLUMN_GROUP,abe(n,e);break}case $.TR:{n.tmplInsertionModeStack[0]=$e.IN_TABLE_BODY,n.insertionMode=$e.IN_TABLE_BODY,yK(n,e);break}case $.TD:case $.TH:{n.tmplInsertionModeStack[0]=$e.IN_ROW,n.insertionMode=$e.IN_ROW,CK(n,e);break}default:n.tmplInsertionModeStack[0]=$e.IN_BODY,n.insertionMode=$e.IN_BODY,vh(n,e)}}function lcn(n,e){e.tagID===$.TEMPLATE&&Xk(n,e)}function EKe(n,e){n.openElements.tmplCount>0?(n.openElements.popUntilTagNamePopped($.TEMPLATE),n.activeFormattingElements.clearToLastMarker(),n.tmplInsertionModeStack.shift(),n._resetInsertionMode(),n.onEof(e)):sbe(n,e)}function ccn(n,e){e.tagID===$.HTML?vh(n,e):wW(n,e)}function xKe(n,e){var t;if(e.tagID===$.HTML){if(n.fragmentContext||(n.insertionMode=$e.AFTER_AFTER_BODY),n.options.sourceCodeLocationInfo&&n.openElements.tagIDs[0]===$.HTML){n._setEndLocation(n.openElements.items[0],e);const i=n.openElements.items[1];i&&!(!((t=n.treeAdapter.getNodeSourceCodeLocation(i))===null||t===void 0)&&t.endTag)&&n._setEndLocation(i,e)}}else wW(n,e)}function wW(n,e){n.insertionMode=$e.IN_BODY,vK(n,e)}function ucn(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.FRAMESET:{n._insertElement(e,en.HTML);break}case $.FRAME:{n._appendElement(e,en.HTML),e.ackSelfClosing=!0;break}case $.NOFRAMES:{Tv(n,e);break}}}function dcn(n,e){e.tagID===$.FRAMESET&&!n.openElements.isRootHtmlElementCurrent()&&(n.openElements.pop(),!n.fragmentContext&&n.openElements.currentTagId!==$.FRAMESET&&(n.insertionMode=$e.AFTER_FRAMESET))}function hcn(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.NOFRAMES:{Tv(n,e);break}}}function fcn(n,e){e.tagID===$.HTML&&(n.insertionMode=$e.AFTER_AFTER_FRAMESET)}function pcn(n,e){e.tagID===$.HTML?vh(n,e):A$(n,e)}function A$(n,e){n.insertionMode=$e.IN_BODY,vK(n,e)}function gcn(n,e){switch(e.tagID){case $.HTML:{vh(n,e);break}case $.NOFRAMES:{Tv(n,e);break}}}function mcn(n,e){e.chars=bl,n._insertCharacters(e)}function _cn(n,e){n._insertCharacters(e),n.framesetOk=!1}function TKe(n){for(;n.treeAdapter.getNamespaceURI(n.openElements.current)!==en.HTML&&!n._isIntegrationPoint(n.openElements.currentTagId,n.openElements.current);)n.openElements.pop()}function vcn(n,e){if(Ran(e))TKe(n),n._startTagOutsideForeignContent(e);else{const t=n._getAdjustedCurrentElement(),i=n.treeAdapter.getNamespaceURI(t);i===en.MATHML?cKe(e):i===en.SVG&&(Oan(e),uKe(e)),rbe(e),e.selfClosing?n._appendElement(e,i):n._insertElement(e,i),e.ackSelfClosing=!0}}function bcn(n,e){if(e.tagID===$.P||e.tagID===$.BR){TKe(n),n._endTagOutsideForeignContent(e);return}for(let t=n.openElements.stackTop;t>0;t--){const i=n.openElements.items[t];if(n.treeAdapter.getNamespaceURI(i)===en.HTML){n._endTagOutsideForeignContent(e);break}const r=n.treeAdapter.getTagName(i);if(r.toLowerCase()===e.tagName){e.tagName=r,n.openElements.shortenToLength(t);break}}}ht.AREA,ht.BASE,ht.BASEFONT,ht.BGSOUND,ht.BR,ht.COL,ht.EMBED,ht.FRAME,ht.HR,ht.IMG,ht.INPUT,ht.KEYGEN,ht.LINK,ht.META,ht.PARAM,ht.SOURCE,ht.TRACK,ht.WBR;const ycn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),pAe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function kKe(n,e){const t=Dcn(n),i=Kqe("type",{handlers:{root:Ccn,element:wcn,text:Scn,comment:LKe,doctype:Ecn,raw:Tcn},unknown:kcn}),r={parser:t?new dAe(pAe):dAe.getFragmentParser(void 0,pAe),handle(a){i(a,r)},stitches:!1,options:e||{}};i(n,r),GN(r,k0());const o=t?r.parser.document:r.parser.getFragment(),s=Nsn(o,{file:r.options.file});return r.stitches&&ebe(s,"comment",function(a,l,c){const u=a;if(u.value.stitch&&c&&l!==void 0){const d=c.children;return d[l]=u.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===n.type?s.children[0]:s}function IKe(n,e){let t=-1;if(n)for(;++t<n.length;)e.handle(n[t])}function Ccn(n,e){IKe(n.children,e)}function wcn(n,e){Icn(n,e),IKe(n.children,e),Lcn(n,e)}function Scn(n,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const t={type:Ao.CHARACTER,chars:n.value,location:o6(n)};GN(e,k0(n)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function Ecn(n,e){const t={type:Ao.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:o6(n)};GN(e,k0(n)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function xcn(n,e){e.stitches=!0;const t=Acn(n);if("children"in n&&"children"in t){const i=kKe({type:"root",children:n.children},e.options);t.children=i.children}LKe({type:"comment",value:{stitch:t}},e)}function LKe(n,e){const t=n.value,i={type:Ao.COMMENT,data:t,location:o6(n)};GN(e,k0(n)),e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken)}function Tcn(n,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,DKe(e,k0(n)),e.parser.tokenizer.write(n.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const t=e.parser.tokenizer._consume();e.parser.tokenizer._callState(t)}}function kcn(n,e){const t=n;if(e.options.passThrough&&e.options.passThrough.includes(t.type))xcn(t,e);else{let i="";throw ycn.has(t.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+t.type+"` node"+i)}}function GN(n,e){DKe(n,e);const t=n.parser.tokenizer.currentCharacterToken;t&&t.location&&(t.location.endLine=n.parser.tokenizer.preprocessor.line,t.location.endCol=n.parser.tokenizer.preprocessor.col+1,t.location.endOffset=n.parser.tokenizer.preprocessor.offset+1,n.parser.currentToken=t,n.parser._processToken(n.parser.currentToken)),n.parser.tokenizer.paused=!1,n.parser.tokenizer.inLoop=!1,n.parser.tokenizer.active=!1,n.parser.tokenizer.returnState=Sc.DATA,n.parser.tokenizer.charRefCode=-1,n.parser.tokenizer.consumedAfterSnapshot=-1,n.parser.tokenizer.currentLocation=null,n.parser.tokenizer.currentCharacterToken=null,n.parser.tokenizer.currentToken=null,n.parser.tokenizer.currentAttr={name:"",value:""}}function DKe(n,e){if(e&&e.offset!==void 0){const t={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};n.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,n.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,n.parser.tokenizer.preprocessor.line=e.line,n.parser.tokenizer.currentLocation=t}}function Icn(n,e){const t=n.tagName.toLowerCase();if(e.parser.tokenizer.state===Sc.PLAINTEXT)return;GN(e,k0(n));const i=e.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Wx.html;r===Wx.html&&t==="svg"&&(r=Wx.svg);const o=Fsn({...n,children:[]},{space:r===Wx.svg?"svg":"html"}),s={type:Ao.START_TAG,tagName:t,tagID:KN(t),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:o6(n)};e.parser.currentToken=s,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=t}function Lcn(n,e){const t=n.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&jsn.includes(t)||e.parser.tokenizer.state===Sc.PLAINTEXT)return;GN(e,pK(n));const i={type:Ao.END_TAG,tagName:t,tagID:KN(t),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:o6(n)};e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken),t===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Sc.RCDATA||e.parser.tokenizer.state===Sc.RAWTEXT||e.parser.tokenizer.state===Sc.SCRIPT_DATA)&&(e.parser.tokenizer.state=Sc.DATA)}function Dcn(n){const e=n.type==="root"?n.children[0]:n;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function o6(n){const e=k0(n)||{line:void 0,column:void 0,offset:void 0},t=pK(n)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:t.line,endCol:t.column,endOffset:t.offset}}function Acn(n){return"children"in n?hA({...n,children:[]}):hA(n)}function Ncn(n){return function(e,t){return kKe(e,{...n,file:t})}}function Rcn(n){return n.replace(/^<x-next.*$/gm,"").replace(/---[\s\S]*?---/g,"").replace(/!\[.*?\]\((\/[^)]+)\)/g,(e,t)=>{const i=e.match(/!\[(.*?)\]/);return`![${i?i[1]:"An image"}](https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source${t})`}).trim()}function lbe({id:n,url:e}){const{t}=pe(),{data:i}=Ti({queryKey:["help-widget",n,e],queryFn:()=>fetch(e).then(l=>l.text().then(Rcn))}),[,r]=e.split("v5-rework/source"),o=ni(),s=w.useRef(null),a=w.useRef(null);return w.useEffect(()=>{const l=new AbortController;return window.addEventListener(`help-widget-${n}:moveToHeading`,c=>{var u;if("detail"in c&&s.current&&a.current){const d=(u=s.current)==null?void 0:u.querySelectorAll("h3");if(d){const h=Array.from(d).findIndex(f=>f.innerText===c.detail);if(h>-1){const f=d[h];f&&a.current.scrollTo({behavior:"smooth",top:f.offsetTop-50})}}}},{signal:l.signal}),()=>l.abort()},[]),sp.createPortal(N("div",{id:`help-widget-${n}`,className:"hidden fixed top-0 right-0 w-full md:w-1/2 lg:w-1/3 xl:w-1/4 h-full shadow-xl border rounded-l-lg z-50 overflow-y-auto",style:{backgroundColor:o.$1,color:o.$3,borderColor:o.$4},ref:a,children:[N("div",{className:"flex justify-between items-center sticky px-5 py-3 top-0",style:{backgroundColor:o.$1},children:[p("div",{}),N("div",{className:"flex items-center space-x-2",children:[p("button",{className:"hidden md:block",type:"button",onClick:()=>{const l=document.getElementById(`help-widget-${n}`);l&&(l.classList.toggle("right-0"),l.classList.toggle("left-0"))},children:p(RCt,{size:18})}),p("button",{children:p(kg,{size:20,onClick:()=>wK(n)})})]})]}),N("div",{className:"prose-sm p-5",ref:s,children:[p(bsn,{rehypePlugins:[Ncn],children:i}),p("div",{className:"flex justify-center",children:N(Li,{to:`https://invoiceninja.github.io/${r.replace(".md","")}`,external:!0,className:"flex items-center space-x-2",children:[p("span",{children:t("view_docs")})," ",p(G8e,{size:16})]})})]})]}),document.body)}function wK(n,e){const t=document.querySelector(`div#help-widget-${n}`);console.log(t),t&&(t.classList.toggle("hidden"),e!=null&&e.moveToHeading&&window.dispatchEvent(new CustomEvent(`help-widget-${n}:moveToHeading`,{detail:e.moveToHeading})))}function Ocn(){const{t:n}=pe(),e=vo(),t=ji(),i=So(),[r,o]=w.useState(!1),s=(a,l)=>{i("calculate_taxes",a),a&&(i("enabled_tax_rates",0),i("enabled_item_tax_rates",1),i("enabled_expense_tax_rates",1),i("settings.tax_rate1",0),i("settings.tax_rate2",0),i("settings.tax_rate3",0),i("settings.inclusive_taxes",!1)),l&&o(!1)};return N(dt,{children:[p(Ui,{title:n("calculate_taxes"),visible:r,onClose:()=>s(!1,!0),children:N("div",{className:"flex flex-col space-y-6",children:[N("div",{className:"flex items-center justify-center space-x-2",children:[p("div",{children:p(vt,{element:oxt,color:"orange",size:24})}),N("span",{className:"font-medium text-center break-words",children:[n("calculate_taxes_warning"),"."]})]}),N("div",{className:"flex justify-between",children:[p(Gt,{type:"secondary",behavior:"button",onClick:()=>s(!1,!0),children:n("cancel")}),p(Gt,{behavior:"button",onClick:()=>o(!1),children:n("continue")})]})]})}),p(K,{leftSide:n("calculate_taxes"),leftSideHelp:n("calculate_taxes_help"),children:N("div",{className:"flex items-center gap-4",children:[p(ft,{checked:!!(t!=null&&t.calculate_taxes),onValueChange:a=>{i("calculate_taxes",a),a&&o(!0)}}),p("button",{type:"button",style:{color:e},onClick:()=>wK("calculate-taxes",{moveToHeading:"Turn on Calculate Taxes"}),className:"inline-flex items-center space-x-1",children:p("span",{children:n("learn_more")})})]})})]})}function Pcn(){var f;const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("tax_settings"),href:"/settings/tax_settings"}];Pc(),Pi("tax_settings"),ZUt();const t=Qtn(),{isCompanySettingsActive:i,isGroupSettingsActive:r,isClientSettingsActive:o}=ea(),s=Fi($s),a=Qi(),l=ji(),c=g=>{a(Go({object:"company",property:g.target.id,value:g.target.value}))},u=(g,m)=>{a(Go({object:"company",property:g,value:m}))},d=Tu(),h=lp();return N(ir,{onSaveClick:d,onCancelClick:h,title:n("tax_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#tax_settings",children:[i&&N(dt,{children:[N(Qt,{title:n("tax_settings"),children:[l.calculate_taxes?null:p(K,{leftSide:n("invoice_tax_rates"),children:N(Cn,{id:"enabled_tax_rates",onChange:c,value:(l==null?void 0:l.enabled_tax_rates)||0,errorMessage:s==null?void 0:s.errors.enabled_tax_rates,children:[p("option",{value:"0",children:n("disabled")}),p("option",{value:"1",children:n("one_tax_rate")}),p("option",{value:"2",children:n("two_tax_rates")}),p("option",{value:"3",children:n("three_tax_rates")})]})}),p(K,{leftSide:n("line_item_tax_rates"),children:N(Cn,{id:"enabled_item_tax_rates",onChange:c,value:(l==null?void 0:l.enabled_item_tax_rates)||0,errorMessage:s==null?void 0:s.errors.enabled_item_tax_rates,children:[p("option",{value:"0",children:n("disabled")}),p("option",{value:"1",children:n("one_tax_rate")}),p("option",{value:"2",children:n("two_tax_rates")}),p("option",{value:"3",children:n("three_tax_rates")})]})}),p(K,{leftSide:n("expense_tax_rates"),children:N(Cn,{id:"enabled_expense_tax_rates",onChange:c,value:(l==null?void 0:l.enabled_expense_tax_rates)||0,errorMessage:s==null?void 0:s.errors.enabled_expense_tax_rates,children:[p("option",{value:"0",children:n("disabled")}),p("option",{value:"1",children:n("one_tax_rate")}),p("option",{value:"2",children:n("two_tax_rates")}),p("option",{value:"3",children:n("three_tax_rates")})]})}),l.calculate_taxes?null:p(K,{leftSide:n("inclusive_taxes"),children:N("div",{className:"flex items-center space-x-7",children:[p(ft,{onChange:g=>u("settings.inclusive_taxes",g),checked:!!(l!=null&&l.settings.inclusive_taxes),cypressRef:"inclusiveTaxToggle"}),l!=null&&l.settings.inclusive_taxes?N("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]}):N("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]})]})}),t((f=l==null?void 0:l.settings)==null?void 0:f.country_id)&&N(dt,{children:[p(_i,{}),p(Ocn,{}),l.calculate_taxes&&p(Ytn,{})]})]}),p(sDe,{})]}),(r||o)&&p(sDe,{title:"tax_settings"}),p(r0n,{}),p(lbe,{id:"calculate-taxes",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/taxes.md"})]})}function Mcn(){const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("product_settings"),href:"/settings/product_settings"}];Pc(),Pi("product_settings");const t=Fi($s),i=Qi(),r=ji(),o=(c,u)=>{i(Go({object:"company",property:c,value:u}))},s=So(),a=Tu(),l=lp();return p(ir,{onSaveClick:a,onCancelClick:l,title:n("product_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#product_settings",children:N(Qt,{title:n("Settings"),children:[p(K,{leftSide:n("track_inventory"),leftSideHelp:n("track_inventory_help"),children:p(ft,{checked:r==null?void 0:r.track_inventory,onChange:c=>o("track_inventory",c)})}),p(K,{leftSide:n("stock_notifications"),leftSideHelp:n("stock_notifications_help"),children:p(ft,{checked:r==null?void 0:r.stock_notification,onChange:c=>o("stock_notification",c)})}),(r==null?void 0:r.stock_notification)===!0?p(dt,{children:p(K,{leftSide:n("notification_threshold"),children:p(wo,{precision:0,value:(r==null?void 0:r.inventory_notification_threshold)||"",onValueChange:c=>s("inventory_notification_threshold",parseFloat(c)),errorMessage:t==null?void 0:t.errors.inventory_notification_threshold,disablePrecision:!0})})}):"",p(_i,{}),p(K,{leftSide:n("show_product_discount"),leftSideHelp:n("show_product_discount_help"),children:p(ft,{checked:r==null?void 0:r.enable_product_discount,onChange:c=>o("enable_product_discount",c)})}),p(K,{leftSide:n("show_product_cost"),leftSideHelp:n("show_cost_help"),children:p(ft,{checked:r==null?void 0:r.enable_product_cost,onChange:c=>o("enable_product_cost",c)})}),p(K,{leftSide:n("show_product_quantity"),leftSideHelp:n("show_product_quantity_help"),children:p(ft,{checked:r==null?void 0:r.enable_product_quantity,onChange:c=>o("enable_product_quantity",c)})}),p(K,{leftSide:n("default_quantity"),leftSideHelp:n("default_quantity_help"),children:p(ft,{checked:r==null?void 0:r.default_quantity,onChange:c=>o("default_quantity",c)})}),p(_i,{}),p(K,{leftSide:n("fill_products"),leftSideHelp:n("fill_products_help"),children:p(ft,{checked:r==null?void 0:r.fill_products,onChange:c=>o("fill_products",c)})}),p(K,{leftSide:n("update_products"),leftSideHelp:n("update_products_help"),children:p(ft,{checked:r==null?void 0:r.update_products,onChange:c=>o("update_products",c)})}),p(K,{leftSide:n("convert_products"),leftSideHelp:n("convert_products_help"),children:p(ft,{checked:r==null?void 0:r.convert_products,onChange:c=>o("convert_products",c)})})]})})}function Fcn(){var f,g,m,v,_,b,y,C;Pi("task_settings");const[n]=pe();Pc();const e=Qi(),t=lp(),i=Tu(),r=ma(),o=So(),s=ji(),a=Fi($s),{isCompanySettingsActive:l}=ea(),c=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"}],u=()=>{var x;return((x=s==null?void 0:s.settings)==null?void 0:x.task_round_to_nearest)===-1||![1,60,300,900,1800,3600,86400].find(E=>{var k;return E===((k=s==null?void 0:s.settings)==null?void 0:k.task_round_to_nearest)})},d=x=>e(Go({object:"company",property:x.target.id,value:x.target.value})),h=(x,E)=>e(Go({object:"company",property:x,value:E}));return N(ir,{onSaveClick:i,onCancelClick:t,title:n("task_settings"),breadcrumbs:c,docsLink:"en/basic-settings/#task_settings",children:[N(Qt,{title:n("settings"),children:[p(K,{leftSide:p(Bt,{propertyKey:"default_task_rate",labelElement:p($t,{label:n("default_task_rate")})}),children:p(wo,{value:((f=s==null?void 0:s.settings)==null?void 0:f.default_task_rate)||"",onValueChange:x=>o("settings.default_task_rate",parseFloat(x)),disabled:r("default_task_rate"),errorMessage:a==null?void 0:a.errors["settings.default_task_rate"]})}),l&&p(K,{leftSide:n("auto_start_tasks"),leftSideHelp:n("auto_start_tasks_help"),children:p(ft,{checked:!!(s!=null&&s.auto_start_tasks),onChange:x=>h("auto_start_tasks",x)})}),l&&p(K,{leftSide:n("show_task_end_date"),leftSideHelp:n("show_task_end_date_help"),children:p(ft,{checked:!!(s!=null&&s.show_task_end_date),onChange:x=>h("show_task_end_date",x)})}),l&&p(K,{leftSide:n("show_task_item_description"),leftSideHelp:n("show_task_item_description_help"),children:p(ft,{checked:!!(s!=null&&s.settings.show_task_item_description),onChange:x=>h("settings.show_task_item_description",x)})}),l&&p(K,{leftSide:n("allow_billable_task_items"),leftSideHelp:n("allow_billable_task_items_help"),children:p(ft,{checked:!!(s!=null&&s.settings.allow_billable_task_items),onChange:x=>h("settings.allow_billable_task_items",x)})}),l&&p(_i,{}),l&&p(K,{leftSide:n("show_tasks_table"),leftSideHelp:n("show_tasks_table_help"),children:p(ft,{checked:!!(s!=null&&s.show_tasks_table),onChange:x=>h("show_tasks_table",x)})}),l&&p(K,{leftSide:n("invoice_task_datelog"),leftSideHelp:n("invoice_task_datelog_help"),children:p(ft,{checked:!!(s!=null&&s.invoice_task_datelog),onChange:x=>h("invoice_task_datelog",x)})}),l&&p(K,{leftSide:n("invoice_task_timelog"),leftSideHelp:n("invoice_task_timelog_help"),children:p(ft,{checked:!!(s!=null&&s.invoice_task_timelog),onChange:x=>h("invoice_task_timelog",x)})}),l&&p(K,{leftSide:n("invoice_task_hours"),leftSideHelp:n("invoice_task_hours_help"),children:p(ft,{checked:!!(s!=null&&s.invoice_task_hours),onChange:x=>h("invoice_task_hours",x)})}),l&&p(K,{leftSide:n("invoice_task_project"),leftSideHelp:n("invoice_task_project_help"),children:p(ft,{checked:!!(s!=null&&s.invoice_task_project),onChange:x=>h("invoice_task_project",x)})}),l&&p(K,{leftSide:n("invoice_task_item_description"),leftSideHelp:n("invoice_task_item_description_help"),children:p(ft,{checked:!!(s!=null&&s.invoice_task_item_description),onChange:x=>h("invoice_task_item_description",x)})}),l&&p(K,{leftSide:n("lock_invoiced_tasks"),leftSideHelp:n("lock_invoiced_tasks_help"),children:p(ft,{checked:!!(s!=null&&s.invoice_task_lock),onChange:x=>h("invoice_task_lock",x)})}),l&&p(K,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:p(ft,{checked:!!(s!=null&&s.invoice_task_documents),onChange:x=>h("invoice_task_documents",x)})}),p(_i,{}),p(K,{leftSide:p(Bt,{propertyKey:"enable_client_portal_tasks",labelElement:p($t,{label:n("show_tasks_in_client_portal")}),defaultValue:!1}),children:p(ft,{checked:!!((g=s==null?void 0:s.settings)!=null&&g.enable_client_portal_tasks),onChange:x=>h("settings.enable_client_portal_tasks",x),disabled:r("enable_client_portal_tasks")})}),p(K,{leftSide:p(Bt,{propertyKey:"show_all_tasks_client_portal",labelElement:p($t,{label:n("tasks_shown_in_portal")}),defaultValue:"invoiced"}),children:N(Cn,{id:"settings.show_all_tasks_client_portal",onChange:d,disabled:!((m=s==null?void 0:s.settings)!=null&&m.enable_client_portal_tasks)||r("show_all_tasks_client_portal"),value:((_=(v=s==null?void 0:s.settings)==null?void 0:v.show_all_tasks_client_portal)==null?void 0:_.toString())||"invoiced",errorMessage:a==null?void 0:a.errors["settings.show_all_tasks_client_portal"],children:[p("option",{value:"invoiced",children:n("invoiced")}),p("option",{value:"uninvoiced",children:n("uninvoiced")}),p("option",{value:"all",children:n("all")})]})}),p(K,{leftSide:p(Bt,{propertyKey:"task_round_up",labelElement:p($t,{label:n("round_tasks"),helpLabel:n("round_tasks_help")}),defaultValue:!0}),children:N("div",{className:"flex items-center space-x-7",children:[p(ft,{checked:!!(((b=s==null?void 0:s.settings)==null?void 0:b.task_round_up)??!0),onChange:x=>h("settings.task_round_up",x),disabled:r("task_round_up")}),s!=null&&s.settings.task_round_up?p("span",{children:n("round_up")}):p("span",{children:n("round_down")})]})}),p(K,{leftSideHelp:n("task_round_to_nearest_help"),leftSide:p(Bt,{propertyKey:"task_round_to_nearest",labelElement:p($t,{label:n("task_round_to_nearest")}),defaultValue:1}),children:N(Cn,{value:typeof((y=s==null?void 0:s.settings)==null?void 0:y.task_round_to_nearest)<"u"?u()?"-1":s.settings.task_round_to_nearest.toString():"1",onValueChange:x=>o("settings.task_round_to_nearest",parseFloat(x)),disabled:r("task_round_to_nearest"),children:[N("option",{value:"1",children:[n("1_second")," (",n("disabled"),")"]}),p("option",{value:"60",children:n("1_minute")}),p("option",{value:"300",children:Ms("count_minutes",{count:5})}),p("option",{value:"900",children:Ms("count_minutes",{count:15})}),p("option",{value:"1800",children:Ms("count_minutes",{count:30})}),p("option",{value:"3600",children:n("1_hour")}),p("option",{value:"86400",children:n("1_day")}),p("option",{value:"-1",children:n("custom")})]})}),u()&&p(K,{leftSide:n("task_round_to_nearest"),children:p(wo,{precision:0,value:((C=s==null?void 0:s.settings)==null?void 0:C.task_round_to_nearest)||-1,onValueChange:x=>o("settings.task_round_to_nearest",parseFloat(x)),disabled:r("task_round_to_nearest"),disablePrecision:!0})})]}),l&&p(p0n,{})]})}function Bcn(n){const[e]=pe(),{customFilter:t}=n,i=n.customFilters?el(n.customFilters).pluck("dropdownKey").unique().toArray().map(l=>l??"0"):[],r=l=>{if(n.onStatusChange){const c=[];return l.map(u=>c.push(u.value)),n.onStatusChange(c)}},o=(l,c)=>{var u;if(n.onCustomFilterChange&&i.length===1){const d=[];return l.map(h=>d.push(h.value)),n.onCustomFilterChange(d)}else if(n.onCustomFilterChange&&i.length>1){const d=[];if(l.map(h=>d.push(h.value)),t!=null&&t.length){const h=((u=n.customFilters)==null?void 0:u.filter(f=>f.dropdownKey!==c&&t.some(g=>g===f.value)))||[];return n.onCustomFilterChange([...h.map(f=>f.value),...d])}else return n.onCustomFilterChange(d)}},s=ni(),a={multiValue:(l,{data:c})=>({...l,backgroundColor:c.backgroundColor,color:c.color,borderRadius:"3px"}),multiValueLabel:(l,{data:c})=>({...l,color:c.color}),multiValueRemove:l=>({...l,":hover":{color:"white"},color:"#999999"}),menu:l=>({...l,width:"max-content",minWidth:"100%",backgroundColor:s.$4,borderColor:s.$4}),control:l=>({...l,borderRadius:"3px",backgroundColor:s.$1,color:s.$3,borderColor:s.$5}),option:l=>({...l,backgroundColor:s.$1,":hover":{backgroundColor:s.$7}})};return N("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$2,borderColor:s.$4},children:[N("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-4 lg:space-y-0",style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},children:[n.children,n.options&&n.defaultOptions&&!n.withoutStatusFilter&&p(mv,{styles:a,defaultValue:n.defaultOptions,onChange:l=>r(l),placeholder:e("status"),options:n.options,isMulti:n.optionsMultiSelect}),i.map((l,c)=>{var u;return n.customFilters&&n.customFilterPlaceholder&&n.defaultCustomFilterOptions&&p(mv,{styles:a,defaultValue:n.defaultCustomFilterOptions.filter(d=>(d.dropdownKey??"0")===l),onChange:d=>o(d,l),placeholder:e(((u=n.customFilters.filter(d=>d.dropdownKey===l)[0])==null?void 0:u.placeHolder)??n.customFilterPlaceholder),options:n.customFilters.filter(d=>(d.dropdownKey??"0")===l),isMulti:n.optionsMultiSelect},c)})]}),N("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-4 lg:space-y-0",children:[n.beforeFilter,p(We,{id:"filter",changeOverride:!0,placeholder:e("filter"),value:n.filter,onValueChange:l=>n.onFilterChange&&n.onFilterChange(l),debounceTimeout:800}),n.rightSide]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function AKe(){const[n]=pe();return[{value:"active",label:n("active"),color:"black",backgroundColor:"#e4e4e4"},{value:"archived",label:n("archived"),color:"white",backgroundColor:"#e6b05c"},{value:"deleted",label:n("deleted"),color:"white",backgroundColor:"#c95f53"}]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const $cn=$8e(()=>sessionStorage),NKe=hF("dataTableFilters",{},$cn);function Vcn(n){const{tableKey:e}=n,t=Ar(NKe);return(i,r)=>{e&&t(o=>({...o,[e]:{filter:i,currentPage:r}}))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function RKe(n){const e=aF(),{tableKey:t}=n,i=Fi(NKe);return r=>{var s,a,l;if(!t)return"";if(r==="filter"||r==="currentPage")return(s=i==null?void 0:i[t])!=null&&s[r]?i[t][r]:"";const o=(a=e==null?void 0:e.company_user)==null?void 0:a.react_settings.table_filters;return(l=o==null?void 0:o[t])!=null&&l[r]?o[t][r]:""}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Hcn(n){const e=AKe(),{isInitialConfiguration:t,tableKey:i,customFilters:r,apiEndpoint:o,customFilter:s}=n,a=RKe({tableKey:i}),l=()=>{if(!t){const d=a("status"),h=d!=null&&d.length?d:["active"];return e.filter(({value:f})=>h.includes(f))||[e[0]]}},c=()=>{if(!t&&r){const d=a("customFilter"),h=d!=null&&d.length?d:[];return r.filter(({value:f})=>h.includes(f))||[r[0]]}},u=()=>{r&&el(r).pluck("queryKey").unique().toArray().forEach(h=>{const f=h||"client_status",g=[];r.forEach((m,v)=>{(m.queryKey||null)===h&&(s!=null&&s.includes(m.value))&&g.push(m.value),v===r.length-1&&o.searchParams.set(f,g.join(","))})})};return{defaultOptions:l(),defaultCustomFilterOptions:c(),handleChangingCustomFilters:u}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Wcn(n){const e=aF(),t=Qi(),{apiEndpoint:i,customFilters:r,tableKey:o,isInitialConfiguration:s,customFilter:a,setFilter:l,setCustomFilter:c,setCurrentPage:u,setSort:d,setSortedBy:h,setStatus:f,setPerPage:g,withoutStoringPerPage:m,enableSavingFilterPreference:v}=n,_=RKe({tableKey:o}),b=Vcn({tableKey:o}),y=x=>{Ae("PUT",Te("/api/v1/company_users/:id",{id:x.id}),x).then(E=>{un.set(x,"company_user",E.data.data),En(["company_users"]),t(qy(x))})},C=(x,E,k,L,D,A)=>{var M,V,U;if(!a||!o||!v)return;const O=(V=(M=e==null?void 0:e.company_user)==null?void 0:M.react_settings.table_filters)==null?void 0:V[o],P={...r&&{customFilter:[]},sort:i.searchParams.get("sort")||"id|asc",status:["active"],...!m&&{perPage:"10"}},F={...E&&{sortedBy:E},...r&&{customFilter:a},sort:k,status:D,...!m&&{perPage:A}};if(O&&m&&delete O.perPage,b(x,L),un.isEqual(P,F)&&!O||un.isEqual(O,F)&&O)return;const B=un.cloneDeep(e);if(B){const W=((U=B.company_user)==null?void 0:U.react_settings.table_filters)||{};Object.keys(W).forEach(q=>{q.includes("/")&&delete W[q]}),un.set(B,`company_user.react_settings.table_filters.${o}`,F),y(B)}};return w.useEffect(()=>{!s&&!a&&(l(_("filter")||""),r?_("customFilter").length?c(_("customFilter")):c([]):c([]),!m&&g(_("perPage")||"10"),u(_("currentPage")||1),d(_("sort")||"id|asc"),h(_("sortedBy")||void 0),_("status").length?f(_("status")):f(["active"]))},[s]),{handleUpdateTableFilters:C}}const cbe=Oo(null);function rLr(n){const[e]=pe(),[t,i]=w.useState(!1),{RangePicker:r}=CWe,[o,s]=w.useState(),[a,l]=w.useState(),{dateFormat:c}=lc(),u=Fi(cbe);w.useEffect(()=>{s(n.startDate),l(n.endDate)},[n.startDate,n.endDate]);const d=f=>{if(Un.extend(y_e),f[0]===""||f[1]==="")return;const g=["DD. MMM. YYYY","ddd MMM D, YYYY"];n.handleDateChange(Un(f[0],g.includes(c)?void 0:c,u==null?void 0:u.locale).format("YYYY-MM-DD")+","+Un(f[1],g.includes(c)?void 0:c,u==null?void 0:u.locale).format("YYYY-MM-DD"))},h=vo();return N("div",{className:"flex justify-end items-center",children:[p(q8e,{style:{color:h},className:"mx-2"}),N(Cn,{value:n.value,className:"appearance-none block px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding bg-no-repeat border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none",onValueChange:f=>{i(f==="custom"),n.handleDateRangeChange(f)},style:{width:"9.7rem"},children:[p("option",{value:"last7_days",children:e("last_7_days")}),p("option",{value:"last30_days",children:e("last_30_days")}),p("option",{value:"this_month",children:e("this_month")}),p("option",{value:"last_month",children:e("last_month")}),p("option",{value:"this_quarter",children:e("current_quarter")}),p("option",{value:"last_quarter",children:e("last_quarter")}),p("option",{value:"this_year",children:e("this_year")}),p("option",{value:"last_year",children:e("last_year")}),p("option",{value:"last365_days",children:`${e("last365_days")}`}),p("option",{value:"custom",children:`${e("custom")}`})]}),t&&p("div",{className:"flex flex-row space-x-2",children:p(u_e,{locale:u==null?void 0:u.default,children:p(r,{size:"large",defaultValue:[Un(o),Un(a)],format:c,onChange:(f,g)=>d(g)})})})]})}function zcn(n){const e=w.useRef(null),{RangePicker:t}=CWe,i=ni(),{setDateRange:r,onClick:o}=n,[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(""),h=Fi(cbe),{dateFormat:f}=lc();zk(e,()=>{s&&!l&&a(!1)});const g=v=>{Un.extend(y_e);const _=["DD. MMM. YYYY","ddd MMM D, YYYY"],b=v[0]?Un(v[0],_.includes(f)?void 0:f,h==null?void 0:h.locale).format("YYYY-MM-DD"):"",y=v[1]?Un(v[1],_.includes(f)?void 0:f,h==null?void 0:h.locale).format("YYYY-MM-DD"):"";d(b||y?[b,y].join(","):""),r(b||y?[b,y].join(","):"")},m=()=>{var b,y;const v=(b=u==null?void 0:u.split(","))==null?void 0:b[0],_=(y=u==null?void 0:u.split(","))==null?void 0:y[1];return!!(v&&_)};return w.useEffect(()=>{var v,_;if(s){const b=(v=u==null?void 0:u.split(","))==null?void 0:v[0],y=(_=u==null?void 0:u.split(","))==null?void 0:_[1];r((u==null?void 0:u.length)>1?[b,y].join(","):"")}},[s]),p("div",{ref:e,children:p(AF,{visible:s,placement:"bottom",interactive:!0,render:()=>{var v,_;return p("div",{className:"flex flex-col p-3",style:{backgroundColor:i.$2,border:`1px solid ${i.$5}`},onClick:b=>b.stopPropagation(),children:p(u_e,{locale:h==null?void 0:h.default,children:p(t,{size:"large",value:[(v=u==null?void 0:u.split(","))!=null&&v[0]?Un(u.split(",")[0]):null,(_=u==null?void 0:u.split(","))!=null&&_[1]?Un(u.split(",")[1]):null],format:f,onCalendarChange:(b,y)=>g(y),onOpenChange:b=>c(b)})})})},children:p("div",{className:"cursor-pointer",onClick:v=>{v.stopPropagation(),o(),a(_=>!_)},children:p(vt,{element:q8e,color:m()?"lightgreen":"white",style:{width:"1.4rem",height:"1.4rem"}})})})})}function Ucn(n){const{children:e}=n,t=vo();return p("tfoot",{style:{backgroundColor:t},children:p("tr",{children:e})})}function Ng(n){var et,Et;const[e]=pe(),t=AKe(),i=Ha(),r=Xme(),[o,s]=w.useState(!1),[a,l]=w.useState(new URL(Te(n.endpoint))),c=Ar(tu),{styleOptions:u,customFilters:d,onBulkActionCall:h,hideEditableOptions:f=!1,dateRangeColumns:g=[],excludeColumns:m=[],methodType:v="GET",queryIdentificator:_,disableQuery:b,footerColumns:y=[],bottomActionsKeys:C=[],withoutPerPageAsPreference:x=!1,withoutSortQueryParameter:E=!1,showRestoreBulk:k,enableSavingFilterPreference:L=!1}=n,D=w.useRef(void 0),[A,O]=w.useState(""),[P,F]=w.useState(void 0),[B,M]=w.useState(1),[V,U]=w.useState(a.searchParams.get("per_page")||"10"),[W,q]=w.useState(a.searchParams.get("sort")||"id|asc"),[H,ie]=w.useState(void 0),[se,Q]=w.useState(["active"]),[Ee,Fe]=w.useState(""),[He,ke]=w.useState(""),[Me,je]=w.useState([]),[qe,Be]=w.useState([]),[_t,Wt]=w.useState(!0),Tt=w.useRef(null),{handleUpdateTableFilters:rn}=Wcn({apiEndpoint:a,isInitialConfiguration:_t,customFilter:P,setCurrentPage:M,setCustomFilter:F,setFilter:O,setPerPage:U,setSort:q,setSortedBy:ie,setStatus:Q,tableKey:`${n.resource}s`,customFilters:d,withoutStoringPerPage:x,enableSavingFilterPreference:L}),{defaultOptions:_n,defaultCustomFilterOptions:wt,handleChangingCustomFilters:pt}=Hcn({apiEndpoint:a,isInitialConfiguration:_t,tableKey:`${n.resource}s`,customFilter:P,customFilters:d});w.useEffect(()=>{if(!_t){clearTimeout(D.current);const Qe=setTimeout(()=>rn(A,H,W,B,se,V),1500);D.current=Qe}if(a.searchParams.set("per_page",V),a.searchParams.set("page",B.toString()),a.searchParams.set("filter",A),pt(),(!E||E&&W!=="id|asc")&&a.searchParams.set("sort",W),a.searchParams.set("status",se),g.length&&He){const Qe=Ee==null?void 0:Ee.split(",")[0],At=Ee==null?void 0:Ee.split(",")[1];a.searchParams.set(He,Qe&&At?Ee:"")}return l(a),_t&&Wt(!1),()=>{c(void 0)}},[V,B,A,W,se,P,Ee,He]);const{data:ot,isLoading:we,isError:Se}=Ti([..._?[_]:[],a.pathname,n.endpoint,V,B,A,W,se,P,Ee,He],()=>Ae(v,a.href),{staleTime:n.staleTime??1/0,enabled:!b}),re=()=>qe.every(Qe=>Sr(Qe)!==Zi.Active),Y=(Qe,At)=>{ce.processing(),Ae("POST",Te(n.bulkRoute??`${n.endpoint}/bulk`),{action:Qe,ids:At?[At]:Array.from(Me)}).then(Ut=>{var fe;ce.success(`${Qe}d_${n.resource}`),(fe=n.onBulkActionSuccess)==null||fe.call(n,Ut.data.data,Qe),Tt.current.checked=!1,window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:Te(n.endpoint)}}))}).finally(()=>{B0t([n.endpoint,a.pathname]),je([])})},Z=w.useMemo(()=>n.customBulkActions?n.customBulkActions.some(Qe=>ae.isValidElement(Qe({selectedIds:Me,selectedResources:qe,setSelected:je}))):!1,[n.customBulkActions,Me,qe]),le=Qe=>n.customActions?n.customActions.some(At=>ae.isValidElement(At(Qe))):!1,te=Qe=>{var fe,Re;const At=(fe=g.find(Je=>He===Je.column))==null?void 0:fe.column,Ut=(Re=g.find(Je=>Qe===Je.column))==null?void 0:Re.queryParameterKey;At!==Qe&&Ut&&ke(Ut)},me=Qe=>y.find(At=>At.id===Qe),Oe=Qe=>ot==null?void 0:ot.data.data.map(At=>At[Qe]);return w.useEffect(()=>{c(a.pathname)},[a.pathname]),w.useEffect(()=>{if(ot){const Qe=ot.data.data.filter(Ut=>Me.includes(Ut.id));Be(Qe),ot.data.data.some(Ut=>!Me.includes(Ut.id))&&Tt.current?Tt.current.checked=!1:Tt.current&&ot.data.data.length&&(Tt.current.checked=!0)}},[Me]),w.useEffect(()=>{ot&&!ot.data.data.length&&M(1)},[ot]),w.useEffect(()=>{ot&&(Number(V)<Me.length||Number(V)===Me.length?je(ot.data.data.map(Qe=>Qe.id).filter(Qe=>Me.includes(Qe))):Number(V)>Me.length&&Tt.current&&(Tt.current.checked=!1))},[V]),w.useEffect(()=>{dfe.on("bulk.completed",()=>je([]))},[]),N("div",{"data-cy":"dataTable",children:[!n.withoutActions&&p(Bcn,{filter:A,onFilterChange:O,optionsMultiSelect:!0,options:t,defaultOptions:_n,defaultCustomFilterOptions:wt,onStatusChange:Q,customFilters:n.customFilters,customFilterPlaceholder:n.customFilterPlaceholder,onCustomFilterChange:F,customFilter:P,rightSide:N(dt,{children:[n.rightSide,n.linkToCreate&&p($n,{type:"component",guards:n.linkToCreateGuards||[],component:p(Gt,{to:n.linkToCreate,children:p("span",{children:e(`new_${n.resource}`)})})})]}),beforeFilter:n.beforeFilter,withoutStatusFilter:n.withoutStatusFilter,children:!f&&N($m,{label:e("actions"),disabled:!Me.length,cypressRef:"bulkActionsDropdown",children:[n.customBulkActions&&n.customBulkActions.map((Qe,At)=>p("div",{children:Qe({selectedIds:Me,selectedResources:qe,setSelected:je})},At)),n.customBulkActions&&Z&&p(_i,{withoutPadding:!0}),!n.withoutDefaultBulkActions&&N(dt,{children:[p(tn,{onClick:()=>{h?h(Me,"archive"):Y("archive")},icon:p(vt,{element:Ac}),children:e("archive")}),p(tn,{onClick:()=>{h?h(Me,"delete"):Y("delete")},icon:p(vt,{element:gl}),children:e("delete")}),(k?k(qe):re())&&p(tn,{onClick:()=>{h?h(Me,"restore"):Y("restore")},icon:p(vt,{element:Dc}),children:e("restore")})]})]})}),N(eE,{className:Nt(n.className,{"pr-0":!o}),withoutPadding:n.withoutPadding,withoutBottomBorder:u==null?void 0:u.withoutBottomBorder,withoutTopBorder:u==null?void 0:u.withoutTopBorder,withoutLeftBorder:u==null?void 0:u.withoutLeftBorder,withoutRightBorder:u==null?void 0:u.withoutRightBorder,onVerticalOverflowChange:Qe=>s(Qe),isDataLoading:we,style:n.style,resizable:a.pathname,children:[N(nE,{backgroundColor:u==null?void 0:u.headerBackgroundColor,children:[!n.withoutActions&&!f&&p(Fa,{className:u==null?void 0:u.thClassName,resizable:`${a.pathname}.leftCheckbox`,children:p(Ph,{innerRef:Tt,onChange:Qe=>{Array.from(document.querySelectorAll(".child-checkbox")).forEach(At=>{At.checked=Qe.target.checked,Qe.target.checked?Me.find(fe=>fe===At.id)||je(fe=>[...fe,At.id]):je([])})},cypressRef:"dataTableCheckbox"})}),n.columns.map((Qe,At)=>!m.includes(Qe.id)&&p(Fa,{id:Qe.id,className:u==null?void 0:u.thClassName,isCurrentlyUsed:H===Qe.id,onColumnClick:Ut=>{ie(Ut.field),q(Ut.sort)},childrenClassName:u==null?void 0:u.thChildrenClassName,resizable:`${a.pathname}.${Qe.id}`,children:N("div",{className:"flex items-center space-x-3",children:[g.some(Ut=>Qe.id===Ut.column)&&p(zcn,{setDateRange:Fe,onClick:()=>te(Qe.id)}),p("span",{children:Qe.label})]})},At)),n.withResourcefulActions&&!f&&p(Fa,{})]}),N(tE,{style:u==null?void 0:u.tBodyStyle,children:[we&&p(Ec,{className:Nt({"border-b border-gray-200":u==null?void 0:u.addRowSeparator,"last:border-b-0":o}),children:p(ko,{colSpan:100,children:p(ns,{})})}),Se&&p(Ec,{className:Nt({"border-b border-gray-200":u==null?void 0:u.addRowSeparator,"last:border-b-0":o}),children:p(ko,{className:"text-center",colSpan:100,children:e("error_refresh_page")})}),ot&&ot.data.data.length===0&&p(Ec,{className:Nt({"border-b border-gray-200":u==null?void 0:u.addRowSeparator,"last:border-b-0":o}),children:p(ko,{className:u==null?void 0:u.tdClassName,colSpan:100,children:e("no_records_found")})}),ot&&((Et=(et=ot==null?void 0:ot.data)==null?void 0:et.data)==null?void 0:Et.map((Qe,At)=>{var Ut,fe,Re,Je,Ot,Ft;return N(Ec,{className:Nt({"border-b border-gray-200":u==null?void 0:u.addRowSeparator,"last:border-b-0":o}),backgroundColor:At%2===0?r.$7:"",children:[!n.withoutActions&&!f&&p(ko,{className:"cursor-pointer",onClick:()=>Me.includes(Qe.id)?je(jt=>jt.filter(Jt=>Jt!==Qe.id)):je(jt=>[...jt,Qe.id]),children:p(Ph,{checked:Me.includes(Qe.id),className:"child-checkbox",value:Qe.id,id:Qe.id,cypressRef:"dataTableCheckbox"})}),n.columns.map((jt,Jt)=>!m.includes(jt.id)&&p(ko,{className:Nt({"cursor-pointer":Jt<3,"py-4":f},u==null?void 0:u.tdClassName),onClick:()=>{var ei;Jt<3&&(n.onTableRowClick?n.onTableRowClick(Qe):(ei=document.getElementById(Qe.id))==null||ei.click())},resizable:`${a.pathname}.${jt.id}`,children:jt.format?jt.format(Qe[jt.id],Qe):Qe[jt.id]},Jt)),n.withResourcefulActions&&!f&&p(ko,{children:N($m,{label:e("actions"),children:[n.linkToEdit&&(((Ut=n.showEdit)==null?void 0:Ut.call(n,Qe))||!n.showEdit)&&p(tn,{to:bt(n.linkToEdit,{id:Qe==null?void 0:Qe.id}),icon:p(vt,{element:_F}),children:e("edit")}),n.linkToEdit&&n.customActions&&le(Qe)&&(((fe=n.showEdit)==null?void 0:fe.call(n,Qe))||!n.showEdit)&&p(_i,{withoutPadding:!0}),n.customActions&&n.customActions.map((jt,Jt)=>{var ei;return!C.includes(((ei=jt(Qe))==null?void 0:ei.key)||"")&&p("div",{children:jt(Qe)},Jt)}),n.customActions&&(((Re=n.showRestore)==null?void 0:Re.call(n,Qe))||!n.showRestore)&&p(_i,{withoutPadding:!0}),(Qe==null?void 0:Qe.archived_at)===0&&(((Je=n.showArchive)==null?void 0:Je.call(n,Qe))||!n.showArchive)&&p(tn,{onClick:()=>Y("archive",Qe.id),icon:p(vt,{element:Ac}),children:e("archive")}),(Qe==null?void 0:Qe.archived_at)>0&&(((Ot=n.showRestore)==null?void 0:Ot.call(n,Qe))||!n.showRestore)&&p(tn,{onClick:()=>Y("restore",Qe.id),icon:p(vt,{element:Dc}),children:e("restore")}),!(Qe!=null&&Qe.is_deleted)&&(((Ft=n.showDelete)==null?void 0:Ft.call(n,Qe))||!n.showDelete)&&p(tn,{onClick:()=>Y("delete",Qe.id),icon:p(vt,{element:gl}),children:e("delete")}),n.customActions&&n.customActions.map((jt,Jt)=>{var ei;return C.includes(((ei=jt(Qe))==null?void 0:ei.key)||"")&&p("div",{children:jt(Qe)},Jt)})]})})]},At)}))]}),!!y.length&&!!(ot!=null&&ot.data.data.length)&&!!i.show_table_footer&&N(Ucn,{children:[!n.withoutActions&&!f&&p(Fa,{}),n.columns.map((Qe,At)=>{var Ut;return!m.includes(Qe.id)&&p(ko,{customizeTextColor:!0,resizable:`${a.pathname}.${Qe.id}`,children:me(Qe.id)?p("div",{className:"flex items-center space-x-3",children:((Ut=me(Qe.id))==null?void 0:Ut.format(Oe(Qe.id)||[],(ot==null?void 0:ot.data.data)||[]))??"-/-"}):p(dt,{})},At)}),n.withResourcefulActions&&!f&&p(Fa,{})]})]}),ot&&!n.withoutPagination&&p(JUe,{currentPerPage:V,currentPage:B,onPageChange:M,onRowsChange:U,totalPages:ot.data.meta.pagination.total_pages,totalRecords:ot.data.meta.pagination.total,leftSideChevrons:n.leftSideChevrons})]})}function jcn(){return p(Ng,{endpoint:"/api/v1/expense_categories?sort=id|desc",bulkRoute:"/api/v1/expense_categories/bulk",resource:"expense_category",columns:[{id:"category",label:"name",format:(e,t)=>p(Li,{to:bt("/settings/expense_categories/:id/edit",{id:t.id}),children:t.name})},{id:"color",label:"color",format:e=>p("div",{style:{backgroundColor:e},className:"p-1 h-4 w-10"})}],linkToCreate:"/settings/expense_categories/create",linkToEdit:"/settings/expense_categories/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ube(n){return Ti(["/api/v1/expense_categories",n],()=>{var e;return Ae("GET",Te("/api/v1/expense_categories?per_page=:perPage&page=:currentPage&sort=:sort&filter=:filter&status=:status",{perPage:n.perPage??"100",currentPage:n.currentPage??"1",sort:n.sort??"name|asc",filter:n.filter??"",status:((e=n.status)==null?void 0:e.join(","))??""})).then(t=>t.data.data)},{enabled:n.enabled??!0,staleTime:1/0})}function qcn(n){return Ti(["/api/v1/expense_categories",n.id],()=>Ae("GET",Te("/api/v1/expense_categories/:id",{id:n.id})),{enabled:n.enabled??!0,staleTime:1/0})}function Kcn(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/expense_categories/bulk"),{action:e,ids:[n]}).then(()=>{ce.success(`${e}d_expense_category`),En(["expense_categories"])})}}function OKe(){const{isAdmin:n}=Po();return Ti("/api/v1/expense_categories/create",()=>Ae("GET",Te("/api/v1/expense_categories/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function PKe(n){const[e]=pe(),{errors:t,setErrors:i,setExpenseCategory:r,expenseCategory:o,nameFieldRef:s}=n,a=ni(),l=(c,u)=>{i(void 0),r(d=>d&&{...d,[c]:u})};return N(x0,{children:[p(We,{innerRef:s,style:{color:a.$3,colorScheme:a.$0,backgroundColor:a.$1,borderColor:a.$4},required:!0,label:e("name"),value:o==null?void 0:o.name,onValueChange:c=>l("name",c),errorMessage:t==null?void 0:t.errors.name,cypressRef:"expenseCategoryNameField"}),p(pg,{children:e("color")}),p(Gk,{value:o==null?void 0:o.color,onValueChange:c=>l("color",c)})]})}function Gcn(){Pi("new_expense_category");const[n]=pe(),e=wi(),t=vo(),i=w.useRef(null),{data:r}=OKe(),[o,s]=w.useState(),[a,l]=w.useState(!1),[c,u]=w.useState(),d=[{name:n("settings"),href:"/settings"},{name:n("expense_settings"),href:"/settings/expense_settings"},{name:n("new_expense_category"),href:"/settings/expense_categories/create"}],h=()=>{i.current&&i.current.focus()},f=m=>{a||(l(!0),ce.processing(),Ae("POST",Te("/api/v1/expense_categories"),c).then(v=>{ce.success("created_expense_category"),En(["expense_categories"]),m==="save"?e(bt("/settings/expense_categories/:id/edit",{id:v.data.data.id})):r&&(u({...r,color:t}),h())}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(ce.dismiss(),s(v.response.data))}).finally(()=>l(!1)))},g=[{onClick:()=>f("create"),text:`${n("save")} / ${n("create")}`,icon:p(vt,{element:qp})}];return w.useEffect(()=>{r&&u({...r,color:t})},[r]),w.useEffect(()=>{h()},[i]),p(ir,{title:n("expense_categories"),breadcrumbs:d,children:p(Qt,{title:n("create_expense_category"),withSaveButton:!0,disableSubmitButton:a,onSaveClick:()=>f("save"),additionalSaveOptions:g,children:p(PKe,{nameFieldRef:i,expenseCategory:c,setExpenseCategory:u,errors:o,setErrors:s})})})}function Ycn(){const[n]=pe(),e=Kcn();return[i=>i.archived_at===0&&p(tn,{onClick:()=>e(i.id,"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),i=>i.archived_at>0&&p(tn,{onClick:()=>e(i.id,"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),i=>!i.is_deleted&&p(tn,{onClick:()=>e(i.id,"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function D1(n){const[e]=pe(),{onSaveClick:t,disableSaveButton:i,label:r,saveButtonLabel:o,disableSaveButtonOnly:s}=n;return N(dt,{children:[t&&N("div",{className:"flex",children:[p(Gt,{behavior:"button",className:"rounded-br-none rounded-tr-none px-3",onClick:t,disabled:i||s,disableWithoutIcon:!0,children:o??e("save")}),p($m,{className:"rounded-bl-none rounded-tl-none h-full border-l-1 border-y-0 border-r-0",cardActions:!0,disabled:i,cypressRef:n.cypressRef,children:n.actions.map((a,l)=>p(w.Fragment,{children:a(n.resource)},l))})]}),!t&&r&&p($m,{label:n.label,cypressRef:n.cypressRef,children:n.actions.map((a,l)=>p(w.Fragment,{children:a(n.resource)},l))})]})}function Qcn(){const{setDocumentTitle:n}=Pi("edit_expense_category"),[e]=pe(),{id:t}=il(),i=Ycn(),{data:r}=qcn({id:t}),o=[{name:e("settings"),href:"/settings"},{name:e("expense_settings"),href:"/settings/expense_settings"},{name:e("edit_expense_category"),href:bt("/settings/expense_categories/:id/edit",{id:t})}],[s,a]=w.useState(),[l,c]=w.useState(!1),[u,d]=w.useState({name:"",color:""}),h=(g,m)=>{a(void 0),d(v=>({...v,[g]:m}))},f=g=>{g.preventDefault(),l||(c(!0),a(void 0),ce.processing(),Ae("PUT",Te("/api/v1/expense_categories/:id",{id:t}),u).then(()=>{ce.success("updated_expense_category"),En(["expense_categories"])}).catch(m=>{var v;((v=m.response)==null?void 0:v.status)===422&&(a(m.response.data),ce.dismiss())}).finally(()=>c(!1)))};return w.useEffect(()=>{n(r==null?void 0:r.data.data.name),d(r==null?void 0:r.data.data)},[r]),N(ir,{title:e("expense_categories"),breadcrumbs:o,navigationTopRight:u&&p(D1,{label:e("more_actions"),resource:u,actions:i}),children:[!r&&p("div",{className:"flex justify-center",children:p(ns,{})}),r&&N(Qt,{withSaveButton:!0,disableSubmitButton:l,onFormSubmit:f,title:u==null?void 0:u.name,children:[N(K,{leftSide:e("status"),children:[!r.data.data.is_deleted&&!r.data.data.archived_at&&p(pr,{variant:"primary",children:e("active")}),r.data.data.archived_at&&!r.data.data.is_deleted?p(pr,{variant:"yellow",children:e("archived")}):null,r.data.data.is_deleted&&p(pr,{variant:"red",children:e("deleted")})]}),N(x0,{children:[p(We,{label:e("name"),onValueChange:g=>h("name",g),value:u==null?void 0:u.name,errorMessage:s==null?void 0:s.errors.name,required:!0}),p(pg,{children:e("color")}),p(Gk,{value:u==null?void 0:u.color,onValueChange:g=>h("color",g)})]})]})]})}function Xcn(){Pi("expense_settings");const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("expense_settings"),href:"/settings/expense_settings"}],t=Pc(),{isCompanySettingsActive:i}=ea(),r=Qi(),o=lp(),s=Tu(),a=So();return N(ir,{onSaveClick:s,onCancelClick:o,title:n("expense_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#expense_settings",children:[N(Qt,{title:n("settings"),children:[p(K,{leftSide:n("should_be_invoiced"),leftSideHelp:n("should_be_invoiced_help"),children:p(ft,{checked:t==null?void 0:t.mark_expenses_invoiceable,onChange:l=>a("mark_expenses_invoiceable",l),cypressRef:"shouldBeInvoicedToggle"})}),p(K,{leftSide:n("mark_paid"),leftSideHelp:n("mark_paid_help"),children:p(ft,{checked:t==null?void 0:t.mark_expenses_paid,onChange:l=>a("mark_expenses_paid",l),cypressRef:"markPaidToggle"})}),p(K,{leftSide:n("convert_currency"),leftSideHelp:n("convert_expense_currency_help"),children:p(ft,{checked:t==null?void 0:t.convert_expense_currency,onChange:l=>a("convert_expense_currency",l),cypressRef:"convertCurrencyToggle"})}),p(K,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:p(ft,{checked:t==null?void 0:t.invoice_expense_documents,onChange:l=>a("invoice_expense_documents",l),cypressRef:"addDocumentsToInvoiceToggle"})}),p(K,{leftSide:n("notify_vendor_when_paid"),leftSideHelp:n("notify_vendor_when_paid_help"),children:p(ft,{onChange:l=>a("notify_vendor_when_paid",l),checked:(t==null?void 0:t.notify_vendor_when_paid)||!1})}),i&&Rk()&&N(dt,{children:[p(_i,{withoutPadding:!0}),p(K,{className:"mt-3.5",leftSide:n("expense_mailbox_active"),children:p(ft,{checked:!!(t!=null&&t.expense_mailbox_active),onChange:l=>a("expense_mailbox_active",l)})}),!!(t!=null&&t.expense_mailbox_active)&&N(dt,{children:[p(K,{leftSide:n("expense_mailbox"),children:p(We,{value:(t==null?void 0:t.expense_mailbox)||"",onValueChange:l=>a("expense_mailbox",l)})}),p(K,{leftSide:n("inbound_mailbox_allow_company_users"),children:p(ft,{checked:!!(t!=null&&t.inbound_mailbox_allow_company_users),onChange:l=>a("inbound_mailbox_allow_company_users",l)})}),p(K,{leftSide:n("inbound_mailbox_allow_vendors"),children:p(ft,{checked:!!(t!=null&&t.inbound_mailbox_allow_vendors),onChange:l=>a("inbound_mailbox_allow_vendors",l)})}),p(K,{leftSide:n("inbound_mailbox_allow_clients"),children:p(ft,{checked:!!(t!=null&&t.inbound_mailbox_allow_clients),onChange:l=>a("inbound_mailbox_allow_clients",l)})}),p(K,{leftSide:n("inbound_mailbox_whitelist"),leftSideHelp:n("inbound_mailbox_whitelist_help"),children:p(We,{value:(t==null?void 0:t.inbound_mailbox_whitelist)||"",onValueChange:l=>a("inbound_mailbox_whitelist",l)})}),p(K,{leftSide:n("inbound_mailbox_blacklist"),leftSideHelp:n("inbound_mailbox_blacklist_help"),children:p(We,{value:(t==null?void 0:t.inbound_mailbox_blacklist)||"",onValueChange:l=>a("inbound_mailbox_blacklist",l)})}),p(K,{leftSide:n("inbound_mailbox_allow_unknown"),children:p(ft,{checked:!!(t!=null&&t.inbound_mailbox_allow_unknown),onChange:l=>a("inbound_mailbox_allow_unknown",l)})})]})]}),p(_i,{className:"pb-3.5",withoutPadding:!0}),p(K,{leftSide:n("enter_taxes"),children:p(L7e,{onValueChange:l=>r(Go({object:"company",property:"calculate_expense_tax_by_amount",value:l==="true"})),options:[{id:"by_rate",title:n("by_rate"),value:"false"},{id:"by_amount",title:n("by_amount"),value:"true"}],name:"calculate_expense_tax_by_amount",defaultSelected:t==null?void 0:t.calculate_expense_tax_by_amount.toString(),cypressRef:"taxByRadio"})}),p(K,{leftSide:n("inclusive_taxes"),leftSideHelp:N("span",{className:"flex flex-col",children:[N("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]}),N("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]})]}),children:p(ft,{onChange:l=>a("expense_inclusive_taxes",l),checked:(t==null?void 0:t.expense_inclusive_taxes)||!1,cypressRef:"inclusiveTaxesToggle"})})]}),p(jcn,{})]})}function kv(n){const e=ni(),t=vo(),{withoutVerticalMargin:i}=n,[r,o]=w.useState(n.defaultTabIndex||0),s=a=>{var l;o(a),(l=n.onTabChange)==null||l.call(n,a)};return w.useEffect(()=>{o(n.defaultTabIndex||0)},[n.defaultTabIndex]),N("div",{className:n.className,"data-cy":"tabs",children:[p("div",{className:"-mb-px flex space-x-8 overflow-x-auto border-b",style:{borderColor:e.$5},children:n.tabs.map((a,l)=>{var c;return p("div",{className:Nt({"w-full":n.width==="full"}),children:p("button",{type:"button",onClick:()=>s(l),style:{borderColor:r===l?t:"transparent",color:r===l?t:e.$3},className:Nt("whitespace-nowrap py-4 px-3 border-b-2 font-medium text-sm",{"w-full":n.width==="full"}),children:((c=n.formatTabLabel)==null?void 0:c.call(n,l))||a})},l)})}),p("div",{className:Nt(n.childrenClassName,{"flex flex-1":n.height==="full","my-4":n.height!=="full"&&!i,"overflow-y-scroll px-[5px]":n.withScrollableContent}),children:[...n.children].map((a,l)=>{var c;return ae.isValidElement(a)&&ae.cloneElement(a,{key:l,className:Nt((c=a.props)==null?void 0:c.className,{"flex flex-col flex-1":n.height==="full","block my-4":n.height!=="full"&&!i,hidden:r!==l})})})})]})}function Zcn(){var a,l,c,u;const[n]=pe(),e=Qi(),t=ji(),i=ma(),{isCompanySettingsActive:r}=ea(),o=Fi($s),s=(d,h)=>e(Go({object:"company",property:d,value:h}));return N(Qt,{title:n("invoices"),children:[p(K,{leftSide:p(Bt,{propertyKey:"auto_email_invoice",labelElement:p($t,{label:n("auto_email_invoice"),helpLabel:n("auto_email_invoice_help")}),defaultValue:!1}),children:p(ft,{checked:!!((a=t==null?void 0:t.settings)!=null&&a.auto_email_invoice),onChange:d=>s("settings.auto_email_invoice",d),disabled:i("auto_email_invoice")})}),r&&p(K,{leftSide:n("stop_on_unpaid"),leftSideHelp:n("stop_on_unpaid_help"),children:p(ft,{checked:!!(t!=null&&t.stop_on_unpaid_recurring),onChange:d=>s("stop_on_unpaid_recurring",d)})}),p(_i,{}),p(K,{leftSide:p(Bt,{propertyKey:"auto_archive_invoice",labelElement:p($t,{label:n("auto_archive_invoice"),helpLabel:n("auto_archive_invoice_help")}),defaultValue:!1}),children:p(ft,{checked:!!((l=t==null?void 0:t.settings)!=null&&l.auto_archive_invoice),onChange:d=>s("settings.auto_archive_invoice",d),disabled:i("auto_archive_invoice")})}),p(K,{leftSide:p(Bt,{propertyKey:"auto_archive_invoice_cancelled",labelElement:p($t,{label:n("auto_archive_invoice_cancelled"),helpLabel:n("auto_archive_invoice_cancelled_help")}),defaultValue:!1}),children:p(ft,{checked:!!((c=t==null?void 0:t.settings)!=null&&c.auto_archive_invoice_cancelled),onChange:d=>s("settings.auto_archive_invoice_cancelled",d),disabled:i("auto_archive_invoice_cancelled")})}),p(_i,{}),p(K,{leftSide:p(Bt,{propertyKey:"lock_invoices",labelElement:p($t,{label:n("lock_invoices")}),defaultValue:"off"}),children:N(Cn,{onChange:d=>s("settings.lock_invoices",d.target.value),value:((u=t==null?void 0:t.settings)==null?void 0:u.lock_invoices)||"off",disabled:i("lock_invoices"),errorMessage:o==null?void 0:o.errors["settings.lock_invoices"],children:[p("option",{value:"off",children:n("off")}),p("option",{value:"when_sent",children:n("when_sent")}),p("option",{value:"when_paid",children:n("when_paid")}),p("option",{value:"end_of_month",children:n("end_of_month")})]})})]})}function Jcn(){var s,a;const[n]=pe(),e=Qi(),t=ji(),{isCompanySettingsActive:i}=ea(),r=ma(),o=(l,c)=>e(Go({object:"company",property:l,value:c}));return N(Qt,{title:n("quotes"),children:[p(K,{leftSide:p(Bt,{propertyKey:"auto_convert_quote",labelElement:p($t,{label:n("auto_convert_quote"),helpLabel:n("auto_convert_quote_help")}),defaultValue:!1}),children:p(ft,{checked:!!((s=t==null?void 0:t.settings)!=null&&s.auto_convert_quote),onChange:l=>o("settings.auto_convert_quote",l),disabled:r("auto_convert_quote")})}),p(K,{leftSide:p(Bt,{propertyKey:"auto_archive_quote",labelElement:p($t,{label:n("auto_archive_quote"),helpLabel:n("auto_archive_quote_help")}),defaultValue:!1}),children:p(ft,{checked:!!((a=t==null?void 0:t.settings)!=null&&a.auto_archive_quote),onChange:l=>o("settings.auto_archive_quote",l),disabled:r("auto_archive_quote")})}),i&&p(K,{leftSide:n("use_quote_terms"),leftSideHelp:n("use_quote_terms_help"),children:p(ft,{checked:!!(t!=null&&t.use_quote_terms_on_conversion),onChange:l=>o("use_quote_terms_on_conversion",l)})})]})}function eun(){const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("workflow_settings"),href:"/settings/workflow_settings"}];Pi("workflow_settings"),Pc();const t=Tu(),i=lp(),r=[n("invoices"),n("quotes")];return p(ir,{onSaveClick:t,onCancelClick:i,title:n("workflow_settings"),breadcrumbs:e,docsLink:"en/advanced-settings/#workflow_settings",children:N(kv,{tabs:r,children:[p("div",{children:p(Zcn,{})}),p("div",{children:p(Jcn,{})})]})})}const lee={activities:[],clients:["created_at"],client_contacts:["created_at"],invoices:["date","due_date","partial_due_date"],invoice_items:["date","due_date","partial_due_date"],quotes:["date","due_date","partial_due_date"],quote_items:["date","due_date","partial_due_date"],credits:["date","due_date","partial_due_date"],documents:["created_at"],expenses:["date","payment_date"],purchase_orders:[],purchase_order_items:[],recurring_invoices:["date","due_date","partial_due_date"],payments:["date"],products:["created_at"],vendors:[],tasks:["created_at"]},tun=[{identifier:"last7",label:"last_7_days"},{identifier:"last30",label:"last_30_days"},{identifier:"this_month",label:"this_month"},{identifier:"last_month",label:"last_month"},{identifier:"this_quarter",label:"this_quarter"},{identifier:"last_quarter",label:"last_quarter"},{identifier:"this_year",label:"this_year"},{identifier:"custom",label:"custom"}],gAe={date_key:"",date_range:"",end_date:"",report_keys:[],send_email:!0,start_date:""};function nun(){const[n]=pe(),[e,t]=w.useState(),[i,r]=w.useState(!1),[o,s]=w.useState("activities"),[a,l]=w.useState(gAe),c=(d,h)=>{l(h==="date_key"?f=>({...f,date_key:d,date_range:d?"last7":""}):h==="date_range"?f=>({...f,date_range:d,start_date:d==="custom"?f.start_date:"",end_date:d==="custom"?f.end_date:""}):f=>({...f,[h]:d}))},u=()=>{i||(ce.processing(),r(!0),Ae("POST",Te(`/api/v1/reports/${o}`),a).then(()=>ce.success("exported_data")).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(ce.dismiss(),t(d.response.data))}).finally(()=>r(!1)))};return w.useEffect(()=>{l(gAe)},[o]),N(Qt,{title:n("export"),saveButtonLabel:n("export"),withSaveButton:!0,onSaveClick:d=>{d.preventDefault(),u()},disableSubmitButton:i,disableWithoutIcon:!0,children:[p(K,{leftSide:n("export"),children:n("csv")}),p(K,{leftSide:n("export_type"),children:p(Cn,{value:o,onValueChange:d=>s(d),children:Object.keys(lee).map((d,h)=>p("option",{value:d,children:n(d)},h))})}),!!lee[o].length&&p(K,{leftSide:n("date"),children:p(Cn,{value:a.date_key,onValueChange:d=>c(d,"date_key"),withBlank:!0,errorMessage:e==null?void 0:e.errors.date_key,children:lee[o].map((d,h)=>p("option",{value:d,children:n(d)},h))})}),a.date_key&&p(K,{leftSide:n("date_range"),children:p(Cn,{value:a.date_range,onValueChange:d=>c(d,"date_range"),errorMessage:e==null?void 0:e.errors.date_range,children:tun.map(({identifier:d,label:h},f)=>p("option",{value:d,children:n(h)},f))})}),a.date_range==="custom"&&N(dt,{children:[p(K,{leftSide:n("start_date"),children:p(We,{type:"date",value:a.start_date,onValueChange:d=>c(d,"start_date"),errorMessage:e==null?void 0:e.errors.start_date})}),p(K,{leftSide:n("end_date"),children:p(We,{type:"date",value:a.end_date,onValueChange:d=>c(d,"end_date"),errorMessage:e==null?void 0:e.errors.end_date})})]})]})}var iun=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function s6(n,e){var t=run(n);if(typeof t.path!="string"){var i=n.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof e=="string"?e:typeof i=="string"&&i.length>0?i:n.name,writable:!1,configurable:!1,enumerable:!0})}return t}function run(n){var e=n.name,t=e&&e.lastIndexOf(".")!==-1;if(t&&!n.type){var i=e.split(".").pop().toLowerCase(),r=iun.get(i);r&&Object.defineProperty(n,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return n}var oun=[".DS_Store","Thumbs.db"];function sun(n){return CN(this,void 0,void 0,function(){return wN(this,function(e){return SW(n)&&aun(n.dataTransfer)?[2,dun(n.dataTransfer,n.type)]:lun(n)?[2,cun(n)]:Array.isArray(n)&&n.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,uun(n)]:[2,[]]})})}function aun(n){return SW(n)}function lun(n){return SW(n)&&SW(n.target)}function SW(n){return typeof n=="object"&&n!==null}function cun(n){return bae(n.target.files).map(function(e){return s6(e)})}function uun(n){return CN(this,void 0,void 0,function(){var e;return wN(this,function(t){switch(t.label){case 0:return[4,Promise.all(n.map(function(i){return i.getFile()}))];case 1:return e=t.sent(),[2,e.map(function(i){return s6(i)})]}})})}function dun(n,e){return CN(this,void 0,void 0,function(){var t,i;return wN(this,function(r){switch(r.label){case 0:return n.items?(t=bae(n.items).filter(function(o){return o.kind==="file"}),e!=="drop"?[2,t]:[4,Promise.all(t.map(hun))]):[3,2];case 1:return i=r.sent(),[2,mAe(MKe(i))];case 2:return[2,mAe(bae(n.files).map(function(o){return s6(o)}))]}})})}function mAe(n){return n.filter(function(e){return oun.indexOf(e.name)===-1})}function bae(n){if(n===null)return[];for(var e=[],t=0;t<n.length;t++){var i=n[t];e.push(i)}return e}function hun(n){if(typeof n.webkitGetAsEntry!="function")return _Ae(n);var e=n.webkitGetAsEntry();return e&&e.isDirectory?FKe(e):_Ae(n)}function MKe(n){return n.reduce(function(e,t){return FD(FD([],Zxe(e),!1),Zxe(Array.isArray(t)?MKe(t):[t]),!1)},[])}function _Ae(n){var e=n.getAsFile();if(!e)return Promise.reject("".concat(n," is not a File"));var t=s6(e);return Promise.resolve(t)}function fun(n){return CN(this,void 0,void 0,function(){return wN(this,function(e){return[2,n.isDirectory?FKe(n):pun(n)]})})}function FKe(n){var e=n.createReader();return new Promise(function(t,i){var r=[];function o(){var s=this;e.readEntries(function(a){return CN(s,void 0,void 0,function(){var l,c,u;return wN(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(r)];case 2:return l=d.sent(),t(l),[3,4];case 3:return c=d.sent(),i(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(fun)),r.push(u),o(),d.label=6;case 6:return[2]}})})},function(a){i(a)})}o()})}function pun(n){return CN(this,void 0,void 0,function(){return wN(this,function(e){return[2,new Promise(function(t,i){n.file(function(r){var o=s6(r,n.fullPath);t(o)},function(r){i(r)})})]})})}var gun=function(n,e){if(n&&e){var t=Array.isArray(e)?e:e.split(","),i=n.name||"",r=(n.type||"").toLowerCase(),o=r.replace(/\/.*$/,"");return t.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?i.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):r===a})}return!0};function vAe(n){return vun(n)||_un(n)||$Ke(n)||mun()}function mun(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _un(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function vun(n){if(Array.isArray(n))return yae(n)}function bAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function yAe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bAe(Object(t),!0).forEach(function(i){BKe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bAe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function BKe(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function s3(n,e){return Cun(n)||yun(n,e)||$Ke(n,e)||bun()}function bun(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Ke(n,e){if(n){if(typeof n=="string")return yae(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return yae(n,e)}}function yae(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function yun(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function Cun(n){if(Array.isArray(n))return n}var wun="file-invalid-type",Sun="file-too-large",Eun="file-too-small",xun="too-many-files",Tun=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var t=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:wun,message:"File type must be ".concat(t)}},CAe=function(e){return{code:Sun,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},wAe=function(e){return{code:Eun,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},kun={code:xun,message:"Too many files"};function VKe(n,e){var t=n.type==="application/x-moz-file"||gun(n,e);return[t,t?null:Tun(e)]}function HKe(n,e,t){if(bx(n.size))if(bx(e)&&bx(t)){if(n.size>t)return[!1,CAe(t)];if(n.size<e)return[!1,wAe(e)]}else{if(bx(e)&&n.size<e)return[!1,wAe(e)];if(bx(t)&&n.size>t)return[!1,CAe(t)]}return[!0,null]}function bx(n){return n!=null}function Iun(n){var e=n.files,t=n.accept,i=n.minSize,r=n.maxSize,o=n.multiple,s=n.maxFiles,a=n.validator;return!o&&e.length>1||o&&s>=1&&e.length>s?!1:e.every(function(l){var c=VKe(l,t),u=s3(c,1),d=u[0],h=HKe(l,i,r),f=s3(h,1),g=f[0],m=a?a(l):null;return d&&g&&!m})}function EW(n){return typeof n.isPropagationStopped=="function"?n.isPropagationStopped():typeof n.cancelBubble<"u"?n.cancelBubble:!1}function a9(n){return n.dataTransfer?Array.prototype.some.call(n.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!n.target&&!!n.target.files}function SAe(n){n.preventDefault()}function Lun(n){return n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1}function Dun(n){return n.indexOf("Edge/")!==-1}function Aun(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Lun(n)||Dun(n)}function Vv(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(i){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return e.some(function(a){return!EW(i)&&a&&a.apply(void 0,[i].concat(o)),EW(i)})}}function Nun(){return"showOpenFilePicker"in window}function Run(n){if(bx(n)){var e=Object.entries(n).filter(function(t){var i=s3(t,2),r=i[0],o=i[1],s=!0;return WKe(r)||(console.warn('Skipped "'.concat(r,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(zKe))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(t,i){var r=s3(i,2),o=r[0],s=r[1];return yAe(yAe({},t),{},BKe({},o,s))},{});return[{description:"Files",accept:e}]}return n}function Oun(n){if(bx(n))return Object.entries(n).reduce(function(e,t){var i=s3(t,2),r=i[0],o=i[1];return[].concat(vAe(e),[r],vAe(o))},[]).filter(function(e){return WKe(e)||zKe(e)}).join(",")}function Pun(n){return n instanceof DOMException&&(n.name==="AbortError"||n.code===n.ABORT_ERR)}function Mun(n){return n instanceof DOMException&&(n.name==="SecurityError"||n.code===n.SECURITY_ERR)}function WKe(n){return n==="audio/*"||n==="video/*"||n==="image/*"||n==="text/*"||/\w+\/[-+.\w]+/g.test(n)}function zKe(n){return/^.*\.[\w]+$/.test(n)}var Fun=["children"],Bun=["open"],$un=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Vun=["refKey","onChange","onClick"];function Hun(n){return Uun(n)||zun(n)||UKe(n)||Wun()}function Wun(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zun(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Uun(n){if(Array.isArray(n))return Cae(n)}function cee(n,e){return Kun(n)||qun(n,e)||UKe(n,e)||jun()}function jun(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UKe(n,e){if(n){if(typeof n=="string")return Cae(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cae(n,e)}}function Cae(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function qun(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function Kun(n){if(Array.isArray(n))return n}function EAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Al(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?EAe(Object(t),!0).forEach(function(i){wae(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):EAe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function wae(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xW(n,e){if(n==null)return{};var t=Gun(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Gun(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var dbe=w.forwardRef(function(n,e){var t=n.children,i=xW(n,Fun),r=YN(i),o=r.open,s=xW(r,Bun);return w.useImperativeHandle(e,function(){return{open:o}},[o]),ae.createElement(w.Fragment,null,t(Al(Al({},s),{},{open:o})))});dbe.displayName="Dropzone";var jKe={disabled:!1,getFilesFromEvent:sun,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};dbe.defaultProps=jKe;dbe.propTypes={children:Ke.func,accept:Ke.objectOf(Ke.arrayOf(Ke.string)),multiple:Ke.bool,preventDropOnDocument:Ke.bool,noClick:Ke.bool,noKeyboard:Ke.bool,noDrag:Ke.bool,noDragEventsBubbling:Ke.bool,minSize:Ke.number,maxSize:Ke.number,maxFiles:Ke.number,disabled:Ke.bool,getFilesFromEvent:Ke.func,onFileDialogCancel:Ke.func,onFileDialogOpen:Ke.func,useFsAccessApi:Ke.bool,autoFocus:Ke.bool,onDragEnter:Ke.func,onDragLeave:Ke.func,onDragOver:Ke.func,onDrop:Ke.func,onDropAccepted:Ke.func,onDropRejected:Ke.func,onError:Ke.func,validator:Ke.func};var Sae={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function YN(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Al(Al({},jKe),n),t=e.accept,i=e.disabled,r=e.getFilesFromEvent,o=e.maxSize,s=e.minSize,a=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,h=e.onDrop,f=e.onDropAccepted,g=e.onDropRejected,m=e.onFileDialogCancel,v=e.onFileDialogOpen,_=e.useFsAccessApi,b=e.autoFocus,y=e.preventDropOnDocument,C=e.noClick,x=e.noKeyboard,E=e.noDrag,k=e.noDragEventsBubbling,L=e.onError,D=e.validator,A=w.useMemo(function(){return Oun(t)},[t]),O=w.useMemo(function(){return Run(t)},[t]),P=w.useMemo(function(){return typeof v=="function"?v:xAe},[v]),F=w.useMemo(function(){return typeof m=="function"?m:xAe},[m]),B=w.useRef(null),M=w.useRef(null),V=w.useReducer(Yun,Sae),U=cee(V,2),W=U[0],q=U[1],H=W.isFocused,ie=W.isFileDialogActive,se=w.useRef(typeof window<"u"&&window.isSecureContext&&_&&Nun()),Q=function(){!se.current&&ie&&setTimeout(function(){if(M.current){var le=M.current.files;le.length||(q({type:"closeDialog"}),F())}},300)};w.useEffect(function(){return window.addEventListener("focus",Q,!1),function(){window.removeEventListener("focus",Q,!1)}},[M,ie,F,se]);var Ee=w.useRef([]),Fe=function(le){B.current&&B.current.contains(le.target)||(le.preventDefault(),Ee.current=[])};w.useEffect(function(){return y&&(document.addEventListener("dragover",SAe,!1),document.addEventListener("drop",Fe,!1)),function(){y&&(document.removeEventListener("dragover",SAe),document.removeEventListener("drop",Fe))}},[B,y]),w.useEffect(function(){return!i&&b&&B.current&&B.current.focus(),function(){}},[B,b,i]);var He=w.useCallback(function(Z){L?L(Z):console.error(Z)},[L]),ke=w.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),Ee.current=[].concat(Hun(Ee.current),[Z.target]),a9(Z)&&Promise.resolve(r(Z)).then(function(le){if(!(EW(Z)&&!k)){var te=le.length,me=te>0&&Iun({files:le,accept:A,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:D}),Oe=te>0&&!me;q({isDragAccept:me,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),c&&c(Z)}}).catch(function(le){return He(le)})},[r,c,He,k,A,s,o,a,l,D]),Me=w.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var le=a9(Z);if(le&&Z.dataTransfer)try{Z.dataTransfer.dropEffect="copy"}catch{}return le&&d&&d(Z),!1},[d,k]),je=w.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z);var le=Ee.current.filter(function(me){return B.current&&B.current.contains(me)}),te=le.indexOf(Z.target);te!==-1&&le.splice(te,1),Ee.current=le,!(le.length>0)&&(q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),a9(Z)&&u&&u(Z))},[B,u,k]),qe=w.useCallback(function(Z,le){var te=[],me=[];Z.forEach(function(Oe){var et=VKe(Oe,A),Et=cee(et,2),Qe=Et[0],At=Et[1],Ut=HKe(Oe,s,o),fe=cee(Ut,2),Re=fe[0],Je=fe[1],Ot=D?D(Oe):null;if(Qe&&Re&&!Ot)te.push(Oe);else{var Ft=[At,Je];Ot&&(Ft=Ft.concat(Ot)),me.push({file:Oe,errors:Ft.filter(function(jt){return jt})})}}),(!a&&te.length>1||a&&l>=1&&te.length>l)&&(te.forEach(function(Oe){me.push({file:Oe,errors:[kun]})}),te.splice(0)),q({acceptedFiles:te,fileRejections:me,type:"setFiles"}),h&&h(te,me,le),me.length>0&&g&&g(me,le),te.length>0&&f&&f(te,le)},[q,a,A,s,o,l,h,f,g,D]),Be=w.useCallback(function(Z){Z.preventDefault(),Z.persist(),we(Z),Ee.current=[],a9(Z)&&Promise.resolve(r(Z)).then(function(le){EW(Z)&&!k||qe(le,Z)}).catch(function(le){return He(le)}),q({type:"reset"})},[r,qe,He,k]),_t=w.useCallback(function(){if(se.current){q({type:"openDialog"}),P();var Z={multiple:a,types:O};window.showOpenFilePicker(Z).then(function(le){return r(le)}).then(function(le){qe(le,null),q({type:"closeDialog"})}).catch(function(le){Pun(le)?(F(le),q({type:"closeDialog"})):Mun(le)?(se.current=!1,M.current?(M.current.value=null,M.current.click()):He(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):He(le)});return}M.current&&(q({type:"openDialog"}),P(),M.current.value=null,M.current.click())},[q,P,F,_,qe,He,O,a]),Wt=w.useCallback(function(Z){!B.current||!B.current.isEqualNode(Z.target)||(Z.key===" "||Z.key==="Enter"||Z.keyCode===32||Z.keyCode===13)&&(Z.preventDefault(),_t())},[B,_t]),Tt=w.useCallback(function(){q({type:"focus"})},[]),rn=w.useCallback(function(){q({type:"blur"})},[]),_n=w.useCallback(function(){C||(Aun()?setTimeout(_t,0):_t())},[C,_t]),wt=function(le){return i?null:le},pt=function(le){return x?null:wt(le)},ot=function(le){return E?null:wt(le)},we=function(le){k&&le.stopPropagation()},Se=w.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=Z.refKey,te=le===void 0?"ref":le,me=Z.role,Oe=Z.onKeyDown,et=Z.onFocus,Et=Z.onBlur,Qe=Z.onClick,At=Z.onDragEnter,Ut=Z.onDragOver,fe=Z.onDragLeave,Re=Z.onDrop,Je=xW(Z,$un);return Al(Al(wae({onKeyDown:pt(Vv(Oe,Wt)),onFocus:pt(Vv(et,Tt)),onBlur:pt(Vv(Et,rn)),onClick:wt(Vv(Qe,_n)),onDragEnter:ot(Vv(At,ke)),onDragOver:ot(Vv(Ut,Me)),onDragLeave:ot(Vv(fe,je)),onDrop:ot(Vv(Re,Be)),role:typeof me=="string"&&me!==""?me:"presentation"},te,B),!i&&!x?{tabIndex:0}:{}),Je)}},[B,Wt,Tt,rn,_n,ke,Me,je,Be,x,E,i]),re=w.useCallback(function(Z){Z.stopPropagation()},[]),Y=w.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=Z.refKey,te=le===void 0?"ref":le,me=Z.onChange,Oe=Z.onClick,et=xW(Z,Vun),Et=wae({accept:A,multiple:a,type:"file",style:{display:"none"},onChange:wt(Vv(me,Be)),onClick:wt(Vv(Oe,re)),tabIndex:-1},te,M);return Al(Al({},Et),et)}},[M,t,a,Be,i]);return Al(Al({},W),{},{isFocused:H&&!i,getRootProps:Se,getInputProps:Y,rootRef:B,inputRef:M,open:wt(_t)})}function Yun(n,e){switch(e.type){case"focus":return Al(Al({},n),{},{isFocused:!0});case"blur":return Al(Al({},n),{},{isFocused:!1});case"openDialog":return Al(Al({},Sae),{},{isFileDialogActive:!0});case"closeDialog":return Al(Al({},n),{},{isFileDialogActive:!1});case"setDraggedFiles":return Al(Al({},n),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Al(Al({},n),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return Al({},Sae);default:return n}}function xAe(){}function Qun(n){const[e]=pe(),t=ni(),{group:i,files:r,setFiles:o}=n,[s,a]=w.useState([]),l=g=>{o(m=>m.filter(({file:v})=>v!==g))},c=g=>new Promise(m=>{try{const v=new FileReader;v.onload=_=>{var C;const y=(((C=_.target)==null?void 0:C.result)||"").split(` `);!y.length||y.length===1||y.length===2&&!y[1]?m(!1):m(!0)},v.readAsText(g)}catch{m(!1)}}),u=async g=>{for(let m=0;m<g.length;m++)if(!await c(g[m]))return!1;return!0},{getRootProps:d,getInputProps:h,isDragActive:f}=YN({accept:{"text/*":[".csv"]},onDrop:async g=>{await u(g)?g.forEach(v=>{o(_=>[..._,{group:i,file:v}])}):ce.error("csv_rows_length")}});return w.useEffect(()=>{a(r.filter(({group:g})=>g===i).map(({file:g})=>g))},[r]),p(K,{leftSide:e(i),children:s.length?p("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:s.map((g,m)=>N("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[g.name," - ",(g.size/1024).toPrecision(2)," KB"," ",p(t0,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>l(g)})]},m))}):p("div",{...d(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[p("input",{...h()}),p(NT,{className:"mx-auto h-12 w-12",style:{color:t.$3,colorScheme:t.$0}}),p("span",{className:"mt-2 block text-sm font-medium",style:{color:t.$3,colorScheme:t.$0},children:e(f?"drop_file_here":"dropzone_default_message")})]})})})}const Xun={clients:"client",invoices:"invoice",accounting:"invoice",contacts:"client"},TAe={freshbooks:["clients","invoices"],invoice2go:["invoices"],invoicely:["clients","invoices"],waveaccounting:["clients","accounting"],zoho:["contacts","invoices"]};function Zun(){const[n]=pe(),[e,t]=w.useState("freshbooks"),[i,r]=w.useState([]),[o,s]=w.useState(),[a,l]=w.useState(!1),c=()=>{if(!a){ce.processing(),l(!0);const d=new FormData;d.append("import_type",e),i.forEach(({file:h,group:f})=>{d.append(`files[${Xun[f]}]`,h)}),Ae("POST",Te("/api/v1/import"),d).then(h=>ce.success(h.data.message)).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===422&&(ce.dismiss(),s(h.response.data))}).finally(()=>{l(!1),r([])})}},u=()=>TAe[e].some(d=>!i.filter(({group:h})=>h===d).length);return w.useEffect(()=>{s(void 0),r([])},[e]),N(Qt,{title:n("import"),saveButtonLabel:n("import"),onSaveClick:d=>{d.preventDefault(),c()},disableSubmitButton:u()||a,withSaveButton:!0,disableWithoutIcon:!0,children:[p(K,{leftSide:n("import_type"),children:N(Cn,{value:e,onValueChange:d=>t(d),errorMessage:o==null?void 0:o.errors.import_type,children:[p("option",{value:"freshbooks",children:n("freshbooks")}),p("option",{value:"invoice2go",children:n("invoice2go")}),p("option",{value:"invoicely",children:n("invoicely")}),p("option",{value:"waveaccounting",children:n("waveaccounting")}),p("option",{value:"zoho",children:n("zoho")})]})}),TAe[e].map(d=>p(Qun,{group:d,files:i,setFiles:r},d)),p(K,{children:o&&Object.keys(o.errors).map((d,h)=>d!=="import_type"&&p(Ls,{type:"danger",children:o.errors[d]},h))})]})}function Jun(){Pi("import_export");const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("import_export"),href:"/settings/import_export"}];return N(ir,{title:n("import_export"),breadcrumbs:e,docsLink:"en/basic-settings/#import_export",children:[p(Zun,{}),p(nun,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function edn(){const[n]=pe();let e=[{name:n("plan"),href:"/settings/account_management"},{name:n("overview"),href:"/settings/account_management/overview"},{name:n("enabled_modules"),href:"/settings/account_management/enabled_modules"},{name:n("integrations"),href:"/settings/account_management/integrations"},{name:n("security_settings"),href:"/settings/account_management/security_settings"}];return e=e,f1()?e:[...e,{name:n("danger_zone"),href:"/settings/account_management/danger_zone"}]}function tdn(){const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"}];Pi("account_management"),Pc();const t=Tu(),i=lp(),r=edn();return N(ir,{onSaveClick:t,onCancelClick:i,title:n("account_management"),breadcrumbs:e,docsLink:"en/basic-settings/#account_management",children:[p(QS,{tabs:r,className:"mt-6"}),p("div",{className:"my-4",children:p(Tg,{})})]})}function ndn(){Pi("custom_fields");const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("custom_fields"),href:"/settings/custom_fields"}],t=[{name:n("company"),href:"/settings/custom_fields/company"},{name:n("clients"),href:"/settings/custom_fields/clients"},{name:n("products"),href:"/settings/custom_fields/products"},{name:n("invoices"),href:"/settings/custom_fields/invoices"},{name:n("payments"),href:"/settings/custom_fields/payments"},{name:n("projects"),href:"/settings/custom_fields/projects"},{name:n("tasks"),href:"/settings/custom_fields/tasks"},{name:n("vendors"),href:"/settings/custom_fields/vendors"},{name:n("expenses"),href:"/settings/custom_fields/expenses"},{name:n("users"),href:"/settings/custom_fields/users"}],i=Tl(),r=Tu(),o=lp();return N(ir,{title:n("custom_fields"),breadcrumbs:e,docsLink:"en/advanced-settings/#custom_fields",onSaveClick:r,onCancelClick:o,children:[i.pathname.endsWith("custom_fields")&&p(iS,{to:"/settings/custom_fields/company"}),p(QS,{tabs:t}),p(mve,{}),p(Tg,{})]})}function idn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("company")}`,t=ji(),i=Ym();return t?p(Qt,{title:e,children:["company1","company2","company3","company4"].map(r=>p(Jf,{field:r,placeholder:n("company_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function rdn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("clients")}`,t=ji(),i=Ym();return t?N(dt,{children:[p(Qt,{title:e,children:["client1","client2","client3","client4"].map(r=>p(Jf,{field:r,placeholder:n("client_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}),p(Qt,{title:`${n("custom_fields")}: ${n("contacts")}`,children:["contact1","contact2","contact3","contact4"].map(r=>p(Jf,{field:r,placeholder:n("contact_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))})]}):null}function odn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("products")}`,t=ji(),i=Ym();return t?p(Qt,{title:e,children:["product1","product2","product3","product4"].map(r=>p(Jf,{field:r,placeholder:n("product_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function sdn(){const n=Pc(),e=Qi();return(t,i)=>{if(i===""){const r=un.cloneDeep(n);return r&&delete r.custom_fields[t],e(rS({object:"company",data:r}))}e(Go({object:"company",property:`custom_fields.${t}`,value:i}))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function adn(){const n=Qi(),e=ci();return t=>{switch(t){case 0:n(Go({object:"company",property:"custom_surcharge_taxes1",value:!(e!=null&&e.custom_surcharge_taxes1)}));break;case 1:n(Go({object:"company",property:"custom_surcharge_taxes2",value:!(e!=null&&e.custom_surcharge_taxes2)}));break;case 2:n(Go({object:"company",property:"custom_surcharge_taxes3",value:!(e!=null&&e.custom_surcharge_taxes3)}));break;case 3:n(Go({object:"company",property:"custom_surcharge_taxes4",value:!(e!=null&&e.custom_surcharge_taxes4)}));break}}}function ldn(){const[n]=pe(),e=pve(),t=ji(),i=Ym(),r=sdn(),o=a=>{switch(a){case 0:return t==null?void 0:t.custom_surcharge_taxes1;case 1:return t==null?void 0:t.custom_surcharge_taxes2;case 2:return t==null?void 0:t.custom_surcharge_taxes3;case 3:return t==null?void 0:t.custom_surcharge_taxes4}},s=adn();return t?N(Qt,{title:`${n("custom_fields")}: ${n("invoices")}`,children:[["invoice1","invoice2","invoice3","invoice4"].map(a=>p(Jf,{field:a,placeholder:n("invoice_field"),onChange:l=>i(a,l),initialValue:t.custom_fields[a]},a)),p(_i,{}),t&&["surcharge1","surcharge2","surcharge3","surcharge4"].map((a,l)=>p(K,{leftSide:p(We,{id:a,value:t.custom_fields[a],placeholder:n("surcharge_field"),onValueChange:c=>r(a,c),disabled:e}),children:!!(t!=null&&t.enabled_tax_rates)&&p(ft,{label:n("charge_taxes"),checked:o(l),onChange:()=>s(l)})},l))]}):null}function cdn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("payments")}`,t=ji(),i=Ym();return t?p(Qt,{title:e,children:["payment1","payment2","payment3","payment4"].map(r=>p(Jf,{field:r,placeholder:n("payment_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function udn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("projects")}`,t=ji(),i=Ym();return t?p(Qt,{title:e,children:["project1","project2","project3","project4"].map(r=>p(Jf,{field:r,placeholder:n("project_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function ddn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("tasks")}`,t=ji(),i=Ym();return t?p(Qt,{title:e,children:["task1","task2","task3","task4"].map(r=>p(Jf,{field:r,placeholder:n("task_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function hdn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("vendors")}`,t=ji(),i=Ym();return t?N(dt,{children:[p(Qt,{title:e,children:["vendor1","vendor2","vendor3","vendor4"].map(r=>p(Jf,{field:r,placeholder:n("vendor_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}),p(Qt,{title:`${n("custom_fields")}: ${n("contacts")}`,children:["vendor_contact1","vendor_contact2","vendor_contact3","vendor_contact4"].map(r=>p(Jf,{field:r,placeholder:n("contact_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))})]}):null}function fdn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("expenses")}`,t=ji(),i=Ym();return t?p(Qt,{title:e,children:["expense1","expense2","expense3","expense4"].map(r=>p(Jf,{field:r,placeholder:n("expense_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function pdn(){Pi("custom_fields");const[n]=pe(),e=`${n("custom_fields")}: ${n("users")}`,t=ji(),i=Ym();return t?p(Qt,{title:e,children:["user1","user2","user3","user4"].map(r=>p(Jf,{field:r,placeholder:n("user_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function I0(){return!Vm()&&!rc()&&Ro()}function Iv(n){const[e]=pe(),t=pa();return p(dt,{children:p("div",{className:n.className,children:p(Ls,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center",children:[p(vt,{element:OT,className:"mr-2",size:20}),p("span",{children:n.message?n.message:e("start_free_trial_message")}),(t==null?void 0:t.company_user)&&p(Li,{className:"ml-10",external:!0,to:t.company_user.ninja_portal_url,children:e("plan_change")})]})})})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function gdn(){const{t:n}=pe();return[{name:n("settings"),href:bt("/settings/generated_numbers")},{name:n("clients"),href:bt("/settings/generated_numbers/clients")},{name:n("invoices"),href:bt("/settings/generated_numbers/invoices")},{name:n("recurring_invoices"),href:bt("/settings/generated_numbers/recurring_invoices")},{name:n("payments"),href:bt("/settings/generated_numbers/payments")},{name:n("quotes"),href:bt("/settings/generated_numbers/quotes")},{name:n("credits"),href:bt("/settings/generated_numbers/credits")},{name:n("projects"),href:bt("/settings/generated_numbers/projects")},{name:n("tasks"),href:bt("/settings/generated_numbers/tasks")},{name:n("vendors"),href:bt("/settings/generated_numbers/vendors")},{name:n("purchase_orders"),href:bt("/settings/generated_numbers/purchase_orders")},{name:n("expenses"),href:bt("/settings/generated_numbers/expenses")},{name:n("recurring_expenses"),href:bt("/settings/generated_numbers/recurring_expenses")}]}function mdn(){Pi("generated_numbers");const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("generated_numbers"),href:"/settings/generated_numbers"}];Pc();const t=gdn(),i=Tu(),r=lp(),o=I0();return N(ir,{title:n("generated_numbers"),docsLink:"en/advanced-settings/#generated_numbers",breadcrumbs:e,onSaveClick:i,onCancelClick:r,disableSaveButton:o,children:[p(QS,{tabs:t,className:"mt-6"}),o&&p(Iv,{}),p("div",{className:"my-4",children:p(Tg,{})})]})}function Xm(){const[n]=pe();return p(Li,{className:"pl-6",to:"https://invoiceninja.github.io/en/custom-fields/#custom-fields",external:!0,children:n("click_to_variables")})}function _dn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("clients"),children:[p(K,{leftSide:p(Bt,{propertyKey:"client_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.client_number_pattern)||"",onValueChange:u=>s("settings.client_number_pattern",u),disabled:r("client_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.client_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"client_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.client_number_counter)||"",onValueChange:u=>s("settings.client_number_counter",parseFloat(u)||0),disabled:r("client_number_counter"),errorMessage:o==null?void 0:o.errors["settings.client_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function vdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("invoices"),children:[p(K,{leftSide:p(Bt,{propertyKey:"invoice_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.invoice_number_pattern)||"",onValueChange:u=>s("settings.invoice_number_pattern",u),disabled:r("invoice_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.invoice_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"invoice_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.invoice_number_counter)||"",onValueChange:u=>s("settings.invoice_number_counter",parseFloat(u)||0),disabled:r("invoice_number_counter"),errorMessage:o==null?void 0:o.errors["settings.invoice_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function bdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("recurring_invoices"),children:[p(K,{leftSide:p(Bt,{propertyKey:"recurring_invoice_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.recurring_invoice_number_pattern)||"",onValueChange:u=>s("settings.recurring_invoice_number_pattern",u),disabled:r("recurring_invoice_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.recurring_invoice_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"recurring_invoice_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.recurring_invoice_number_counter)||"",onValueChange:u=>s("settings.recurring_invoice_number_counter",parseFloat(u)||0),disabled:r("recurring_invoice_number_counter"),errorMessage:o==null?void 0:o.errors["settings.recurring_invoice_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function ydn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("payments"),children:[p(K,{leftSide:p(Bt,{propertyKey:"payment_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.payment_number_pattern)||"",onValueChange:u=>s("settings.payment_number_pattern",u),disabled:r("payment_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.payment_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"payment_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.payment_number_counter)||"",onValueChange:u=>s("settings.payment_number_counter",parseFloat(u)||0),disabled:r("payment_number_counter"),errorMessage:o==null?void 0:o.errors["settings.payment_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function Cdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("quotes"),children:[p(K,{leftSide:p(Bt,{propertyKey:"quote_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.quote_number_pattern)||"",onValueChange:u=>s("settings.quote_number_pattern",u),disabled:r("quote_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.quote_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"quote_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.quote_number_counter)||"",onValueChange:u=>s("settings.quote_number_counter",parseFloat(u)||0),disabled:r("quote_number_counter"),errorMessage:o==null?void 0:o.errors["settings.quote_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function wdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("credits"),children:[p(K,{leftSide:p(Bt,{propertyKey:"credit_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.credit_number_pattern)||"",onValueChange:u=>s("settings.credit_number_pattern",u),disabled:r("credit_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.credit_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"credit_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.credit_number_counter)||"",onValueChange:u=>s("settings.credit_number_counter",parseFloat(u)||0),disabled:r("credit_number_counter"),errorMessage:o==null?void 0:o.errors["settings.credit_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function Sdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("projects"),children:[p(K,{leftSide:p(Bt,{propertyKey:"project_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.project_number_pattern)||"",onValueChange:u=>s("settings.project_number_pattern",u),disabled:r("project_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.project_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"project_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.project_number_counter)||"",onValueChange:u=>s("settings.project_number_counter",parseFloat(u)||0),disabled:r("project_number_counter"),errorMessage:o==null?void 0:o.errors["settings.project_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function Edn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("tasks"),children:[p(K,{leftSide:p(Bt,{propertyKey:"task_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.task_number_pattern)||"",onValueChange:u=>s("settings.task_number_pattern",u),disabled:r("task_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.task_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"task_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.task_number_counter)||"",onValueChange:u=>s("settings.task_number_counter",parseFloat(u)||0),disabled:r("task_number_counter"),errorMessage:o==null?void 0:o.errors["settings.task_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function xdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("vendors"),children:[p(K,{leftSide:p(Bt,{propertyKey:"vendor_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.vendor_number_pattern)||"",onValueChange:u=>s("settings.vendor_number_pattern",u),disabled:r("vendor_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.vendor_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"vendor_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.vendor_number_counter)||"",onValueChange:u=>s("settings.vendor_number_counter",parseFloat(u)||0),disabled:r("vendor_number_counter"),errorMessage:o==null?void 0:o.errors["settings.vendor_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function Tdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("purchase_orders"),children:[p(K,{leftSide:p(Bt,{propertyKey:"purchase_order_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.purchase_order_number_pattern)||"",onValueChange:u=>s("settings.purchase_order_number_pattern",u),disabled:r("purchase_order_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.purchase_order_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"purchase_order_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.purchase_order_number_counter)||"",onValueChange:u=>s("settings.purchase_order_number_counter",parseFloat(u)||0),disabled:r("purchase_order_number_counter"),errorMessage:o==null?void 0:o.errors["settings.purchase_order_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function kdn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("expenses"),children:[p(K,{leftSide:p(Bt,{propertyKey:"expense_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.expense_number_pattern)||"",onValueChange:u=>s("settings.expense_number_pattern",u),disabled:r("expense_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.expense_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"expense_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.expense_number_counter)||"",onValueChange:u=>s("settings.expense_number_counter",parseFloat(u)||0),disabled:r("expense_number_counter"),errorMessage:o==null?void 0:o.errors["settings.expense_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}function Idn(){var l,c;const[n]=pe(),[e,t]=w.useState(""),i=ji(),r=ma(),o=Fi($s),s=So(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Qt,{title:n("recurring_expenses"),children:[p(K,{leftSide:p(Bt,{propertyKey:"recurring_expense_number_pattern",labelElement:p($t,{label:n("number_pattern")})}),children:p(We,{value:((l=i==null?void 0:i.settings)==null?void 0:l.recurring_expense_number_pattern)||"",onValueChange:u=>s("settings.recurring_expense_number_pattern",u),disabled:r("recurring_expense_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.recurring_expense_number_pattern"]})}),p(K,{leftSide:p(Bt,{propertyKey:"recurring_expense_number_counter",labelElement:p($t,{label:n("number_counter")})}),children:p(wo,{precision:0,value:((c=i==null?void 0:i.settings)==null?void 0:c.recurring_expense_number_counter)||"",onValueChange:u=>s("settings.recurring_expense_number_counter",parseFloat(u)||0),disabled:r("recurring_expense_number_counter"),errorMessage:o==null?void 0:o.errors["settings.recurring_expense_number_counter"]})}),p(_i,{}),a.map((u,d)=>p(wl,{onClick:()=>t(e+u),children:p(Fl,{text:u})},d)),p(_i,{}),p(Xm,{})]})}const Ldn=["1","01","001","0001","00001","000001","0000001","00000001","000000001","0000000001"],Ddn=["never","freq_daily","freq_weekly","freq_two_weeks","freq_four_weeks","freq_monthly","freq_two_months","freq_three_months","freq_four_months","freq_six_months","freq_annually","freq_two_years","freq_three_years"];function Adn(){var o,s,a,l,c,u,d,h;const[n]=pe(),e=ma(),t=Pc(),i=So(),r=Fi($s);return N(Qt,{title:n("settings"),children:[p(K,{leftSide:p(Bt,{propertyKey:"counter_padding",labelElement:p($t,{label:n("number_padding")}),defaultValue:"1"}),children:p(Cn,{id:"settings.counter_padding",value:((o=t==null?void 0:t.settings)==null?void 0:o.counter_padding)||"1",onValueChange:f=>i("settings.counter_padding",f),disabled:e("counter_padding"),errorMessage:r==null?void 0:r.errors["settings.counter_padding"],children:Ldn.map((f,g)=>p("option",{value:g+1,children:f},g))})}),p(K,{leftSide:p(Bt,{propertyKey:"counter_number_applied",labelElement:p($t,{label:n("generate_number")}),defaultValue:"when_saved"}),children:N(Cn,{id:"settings.counter_number_applied",value:((s=t==null?void 0:t.settings)==null?void 0:s.counter_number_applied)||"when_saved",onValueChange:f=>i("settings.counter_number_applied",f),disabled:e("counter_number_applied"),errorMessage:r==null?void 0:r.errors["settings.counter_number_applied"],children:[p("option",{value:"when_saved",children:n("when_saved")}),p("option",{value:"when_sent",children:n("when_sent")})]})}),p(K,{leftSide:p(Bt,{propertyKey:"recurring_number_prefix",labelElement:p($t,{label:n("recurring_prefix")})}),children:p(We,{value:((a=t==null?void 0:t.settings)==null?void 0:a.recurring_number_prefix)||"",onValueChange:f=>i("settings.recurring_number_prefix",f),disabled:e("recurring_number_prefix"),errorMessage:r==null?void 0:r.errors["settings.recurring_number_prefix"]})}),p(K,{leftSide:p(Bt,{propertyKey:"shared_invoice_quote_counter",labelElement:p($t,{label:n("shared_invoice_quote_counter")}),defaultValue:!1}),children:p(ft,{onChange:f=>i("settings.shared_invoice_quote_counter",f),checked:!!((l=t==null?void 0:t.settings)!=null&&l.shared_invoice_quote_counter),disabled:e("shared_invoice_quote_counter")})}),p(K,{leftSide:p(Bt,{propertyKey:"shared_invoice_credit_counter",labelElement:p($t,{label:n("shared_invoice_credit_counter")}),defaultValue:!1}),children:p(ft,{onChange:f=>i("settings.shared_invoice_credit_counter",f),checked:!!((c=t==null?void 0:t.settings)!=null&&c.shared_invoice_credit_counter),disabled:e("shared_invoice_credit_counter")})}),p(K,{leftSide:p(Bt,{propertyKey:"reset_counter_frequency_id",labelElement:p($t,{label:n("reset_counter")}),defaultValue:"0"}),children:p(Cn,{value:((u=t==null?void 0:t.settings)==null?void 0:u.reset_counter_frequency_id)||"0",onValueChange:f=>{i("settings.reset_counter_frequency_id",parseInt(f)),f==="0"&&i("settings.reset_counter_date","")},disabled:e("reset_counter_frequency_id"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_frequency_id"],children:Ddn.map((f,g)=>p("option",{value:g,children:n(f)},g))})}),(t==null?void 0:t.settings)&&((d=t==null?void 0:t.settings)==null?void 0:d.reset_counter_frequency_id)>0&&p(K,{leftSide:p(Bt,{propertyKey:"reset_counter_date",labelElement:p($t,{label:n("next_reset")})}),children:p(We,{type:"date",value:((h=t==null?void 0:t.settings)==null?void 0:h.reset_counter_date)||"",onValueChange:f=>i("settings.reset_counter_date",f),disabled:e("reset_counter_date"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_date"]})})]})}const Ndn={1:"Instrument not defined",2:"Automated clearing house credit",3:"Automated clearing house debit",4:"ACH demand debit reversal",5:"ACH demand credit reversal",6:"ACH demand credit",7:"ACH demand debit",8:"Hold",9:"National or regional clearing",10:"In cash",11:"ACH savings credit reversal",12:"ACH savings debit reversal",13:"ACH savings credit",14:"ACH savings debit",15:"Bookentry credit",16:"Bookentry debit",17:"ACH demand cash concentration/disbursement (CCD) credit",18:"ACH demand cash concentration/disbursement (CCD) debit",19:"ACH demand corporate trade payment (CTP) credit",20:"Cheque",21:"Banker's draft",22:"Certified banker's draft",23:"Bank cheque (issued by a banking or similar establishment)",24:"Bill of exchange awaiting acceptance",25:"Certified cheque",26:"Local cheque",27:"ACH demand corporate trade payment (CTP) debit",28:"ACH demand corporate trade exchange (CTX) credit",29:"ACH demand corporate trade exchange (CTX) debit",30:"Credit transfer",31:"Debit transfer",32:"ACH demand cash concentration/disbursement plus (CCD+)",33:"ACH demand cash concentration/disbursement plus (CCD+)",34:"ACH prearranged payment and deposit (PPD)",35:"ACH savings cash concentration/disbursement (CCD) credit",36:"ACH savings cash concentration/disbursement (CCD) debit",37:"ACH savings corporate trade payment (CTP) credit",38:"ACH savings corporate trade payment (CTP) debit",39:"ACH savings corporate trade exchange (CTX) credit",40:"ACH savings corporate trade exchange (CTX) debit",41:"ACH savings cash concentration/disbursement plus (CCD+)",42:"Payment to bank account",43:"ACH savings cash concentration/disbursement plus (CCD+)",44:"Accepted bill of exchange",45:"Referenced home-banking credit transfer",46:"Interbank debit transfer",47:"Home-banking debit transfer",48:"Bank card",49:"Direct debit",50:"Payment by postgiro",51:"FR, norme 6 97-Telereglement CFONB (French Organisation for",52:"Urgent commercial payment",53:"Urgent Treasury Payment",54:"Credit card",55:"Debit card",56:"Bankgiro",57:"Standing agreement",58:"SEPA credit transfer",59:"SEPA direct debit",60:"Promissory note",61:"Promissory note signed by the debtor",62:"Promissory note signed by the debtor and endorsed by a bank",63:"Promissory note signed by the debtor and endorsed by a",64:"Promissory note signed by a bank",65:"Promissory note signed by a bank and endorsed by another",66:"Promissory note signed by a third party",67:"Promissory note signed by a third party and endorsed by a",68:"Online payment service",69:"Transfer Advice",70:"Bill drawn by the creditor on the debtor",74:"Bill drawn by the creditor on a bank",75:"Bill drawn by the creditor, endorsed by another bank",76:"Bill drawn by the creditor on a bank and endorsed by a",77:"Bill drawn by the creditor on a third party",78:"Bill drawn by creditor on third party, accepted and",91:"Not transferable banker's draft",92:"Not transferable local cheque",93:"Reference giro",94:"Urgent giro",95:"Free format giro",96:"Requested method for payment was not used",97:"Clearing between partners",ZZZ:"Mutually defined"},Rdn={1:[],2:["iban","bic_swift"],3:["payer_bank_account","iban","bic_swift"],4:["payer_bank_account","iban","bic_swift"],5:["iban","bic_swift"],6:["iban","bic_swift"],7:["payer_bank_account","iban","bic_swift"],8:[],9:["iban","bic_swift"],10:[],11:["iban","bic_swift"],12:["payer_bank_account","iban","bic_swift"],13:["iban","bic_swift"],14:["payer_bank_account","iban","bic_swift"],15:["account_holder","bsb_sort"],16:["account_holder","bsb_sort"],17:["iban","bic_swift"],18:["payer_bank_account","iban","bic_swift"],19:["iban","bic_swift"],20:[],21:[],22:[],23:[],24:[],25:[],26:[],27:["payer_bank_account","iban","bic_swift"],28:["iban","bic_swift"],29:["payer_bank_account","iban","bic_swift"],30:["iban","bic_swift","account_holder"],31:["iban","bic_swift","account_holder"],32:["iban","bic_swift","account_holder"],33:["payer_bank_account","iban","bic_swift","account_holder"],34:["iban","bic_swift","account_holder"],35:["iban","bic_swift","account_holder"],36:["payer_bank_account","iban","bic_swift","account_holder"],37:["iban","bic_swift","account_holder"],38:["payer_bank_account","iban","bic_swift","account_holder"],39:["iban","bic_swift","account_holder"],40:["payer_bank_account","iban","bic_swift","account_holder"],41:["iban","bic_swift","account_holder"],42:["iban","bic_swift","account_holder"],43:["payer_bank_account","iban","bic_swift","account_holder"],44:[],45:["iban","bic_swift"],46:["iban","bic_swift"],47:["iban","bic_swift"],48:["card_type","card_number"],49:["payer_bank_account","iban","bic_swift"],50:["account_holder"],51:["iban","bic_swift"],52:["iban","bic_swift"],53:["iban","bic_swift"],54:["card_type","card_number","card_holder"],55:["card_type","card_number","card_holder"],56:["account_holder"],57:["iban","bic_swift"],58:["iban","bic_swift"],59:["payer_bank_account","iban","bic_swift"],60:[],61:[],62:["bic_swift"],63:[],64:["bic_swift"],65:["bic_swift"],66:[],67:["bic_swift"],68:["iban"],69:["iban","bic_swift"],70:[],74:["bic_swift"],75:["bic_swift"],76:["bic_swift"],77:[],78:[],91:[],92:[],93:["iban","bic_swift"],94:["iban","bic_swift"],95:["iban","bic_swift"],96:[],97:["account_holder"],ZZZ:[]},Odn=w.forwardRef((n,e)=>{var l,c,u,d,h,f,g,m,v;const t=ci(),[i]=pe(),[r,o]=w.useState(null),s=td({initialValues:{entity:n.entity,payment_means:[{code:"1",iban:null,bic_swift:"",payer_bank_account:"",account_holder:"",bsb_sort:"",card_type:"",card_number:"",card_holder:""}]},onSubmit:(_,{setSubmitting:b})=>{ce.processing(),o(null),Ae("POST",Te("/api/v1/einvoice/configurations"),_).then(()=>{ce.success("saved_einvoice_details")}).catch(y=>{var C;if(((C=y.response)==null?void 0:C.status)===422){ce.dismiss(),o(y.response.data);return}ce.error()}).finally(()=>b(!1))}});w.useImperativeHandle(e,()=>({saveEInvoice(){s.submitForm()}}),[s.values]);const a=w.useMemo(()=>s.values.payment_means[0].code?Rdn[s.values.payment_means[0].code]||[]:[],[s.values.payment_means]);return w.useEffect(()=>{s.setFieldValue("payment_means.0.code",un.get(t.e_invoice,"Invoice.PaymentMeans.0.PaymentMeansCode.value")||"1"),s.setFieldValue("payment_means.0.iban",un.get(t.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.ID.value")||null),s.setFieldValue("payment_means.0.bic_swift",un.get(t.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.FinancialInstitutionBranch.FinancialInstitution.ID.value")||""),s.setFieldValue("payment_means.0.account_holder",un.get(t.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.Name")||""),s.setFieldValue("payment_means.0.payer_bank_account",un.get(t.e_invoice,"Invoice.PaymentMeans.0.PayerFinancialAccount.ID.value")||""),s.setFieldValue("payment_means.0.bsb_sort",un.get(t.e_invoice,"Invoice.PaymentMeans.0.PayeeFinancialAccount.SortCode.value")||""),s.setFieldValue("payment_means.0.card_type",un.get(t.e_invoice,"Invoice.PaymentMeans.0.CardAccount.NetworkID.value")||""),s.setFieldValue("payment_means.0.card_number",un.get(t.e_invoice,"Invoice.PaymentMeans.0.CardAccount.PrimaryAccountNumberID.value")||""),s.setFieldValue("payment_means.0.card_holder",un.get(t.e_invoice,"Invoice.PaymentMeans.0.CardAccount.HolderName.value")||"")},[t.e_invoice]),N(Qt,{title:i("payment_means"),children:[p(K,{leftSide:"Code",children:p(Cn,{value:s.values.payment_means[0].code,onValueChange:_=>s.setFieldValue("payment_means.0.code",_),errorMessage:(l=r==null?void 0:r.errors)==null?void 0:l["payment_means.0.code"],dismissable:!1,customSelector:!0,children:Object.entries(Ndn).map(([_,b])=>p("option",{value:_,children:b},_))})}),a.includes("iban")?p(K,{leftSide:i("iban"),leftSideHelp:i("iban_help"),children:p(We,{value:s.values.payment_means[0].iban,onValueChange:_=>s.setFieldValue("payment_means.0.iban",_),errorMessage:(c=r==null?void 0:r.errors)==null?void 0:c["payment_means.0.iban"]})}):null,a.includes("bic_swift")?p(K,{leftSide:i("bic"),leftSideHelp:i("bic_swift_help"),children:p(We,{value:s.values.payment_means[0].bic_swift,onValueChange:_=>s.setFieldValue("payment_means.0.bic_swift",_),errorMessage:(u=r==null?void 0:r.errors)==null?void 0:u["payment_means.0.bic_swift"]})}):null,a.includes("payer_bank_account")?p(K,{leftSide:i("payer_bank_account"),leftSideHelp:i("payer_bank_account_help"),children:p(We,{value:s.values.payment_means[0].payer_bank_account,onValueChange:_=>s.setFieldValue("payment_means.0.payer_bank_account",_),errorMessage:(d=r==null?void 0:r.errors)==null?void 0:d["payment_means.0.payer_bank_account"]})}):null,a.includes("account_holder")?p(K,{leftSide:i("account_holder"),leftSideHelp:i("account_holder_help"),children:p(We,{value:s.values.payment_means[0].account_holder,onValueChange:_=>s.setFieldValue("payment_means.0.account_holder",_),errorMessage:(h=r==null?void 0:r.errors)==null?void 0:h["payment_means.0.account_holder"]})}):null,a.includes("bsb_sort")?p(K,{leftSide:i("bsb_sort"),leftSideHelp:i("bsb_sort_help"),children:p(We,{value:s.values.payment_means[0].bsb_sort,onValueChange:_=>s.setFieldValue("payment_means.0.bsb_sort",_),errorMessage:(f=r==null?void 0:r.errors)==null?void 0:f["payment_means.0.bsb_sort"]})}):null,a.includes("card_type")?p(K,{leftSide:i("card_type"),leftSideHelp:i("card_type_help"),children:p(We,{value:s.values.payment_means[0].card_type,onValueChange:_=>s.setFieldValue("payment_means.0.card_type",_),errorMessage:(g=r==null?void 0:r.errors)==null?void 0:g["payment_means.0.card_type"]})}):null,a.includes("card_number")?p(K,{leftSide:i("card_number"),leftSideHelp:i("card_number_help"),children:p(We,{value:s.values.payment_means[0].card_number,onValueChange:_=>s.setFieldValue("payment_means.0.card_number",_),errorMessage:(m=r==null?void 0:r.errors)==null?void 0:m["payment_means.0.card_number"]})}):null,a.includes("card_holder")?p(K,{leftSide:i("card_holder"),leftSideHelp:i("card_holder_help"),children:p(We,{value:s.values.payment_means[0].card_holder,onValueChange:_=>s.setFieldValue("payment_means.0.card_holder",_),errorMessage:(v=r==null?void 0:r.errors)==null?void 0:v["payment_means.0.card_holder"]})}):null]})});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Pdn(){var n,e;return((e=(n=GD.getState().companyUsers.api)==null?void 0:n[GD.getState().companyUsers.currentIndex])==null?void 0:e.account.plan)==="white_label"}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const hbe=["40","56","208","276","352","372","442","528","578","752","826"];function Mdn(){const[n]=pe(),e=ci(),t=ZS(),i=r=>{var a;const o=(a=t(r))==null?void 0:a.iso_3166_2,s=o==="GB"?"UK":"EU";return o?un.get(e.tax_data.regions[s].subregions,`${o}.vat_number`):!1};return N(Qt,{title:n("additional_tax_identifiers"),description:n("additional_tax_identifiers_help").toString(),children:[p(K,{leftSide:n("new_identifier"),children:p(Bdn,{})}),hbe.filter(r=>i(r)).map(r=>{var o;return p(K,{leftSide:(o=t(r))==null?void 0:o.name,children:t(r)?p(Fdn,{country:t(r),vat:i(r)}):null},r)})]})}function Fdn({country:n,vat:e}){const[t,i]=w.useState(!1),{t:r}=pe(),o=vo(),s=GS(),a=td({initialValues:{country:n.iso_3166_2,vat_number:e},onSubmit(l,{setSubmitting:c}){ce.processing(),Ae("DELETE",Te("/api/v1/einvoice/peppol/remove_additional_legal_identifier"),l).then(()=>{ce.success(),s(),i(!1)}).catch(u=>{var d;if(((d=u.response)==null?void 0:d.status)===422){const h=un.get(u.response.data,"errors.vat_number.0");if(h)return ce.error(h)}return ce.error()}).finally(()=>c(!1))}});return N(dt,{children:[N(Ui,{visible:t,onClose:()=>i(!1),title:r("delete_identifier"),children:[p("p",{children:r("delete_identifier_description")}),p("form",{onSubmit:a.handleSubmit,children:p("div",{className:"flex justify-end",children:p(Gt,{disabled:a.isSubmitting,children:r("continue")})})})]}),N("div",{className:"flex items-center gap-2",children:[e,p("button",{type:"button",style:{color:o},onClick:()=>i(!0),children:p(kg,{size:18})})]})]})}function Bdn(){var d,h;const{t:n}=pe(),e=vo(),t=ci(),i=ZS(),r=GS(),[o,s]=w.useState(!1),[a,l]=w.useState(null),c=td({initialValues:{country:"",vat_number:""},onSubmit:(f,{setSubmitting:g})=>{l(null),g(!0),ce.processing(),Ae("POST",Te("/api/v1/einvoice/peppol/add_additional_legal_identifier"),f).then(()=>{ce.success(),r(),s(!1),c.resetForm()}).catch(m=>{var v,_;if(((v=m.response)==null?void 0:v.status)===422){un.get(m.response.data,"0.source")!==""&&un.get(m.response.data,"0.source")!==void 0?ce.error(`Error: ${un.get(m.response.data,"0.details")}`):(l(m.response.data),ce.dismiss());return}if(((_=m.response)==null?void 0:_.status)===400){ce.error(m.response.data.message);return}console.error(m),ce.error()}).finally(()=>g(!1))}}),u=f=>{var v;const g=(v=i(f))==null?void 0:v.iso_3166_2,m=g==="GB"?"UK":"EU";return!g||t.settings.country_id===f?!1:!un.get(t.tax_data.regions[m].subregions,`${g}.vat_number`)};return N(dt,{children:[p(Ui,{title:n("new_identifier"),visible:o,onClose:()=>s(!1),overflowVisible:!0,size:"small",children:N("form",{onSubmit:c.handleSubmit,className:"space-y-5",children:[p(Cn,{value:c.values.country,label:n("country"),onValueChange:f=>c.setFieldValue("country",f),errorMessage:(d=a==null?void 0:a.errors)==null?void 0:d.country,customSelector:!0,children:hbe.filter(f=>u(f)).map(f=>{var g;return p("option",{value:f,children:(g=i(f))==null?void 0:g.name},f)})}),p(We,{label:n("vat_number"),value:c.values.vat_number,onValueChange:f=>c.setFieldValue("vat_number",f),errorMessage:(h=a==null?void 0:a.errors)==null?void 0:h.vat_number}),p("div",{className:"flex justify-end",children:p(Gt,{disabled:c.isSubmitting,children:n("continue")})})]})}),p("button",{type:"button",style:{color:e},onClick:()=>s(!0),children:n("configure")})]})}function $dn(){var r;const[n]=pe(),e=pa(),{isAdmin:t,isOwner:i}=Po();return rc()||!((r=e==null?void 0:e.company_user)!=null&&r.ninja_portal_url)||!t&&!i?null:p(Ls,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center",children:[p(vt,{element:OT,className:"mr-2",size:20}),p("span",{children:n("peppol_plan_warning")}),(e==null?void 0:e.company_user)&&p(Li,{className:"ml-10",external:!0,to:e.company_user.ninja_portal_url,children:n("plan_change")})]})})}const Vdn={PEPPOL:"PEPPOL",FACT1:"FACT1",EN16931:"EN16931",XInvoice_3_0:"XInvoice_3.0",XInvoice_2_3:"XInvoice_2.3",XInvoice_2_2:"XInvoice_2.2",XInvoice_2_1:"XInvoice_2.1",XInvoice_2_0:"XInvoice_2.0",XInvoice_1_0:"XInvoice_1.0","XInvoice-Extended":"XInvoice-Extended","XInvoice-BasicWL":"XInvoice-BasicWL","XInvoice-Basic":"XInvoice-Basic","Facturae_3.2.2":"Facturae_3.2.2","Facturae_3.2.1":"Facturae_3.2.1","Facturae_3.2":"Facturae_3.2",FatturaPA:"FatturaPA"};function Hdn(){const n=Pc(),[e]=pe(),t=()=>Pdn()&&hbe.includes((n==null?void 0:n.settings.country_id)||""),i=w.useRef(null),r=[{name:e("settings"),href:"/settings"},{name:e("e_invoice"),href:"/settings/e_invoice"}],o=Qi(),s=Tu(),a=ma(),l=So(),{isCompanySettingsActive:c}=ea(),u=I0(),[d,h]=Yo($s),[f,g]=w.useState(new FormData),[m,v]=w.useState(!1),_=td({enableReinitialize:!0,initialValues:f,onSubmit:()=>{ce.processing(),h(void 0),Ae("POST",Te("/api/v1/companies/:id",{id:n==null?void 0:n.id}),f,{headers:{"Content-Type":"multipart/form-data"}}).then(E=>{o(US({object:"company",data:E.data.data})),ce.success("uploaded_document")}).catch(E=>{var k;((k=E.response)==null?void 0:k.status)===422&&(h(E.response.data),ce.dismiss())}).finally(()=>g(new FormData))}}),b=w.useCallback(E=>{if(E.length===0){ce.error("invalid_file");return}f.append("e_invoice_certificate",E[0]),f.append("_method","PUT"),g(f),_.submitForm()},[f]),{getRootProps:y,getInputProps:C,isDragActive:x}=YN({onDrop:b,multiple:!1,maxFiles:1,accept:{"application/*":[".p12",".pfx",".pem",".cer",".crt",".der",".txt",".p7b",".spc",".bin"]}});return w.useEffect(()=>{m&&(s(),v(!1))},[m]),N(ir,{title:e("e_invoice"),docsLink:"en/advanced-settings/#e_invoice",breadcrumbs:r,onSaveClick:()=>{var E;(E=i==null?void 0:i.current)==null||E.saveEInvoice(),s()},children:[u&&p(Iv,{}),p($dn,{}),!(n!=null&&n.legal_entity_id)&&N(Qt,{title:e("e_invoice"),children:[p(K,{leftSide:p(Bt,{propertyKey:"e_invoice_type",labelElement:p($t,{label:e("e_invoice_type")}),defaultValue:"EN16931"}),children:p(Cn,{value:(n==null?void 0:n.settings.e_invoice_type)||"EN16931",onValueChange:E=>l("settings.e_invoice_type",E),disabled:a("e_invoice_type"),dismissable:!1,customSelector:!0,children:Object.entries(Vdn).filter(([E])=>E!=="PEPPOL"||t()).map(([E,k])=>p("option",{value:E,children:k},E))})}),(n==null?void 0:n.settings.e_invoice_type)!=="PEPPOL"?p(K,{leftSide:p(Bt,{propertyKey:"enable_e_invoice",labelElement:p($t,{label:e("enable_e_invoice")})}),children:p(ft,{checked:!!(n!=null&&n.settings.enable_e_invoice),onValueChange:E=>l("settings.enable_e_invoice",E),disabled:a("enable_e_invoice")})}):null,(n==null?void 0:n.settings.e_invoice_type)==="PEPPOL"?p(dt,{children:n!=null&&n.settings.enable_e_invoice&&(n!=null&&n.legal_entity_id)?p("div",{className:"flex flex-col space-y-4"}):p(ijt,{})}):p(dt,{children:n!=null&&n.settings.enable_e_invoice?N(dt,{children:[p(K,{leftSide:p(Bt,{propertyKey:"merge_e_invoice_to_pdf",labelElement:p($t,{label:e("merge_e_invoice_to_pdf")})}),children:p(ft,{checked:!!(n!=null&&n.settings.merge_e_invoice_to_pdf),onValueChange:E=>l("settings.merge_e_invoice_to_pdf",E),disabled:a("merge_e_invoice_to_pdf")})}),c&&p(K,{leftSide:e("upload_certificate"),leftSideHelp:n!=null&&n.has_e_invoice_certificate?e("certificate_set"):e("certificate_not_set"),children:p("div",{...y(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[p("input",{...C()}),p(NT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium text-gray-900",children:x?"drop_your_logo_here":e("dropzone_default_message")})]})})}),c&&p(K,{leftSide:e("certificate_passphrase"),leftSideHelp:n!=null&&n.has_e_invoice_certificate_passphrase?e("passphrase_set"):e("passphrase_not_set"),children:p(We,{value:"",id:"password",type:"password",onValueChange:E=>l("has_e_invoice_certificate_passphrase",E),errorMessage:d==null?void 0:d.errors.has_e_invoice_certificate_passphrase})}),p(K,{leftSide:p(Bt,{propertyKey:"e_quote_type",labelElement:p($t,{label:e("e_quote_type")}),defaultValue:"OrderX_Comfort"}),children:N(Cn,{value:(n==null?void 0:n.settings.e_quote_type)||"OrderX_Comfort",onValueChange:E=>l("settings.e_quote_type",E),disabled:a("e_quote_type"),children:[p("option",{value:"OrderX_Comfort",children:"OrderX_Comfort"}),p("option",{value:"OrderX_Basic",children:"OrderX_Basic"}),p("option",{value:"OrderX_Extended",children:"OrderX_Extended"})]})})]}):null})]}),(n==null?void 0:n.settings.e_invoice_type)==="PEPPOL"&&t()&&n.legal_entity_id?p(ujt,{}):null,n!=null&&n.settings.enable_e_invoice?p(Odn,{ref:i,currentEInvoice:(n==null?void 0:n.e_invoice)||{},entity:"company"}):null,n!=null&&n.settings.enable_e_invoice&&(n!=null&&n.legal_entity_id)&&t()?p(Mdn,{}):null]})}const Wdn=rl(YE.Option)` &:hover { background-color: ${n=>n.theme.hoverColor}; } `,qKe=rl.button` &:hover { background-color: ${n=>n.theme.hoverColor}; } `,zdn=rl.li` background-color: ${n=>n.theme.backgroundColor}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Udn({inputOptions:n,entries:e,readonly:t,nullable:i,initiallyVisible:r=!1,exclude:o=[],includeOnly:s=[],includeByLabel:a,action:l,onChange:c,onDismiss:u,entryOptions:d,errorMessage:h,clearInputAfterSelection:f,onEmptyValues:g,onFocus:m,onInputValueChange:v}){const[_,b]=w.useState(String(n.value??"")),[y,C]=w.useState(r),[x,E]=w.useState(null),[k,L]=w.useState(-1),D=w.useRef(null),A=w.useRef(null);let O=_===""?e:e.filter(V=>{var U,W,q,H,ie;return((W=(U=V.label)==null?void 0:U.toLowerCase())==null?void 0:W.includes(_==null?void 0:_.toLowerCase()))||((ie=(H=(q=V.value)==null?void 0:q.toString())==null?void 0:H.toLowerCase())==null?void 0:ie.includes(_==null?void 0:_.toLowerCase()))||V.searchable.toLowerCase().includes(_==null?void 0:_.toLowerCase())});O=O.filter(V=>o.length>0?!o.includes(V.value):!0),O=O.filter(V=>s.length>0?s.includes(V[a?"label":"value"]):!0),w.useEffect(()=>{const V=e.findIndex(U=>U.value===n.value||U.label===n.value);if(V>=0){E(e[V]),L(V);return}if(i){E({id:-1,label:n.value?n.value.toString():"",value:n.value?n.value.toString():"",resource:null,eventType:"internal",searchable:d.searchable||d.value});return}},[e]);const P=V=>{b(V),E(null),C(!0),L(-1)},F=V=>{x&&x.value===V.value||(E(V),b(V.label),c(V),f&&(b(""),E(null)),setTimeout(()=>C(!1),100))},B=V=>{if(V.key==="ArrowDown"&&k<O.length-1){V.preventDefault(),L(k+1);return}if(V.key==="ArrowUp"&&k>0){V.preventDefault(),L(k-1);return}if(V.key==="Enter"){if(C(!1),k>=0){F(O[k]);return}k===-1&&i&&F({id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()});return}if(V.key==="Escape"){C(!1);return}if(V.key==="Tab"&&i){C(!1),F({id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()});return}};zk(D,()=>{if(C(!1),x&&x.value&&_===x.value||_==="")return;const V={id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()};F(V),c(V)}),QD(()=>{if(g&&(_===""&&O.length>0||O.length<=3))return g(_)},600,[_,O]),w.useEffect(()=>{const V=document.querySelector(`[data-combobox-element-id="${k+1}"]`);V&&V.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})},[k]);const M=ni();return N("div",{ref:D,className:"w-full",tabIndex:-1,children:[n.label?p("p",{className:"text-sm font-medium block",children:n.label}):null,p("div",{className:"relative mt-1",children:N("div",{className:"relative w-full cursor-default overflow-hidden rounded border text-left sm:text-sm",style:{borderColor:M.$5},children:[p("input",{type:"text",onChange:V=>P(V.target.value),onKeyDown:B,onFocus:()=>{C(!0),m&&m()},onBlur:()=>v==null?void 0:v(_),placeholder:n.placeholder,disabled:t,defaultValue:x?x.label:_==null?void 0:_.toString(),className:"w-full border-0 rounded py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6",ref:A,style:{backgroundColor:M.$1,borderColor:M.$5,color:M.$3},"data-cy":"comboboxInput",tabIndex:-1}),!t&&p("button",{tabIndex:-1,type:"button",onClick:V=>{if(u)return V.preventDefault(),C(!1),u()},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",children:u&&x?p(kg,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-clear-icon",style:{color:M.$3}}):p(fF,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-chevrondown-icon",style:{color:M.$3}})})]})}),y&&N("ul",{className:"border absolute z-10 mt-1 max-h-60 overflow-auto rounded-md py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",style:{backgroundColor:M.$1,borderColor:M.$4},tabIndex:-1,children:[l&&l.visible&&p(qKe,{theme:{hoverColor:M.$2},"data-testid":"combobox-action-button",type:"button",onClick:l.onClick,className:"min-w-[19rem] relative cursor-pointer select-none py-2 pl-3 pr-9",tabIndex:-1,style:{color:M.$3},children:l.label}),O.map((V,U)=>p(zdn,{theme:{backgroundColor:k===U?M.$2:M.$1},className:Nt("min-w-[19rem] relative cursor-pointer select-none py-2 pl-3 pr-9 hover:font-semibold",{"font-medium":k===U}),onClick:()=>F(V),"data-combobox-element-id":U,tabIndex:-1,children:V.resource&&typeof d.dropdownLabelFn<"u"?d.dropdownLabelFn(V.resource):V.label},V.id))]}),h&&p(Ls,{className:"mt-2",type:"danger",children:h})]})}function KKe({inputOptions:n,entries:e,readonly:t,nullable:i,initiallyVisible:r=!1,exclude:o=[],includeOnly:s=[],includeByLabel:a,action:l,onEmptyValues:c,onChange:u,onDismiss:d,entryOptions:h,errorMessage:f,clearInputAfterSelection:g,isDataLoading:m,compareOnlyByValue:v}){const[_]=pe(),[b,y]=w.useState(null),[C,x]=w.useState(""),[E,k]=w.useState(r);let L=C===""?e:e.filter(F=>{var B,M,V,U,W;return((M=(B=F.label)==null?void 0:B.toLowerCase())==null?void 0:M.includes(C==null?void 0:C.toLowerCase()))||((W=(U=(V=F.value)==null?void 0:V.toString())==null?void 0:U.toLowerCase())==null?void 0:W.includes(C==null?void 0:C.toLowerCase()))||F.searchable.toLowerCase().includes(C==null?void 0:C.toLowerCase())});L=L.filter(F=>o.length>0?!o.includes(F.value):!0),L=L.filter(F=>s.length>0?s.includes(F[a?"label":"value"]):!0);const D=w.useRef(null),A=w.useRef(null);zk(D,()=>{k(!1)}),QD(()=>{if(c&&(C===""&&L.length>0||L.length<=3))return c(C)},600,[L]);const O=F=>{F&&(b&&F.value===b.value?d&&d():y(()=>({...F,eventType:"internal"})))};w.useEffect(()=>{b&&b.eventType==="internal"&&u(b),g&&(y(null),x("")),k(!1),A!=null&&A.current&&A.current.blur()},[b]),w.useEffect(()=>{const F=e.find(B=>v?B.value===n.value:B.value===n.value||B.label===n.value);y(F||(i?{id:-1,label:n.value?n.value.toString():"",value:n.value?n.value.toString():"",resource:null,eventType:"external",searchable:h.searchable||h.value}:null))},[e,n.value]),w.useEffect(()=>(r&&k(!0),()=>{k(!1)}),[r]);const P=ni();return N("div",{className:"w-full",children:[N(YE,{as:"div",value:b,onChange:F=>O(F),disabled:t,ref:D,children:[n.label&&p(YE.Label,{className:"text-sm font-medium block",style:{color:P.$3},children:n.label}),p("div",{className:"relative mt-1",children:N("div",{className:"relative w-full cursor-default overflow-hidden rounded border text-left sm:text-sm",style:{borderColor:P.$5},children:[p(YE.Input,{"data-testid":"combobox-input-field",ref:A,className:"w-full border-0 rounded py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6",onChange:F=>x(F.target.value),displayValue:F=>{var B;return((B=h.inputLabelFn)==null?void 0:B.call(h,F==null?void 0:F.resource))??((F==null?void 0:F.label)||C)},onClick:()=>k(!0),placeholder:n.placeholder,style:{backgroundColor:P.$1,borderColor:P.$5,color:P.$3}}),!t&&p(YE.Button,{onClick:F=>{if(d)return F.preventDefault(),x(""),b&&k(!1),!b&&k(B=>!B),d();k(B=>!B)},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",children:d&&b?p(kg,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-clear-icon",style:{color:P.$3}}):p(fF,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-chevrondown-icon",style:{color:P.$3}})})]})}),E&&N(YE.Options,{static:!0,className:"border absolute z-10 mt-1 max-h-60 overflow-auto rounded-md py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",style:{backgroundColor:P.$1,borderColor:P.$4},children:[l&&l.visible&&p(qKe,{theme:{hoverColor:P.$2},"data-testid":"combobox-action-button",type:"button",onClick:l.onClick,className:"min-w-[19rem] relative cursor-pointer select-none py-2 pl-3 pr-9",tabIndex:-1,style:{color:P.$3},children:l.label}),!!m&&p("div",{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",children:p(ns,{})}),!m&&!L.length&&p("div",{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",children:_("no_records_found")}),i&&C.length>0&&!m&&p(YE.Option,{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",value:{id:-1,label:i?C:null,value:i?C:null,resource:null},children:({active:F})=>N("span",{className:Nt("block truncate space-x-1",F&&"font-semibold"),children:[p("span",{children:_("Select")}),p("q",{className:"font-semibold",children:C})]})},"combobox-not-found"),L.length>0&&!m&&L.map(F=>p(Wdn,{theme:{hoverColor:P.$2},value:F,className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",style:{color:P.$3},children:({selected:B,active:M})=>N(dt,{children:[p("span",{className:Nt("block truncate",B&&"font-semibold",M&&"font-semibold"),children:F.resource&&typeof h.dropdownLabelFn<"u"?h.dropdownLabelFn(F.resource):F.label}),B&&p("span",{className:"absolute inset-y-0 right-0 flex items-center pr-4",style:{color:P.$3},children:p(MD,{className:"h-5 w-5","aria-hidden":"true"})})]})},F.id))]})]}),f&&p(Ls,{className:"mt-2",type:"danger",children:f})]})}function Fh({endpoint:n,inputOptions:e,entryOptions:t,readonly:i,staleTime:r,initiallyVisible:o,sortBy:s="created_at|desc",exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,onChange:h,onDismiss:f,disableWithQueryParameter:g,errorMessage:m,clearInputAfterSelection:v,onInputValueChange:_,compareOnlyByValue:b}){const[y,C]=w.useState([]),[x,E]=w.useState(n),[k,L]=w.useState(!1);w.useEffect(()=>{E(n)},[n]);const D=w.useRef(void 0),A=()=>y.length?!!y.find(M=>M.value===e.value||M.label===e.value):!0,{data:O,isLoading:P}=Ti([new URL(x).pathname,new URL(x).pathname+new URL(x).search],()=>Ae("GET",new URL(x).href).then(B=>{const M=[];return B.data.data.map(V=>{var U;return M.push({id:V[t.id],label:V[t.label],value:t.customValue?t.customValue(V):V[t.value],resource:V,eventType:"external",searchable:((U=t.customSearchableValue)==null?void 0:U.call(t,V))||V[t.searchable||t.id]})}),M}),{staleTime:r??1/0,enabled:k});w.useEffect(()=>{if(!x.includes("/api/v1/products")&&!k){clearTimeout(D.current);const B=setTimeout(()=>L(!0),100);D.current=B}},[e.value]),w.useEffect(()=>{k&&e.value&&!g&&!A()&&E(B=>{const M=new URL(B);return e.value&&e.value.toString().length>0&&(M.searchParams.set("with",e.value.toString()),M.searchParams.get("sort")&&M.searchParams.delete("sort")),M.href}),k&&!e.value&&E(B=>{const M=new URL(B);return M.searchParams.get("with")&&M.searchParams.delete("with"),s&&M.searchParams.set("sort",s),M.href})},[y,k,e.value]),w.useEffect(()=>{O&&C([...O])},[O]),w.useEffect(()=>(E(B=>{const M=new URL(B);return s&&M.searchParams.set("sort",s),M.searchParams.set("status","active"),M.searchParams.set("filter",""),M.href}),()=>{C([]),L(!1),D.current=void 0}),[]);const F=B=>{E(M=>{const V=new URL(M);return V.searchParams.set("filter",B),V.href})};return x.includes("/api/v1/products")?p(Udn,{entries:y,inputOptions:e,readonly:i,onChange:h,onDismiss:f,initiallyVisible:o,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:v,isDataLoading:P,onFocus:()=>L(!0),onInputValueChange:_,onEmptyValues:F,compareOnlyByValue:b}):p(KKe,{entries:y,inputOptions:e,readonly:i,onChange:h,onEmptyValues:F,onDismiss:f,initiallyVisible:o,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:v,isDataLoading:P,onInputValueChange:_,compareOnlyByValue:b})}function fbe(n){var s;const[e]=pe(),t=wi(),i=Mk(),{isAdmin:r,isOwner:o}=Po();return p(Fh,{inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value??null},endpoint:Te(n.endpoint||"/api/v1/users?status=active"),entryOptions:{id:"id",value:"id",label:"first_name",inputLabelFn:a=>a?`${a.first_name} ${a.last_name}`:"",dropdownLabelFn:a=>`${a.first_name} ${a.last_name}`},readonly:n.readonly,onDismiss:n.onClearButtonClick,action:{label:e("new_user"),onClick:()=>i({fn:()=>t("/settings/users")}),visible:(r||o)&&!n.withoutAction},onChange:a=>a.resource?n.onChange(a.resource):null,staleTime:n.staleTime||1/0})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function jdn(){const[n]=pe(),{isCompanySettingsActive:e}=ea(),t=!0;return`${n("default")}`,(Vm()||rc())&&t&&e&&f1(),[{value:"default",label:n("default"),enabled:!0},{value:"client_postmark",label:"Postmark",enabled:!0},{value:"client_mailgun",label:"Mailgun",enabled:!0},{value:"client_brevo",label:"Brevo",enabled:!0},{value:"smtp",label:"SMTP",enabled:e&&!f1()}]}function qdn(){const[n]=pe(),e=ji(),t=So(),[i,r]=w.useState(!1),o=()=>{i||(ce.processing(),r(!0),Ae("POST",Te("/api/v1/smtp/check"),{smtp_host:(e==null?void 0:e.smtp_host)||"",smtp_port:(e==null?void 0:e.smtp_port)||"",smtp_encryption:(e==null?void 0:e.smtp_encryption)||"",smtp_username:(e==null?void 0:e.smtp_username)||"",smtp_password:(e==null?void 0:e.smtp_password)||"",smtp_local_domain:(e==null?void 0:e.smtp_local_domain)||"",smtp_verify_peer:(e==null?void 0:e.smtp_verify_peer)??!0}).then(s=>ce.success(s.data.message)).finally(()=>r(!1)))};return N(dt,{children:[p(K,{leftSide:n("host"),leftSideHelp:n("host_help"),children:p(We,{value:(e==null?void 0:e.smtp_host)||"",onValueChange:s=>t("smtp_host",s),disabled:i})}),p(K,{leftSide:n("port"),leftSideHelp:n("port_help"),children:p(We,{value:(e==null?void 0:e.smtp_port)||"",onValueChange:s=>t("smtp_port",s),disabled:i})}),p(K,{leftSide:n("encryption"),children:N(Cn,{value:(e==null?void 0:e.smtp_encryption)||"",onValueChange:s=>t("smtp_encryption",s),withBlank:!0,disabled:i,children:[p("option",{value:"tls",children:"STARTTLS"}),p("option",{value:"ssl",children:"SSL/TLS"})]})}),p(K,{leftSide:n("username"),children:p(We,{value:(e==null?void 0:e.smtp_username)||"",onValueChange:s=>t("smtp_username",s),disabled:i})}),p(K,{leftSide:n("password"),children:p(We,{value:(e==null?void 0:e.smtp_password)||"",onValueChange:s=>t("smtp_password",s),disabled:i})}),p(K,{leftSide:n("local_domain"),leftSideHelp:n("local_domain_help"),children:p(We,{value:(e==null?void 0:e.smtp_local_domain)||"",onValueChange:s=>t("smtp_local_domain",s),disabled:i})}),p(K,{leftSide:n("bcc_email"),leftSideHelp:n("comma_sparated_list"),children:p(We,{value:(e==null?void 0:e.settings.bcc_email)||"",onValueChange:s=>t("settings.bcc_email",s)})}),p(K,{leftSide:n("send_time"),children:p(Cn,{value:(e==null?void 0:e.settings.entity_send_time)||"",onValueChange:s=>t("settings.entity_send_time",s.length>0?s:6),withBlank:!0,children:[...Array(24).keys()].map((s,a)=>p("option",{value:s+1,children:Un().startOf("day").add(s+1,"hour").format("h:ss A")},a))})}),p(K,{leftSide:n("verify_peer"),children:p(ft,{checked:(e==null?void 0:e.smtp_verify_peer)??!0,onValueChange:s=>t("smtp_verify_peer",s),disabled:i})}),p(K,{pushContentToRight:!0,children:p(Gt,{behavior:"button",onClick:o,disableWithoutIcon:!0,disabled:i,children:n("send_test_email")})})]})}var Kdn=function(n){return n instanceof RegExp},Gdn=function(e){var t=/[\\^$.*+?()[\]{}|]/g,i=RegExp(t.source);return e&&i.test(e)?e.replace(t,"\\$&"):e},GKe=function(n){return typeof n=="string"},Ydn=function(n){var e=[];return n.forEach(function(t){Array.isArray(t)?e=e.concat(t):e.push(t)}),e};function Qdn(n,e,t){var i=0,r=0;if(n==="")return n;if(!n||!GKe(n))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var o=e;Kdn(o)||(o=new RegExp("("+Gdn(o)+")","gi"));for(var s=n.split(o),a=1,l=s.length;a<l;a+=2){if(s[a]===void 0||s[a-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}r=s[a].length,i+=s[a-1].length,s[a]=t(s[a],a,i),i+=r}return s}var Xdn=function(e,t,i){return Array.isArray(e)||(e=[e]),Ydn(e.map(function(r){return GKe(r)?Qdn(r,t,i):r}))};const SK=nl(Xdn);function Zdn(){var u;Pi("email_settings");const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("email_settings"),href:"/settings/email_settings"}],t=jdn(),i=Pc(),r=ma(),o=Fi($s),s=So(),a=Tu(),l=lp(),c=I0();return N(ir,{title:n("email_settings"),docsLink:"en/advanced-settings/#email_settings",breadcrumbs:e,onSaveClick:a,onCancelClick:l,disableSaveButton:c,children:[c&&p(Iv,{}),N(Qt,{title:n("settings"),children:[p(K,{leftSide:p(Bt,{propertyKey:"show_email_footer",labelElement:p($t,{label:n("show_email_footer")})}),children:p(ft,{checked:!!(i!=null&&i.settings.show_email_footer),onValueChange:d=>s("settings.show_email_footer",d),disabled:r("show_email_footer")})}),p(K,{leftSide:p(Bt,{propertyKey:"pdf_email_attachment",labelElement:p($t,{label:n("attach_pdf")})}),children:p(ft,{checked:!!(i!=null&&i.settings.pdf_email_attachment),onValueChange:d=>s("settings.pdf_email_attachment",d),disabled:r("pdf_email_attachment")})}),p(K,{leftSide:p(Bt,{propertyKey:"document_email_attachment",labelElement:p($t,{label:n("attach_documents")})}),children:p(ft,{checked:!!(i!=null&&i.settings.document_email_attachment),onValueChange:d=>s("settings.document_email_attachment",d),disabled:r("document_email_attachment")})}),p(K,{leftSide:p(Bt,{propertyKey:"ubl_email_attachment",labelElement:p($t,{label:n("attach_ubl"),helpLabel:SK(`${n("ubl_email_attachment_help")}.`,":here",()=>p(Li,{className:"text-xs",to:"/settings/e_invoice",children:n("here")}))})}),children:p(ft,{checked:!!(i!=null&&i.settings.ubl_email_attachment),onValueChange:d=>s("settings.ubl_email_attachment",d),disabled:r("ubl_email_attachment")})}),p(_i,{}),p(K,{leftSide:p(Bt,{propertyKey:"email_sending_method",labelElement:p($t,{label:n("email_provider")}),defaultValue:"default"}),children:p(Cn,{value:(i==null?void 0:i.settings.email_sending_method)||"default",onValueChange:d=>s("settings.email_sending_method",d),disabled:r("email_sending_method")||!Vm()&&!rc(),errorMessage:o==null?void 0:o.errors["settings.email_sending_method"],children:t.map(({value:d,label:h,enabled:f})=>f&&p("option",{value:d,children:h},d))})}),((i==null?void 0:i.settings.email_sending_method)==="office365"||(i==null?void 0:i.settings.email_sending_method)==="microsoft"||(i==null?void 0:i.settings.email_sending_method)==="gmail")&&Ro()&&p(K,{leftSide:p(Bt,{propertyKey:"gmail_sending_user_id",labelElement:p($t,{label:`Gmail / Microsoft ${n("user")}`})}),children:p(fbe,{endpoint:"/api/v1/users?sending_users=true",value:(u=i==null?void 0:i.settings)==null?void 0:u.gmail_sending_user_id,onChange:d=>s("settings.gmail_sending_user_id",d.id),onClearButtonClick:()=>s("settings.gmail_sending_user_id","0"),readonly:r("gmail_sending_user_id"),withoutAction:!0,errorMessage:o==null?void 0:o.errors["settings.gmail_sending_user_id"]})}),(i==null?void 0:i.settings.email_sending_method)==="client_postmark"&&p(K,{leftSide:p(Bt,{propertyKey:"postmark_secret",labelElement:p($t,{label:n("secret")})}),children:p(We,{value:(i==null?void 0:i.settings.postmark_secret)||"",onValueChange:d=>s("settings.postmark_secret",d),disabled:r("postmark_secret"),errorMessage:o==null?void 0:o.errors["settings.postmark_secret"]})}),(i==null?void 0:i.settings.email_sending_method)==="client_mailgun"&&N(dt,{children:[p(K,{leftSide:p(Bt,{propertyKey:"mailgun_secret",labelElement:p($t,{label:n("secret")})}),children:p(We,{value:(i==null?void 0:i.settings.mailgun_secret)||"",onValueChange:d=>s("settings.mailgun_secret",d),disabled:r("mailgun_secret"),errorMessage:o==null?void 0:o.errors["settings.mailgun_secret"]})}),p(K,{leftSide:p(Bt,{propertyKey:"mailgun_domain",labelElement:p($t,{label:n("domain")})}),children:p(We,{value:(i==null?void 0:i.settings.mailgun_domain)||"",onValueChange:d=>s("settings.mailgun_domain",d),disabled:r("mailgun_domain"),errorMessage:o==null?void 0:o.errors["settings.mailgun_domain"]})}),p(K,{leftSide:p(Bt,{propertyKey:"mailgun_endpoint",labelElement:p($t,{label:n("endpoint")}),defaultValue:"api.mailgun.net"}),children:N(Cn,{value:(i==null?void 0:i.settings.mailgun_endpoint)||"api.mailgun.net",onValueChange:d=>s("settings.mailgun_endpoint",d),disabled:r("mailgun_endpoint"),errorMessage:o==null?void 0:o.errors["settings.mailgun_endpoint"],children:[p("option",{value:"api.mailgun.net",defaultChecked:!0,children:"api.mailgun.net"}),p("option",{value:"api.eu.mailgun.net",children:"api.eu.mailgun.net"})]})})]}),(i==null?void 0:i.settings.email_sending_method)==="client_brevo"&&p(K,{leftSide:p(Bt,{propertyKey:"brevo_secret",labelElement:p($t,{label:n("secret")})}),children:p(We,{value:(i==null?void 0:i.settings.brevo_secret)||"",onValueChange:d=>s("settings.brevo_secret",d),disabled:r("brevo_secret"),errorMessage:o==null?void 0:o.errors["settings.brevo_secret"]})}),((i==null?void 0:i.settings.email_sending_method)==="client_mailgun"||(i==null?void 0:i.settings.email_sending_method)==="client_postmark"||(i==null?void 0:i.settings.email_sending_method)==="smtp"||(i==null?void 0:i.settings.email_sending_method)==="client_brevo")&&p(K,{leftSide:p(Bt,{propertyKey:"custom_sending_email",labelElement:p($t,{label:n("from_email")})}),children:p(We,{value:(i==null?void 0:i.settings.custom_sending_email)||"",onValueChange:d=>s("settings.custom_sending_email",d),disabled:r("custom_sending_email"),errorMessage:o==null?void 0:o.errors["settings.custom_sending_email"]})}),p(K,{leftSide:p(Bt,{propertyKey:"email_from_name",labelElement:p($t,{label:n("from_name")})}),children:p(We,{value:(i==null?void 0:i.settings.email_from_name)||"",onValueChange:d=>s("settings.email_from_name",d),disabled:r("email_from_name"),errorMessage:o==null?void 0:o.errors["settings.email_from_name"]})}),p(K,{leftSide:p(Bt,{propertyKey:"reply_to_name",labelElement:p($t,{label:n("reply_to_name")})}),children:p(We,{value:(i==null?void 0:i.settings.reply_to_name)||"",onValueChange:d=>s("settings.reply_to_name",d),disabled:r("reply_to_name"),errorMessage:o==null?void 0:o.errors["settings.reply_to_name"]})}),p(K,{leftSide:p(Bt,{propertyKey:"reply_to_email",labelElement:p($t,{label:n("reply_to_email")})}),children:p(We,{value:(i==null?void 0:i.settings.reply_to_email)||"",onValueChange:d=>s("settings.reply_to_email",d),disabled:r("reply_to_email"),errorMessage:o==null?void 0:o.errors["settings.reply_to_email"]})}),(i==null?void 0:i.settings.email_sending_method)!=="smtp"&&p(K,{leftSide:p(Bt,{propertyKey:"bcc_email",labelElement:p($t,{label:n("bcc_email"),helpLabel:n("comma_sparated_list")})}),children:p(We,{value:(i==null?void 0:i.settings.bcc_email)||"",onValueChange:d=>s("settings.bcc_email",d),disabled:r("bcc_email"),errorMessage:o==null?void 0:o.errors["settings.bcc_email"]})}),(i==null?void 0:i.settings.email_sending_method)!=="smtp"&&p(K,{leftSide:p(Bt,{propertyKey:"entity_send_time",labelElement:p($t,{label:n("send_time")})}),children:p(Cn,{value:(i==null?void 0:i.settings.entity_send_time)||"",onValueChange:d=>s("settings.entity_send_time",d.length>0?d:6),withBlank:!0,disabled:r("entity_send_time"),errorMessage:o==null?void 0:o.errors["settings.entity_send_time"],children:[...Array(24).keys()].map((d,h)=>p("option",{value:d+1,children:Un().startOf("day").add(d+1,"hour").format("h:ss A")},h))})}),(i==null?void 0:i.settings.email_sending_method)==="smtp"&&p(qdn,{}),p(_i,{}),p(K,{leftSide:p(Bt,{propertyKey:"email_style",labelElement:p($t,{label:n("email_design")}),defaultValue:"plain"}),children:N(Cn,{value:(i==null?void 0:i.settings.email_style)||"plain",onValueChange:d=>s("settings.email_style",d),disabled:r("email_style"),errorMessage:o==null?void 0:o.errors["settings.email_style"],children:[p("option",{value:"plain",children:n("plain")}),p("option",{value:"light",children:n("light")}),p("option",{value:"dark",children:n("dark")}),p("option",{value:"custom",children:n("custom")})]})}),(i==null?void 0:i.settings.email_style)==="custom"&&p(K,{leftSide:p(Bt,{propertyKey:"email_style_custom",labelElement:p($t,{label:n("custom")})}),children:p(We,{element:"textarea",value:(i==null?void 0:i.settings.email_style_custom)||"",onValueChange:d=>d.includes("$body")?s("settings.email_style_custom",d):ce.error(Ms("body_variable_missing",{body:"$body"})),disabled:r("email_style_custom"),errorMessage:o==null?void 0:o.errors["settings.email_style_custom"]})}),p(K,{leftSide:p(Bt,{propertyKey:"email_signature",labelElement:p($t,{label:n("signature")})}),children:p(pd,{value:(i==null?void 0:i.settings.email_signature)||"",onChange:d=>s("settings.email_signature",d),disabled:r("email_signature")})})]})]})}function Jdn(){var a,l;const[n]=pe();Pc();const{isCompanySettingsActive:e}=ea(),t=ji(),i=ma(),r=So(),[o,s]=Yo($s);return w.useState(""),N(Qt,{title:n("settings"),children:[Ro(),e&&p(K,{leftSide:n("domain_url"),children:p(We,{value:(t==null?void 0:t.portal_domain)||"",onValueChange:c=>r("portal_domain",c),errorMessage:o==null?void 0:o.errors.portal_domain})}),e&&p(K,{leftSide:N("span",{children:[n("login")," ",n("url")]}),children:N("div",{className:"flex flex-col space-y-1",children:[p(Fl,{text:`${t==null?void 0:t.portal_domain}/client/login?company_key=${t==null?void 0:t.company_key}`}),!!Ro()&&p(Fl,{text:`${t==null?void 0:t.portal_domain}/client/login`}),!!Ro()&&p(Fl,{text:`${t==null?void 0:t.subdomain}.invoicing.co/client/login`}),!!Ro()&&N("div",{children:[p("span",{children:n("app_help_link")}),p(Li,{external:!0,to:"https://invoiceninja.github.io/en/hosted-custom-domain/#custom-domain-configuration",children:n("here")}),"."]})]})}),e&&p(_i,{}),p(K,{className:Nt({"mt-4":e}),leftSide:p(Bt,{propertyKey:"enable_client_portal",labelElement:p($t,{label:n("client_portal")}),defaultValue:!1}),children:p(ft,{checked:!!(t!=null&&t.settings.enable_client_portal),onValueChange:c=>r("settings.enable_client_portal",c),disabled:i("enable_client_portal")})}),p(K,{leftSide:p(Bt,{propertyKey:"client_portal_enable_uploads",labelElement:p($t,{label:n("client_document_upload"),helpLabel:n("document_upload_help")}),defaultValue:!1}),children:p(ft,{checked:!!(t!=null&&t.settings.client_portal_enable_uploads),onValueChange:c=>r("settings.client_portal_enable_uploads",c),disabled:i("client_portal_enable_uploads")})}),p(K,{leftSide:p(Bt,{propertyKey:"vendor_portal_enable_uploads",labelElement:p($t,{label:n("vendor_document_upload"),helpLabel:n("vendor_document_upload_help")}),defaultValue:!1}),children:p(ft,{checked:!!(t!=null&&t.settings.vendor_portal_enable_uploads),onValueChange:c=>r("settings.vendor_portal_enable_uploads",c),disabled:i("vendor_portal_enable_uploads")})}),p(K,{leftSide:p(Bt,{propertyKey:"accept_client_input_quote_approval",labelElement:p($t,{label:n("accept_purchase_order_number"),helpLabel:n("accept_purchase_order_number_help")}),defaultValue:!1}),children:p(ft,{checked:!!(t!=null&&t.settings.accept_client_input_quote_approval),onValueChange:c=>r("settings.accept_client_input_quote_approval",c),disabled:i("accept_client_input_quote_approval")})}),p(K,{leftSide:p(Bt,{propertyKey:"show_pdfhtml_on_mobile",labelElement:p($t,{label:n("show_pdfhtml_on_mobile"),helpLabel:n("show_pdfhtml_on_mobile_help")}),defaultValue:!1}),children:p(ft,{checked:!!((a=t==null?void 0:t.settings)!=null&&a.show_pdfhtml_on_mobile),onValueChange:c=>r("settings.show_pdfhtml_on_mobile",c),disabled:i("show_pdfhtml_on_mobile")})}),p(K,{leftSide:n("enable_client_portal_dashboard"),leftSideHelp:n("enable_client_portal_dashboard_help"),children:p(ft,{checked:!!((l=t==null?void 0:t.settings)!=null&&l.enable_client_portal_dashboard),onValueChange:c=>r("settings.enable_client_portal_dashboard",c)})}),p(_i,{}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"client_portal_terms",labelElement:p($t,{label:n("terms_of_service")})}),children:p(We,{element:"textarea",onValueChange:c=>r("settings.client_portal_terms",c),value:(t==null?void 0:t.settings.client_portal_terms)||"",disabled:i("client_portal_terms"),errorMessage:o==null?void 0:o.errors["settings.client_portal_terms"]})}),p(K,{leftSide:p(Bt,{propertyKey:"client_portal_privacy_policy",labelElement:p($t,{label:n("privacy_policy")})}),children:p(We,{element:"textarea",onValueChange:c=>r("settings.client_portal_privacy_policy",c),value:(t==null?void 0:t.settings.client_portal_privacy_policy)||"",disabled:i("client_portal_privacy_policy"),errorMessage:o==null?void 0:o.errors["settings.client_portal_privacy_policy"]})})]})}function ehn(){const[n]=pe(),e=ji(),t=So(),i=ma();return N(Qt,{title:n("authorization"),children:[p(K,{leftSide:p(Bt,{propertyKey:"enable_client_portal_password",labelElement:p($t,{label:n("enable_portal_password"),helpLabel:n("enable_portal_password_help")}),defaultValue:!1}),children:p(ft,{checked:!!(e!=null&&e.settings.enable_client_portal_password),onValueChange:r=>t("settings.enable_client_portal_password",r),disabled:i("enable_client_portal_password")})}),p(K,{leftSide:p(Bt,{propertyKey:"show_accept_invoice_terms",labelElement:p($t,{label:n("show_accept_invoice_terms"),helpLabel:n("show_accept_invoice_terms_help")}),defaultValue:!1}),children:p(ft,{checked:!!(e!=null&&e.settings.show_accept_invoice_terms),onValueChange:r=>t("settings.show_accept_invoice_terms",r),disabled:i("show_accept_invoice_terms")})}),p(K,{leftSide:p(Bt,{propertyKey:"show_accept_quote_terms",labelElement:p($t,{label:n("show_accept_quote_terms"),helpLabel:n("show_accept_quote_terms_help")}),defaultValue:!1}),children:p(ft,{checked:!!(e!=null&&e.settings.show_accept_quote_terms),onValueChange:r=>t("settings.show_accept_quote_terms",r),disabled:i("show_accept_quote_terms")})}),p(_i,{}),p(K,{leftSide:p(Bt,{propertyKey:"require_invoice_signature",labelElement:p($t,{label:n("require_invoice_signature"),helpLabel:n("require_invoice_signature_help")}),defaultValue:!1}),children:p(ft,{checked:!!(e!=null&&e.settings.require_invoice_signature),onValueChange:r=>t("settings.require_invoice_signature",r),disabled:i("require_invoice_signature")})}),p(K,{leftSide:p(Bt,{propertyKey:"require_quote_signature",labelElement:p($t,{label:n("require_quote_signature"),helpLabel:n("require_quote_signature_help")}),defaultValue:!1}),children:p(ft,{checked:!!(e!=null&&e.settings.require_quote_signature),onValueChange:r=>t("settings.require_quote_signature",r),disabled:i("require_quote_signature")})}),p(K,{leftSide:p(Bt,{propertyKey:"require_purchase_order_signature",labelElement:p($t,{label:n("require_purchase_order_signature"),helpLabel:n("require_purchase_order_signature_help")}),defaultValue:!1}),children:p(ft,{checked:!!(e!=null&&e.settings.require_purchase_order_signature),onValueChange:r=>t("settings.require_purchase_order_signature",r),disabled:i("require_purchase_order_signature")})}),p(K,{leftSide:p(Bt,{propertyKey:"signature_on_pdf",labelElement:p($t,{label:n("signature_on_pdf"),helpLabel:n("signature_on_pdf_help")}),defaultValue:!1}),children:p(ft,{checked:!!(e!=null&&e.settings.signature_on_pdf),onValueChange:r=>t("settings.signature_on_pdf",r),disabled:i("signature_on_pdf")})})]})}function thn(){const[n]=pe(),e=ji(),t=So(),i=ma(),r=Fi($s);return N(Qt,{title:n("customize"),children:[p(K,{leftSide:p(Bt,{propertyKey:"portal_custom_head",labelElement:p($t,{label:n("header")})}),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_head)||"",onValueChange:o=>t("settings.portal_custom_head",o),disabled:i("portal_custom_head"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_head"]})}),p(K,{leftSide:p(Bt,{propertyKey:"portal_custom_footer",labelElement:p($t,{label:n("footer")})}),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_footer)||"",onValueChange:o=>t("settings.portal_custom_footer",o),disabled:i("portal_custom_footer"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_footer"]})}),N(dt,{children:[p(K,{leftSide:p(Bt,{propertyKey:"portal_custom_css",labelElement:p($t,{label:n("custom_css")})}),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_css)||"",onValueChange:o=>t("settings.portal_custom_css",o),disabled:i("portal_custom_css"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_css"]})}),p(K,{leftSide:p(Bt,{propertyKey:"portal_custom_js",labelElement:p($t,{label:n("custom_javascript")})}),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_js)||"",onValueChange:o=>t("settings.portal_custom_js",o),disabled:i("portal_custom_js"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_js"]})})]})]})}function nhn(){const[n]=pe(),e=ji(),t=So(),i=ma(),{isCompanySettingsActive:r}=ea(),o=Fi($s);return N(Qt,{title:n("messages"),children:[r&&p(K,{leftSide:n("dashboard"),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_dashboard)||"",onValueChange:s=>t("settings.custom_message_dashboard",s),errorMessage:o==null?void 0:o.errors["settings.custom_message_dashboard"]})}),p(K,{leftSide:p(Bt,{propertyKey:"custom_message_unpaid_invoice",labelElement:p($t,{label:n("unpaid_invoice")})}),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_unpaid_invoice)||"",onValueChange:s=>t("settings.custom_message_unpaid_invoice",s),disabled:i("custom_message_unpaid_invoice"),errorMessage:o==null?void 0:o.errors["settings.custom_message_unpaid_invoice"]})}),p(K,{leftSide:p(Bt,{propertyKey:"custom_message_paid_invoice",labelElement:p($t,{label:n("paid_invoice")})}),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_paid_invoice)||"",onValueChange:s=>t("settings.custom_message_paid_invoice",s),disabled:i("custom_message_paid_invoice"),errorMessage:o==null?void 0:o.errors["settings.custom_message_paid_invoice"]})}),p(K,{leftSide:p(Bt,{propertyKey:"custom_message_unapproved_quote",labelElement:p($t,{label:n("unapproved_quote")})}),children:p(We,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_unapproved_quote)||"",onValueChange:s=>t("settings.custom_message_unapproved_quote",s),disabled:i("custom_message_unapproved_quote"),errorMessage:o==null?void 0:o.errors["settings.custom_message_unapproved_quote"]})})]})}function ihn(){const[n]=pe(),e=ji(),t=So(),i=[{field:"first_name",label:n("first_name")},{field:"last_name",label:n("last_name")},{field:"email",label:n("email")},{field:"phone",label:n("phone")},{field:"password",label:n("password")},{field:"name",label:n("name")},{field:"website",label:n("website")},{field:"address1",label:n("address1")},{field:"address2",label:n("address2")},{field:"city",label:n("city")},{field:"state",label:n("state")},{field:"postal_code",label:n("postal_code")},{field:"country_id",label:n("country")},{field:"currency_id",label:n("currency")},{field:"custom_value1",label:n("custom1")},{field:"custom_value2",label:n("custom2")},{field:"custom_value3",label:n("custom3")},{field:"custom_value4",label:n("custom4")},{field:"public_notes",label:n("public_notes")},{field:"vat_number",label:n("vat_number")}],r=s=>{const l=un.cloneDeep((e==null?void 0:e.client_registration_fields)||[]).find(u=>u.key===s);let c="hidden";return l!=null&&l.required&&(l!=null&&l.visible)&&(c="required"),!(l!=null&&l.required)&&(l!=null&&l.visible)&&(c="optional"),c},o=(s,a)=>{let l=un.cloneDeep((e==null?void 0:e.client_registration_fields)||[]);const c=l.some(d=>d.key===s),u=i.findIndex(d=>d.field===s);if(u>=0){let d={visible:!1,required:!1};if(a==="optional"&&(d={...d,visible:!0}),a==="required"&&(d={visible:!0,required:!0}),c){const h=l.map(f=>({...f,required:f.key===s?d.required:f.required,visible:f.key===s?d.visible:f.visible}));t("client_registration_fields",h)}else{const h=i[u];l=[...l,{key:h.field,...d}],t("client_registration_fields",l)}}};return N(Qt,{title:n("registration"),children:[p(K,{leftSide:n("client_registration"),leftSideHelp:n("client_registration_help"),children:p(ft,{checked:!!(e!=null&&e.client_can_register),onValueChange:s=>t("client_can_register",s)})}),(e==null?void 0:e.client_can_register)&&p(K,{leftSide:n("registration_url"),children:p(Fl,{text:`${e==null?void 0:e.portal_domain}/client/register?company_key=${e==null?void 0:e.company_key}`})}),p("div",{className:"pt-4 border-b"}),i.map(s=>p(K,{leftSide:s.label,children:N(Cn,{value:r(s.field),onValueChange:a=>o(s.field,a),children:[p("option",{value:"hidden",defaultChecked:!0,children:n("hidden")}),p("option",{value:"optional",children:n("optional")}),p("option",{value:"required",children:n("required")})]})},s.field))]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function rhn(){const[n]=pe(),{isGroupSettingsActive:e,isClientSettingsActive:t}=ea();let i=[{name:n("settings"),href:bt("/settings/client_portal")},{name:n("authorization"),href:bt("/settings/client_portal/authorization")},{name:n("registration"),href:bt("/settings/client_portal/registration")},{name:n("messages"),href:bt("/settings/client_portal/messages")},{name:n("customize"),href:bt("/settings/client_portal/customize")}];return(e||t)&&(i=i.filter(r=>r.name!==n("registration"))),i}function ohn(){Pi("client_portal"),Pc();const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("client_portal"),href:"/settings/client_portal"}],t=Tu(),i=lp(),r=I0(),o=rhn();return N(ir,{title:n("client_portal"),docsLink:"en/advanced-settings/#client_portal",breadcrumbs:e,onSaveClick:t,onCancelClick:i,disableSaveButton:r,children:[r&&p(Iv,{}),p(QS,{tabs:o,className:"mt-6"}),p("div",{className:"my-4",children:p(Tg,{})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function shn(n,e){return e.replace("$body",n)}function l9(n){const e=ni();return p("span",{style:{color:e.$3,colorScheme:e.$0,backgroundColor:e.$1,borderColor:e.$4},className:"px-2 py-1 rounded m-1 inline-flex items-center space-x-2 hover:cursor-pointer",onClick:()=>{navigator.clipboard.writeText(n.children),p8e.success(Ms("copied_to_clipboard",{value:n.children}))},children:n.children})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const ahn={invoice:["$amount","$balance","$date","$due_date","$footer","$number","$payment_url","$po_number","$terms","$view_url","$assigned_to_user","$created_by_user","$discount","$exchange_rate","$invoices","$payment_button","$payments","$public_notes","$view_button"],client:["$client_address1","$client.city","$client.credit_balance","$client.name","$client.postal_code","$client.shipping_address1","$client.shipping_city","$client.shipping_postal_code","$client.state","$client.address2","$client.country","$client.id_number","$client.phone","$client.public_notes","$client.shipping_address2","$client.shipping_country","$client.shipping_state","$client.vat_number"],contact:["$contact.email","$contact.first_name","$contact.last_name","$contact.phone"],company:["$company.address1","$company.address2","$company.country","$company.email","$company.id_number","$company.name","$company.phone","$company.state","$company.vat_number","$company.website"]};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const lhn={invoice:["$assigned_to_user","$invoice","$invoices","$invoices.balance","$invoices.po_number","$payment_button","$view_button","$created_by_user","$invoice_references","$invoices.amount","$invoices.due_date","$payment.status","$payment_url","$view_url"],client:["$client_address1","$client.city","$client.credit_balance","$client.name","$client.postal_code","$client.shipping_address1","$client.shipping_city","$client.shipping_postal_code","$client.state","$client.address2","$client.country","$client.id_number","$client.phone","$client.public_notes","$client.shipping_address2","$client.shipping_country","$client.shipping_state","$client.vat_number"],contact:["$contact.email","$contact.first_name","$contact.last_name","$contact.phone"],company:["$company.address1","$company.address2","$company.country","$company.email","$company.id_number","$company.name","$company.phone","$company.state","$company.vat_number","$company.website"]};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var Zd=(n=>(n.Daily="1",n.Weekly="2",n.TwoWeeks="3",n.FourWeeks="4",n.Monthly="5",n.TwoMonths="6",n.ThreeMonths="7",n.FourMonths="8",n.SixMonths="9",n.Annually="10",n.TwoYears="11",n.ThreeYears="12",n))(Zd||{});/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const zT={[Zd.Daily]:"freq_daily",[Zd.Weekly]:"freq_weekly",[Zd.TwoWeeks]:"freq_two_weeks",[Zd.FourWeeks]:"freq_four_weeks",[Zd.Monthly]:"freq_monthly",[Zd.TwoMonths]:"freq_two_months",[Zd.ThreeMonths]:"freq_three_months",[Zd.FourMonths]:"freq_four_months",[Zd.SixMonths]:"freq_six_months",[Zd.Annually]:"freq_annually",[Zd.TwoYears]:"freq_two_years",[Zd.ThreeYears]:"freq_three_years"},nC=["reminder1","reminder2","reminder3"];function chn(){Pi("templates_and_reminders");const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("templates_and_reminders"),href:"/settings/templates_and_reminders"}],t=Pc(),i=So(),r=Tu(),o=lp();pa();const s=ma(),{isCompanySettingsActive:a}=ea(),{data:l}=ed(),[c,u]=w.useState(a||t!=null&&t.settings.email_template_invoice?"invoice":""),[d,h]=w.useState(),[f,g]=w.useState(),[m,v]=w.useState(-1),[_,b]=w.useState(!0),[y,C]=w.useState(!1),x=I0(),E=c==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${c||"invoice"}`,k=c==="quote_reminder1"?"email_quote_template_reminder1":`email_template_${c||"invoice"}`,L=W=>c==="quote_reminder1"?"quote_num_days_reminder1":`num_days_reminder${W}`,D=W=>c==="quote_reminder1"?"quote_schedule_reminder1":`schedule_reminder${W}`,A=W=>c==="quote_reminder1"?"enable_quote_reminder1":`enable_reminder${W}`,O=W=>c==="quote_reminder1"?"quote_late_fee_amount1":`late_fee_amount${W}`,P=W=>c==="quote_reminder1"?"quote_late_fee_percent1":`late_fee_percent${W}`,F=()=>{var W,q;if(l!=null&&l.templates&&t&&c){const H={subject:t.settings[E],body:t.settings[k]};if(((W=H.subject)==null?void 0:W.length)>0||((q=H.body)==null?void 0:q.length)>0)h({...H});else{const ie=l.templates[c]||{subject:t.settings[E]||"",body:t.settings[k]||""};h({...ie})}}},B=W=>{const q=un.cloneDeep(t==null?void 0:t.settings);q&&(W?(q[L(W)]=0,q[D(W)]="disabled",q[A(W)]=!1,q[O(W)]=0,q[P(W)]=0):(q.enable_reminder_endless=!1,q.endless_reminder_frequency_id=""),i("settings",q))},M=(W,q)=>{const H=un.cloneDeep(q||(t==null?void 0:t.settings));H&&(W?(delete H[L(W)],delete H[D(W)],delete H[A(W)],delete H[O(W)],delete H[P(W)]):(delete H.enable_reminder_endless,delete H.endless_reminder_frequency_id),i("settings",H))},V=W=>{if(!W){const q=un.cloneDeep(t==null?void 0:t.settings);if(q){const H=m>-1?`reminder${m}`:"";delete q[c==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${H||c}`],nC.includes(c)||c==="reminder_endless"?M(nC.indexOf(c)+1,q):i("settings",q),h(void 0)}}W&&!c&&u("invoice"),W&&c&&(F(),s(k)&&nC.includes(c)&&B(nC.indexOf(c)+1),c==="reminder_endless"&&s("email_template_reminder_endless")&&B())};w.useEffect(()=>{if(l!=null&&l.templates&&t&&c){nC.includes(c)?v(nC.indexOf(c)+1):v(-1);const W=t==null?void 0:t.settings[k];(a||W&&!a||c==="invoice"&&!W&&!a&&_)&&F(),_&&b(!1)}},[l,c]),w.useEffect(()=>{c&&d&&(i(`settings.${E}`,d==null?void 0:d.subject),i(`settings.${k}`,d==null?void 0:d.body),C(!0),Ae("POST",Te("/api/v1/templates"),{body:d==null?void 0:d.body,subject:d==null?void 0:d.subject,entity:"",entity_id:"",template:k}).then(W=>g(W.data)).finally(()=>C(!1)))},[d]);const U=c==="payment"?lhn:ahn;return N(ir,{title:n("templates_and_reminders"),docsLink:"en/advanced-settings/#templates_and_reminders",breadcrumbs:e,onSaveClick:r,onCancelClick:o,disableSaveButton:x,children:[x&&p(Iv,{}),N(Qt,{title:n("edit"),children:[p(K,{leftSide:p(Bt,{checked:typeof(t==null?void 0:t.settings[k])<"u",propertyKey:k,labelElement:p($t,{label:n("template")}),defaultValue:c||"invoice",onCheckboxChange:W=>V(W)}),children:N(Cn,{value:c,onValueChange:W=>{u(W),!a&&h(void 0)},cypressRef:"templateSelector",customSelector:!0,dismissable:!1,children:[l&&Object.keys(l.templates).map((W,q)=>p("option",{value:W,children:n(W)},q)),p("option",{value:"credit",children:n("credit")}),p("option",{value:"purchase_order",children:n("purchase_order")}),p("option",{value:"partial_payment",children:n("partial_payment")}),p("option",{value:"custom1",children:n("first_custom")}),p("option",{value:"custom2",children:n("second_custom")}),p("option",{value:"custom3",children:n("third_custom")})]})}),p(K,{leftSide:n("subject"),disabledLabels:s(k),children:p(We,{id:"subject",value:(d==null?void 0:d.subject)||"",onValueChange:W=>h(q=>q&&{...q,subject:W}),disabled:s(k)})}),p(K,{leftSide:n("body"),disabledLabels:s(k),children:p(pd,{value:(d==null?void 0:d.body)||"",onChange:W=>h(q=>q&&{...q,body:W}),disabled:s(k)})})]}),(nC.includes(c)||c==="reminder_endless"||c==="quote_reminder1")&&!s(k)&&p(Qt,{children:nC.includes(c)||c==="quote_reminder1"?N(dt,{children:[p(K,{leftSide:n("days"),children:p(wo,{precision:0,value:(t==null?void 0:t.settings[L(m)])||0,onValueChange:W=>i(`settings.${L(m)}`,parseFloat(W)||0),disablePrecision:!0})}),p(K,{leftSide:n("schedule"),children:N(Cn,{value:(t==null?void 0:t.settings[D(m)])||"disabled",onValueChange:W=>i(`settings.${D(m)}`,W),children:[p("option",{value:"disabled",defaultChecked:!0,children:n("disabled")}),p("option",{value:c==="quote_reminder1"?"after_quote_date":"after_invoice_date",children:n(c==="quote_reminder1"?"after_quote_date":"after_invoice_date")}),p("option",{value:c==="quote_reminder1"?"before_valid_until_date":"before_due_date",children:n(c==="quote_reminder1"?"before_valid_until_date":"before_due_date")}),p("option",{value:c==="quote_reminder1"?"after_valid_until_date":"after_due_date",children:n(c==="quote_reminder1"?"after_valid_until_date":"after_due_date")})]})}),p(K,{leftSide:n("send_email"),children:p(ft,{checked:!!(t!=null&&t.settings[A(m)])||!1,onValueChange:W=>i(`settings.${A(m)}`,W)})}),p(K,{leftSide:n("late_fee_amount"),children:p(wo,{value:(t==null?void 0:t.settings[O(m)])||0,onValueChange:W=>i(`settings.${O(m)}`,parseFloat(W)||0)})}),p(K,{leftSide:n("late_fee_percent"),children:p(wo,{value:(t==null?void 0:t.settings[P(m)])||0,onValueChange:W=>i(`settings.${P(m)}`,parseFloat(W)||0)})})]}):N(dt,{children:[p(K,{leftSide:n("send_email"),children:p(ft,{checked:!!(t!=null&&t.settings.enable_reminder_endless),onValueChange:W=>i("settings.enable_reminder_endless",W)})}),p(K,{leftSide:n("frequency"),children:p(Cn,{value:(t==null?void 0:t.settings.endless_reminder_frequency_id)||"",onValueChange:W=>i("settings.endless_reminder_frequency_id",W),withBlank:!0,children:Object.keys(zT).map((W,q)=>p("option",{value:W,children:n(zT[W])},q))})})]})}),f&&p(Qt,{className:"scale-y-100",title:f.subject,children:y?p("div",{className:"flex justify-center items-center",style:{height:800},children:p(ns,{})}):p("iframe",{srcDoc:shn(f.body,f.wrapper),frameBorder:"0",width:"100%",height:800})}),N(Qt,{title:n("variables"),children:[p(K,{leftSide:n("invoice"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:U.invoice.map((W,q)=>p(l9,{children:W},q))})}),p(K,{leftSide:n("client"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:U.client.map((W,q)=>p(l9,{children:W},q))})}),p(K,{leftSide:n("contact"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:U.contact.map((W,q)=>p(l9,{children:W},q))})}),p(K,{leftSide:n("company"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:U.company.map((W,q)=>p(l9,{children:W},q))})})]})]})}const uhn=()=>{const{t:n}=pe(),e=ci(),t=tf(),i=JS({resolveBy:"code"}),r=a=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"nordigen",platform:"react",institution_id:a}).then(l=>{var c;window.open(Te("/nordigen/connect/:hash",{hash:(c=l==null?void 0:l.data)==null?void 0:c.hash}))})},o=()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"yodlee",platform:"react"}).then(a=>{var l;window.open(bt("https://invoicing.co/yodlee/onboard/:hash",{hash:(l=a==null?void 0:a.data)==null?void 0:l.hash}))})};return[{id:"bank_account_name",label:n("name"),format:(a,l)=>N("div",{className:"flex items-center space-x-3",children:[p(Li,{to:bt("/settings/bank_accounts/:id/details",{id:l==null?void 0:l.id}),children:l==null?void 0:l.bank_account_name}),(l.integration_type==="NORDIGEN"||l.integration_type==="YODLEE")&&l.disabled_upstream&&p(wu,{message:n("reconnect"),width:"auto",placement:"top",children:p("div",{className:"cursor-pointer",onClick:c=>{c.stopPropagation(),l.integration_type==="NORDIGEN"&&r(l.nordigen_institution_id),l.integration_type==="YODLEE"&&o()},children:p(Tb,{color:"red",size:22})})})]})},{id:"bank_account_type",label:n("type")},{id:"balance",label:n("balance"),format:(a,l)=>{var c,u;return t(a,(c=e==null?void 0:e.settings)==null?void 0:c.country_id,(u=i(l.currency))==null?void 0:u.id)}}]},dhn="/dap-logos/yodlee.svg",hhn="/dap-logos/goCardless.png";function fhn(){const[n]=pe(),e=vo(),t=ni(),i=w.useRef(null),[r,o]=w.useState(),[s,a]=w.useState(!1);zk(i,()=>{o(void 0)});const l=()=>{a(!1),o(void 0)},c=()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"yodlee",platform:"react"}).then(h=>{var f;l(),window.open(bt("https://invoicing.co/yodlee/onboard/:hash",{hash:(f=h==null?void 0:h.data)==null?void 0:f.hash}))})},u=()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"nordigen",platform:"react"}).then(h=>{var f;l(),window.open(Te("/nordigen/connect/:hash",{hash:(f=h==null?void 0:h.data)==null?void 0:f.hash}))})},d=()=>{r==="yodlee"&&c(),r==="nordigen"&&u()};return N(dt,{children:[N(Gt,{type:"secondary",onClick:()=>u(),children:[p("span",{className:"mr-2",children:p(vt,{element:GEt,size:20})}),n("connect_accounts")]}),p(Ui,{title:n("connect_accounts"),visible:s,onClose:l,children:N("div",{ref:i,className:"flex flex-col space-y-6",children:[rc()&&p("div",{className:"flex cursor-pointer h-44 border-4",style:{borderColor:r==="yodlee"?e:t.$5},onClick:()=>o("yodlee"),children:p("img",{className:"flex-1",src:dhn})}),rc()&&p("div",{"data-cy":"nordigenBox",className:"flex cursor-pointer py-14 px-12 h-44 border-4",style:{borderColor:r==="nordigen"?e:t.$5},onClick:()=>o("nordigen"),children:p("img",{className:"flex-1",src:hhn})}),p(Gt,{onClick:d,disableWithoutIcon:!0,disabled:!r,children:n("connect")})]})})]})}function phn(){Pi("bank_accounts");const[n]=pe(),e=uhn(),t=wi(),i=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"}];return N(ir,{title:n("bank_accounts"),breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_accounts",children:[!rc()&&Ro()&&p(Iv,{message:n("upgrade_to_connect_bank_account")}),p(Ng,{resource:"bank_account",columns:e,endpoint:"/api/v1/bank_integrations?sort=id|desc",bulkRoute:"/api/v1/bank_integrations/bulk",linkToCreate:"/settings/bank_accounts/create",linkToEdit:"/settings/bank_accounts/:id/edit",withResourcefulActions:!0,rightSide:N("div",{className:"flex space-x-2",children:[p(fhn,{}),Ro(),N(Gt,{type:"secondary",onClick:()=>t("/settings/bank_accounts/transaction_rules"),children:[p("span",{className:"mr-2",children:p(vt,{element:ZEt,size:20})}),n("rules")]})]}),enableSavingFilterPreference:!0})]})}function ghn(){Pi("edit_bank_account");const[n]=pe(),e=wi(),{id:t}=il(),{data:i}=EWe({id:t}),[r,o]=w.useState(!1),[s,a]=w.useState(),[l,c]=w.useState(),u=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("edit_bank_account"),href:bt("/bank_accounts/:id/edit",{id:t})}],d=(f,g)=>{c(m=>m&&{...m,[f]:g})},h=async f=>{r||(f.preventDefault(),ce.processing(),a(void 0),o(!0),Ae("PUT",Te("/api/v1/bank_integrations/:id",{id:t}),l).then(()=>{ce.success("updated_bank_account"),En(["bank_integrations"]),e("/settings/bank_accounts")}).catch(g=>{var m;((m=g.response)==null?void 0:m.status)===422&&(a(g.response.data),ce.dismiss())}).finally(()=>o(!1)))};return w.useEffect(()=>{i&&c(i)},[i]),p(ir,{title:n("edit_bank_account"),breadcrumbs:u,docsLink:"en/basic-settings/#edit_bank_account",onSaveClick:h,children:N(Qt,{onFormSubmit:h,title:n("edit_bank_account"),children:[p(K,{leftSide:n("account_name"),children:p(We,{value:l==null?void 0:l.bank_account_name,onValueChange:f=>d("bank_account_name",f),errorMessage:s==null?void 0:s.errors.bank_account_name})}),p(K,{leftSide:n("sync_from"),children:p(We,{type:"date",value:l==null?void 0:l.from_date,onValueChange:f=>d("from_date",f),errorMessage:s==null?void 0:s.errors.from_date})}),p(K,{leftSide:n("auto_sync"),children:p(ft,{checked:(l==null?void 0:l.auto_sync)||!1,onValueChange:f=>d("auto_sync",f)})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function YKe(n,e,t,i,r,o){const s=wi();return a=>{a.preventDefault(),!i&&n&&(ce.processing(),e(void 0),t(!0),Ae("POST",Te("/api/v1/bank_integrations"),n).then(l=>{ce.success("created_bank_account"),En(["bank_integrations"]),r?(En(["bank_integrations"]),o&&o(l.data.data),r(!1)):s("/settings/bank_accounts")}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(ce.dismiss(),e(l.response.data))}).finally(()=>t(!1)))}}function mhn(){const[n]=pe();Pi("new_bank_account");const{data:e}=xWe(),t=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("new_bank_account"),href:"/settings/bank_accounts/create"}],[i,r]=w.useState(!1),[o,s]=w.useState(),[a,l]=w.useState(),c=YKe(a,s,r,i),u=(d,h)=>{l(f=>f&&{...f,[d]:h})};return w.useEffect(()=>{e&&l(e)},[e]),p(ir,{title:n("new_bank_account"),breadcrumbs:t,docsLink:"en/basic-settings/#create_bank_account",disableSaveButton:!rc()&&!Vm()&&Ro(),onSaveClick:c,children:p(Qt,{onFormSubmit:c,title:n("new_bank_account"),children:p(K,{leftSide:n("account_name"),children:p(We,{value:a==null?void 0:a.bank_account_name,onValueChange:d=>u("bank_account_name",d),errorMessage:o==null?void 0:o.errors.bank_account_name})})})})}function _hn(n){var u;const{balance:e,bank_account_type:t,provider_name:i,bank_account_status:r,currency:o=""}=(n==null?void 0:n.accountDetails)||{},[s]=pe(),a=ci(),l=tf(),c=JS({resolveBy:"code"});return N(Qt,{title:s("details"),children:[p(K,{leftSide:s("balance"),children:l(e||0,a.settings.country_id,(u=c(o))==null?void 0:u.id)}),p(K,{leftSide:s("type"),children:t}),p(K,{leftSide:s("provider"),children:i}),p(K,{leftSide:s("status"),children:r})]})}function vhn(){Pi("bank_account");const{id:n}=il(),[e]=pe(),t=[{name:e("settings"),href:"/settings"},{name:e("bank_accounts"),href:"/settings/bank_accounts"},{name:e("bank_account"),href:bt("/settings/bank_accounts/:id/details",{id:n})}],{data:i}=EWe({id:n}),[r,o]=w.useState();return w.useEffect(()=>{o(i)},[i]),p(ir,{title:e("bank_account"),breadcrumbs:t,docsLink:"en/basic-settings/#bank_account_details",children:p(_hn,{accountDetails:r})})}function bhn(){const[n]=pe();return[{id:"name",label:n("name"),format:(t,i)=>p(Li,{to:bt("/settings/bank_accounts/transaction_rules/:id/edit",{id:i.id}),children:i.name})},{id:"vendor_id",label:n("vendor"),format:(t,i)=>{var r;return p(Li,{to:bt("/vendors/:id/edit",{id:i.vendor_id}),children:(r=i.vendor)==null?void 0:r.name})}},{id:"category_id",label:n("category"),format:(t,i)=>{var r;return p(Li,{to:bt("/settings/expense_categories/:id/edit",{id:i.category_id}),children:(r=i.expense_category)==null?void 0:r.name})}},{id:"applies_to",label:n("applies_to")}]}function yhn(){const{documentTitle:n}=Pi("transaction_rules"),[e]=pe(),t=bhn(),i=[{name:e("settings"),href:"/settings"},{name:e("bank_accounts"),href:"/settings/bank_accounts"},{name:e("transaction_rules"),href:"/settings/bank_accounts/transaction_rules"}];return p(ir,{title:n,breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_transaction_rules",children:p(Ng,{resource:"transaction_rule",columns:t,endpoint:"/api/v1/bank_transaction_rules?include=vendor,expense_category&sort=id|desc",bulkRoute:"/api/v1/bank_transaction_rules/bulk",linkToCreate:"/settings/bank_accounts/transaction_rules/create",linkToEdit:"/settings/bank_accounts/transaction_rules/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Chn(){const{isAdmin:n}=Po();return Ti(["/api/v1/bank_transaction_rules","create"],()=>Ae("GET",Te("/api/v1/bank_transaction_rules/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function whn(n){return Ti(["/api/v1/bank_transaction_rules",n.id],()=>Ae("GET",Te("/api/v1/bank_transaction_rules/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function QKe(n){const[e]=pe(),t=vo(),{data:i}=OKe(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState(),u=()=>{s||(ce.processing(),a(!0),Ae("POST",Te("/api/v1/expense_categories"),l).then(d=>{ce.success("created_expense_category"),En(["expense_categories"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:Te("/api/v1/expense_categories")}})),n.setSelectedIds&&n.setSelectedIds([d.data.data.id]),n.onCreatedCategory&&n.onCreatedCategory(d.data.data),i&&c({...i,color:t}),n.setVisible(!1)}).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(o(d.response.data),ce.dismiss())}).finally(()=>a(!1)))};return w.useEffect(()=>{i&&c({...i,color:t})},[i]),p(Ui,{title:e("create_expense_category"),visible:n.visible,onClose:()=>n.setVisible(!1),stopPropagationInHeader:!0,children:N("div",{onClick:d=>d.stopPropagation(),children:[p(PKe,{expenseCategory:l,setExpenseCategory:c,errors:r,setErrors:o}),p("div",{className:"flex justify-end space-x-4 mt-5",children:p(Gt,{behavior:"button",onClick:u,children:e("save")})})]})})}function Shn(n){var s;const[e]=pe(),[t,i]=w.useState(!1),r=ps(),o="&per_page=500";return N(dt,{children:[p(QKe,{visible:n.initiallyVisible||t,setVisible:n.setVisible||i,setSelectedIds:n.setSelectedIds,onCreatedCategory:a=>n.onChange(a)}),!n.setSelectedIds&&p(Fh,{endpoint:Te(`/api/v1/expense_categories?status=active${o}`),onChange:a=>a.resource&&n.onChange(a.resource),inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value||null},entryOptions:{id:"id",label:"name",value:"id"},action:{label:e("new_expense_category"),onClick:()=>i(!0),visible:r("create_expense")},readonly:n.readonly,onDismiss:n.onClearButtonClick,initiallyVisible:n.initiallyVisible,sortBy:"name|asc",staleTime:n.staleTime,errorMessage:n.errorMessage})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function oLr(n){return Ti(["/api/v1/vendors",n.id],()=>Ae("GET",Te("/api/v1/vendors/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function Ehn(){const n=ps();return Ti(["/api/v1/vendors","create"],()=>Ae("GET",Te("/api/v1/vendors/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n("create_vendor")})}function xhn(n){return Ti(["/api/v1/vendors",n],()=>Ae("GET",Te("/api/v1/vendors?filter=:filter&per_page=:per_page&status=:status&page=:page",{per_page:n.perPage??"100",page:n.currentPage??"1",status:n.status??"active",filter:n.filter??""})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function sLr(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/vendors/bulk"),{action:e,ids:[n]}).then(()=>{ce.success(`${e}d_vendor`),En(["vendors"])})}}function Thn(n){var _,b,y,C,x;const[e]=pe(),{vendor:t,setVendor:i,errors:r,page:o,setContacts:s,contacts:a,fundamentalConceptVisible:l}=n,c=ci(),{isAdmin:u,isOwner:d}=Po(),h=(E,k)=>{i(L=>L&&{...L,[E]:k})},f=(E,k,L)=>{un.set(a[L],E,k),s([...a])},g=E=>{let k=[...a];k=k.filter((L,D)=>E!==D),s(k)},m=()=>{const E=[...a];E.push({id:"",first_name:"",last_name:"",email:"",send_email:!1,created_at:0,updated_at:0,archived_at:0,is_primary:!1,phone:"",custom_value1:"",custom_value2:"",custom_value3:"",custom_value4:"",link:"",last_login:0}),s(E)},v=Bj();return p(dt,{children:l?N("div",{className:"flex flex-col space-y-3",children:[p(We,{label:e("name"),value:(t==null?void 0:t.name)||"",onValueChange:E=>h("name",E),errorMessage:r==null?void 0:r.errors.name}),p(We,{label:`${e("contact")} ${e("first_name")}`,value:a[0].first_name,onValueChange:E=>f("first_name",E,0),errorMessage:r==null?void 0:r.errors["contacts.0.first_name"]}),p(We,{label:`${e("contact")} ${e("last_name")}`,value:a[0].last_name,onValueChange:E=>f("last_name",E,0),errorMessage:r==null?void 0:r.errors["contacts.0.last_name"]}),p(We,{label:`${e("contact")} ${e("email")}`,value:a[0].email,onValueChange:E=>f("email",E,0),errorMessage:r==null?void 0:r.errors["contacts.0.email"]}),p(We,{label:`${e("contact")} ${e("phone")}`,value:a[0].phone,onValueChange:E=>f("phone",E,0),errorMessage:r==null?void 0:r.errors["contacts.0.phone"]}),p(lA,{label:e("currency"),value:(t==null?void 0:t.currency_id)||"",onChange:E=>h("currency_id",E),errorMessage:r==null?void 0:r.errors.currency_id,dismissable:!0})]}):N("div",{className:"grid grid-cols-12 gap-4",children:[N("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[N(Qt,{title:e("details"),children:[o==="edit"&&p(K,{leftSide:e("status"),children:p(Hm,{entity:t})}),p(K,{leftSide:e("name"),children:p(We,{id:"name",value:t.name||"",onValueChange:E=>h("name",E),errorMessage:r==null?void 0:r.errors.name})}),p(K,{leftSide:e("number"),children:p(We,{value:t.number||"",onValueChange:E=>h("number",E),errorMessage:r==null?void 0:r.errors.number})}),p(K,{leftSide:e("user"),children:p(fbe,{value:t.assigned_user_id,onChange:E=>h("assigned_user_id",E.id),onClearButtonClick:()=>h("assigned_user_id",""),clearButton:!0,errorMessage:r==null?void 0:r.errors.assigned_user_id})}),p(K,{leftSide:e("id_number"),children:p(We,{value:t.id_number||"",onValueChange:E=>h("id_number",E),errorMessage:r==null?void 0:r.errors.id_number})}),p(K,{leftSide:e("vat_number"),children:p(We,{value:t.vat_number||"",onValueChange:E=>h("vat_number",E),errorMessage:r==null?void 0:r.errors.vat_number})}),p(K,{leftSide:e("website"),children:p(We,{value:t.website||"",onValueChange:E=>h("website",E),errorMessage:r==null?void 0:r.errors.website})}),p(K,{leftSide:e("phone"),children:p(We,{value:t.phone||"",onValueChange:E=>h("phone",E),errorMessage:r==null?void 0:r.errors.phone})}),p(K,{leftSide:e("routing_id"),children:p(We,{value:t.routing_id||"",onValueChange:E=>h("routing_id",E),errorMessage:(_=n.errors)==null?void 0:_.errors.routing_id})}),p(K,{leftSide:e("tax_exempt"),children:p(ft,{checked:!!t.is_tax_exempt,onValueChange:E=>h("is_tax_exempt",E)})}),p(K,{leftSide:e("classification"),children:N(Cn,{value:t.classification??"",onValueChange:E=>h("classification",E),errorMessage:r==null?void 0:r.errors.classification,customSelector:!0,dismissable:!0,children:[p("option",{value:"individual",children:e("individual")}),p("option",{value:"business",children:e("business")}),p("option",{value:"company",children:e("company")}),p("option",{value:"partnership",children:e("partnership")}),p("option",{value:"trust",children:e("trust")}),p("option",{value:"charity",children:e("charity")}),p("option",{value:"government",children:e("government")}),p("option",{value:"other",children:e("other")})]})}),((b=c==null?void 0:c.custom_fields)==null?void 0:b.vendor1)&&p(ls,{field:"contact1",defaultValue:t.custom_value1,value:c.custom_fields.vendor1,onValueChange:E=>h("custom_value1",E)}),((y=c==null?void 0:c.custom_fields)==null?void 0:y.vendor2)&&p(ls,{field:"vendor2",defaultValue:t.custom_value2,value:c.custom_fields.vendor2,onValueChange:E=>h("custom_value2",E)}),((C=c==null?void 0:c.custom_fields)==null?void 0:C.vendor3)&&p(ls,{field:"vendor3",defaultValue:t.custom_value3,value:c.custom_fields.vendor3,onValueChange:E=>h("custom_value3",E)}),((x=c==null?void 0:c.custom_fields)==null?void 0:x.vendor4)&&p(ls,{field:"vendor4",defaultValue:t.custom_value4,value:c.custom_fields.vendor4,onValueChange:E=>h("custom_value4",E)})]}),N(Qt,{title:e("address"),children:[p(K,{leftSide:e("address1"),children:p(We,{value:t.address1,onValueChange:E=>h("address1",E),errorMessage:r==null?void 0:r.errors.address1})}),p(K,{leftSide:e("address2"),children:p(We,{value:t.address2,onValueChange:E=>h("address2",E),errorMessage:r==null?void 0:r.errors.address2})}),p(K,{leftSide:e("city"),children:p(We,{value:t.city,onValueChange:E=>h("city",E),errorMessage:r==null?void 0:r.errors.city})}),p(K,{leftSide:e("state"),children:p(We,{value:t.state,onValueChange:E=>h("state",E),errorMessage:r==null?void 0:r.errors.state})}),p(K,{leftSide:e("postal_code"),children:p(We,{value:t.postal_code,onValueChange:E=>h("postal_code",E),errorMessage:r==null?void 0:r.errors.postal_code})}),p(K,{leftSide:e("country"),children:p(FN,{value:t.country_id,onChange:E=>h("country_id",E),errorMessage:r==null?void 0:r.errors.country_id})})]})]}),N("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[p(Qt,{title:e("contacts"),children:a.map((E,k,{length:L})=>{var D,A,O,P,F,B,M,V;return N("div",{children:[p(K,{leftSide:e("first_name"),children:p(We,{id:`first_name_${k}`,value:E.first_name,onValueChange:U=>f("first_name",U,k),errorMessage:(D=n.errors)==null?void 0:D.errors[`contacts.${k}.first_name`]})}),p(K,{leftSide:e("last_name"),children:p(We,{id:`last_name_${k}`,value:E.last_name,onValueChange:U=>f("last_name",U,k),errorMessage:(A=n.errors)==null?void 0:A.errors[`contacts.${k}.last_name`]})}),p(K,{leftSide:e("email"),children:p(We,{id:`email_${k}`,value:E.email,onValueChange:U=>f("email",U,k),errorMessage:(O=n.errors)==null?void 0:O.errors[`contacts.${k}.email`]})}),p(K,{leftSide:e("phone"),children:p(We,{value:E.phone,onValueChange:U=>f("phone",U,k),errorMessage:(P=n.errors)==null?void 0:P.errors[`contacts.${k}.phone`]})}),p(K,{leftSide:e("send_email"),children:p(ft,{checked:E.send_email,onChange:U=>f("send_email",U,k)})}),((F=c==null?void 0:c.custom_fields)==null?void 0:F.vendor_contact1)&&p(ls,{field:"vendor_contact1",defaultValue:E.custom_value1||"",value:c.custom_fields.vendor_contact1,onValueChange:U=>f("custom_value1",U,k)}),((B=c==null?void 0:c.custom_fields)==null?void 0:B.vendor_contact2)&&p(ls,{field:"vendor_contact2",defaultValue:E.custom_value2||"",value:c.custom_fields.vendor_contact2,onValueChange:U=>f("custom_value2",U,k)}),((M=c==null?void 0:c.custom_fields)==null?void 0:M.vendor_contact3)&&p(ls,{field:"vendor_contact3",defaultValue:E.custom_value3||"",value:c.custom_fields.vendor_contact3,onValueChange:U=>f("custom_value3",U,k)}),((V=c==null?void 0:c.custom_fields)==null?void 0:V.vendor_contact4)&&p(ls,{field:"vendor_contact4",defaultValue:E.custom_value4||"",value:c.custom_fields.vendor_contact4,onValueChange:U=>f("custom_value4",U,k)}),p(K,{children:N("div",{className:"flex justify-between items-center",children:[t.contacts.length>=2&&p("button",{type:"button",className:"text-red-600",onClick:()=>g(k),children:e("remove_contact")}),k+1==L&&p(Gt,{type:"minimal",behavior:"button",onClick:m,children:e("add_contact")})]})}),p(_i,{})]},k)})}),p(Qt,{title:e("additional_info"),children:N(kv,{className:"px-5",tabs:[e("settings"),...u||d?[e("custom_fields")]:[]],children:[N("div",{className:"flex flex-col space-y-4",children:[p(K,{leftSide:e("currency"),noExternalPadding:!0,children:p(lA,{value:t.currency_id,onChange:E=>h("currency_id",parseInt(E)),errorMessage:r==null?void 0:r.errors.currency_id})}),v.length>1&&p(K,{leftSide:e("language"),noExternalPadding:!0,children:p(QF,{value:t.language_id,onChange:E=>h("language_id",E),errorMessage:r==null?void 0:r.errors.language_id,dismissable:!0})}),p(pd,{label:e("public_notes").toString(),onChange:E=>h("public_notes",E),value:t.public_notes}),p(pd,{label:e("private_notes").toString(),onChange:E=>h("private_notes",E),value:t.private_notes})]}),N("div",{children:[N("span",{className:"text-sm",children:[e("custom_fields")," "]}),p(Li,{to:"/settings/custom_fields/vendors",className:"capitalize",children:e("click_here")})]})]})})]})]})})}function khn(n){const[e]=pe(),{fundamentalConceptVisible:t,setFundamentalConceptVisible:i}=n,{data:r}=Ehn(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState([{first_name:"",last_name:"",email:"",phone:"",send_email:!1}]);w.useEffect(()=>{r&&s({...r,country_id:""})},[r]);const d=Tu(),h=async()=>{un.set(o,"contacts",c),ce.processing(),await d(!0),Ae("POST",Te("/api/v1/vendors"),o).then(f=>{ce.success("created_vendor"),En(["vendors"]),n.setSelectedIds&&n.setSelectedIds([f.data.data.id]),n.onVendorCreated&&n.onVendorCreated(f.data.data),s(r),n.setVisible(!1)}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(ce.dismiss(),l(f.response.data))})};return N(dt,{children:[o&&p(Thn,{vendor:o,setVendor:s,errors:a,setContacts:u,contacts:c,fundamentalConceptVisible:t}),N("div",{className:Nt("flex",{"justify-between":t,"justify-end space-x-5":!t}),children:[p(Gt,{behavior:"button",type:"secondary",onClick:()=>i(f=>!f),children:e(t?"more_fields":"less_fields")}),p(Gt,{behavior:"button",onClick:h,children:e("save")})]})]})}function Ihn(n){const[e]=pe(),[t,i]=w.useState(!0);return p(Ui,{title:e("create_vendor"),visible:n.visible,onClose:()=>n.setVisible(!1),size:t?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:p(khn,{setSelectedIds:n.setSelectedIds,setVisible:n.setVisible,onVendorCreated:n.onVendorCreated,fundamentalConceptVisible:t,setFundamentalConceptVisible:i})})}function Lhn(n){var o;const[e]=pe(),t=ps(),[i,r]=w.useState(!1);return N(dt,{children:[p(Ihn,{visible:n.initiallyVisibleModal||i,setVisible:n.setVisible||r,setSelectedIds:n.setSelectedIds,onVendorCreated:s=>n.onChange(s)}),!n.setSelectedIds&&p(Fh,{endpoint:Te("/api/v1/vendors?status=active&per_page=500"),onChange:s=>s.resource&&n.onChange(s.resource),inputOptions:{label:(o=n.inputLabel)==null?void 0:o.toString(),value:n.value||null},entryOptions:{id:"id",label:"name",value:"id"},action:{label:e("new_vendor"),onClick:()=>r(!0),visible:t("create_vendor")&&!n.withoutAction},readonly:n.readonly,onDismiss:n.onClearButtonClick,initiallyVisible:n.initiallyVisible,sortBy:"name|asc",staleTime:n.staleTime||1/0,errorMessage:n.errorMessage,exclude:n.exclude})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function XKe(n){const{setErrors:e,setTransactionRule:t}=n;return(i,r)=>{e(void 0),t(o=>o&&{...o,[i]:r})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Dhn={search_key:"description",operator:"contains",value:""},Ahn={description:[{value:"contains",label:"contains"},{value:"starts_with",label:"starts_with"},{value:"is",label:"is"},{value:"is_empty",label:"is_empty"}],amount:[{value:"<",label:"<"},{value:"<=",label:"<="},{value:"=",label:"="},{value:">",label:">"},{value:">=",label:">="}]};function Nhn(n){const[e]=pe(),{visible:t,setVisible:i,transactionRule:r,ruleIndex:o,setTransactionRule:s,setErrors:a}=n,[l,c]=w.useState(),u=XKe({setTransactionRule:s,setErrors:a}),d=(g,m)=>{c(v=>v&&{...v,[g]:m})},h=g=>{d("search_key",g),g==="description"&&d("operator","contains"),g==="amount"&&d("operator","<")},f=()=>{if(l){const g=r.rules||[];o>-1?(g[o]=l,u("rules",g),i(!1)):(u("rules",[...g,l]),i(!1))}};return w.useEffect(()=>{r&&(o>-1?c(r.rules[o]):c(Dhn))},[r,o]),N(Ui,{title:o>-1?e("edit_rule"):e("add_rule"),visible:t,onClose:()=>i(!1),children:[N(Cn,{required:!0,label:e("field"),value:l==null?void 0:l.search_key,onValueChange:g=>h(g),children:[p("option",{defaultChecked:!0,value:"description",children:e("description")}),p("option",{value:"amount",children:e("amount")})]}),p(Cn,{required:!0,label:e("operator"),value:l==null?void 0:l.operator,onValueChange:g=>d("operator",g),children:(l==null?void 0:l.search_key)&&Ahn[l.search_key].map((g,m)=>p("option",{value:g.value,children:e(g.label)},m))}),p(We,{changeOverride:!0,required:!0,label:e("value"),value:l==null?void 0:l.value,onValueChange:g=>d("value",g)}),p(Gt,{className:"self-end",onClick:f,disableWithoutIcon:!0,disabled:!(l!=null&&l.value),children:e("save")})]})}function ZKe(n){var g;const[e]=pe(),t=vo(),[i,r]=w.useState(!1),[o,s]=w.useState(-1),{transactionRule:a,setTransactionRule:l,errors:c,setErrors:u}=n,d=XKe({setErrors:u,setTransactionRule:l}),h=m=>{const v=a.rules.filter((_,b)=>b!==m);d("rules",v)},f=ni();return N(dt,{children:[N(Qt,{title:n.page==="create"?e("new_transaction_rule"):e("edit_transaction_rule"),children:[p(K,{leftSide:e("name"),required:!0,children:p(We,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},required:!0,value:a.name,onValueChange:m=>d("name",m),errorMessage:c==null?void 0:c.errors.name})}),p(K,{leftSide:e("match_all_rules"),leftSideHelp:e("match_all_rules_help"),children:p(ft,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},checked:a.matches_on_all||!1,onValueChange:m=>d("matches_on_all",m)})}),p(K,{leftSide:e("auto_convert"),leftSideHelp:e("auto_convert_help"),children:p(ft,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},checked:a.auto_convert||!1,onValueChange:m=>d("auto_convert",m)})}),p(K,{leftSide:e("vendor"),children:p(Lhn,{value:a.vendor_id,onChange:m=>d("vendor_id",m.id),onClearButtonClick:()=>d("vendor_id",""),errorMessage:c==null?void 0:c.errors.vendor_id})}),p(K,{leftSide:e("expense_category"),children:p(Shn,{value:a.category_id,onChange:m=>d("category_id",m.id),onClearButtonClick:()=>d("category_id",""),errorMessage:c==null?void 0:c.errors.category_id})})]}),N(eE,{children:[N(nE,{children:[p(Fa,{children:e("field")},"field"),p(Fa,{children:e("operator")},"operator"),p(Fa,{children:e("value")},"value")]}),N(tE,{children:[(g=a.rules)==null?void 0:g.map((m,v)=>N(Ec,{className:"py-2",children:[p(ko,{width:"30%",style:{backgroundColor:f.$2,color:f.$3,colorScheme:f.$0},children:e(m.search_key)}),p(ko,{width:"30%",style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:e(m.operator)}),p(ko,{width:"40%",style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:N("div",{className:"flex justify-between",children:[p("span",{children:m.value}),N("div",{className:"flex space-x-8",style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:[p(_F,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>{s(v),r(!0)}}),p(gl,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>h(v)})]})]})})]},v)),p(Ec,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:p(ko,{colSpan:100,style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:N("button",{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},onClick:()=>{s(-1),r(!0)},className:"w-full py-1 inline-flex justify-center items-center space-x-2",children:[p(qEt,{className:"cursor-pointer",color:t,fontSize:18}),p("span",{children:e("add_rule")})]})})})]})]}),p(Nhn,{visible:i,setVisible:r,ruleIndex:o,setTransactionRule:l,setErrors:u,transactionRule:a})]})}function Rhn(){const[n]=pe();Pi("new_transaction_rule");const e=wi(),t=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("transaction_rules"),href:"/settings/bank_accounts/transaction_rules"},{name:n("new_transaction_rule"),href:"/settings/bank_accounts/transaction_rules/create"}],{data:i}=Chn(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState();w.useEffect(()=>{i&&o({...i,matches_on_all:!0,applies_to:"DEBIT"})},[i]);const u=d=>{d.preventDefault(),s||(ce.processing(),c(void 0),a(!0),Ae("POST",Te("/api/v1/bank_transaction_rules"),r).then(h=>{ce.success("created_transaction_rule"),En(["bank_transaction_rules"]),e(bt("/settings/bank_accounts/transaction_rules/:id/edit",{id:h.data.data.id}))}).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===422&&(ce.dismiss(),c(h.response.data))}).finally(()=>a(!1)))};return p(ir,{title:n("new_transaction_rule"),breadcrumbs:t,docsLink:"en/basic-settings/#create_transaction_rule",disableSaveButton:!r||s,onSaveClick:u,children:r?p(ZKe,{page:"create",transactionRule:r,setTransactionRule:o,errors:l,setErrors:c}):p(ns,{})})}function Ohn(){const[n]=pe();Pi("edit_transaction_rule");const{id:e}=il(),t=wi(),i=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("transaction_rules"),href:"/settings/bank_accounts/transaction_rules"},{name:n("edit_transaction_rule"),href:bt("/settings/bank_accounts/transaction_rules/:id/edit",{id:e})}],{data:r}=whn({id:e}),[o,s]=w.useState(),[a,l]=w.useState(!1),[c,u]=w.useState();w.useEffect(()=>{r&&s(r)},[r]);const d=h=>{h.preventDefault(),a||(ce.processing(),u(void 0),l(!0),Ae("PUT",Te("/api/v1/bank_transaction_rules/:id",{id:e}),o).then(()=>{ce.success("updated_transaction_rule"),En(["bank_transaction_rules"]),t("/settings/bank_accounts/transaction_rules")}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(ce.dismiss(),u(f.response.data))}).finally(()=>l(!1)))};return p(ir,{title:n("edit_transaction_rule"),breadcrumbs:i,docsLink:"en/basic-settings/#edit_transaction_rule",disableSaveButton:!o||a,onSaveClick:d,children:o?p(ZKe,{transactionRule:o,setTransactionRule:s,errors:c,setErrors:u}):p(ns,{})})}function pbe({text:n,className:e,secure:t,limit:i=0,iconColor:r}){const o=n||"",s=a=>{a.stopPropagation(),navigator.clipboard.writeText(o),ce.success("copied_to_clipboard",{value:""})};return N("div",{className:`inline-flex space-x-2 ${e}`,children:[p("span",{children:t?n.split("").map(()=>"*"):o.length>i?o.substring(0,i).concat(" "):o}),o.length>0&&p("button",{type:"button",onClick:s,children:p(M9e,{size:18,color:r})})]})}const Phn=()=>{const[n]=pe(),e=tf(),t=ci();return[{id:"name",label:n("name")},{id:"price",label:n("price"),format:r=>e(r,t==null?void 0:t.settings.country_id,t==null?void 0:t.settings.currency_id)},{id:"purchase_page",label:n("purchase_page"),format:r=>N("div",{className:"flex space-x-2",onClick:o=>o.stopPropagation(),children:[p(Li,{to:r,external:!0,children:n("purchase_page")}),p(pbe,{text:r})]})}]};function Mhn(){const{documentTitle:n}=Pi("payment_links"),[e]=pe(),t=Phn(),i=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"}];return p(ir,{title:n,docsLink:"en/advanced-settings/#subscriptions",breadcrumbs:i,children:p(Ng,{resource:"payment_link",endpoint:"/api/v1/subscriptions?sort=id|desc",bulkRoute:"/api/v1/subscriptions/bulk",columns:t,linkToCreate:"/settings/subscriptions/create",linkToEdit:"/settings/subscriptions/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function JKe(n){return Ti(["/api/v1/products"],()=>Ae("GET",Te("/api/v1/products?per_page=500&include=:include&status=:status",{include:(n==null?void 0:n.include)||"",status:(n==null?void 0:n.status)??"all"})).then(e=>e.data.data),{staleTime:1/0})}function aLr(n){return Ti(["/api/v1/products",n.id],()=>Ae("GET",Te("/api/v1/products/:id",{id:n.id})),{staleTime:1/0})}function Fhn(n){const e=ps();return Ti(["/api/v1/products/create"],()=>Ae("GET",Te("/api/v1/products/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_product")?(n==null?void 0:n.enabled)??!0:!1})}function Bhn(n,e){return Ae("POST",Te("/api/v1/products/bulk"),{action:e,ids:Array.from(n)})}function c9(n){const e=vo(),t=wi(),i=tf(),[r,o]=w.useState([]),[s,a]=w.useState(),l=u=>{const d=r.findIndex(({id:h})=>h===u);if(d>-1){const h=r.filter((g,m)=>m!==d);o(h);const f=h.map(({id:g})=>g);n.handleChange(n.type,f.join(","))}},c=u=>{var d,h;return u.product_key+" "+i(u.price,(d=u.company)==null?void 0:d.settings.country_id,(h=u.company)==null?void 0:h.settings.currency_id).toString()};return w.useEffect(()=>{if(n.products){let u=[];n.subscription[n.type].split(",").forEach(d=>{var h;u=u.concat(((h=n.products)==null?void 0:h.filter(({id:f})=>f===d))||[])}),o(u)}},[n.products]),w.useEffect(()=>{if(n.products&&s){const u=n.products.filter(({id:d})=>s===d);o(d=>[...d,...u]),a("")}},[s]),w.useEffect(()=>{if(n.products){const u=r.map(({id:d})=>d);n.handleChange(n.type,u.join(","))}},[r]),N(dt,{children:[n.products&&p(Cn,{onValueChange:u=>a(u),value:s,withBlank:!0,children:n.products.map((u,d)=>p("option",{value:u.id,children:c(u)},d))}),p("div",{className:"flex justify-center",children:p("ul",{role:"list",className:"-mb-8 mt-3",children:r.map((u,d)=>{var h,f;return p("li",{children:N("div",{className:"relative pb-8",children:[d!==r.length-1&&p("span",{className:"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}),N("div",{className:"relative flex space-x-3",children:[p("span",{className:"h-8 w-8 rounded-full flex items-center justify-center ring-8 ring-white",style:{backgroundColor:e},children:p(Ntn,{className:"h-4 w-4 text-white cursor-pointer","aria-hidden":"true",onClick:()=>t(bt("/products/:id/edit",{id:u.id}))})}),N("div",{className:"flex min-w-0 flex-1 justify-between space-x-4 pt-1.5",children:[N("div",{className:"flex flex-1 justify-between space-x-5",children:[p(Li,{to:bt("/products/:id/edit",{id:u.id}),children:u.product_key}),p("span",{children:i(u.price,(h=u.company)==null?void 0:h.settings.country_id,(f=u.company)==null?void 0:f.settings.currency_id)})]}),p("div",{className:"whitespace-nowrap text-right text-sm text-gray-500",children:p(t0,{className:"cursor-pointer ml-10 xl:ml-20",color:e,fontSize:19,onClick:()=>l(u.id)})})]})]})]})},d)})})})]})}function eGe(n){const[e]=pe(),{subscription:t,handleChange:i,errors:r,products:o,page:s}=n;return N(Qt,{title:e("overview"),children:[p(K,{leftSide:e("name"),required:!0,children:p(We,{value:t.name,onValueChange:a=>i("name",a),errorMessage:r==null?void 0:r.errors.name})}),p(K,{leftSide:e("group"),children:p(Fh,{endpoint:Te("/api/v1/group_settings?status=active"),onChange:a=>a.resource&&i("group_id",a.resource.id),inputOptions:{value:t.group_id},entryOptions:{id:"id",label:"name",value:"id"},onDismiss:()=>i("group_id",""),errorMessage:r==null?void 0:r.errors.group_id})}),p(K,{leftSide:e("user"),children:p(fbe,{value:t.assigned_user_id,onChange:a=>i("assigned_user_id",a.id),onClearButtonClick:()=>i("assigned_user_id",""),clearButton:!0,errorMessage:r==null?void 0:r.errors.assigned_user_id})}),p(K,{leftSide:e("products"),children:p(c9,{type:"product_ids",handleChange:i,subscription:t,products:o})}),p(K,{leftSide:e("recurring_products"),children:p(c9,{type:"recurring_product_ids",handleChange:i,subscription:t,products:o})}),p(K,{leftSide:e("optional_products"),children:p(c9,{type:"optional_product_ids",handleChange:i,subscription:t,products:o})}),p(K,{leftSide:e("optional_recurring_products"),children:p(c9,{type:"optional_recurring_product_ids",handleChange:i,subscription:t,products:o})}),s!=="create"&&p(K,{leftSide:e("purchase_page"),children:p(Fl,{className:"break-all",text:t.purchase_page})})]})}function tGe(n){const[e]=pe(),{subscription:t,handleChange:i,errors:r}=n;return w.useEffect(()=>{t.allow_cancellation||i("refund_period",0),t.trial_enabled||i("trial_duration",0)},[t.trial_enabled,t.allow_cancellation]),N(Qt,{title:e("settings"),children:[p(K,{leftSide:e("frequency"),children:N(Cn,{value:t.frequency_id,errorMessage:r==null?void 0:r.errors.frequency_id,onValueChange:o=>i("frequency_id",o),children:[p("option",{value:"",children:e("once")}),Object.keys(zT).map((o,s)=>p("option",{value:o,children:e(zT[o])},s))]})}),p(K,{leftSide:e("remaining_cycles"),children:N(Cn,{value:t==null?void 0:t.remaining_cycles,onValueChange:o=>i("remaining_cycles",o),errorMessage:r==null?void 0:r.errors.remaining_cycles,children:[p("option",{value:"-1",children:e("endless")}),[...Array(37).keys()].map((o,s)=>p("option",{value:o,children:o},s))]})}),p(K,{leftSide:e("auto_bill"),children:N(Cn,{value:t.auto_bill,onValueChange:o=>i("auto_bill",o),errorMessage:r==null?void 0:r.errors.auto_bill,children:[p("option",{defaultChecked:!0}),p("option",{value:"always",children:e("enabled")}),p("option",{value:"optout",children:e("optout")}),p("option",{value:"optin",children:e("optin")}),p("option",{value:"off",children:e("disabled")})]})}),p(K,{leftSide:e("promo_code"),children:p(We,{value:t.promo_code,onValueChange:o=>i("promo_code",o),errorMessage:r==null?void 0:r.errors.promo_code})}),p(K,{leftSide:e("promo_discount"),children:N(iA,{children:[p("div",{className:"w-full lg:w-1/2",children:p(wo,{value:t.promo_discount||"",onValueChange:o=>i("promo_discount",parseFloat(o)),errorMessage:r==null?void 0:r.errors.promo_discount})}),p("div",{className:"w-full lg:w-1/2",children:N(Cn,{value:t.is_amount_discount.toString(),onValueChange:o=>i("is_amount_discount",JSON.parse(o)),errorMessage:r==null?void 0:r.errors.is_amount_discount,children:[p("option",{value:"true",children:e("amount")}),p("option",{value:"false",children:e("percent")})]})})]})}),p(K,{leftSide:e("registration_required"),leftSideHelp:e("registration_required_help"),children:p(ft,{checked:t.registration_required,onValueChange:o=>i("registration_required",o)})}),p(K,{leftSide:e("use_inventory_management"),leftSideHelp:e("use_inventory_management_help"),children:p(ft,{checked:t.use_inventory_management,onValueChange:o=>i("use_inventory_management",o)})}),p(K,{leftSide:e("return_url"),children:p(We,{value:t.webhook_configuration.return_url,onValueChange:o=>i("webhook_configuration.return_url",o),errorMessage:r==null?void 0:r.errors["webhook_configuration.return_url"]})}),p(K,{leftSide:e("allow_query_overrides"),children:p(ft,{checked:t.allow_query_overrides,onValueChange:o=>i("allow_query_overrides",o)})}),p(K,{leftSide:e("allow_plan_changes"),children:p(ft,{checked:t.allow_plan_changes,onValueChange:o=>i("allow_plan_changes",o)})}),p(K,{leftSide:e("allow_cancellation"),children:p(ft,{checked:t.allow_cancellation,onValueChange:o=>i("allow_cancellation",o)})}),t.allow_cancellation&&p(K,{children:N(Cn,{label:e("refund_period"),value:t.refund_period,onValueChange:o=>i("refund_period",parseFloat(o)||0),withBlank:!0,blankOptionValue:0,errorMessage:r==null?void 0:r.errors.refund_period,children:[p("option",{value:86400,children:e("count_day")}),p("option",{value:172800,children:Ms("count_days",{count:2})}),p("option",{value:259200,children:Ms("count_days",{count:3})}),p("option",{value:604800,children:Ms("count_days",{count:7})}),p("option",{value:1209600,children:Ms("count_days",{count:14})}),p("option",{value:2592e3,children:Ms("count_days",{count:30})}),p("option",{value:5184e3,children:Ms("count_days",{count:60})})]})}),p(K,{leftSide:e("trial_enabled"),children:p(ft,{checked:t.trial_enabled,onValueChange:o=>i("trial_enabled",o)})}),t.trial_enabled&&p(K,{children:N(Cn,{label:e("trial_duration"),value:t.trial_duration,onValueChange:o=>i("trial_duration",parseFloat(o)||0),withBlank:!0,blankOptionValue:0,errorMessage:r==null?void 0:r.errors.trial_duration,children:[p("option",{value:86400,children:e("count_day")}),p("option",{value:172800,children:Ms("count_days",{count:2})}),p("option",{value:259200,children:Ms("count_days",{count:3})}),p("option",{value:604800,children:Ms("count_days",{count:7})}),p("option",{value:1209600,children:Ms("count_days",{count:14})}),p("option",{value:2592e3,children:Ms("count_days",{count:30})}),p("option",{value:5184e3,children:Ms("count_days",{count:60})})]})}),p(K,{leftSide:e("per_seat_enabled"),children:p(ft,{checked:t.per_seat_enabled,onValueChange:o=>i("per_seat_enabled",o)})}),t.per_seat_enabled&&p(K,{children:p(We,{label:e("max_seats_limit"),value:t.max_seats_limit,onValueChange:o=>i("max_seats_limit",parseFloat(o)||0),errorMessage:r==null?void 0:r.errors.max_seats_limit})})]})}function nGe(n){var f;const[e]=pe(),t=vo(),{subscription:i,handleChange:r,errors:o}=n,[s,a]=w.useState(""),[l,c]=w.useState(""),u=Object.entries(((f=i==null?void 0:i.webhook_configuration)==null?void 0:f.post_purchase_headers)??[]),d=()=>{r(`webhook_configuration.post_purchase_headers.${s}`,l),a(""),c("")},h=g=>{Object.hasOwn(i.webhook_configuration.post_purchase_headers,g)&&(delete i.webhook_configuration.post_purchase_headers[g],r("webhook_configuration",i.webhook_configuration))};return N(Qt,{title:e("webhook"),children:[p(K,{leftSide:e("webhook_url"),children:p(We,{value:i.webhook_configuration.post_purchase_url,onValueChange:g=>r("webhook_configuration.post_purchase_url",g),errorMessage:o==null?void 0:o.errors["webhook_configuration.post_purchase_url"]})}),p(K,{leftSide:e("rest_method"),children:N(Cn,{value:i.webhook_configuration.post_purchase_rest_method,onValueChange:g=>r("webhook_configuration.post_purchase_rest_method",g),errorMessage:o==null?void 0:o.errors["webhook_configuration.post_purchase_rest_method"],children:[p("option",{defaultChecked:!0}),p("option",{value:"post",children:e("post")}),p("option",{value:"put",children:e("put")})]})}),p(K,{leftSide:e("add_header"),children:N("div",{className:"flex flex-col",children:[N("div",{className:"flex flex-1 justify-between items-center",children:[p(We,{label:e("header_key"),value:s,onValueChange:g=>a(g)}),p(We,{label:e("header_value"),value:l,onValueChange:g=>c(g)}),p(qp,{className:"mt-7 text-gray-800 cursor-pointer",fontSize:25,onClick:()=>s&&l&&d()})]}),u==null?void 0:u.map(([g,m],v)=>N("div",{className:"flex flex-1 justify-between items-center space-x-2 mt-4",children:[p("span",{className:"flex-1 text-start",children:g}),p("span",{className:"flex-1 text-start",children:m}),p(t0,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>h(g)})]},v)),!u.length&&p("span",{className:"text-gray-500 self-center mt-6 text-xl",children:e("no_headers")})]})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function iGe(n){return(e,t)=>{n.setErrors(void 0);const i=un.cloneDeep(n.subscription);n.setSubscription(un.set(i,e,t))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $hn(){const{isAdmin:n,isOwner:e}=Po();return Ti(["/api/v1/subscriptions","create"],()=>Ae("GET",Te("/api/v1/subscriptions/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function Vhn(n){const{isAdmin:e,isOwner:t}=Po();return Ti(["/api/v1/subscriptions",n.id],()=>Ae("GET",Te("/api/v1/subscriptions/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function Hhn(){const n=_o(),e=Fi(tu);return async(t,i)=>(ce.processing(),Ae("POST",Te("/api/v1/subscriptions/bulk"),{action:i,ids:t}).then(()=>{ce.success(`${i}d_subscription`),En(["subscriptions"]),e&&n.invalidateQueries([e])}))}function rGe({subscription:n,handleChange:e,errors:t}){const{t:i}=pe(),r=n.steps?n.steps.split(","):[],[o,s]=w.useState([]),{data:a}=Ti({initialData:{},queryKey:["subscriptions","dependencies"],queryFn:()=>Ae("GET",Te("/api/v1/subscriptions/steps")).then(f=>f.data)}),l=a?Object.values(a).filter(f=>!r.includes(f.id)):[];function c(f){e("steps",r.filter(g=>g!==f).join(","))}function u(f){if(!f.destination||!a)return;const g=Array.from(r),[m]=g.splice(f.source.index,1);g.splice(f.destination.index,0,m),e("steps",g.join(",")),d(g.join(","))}function d(f){Ae("POST",Te("/api/v1/subscriptions/steps/check"),{steps:f??r.join(",")}).then(()=>s([])).catch(g=>{var m;(m=g.response)!=null&&m.data.errors.steps&&s(g.response.data.errors.steps)})}w.useEffect(()=>{a&&d()},[r.length]);const h=l.filter(f=>f.id.startsWith("auth.")).filter(f=>r.some(g=>g.startsWith("auth."))?!f.id.startsWith("auth."):!0);return N(Qt,{title:i("steps"),children:[p(K,{leftSide:i("authentication"),children:p(Cn,{value:"",onValueChange:f=>{e("steps",[...r,f].join(","))},withBlank:!0,children:h.map((f,g)=>p("option",{value:f.id,children:i(f.id)},g))})}),p(K,{leftSide:i("other_steps"),children:p(Cn,{value:"",onValueChange:f=>{e("steps",[...r,f].join(","))},withBlank:!0,children:l.filter(f=>!f.id.startsWith("auth.")).map((f,g)=>p("option",{value:f.id,children:i(f.id)},g))})}),N(K,{leftSide:i("order"),leftSideHelp:i("steps_order_help"),children:[p(cK,{onDragEnd:u,children:p(dK,{droppableId:"columns",children:f=>N("div",{...f.droppableProps,ref:f.innerRef,children:[r.map((g,m)=>p(uK,{draggableId:`item-${m}`,index:m,children:v=>N("div",{ref:v.innerRef,...v.draggableProps,className:"flex items-center justify-between py-2",children:[N("div",{className:"flex space-x-2 items-center",children:[p(vt,{className:"cursor-pointer",element:t0,size:20,onClick:()=>c(g)}),p("p",{children:i(g)})]}),p("div",{...v.dragHandleProps,children:p(vt,{element:O9e,size:23})})]})},m)),f.placeholder]})})}),t!=null&&t.errors.steps?p("div",{className:"text-red-500 mt-2",children:t.errors.steps}):o.length?p("div",{className:"text-red-500 mt-2",children:o.map((f,g)=>p("p",{children:f},g))}):null]})]})}function Whn(){const{documentTitle:n}=Pi("new_payment_link"),[e]=pe(),t=wi(),{data:i}=$hn(),{data:r}=JKe({include:"company",status:["active"]}),o=I0(),s=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"},{name:e("new_payment_link"),href:"/settings/subscriptions/create"}],a=[e("overview"),e("settings"),e("webhook"),e("steps")],[l,c]=w.useState(),[u,d]=w.useState(),[h,f]=w.useState(),g=iGe({setErrors:f,setSubscription:c,subscription:l});return w.useEffect(()=>{i&&c({...i,frequency_id:Zd.Monthly,webhook_configuration:{post_purchase_headers:{},post_purchase_body:"",post_purchase_rest_method:"",post_purchase_url:"",return_url:""}})},[i]),w.useEffect(()=>{r&&d(r)},[r]),N(ir,{title:n,breadcrumbs:s,onSaveClick:v=>{v.preventDefault(),f(void 0),ce.processing(),Ae("POST",Te("/api/v1/subscriptions"),l).then(_=>{ce.success("created_subscription"),En(["subscriptions"]),t(bt("/settings/subscriptions/:id/edit",{id:_.data.data.id}))}).catch(_=>{var b;((b=_.response)==null?void 0:b.status)===422&&(f(_.response.data),ce.dismiss())})},disableSaveButton:!l||o,children:[o&&p(Iv,{}),N(kv,{tabs:a,children:[p("div",{children:l&&p(eGe,{subscription:l,handleChange:g,errors:h,products:u,page:"create"})}),p("div",{children:l&&p(tGe,{subscription:l,handleChange:g,errors:h})}),p("div",{children:l&&p(nGe,{subscription:l,handleChange:g,errors:h})}),p("div",{children:l&&p(rGe,{subscription:l,handleChange:g,errors:h})})]})]})}function zhn(){const[n]=pe(),e=Hhn();return[i=>Sr(i)===Zi.Active&&p(tn,{onClick:()=>e([i.id],"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),i=>(Sr(i)===Zi.Archived||Sr(i)===Zi.Deleted)&&p(tn,{onClick:()=>e([i.id],"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),i=>(Sr(i)===Zi.Active||Sr(i)===Zi.Archived)&&p(tn,{onClick:()=>e([i.id],"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function Uhn(){const{documentTitle:n}=Pi("edit_payment_link"),[e]=pe(),t=zhn(),{id:i}=il(),{data:r}=Vhn({id:i}),{data:o}=JKe({status:["active"]}),s=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"},{name:e("edit_payment_link"),href:bt("/settings/subscriptions/:id/edit",{id:i})}],a=I0(),l=[e("overview"),e("settings"),e("webhook"),e("steps")],[c,u]=w.useState(),[d,h]=w.useState(),[f,g]=w.useState(),[m,v]=w.useState(!1),_=iGe({setErrors:g,setSubscription:h,subscription:d});return w.useEffect(()=>{if(r){const{post_purchase_headers:y,post_purchase_body:C,post_purchase_rest_method:x,post_purchase_url:E,return_url:k}=r.webhook_configuration;h({...r,webhook_configuration:{...r.webhook_configuration,post_purchase_headers:Array.isArray(y)?{}:y,post_purchase_body:C||"",post_purchase_rest_method:x||"",post_purchase_url:E||"",return_url:k||""}})}},[r]),w.useEffect(()=>{o&&u(o)},[o]),p(ir,{title:n,breadcrumbs:s,navigationTopRight:d&&p(D1,{resource:d,onSaveClick:()=>{m||(g(void 0),v(!0),ce.processing(),Ae("PUT",Te("/api/v1/subscriptions/:id",{id:i}),d).then(()=>{ce.success("updated_subscription"),En(["subscriptions"])}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(g(y.response.data),ce.dismiss())}).finally(()=>v(!1)))},actions:t,disableSaveButton:!d||a||m}),children:N(kv,{tabs:l,children:[p("div",{children:d&&p(eGe,{subscription:d,handleChange:_,errors:f,products:c})}),p("div",{children:d&&p(tGe,{subscription:d,handleChange:_,errors:f})}),p("div",{children:d&&p(nGe,{subscription:d,handleChange:_,errors:f})}),p("div",{children:d&&p(rGe,{subscription:d,handleChange:_,errors:f})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function jhn(n){const e=ps();return Ti("/api/v1/clients/create",()=>Ae("GET",Te("/api/v1/clients/create")).then(t=>t.data.data),{refetchOnWindowFocus:!!n.refetchOnWindowFocus,staleTime:1/0,enabled:e("create_client")})}function oGe(n){return Ti(["/api/v1/clients","per_page=500",n],()=>{var e;return Ae("GET",Te("/api/v1/clients?per_page=500&status=:status",{status:((e=n.status)==null?void 0:e.join(","))??"all"})).then(t=>t.data.data)},{enabled:n.enabled??!0,staleTime:1/0})}function lLr({id:n,enabled:e}){return Ti(["/api/v1/clients",n],()=>Ae("GET",Te("/api/v1/clients/:id?include=group_settings,activities.history",{id:n})).then(t=>t.data.data),{enabled:e,staleTime:1/0})}const qhn={assign_group:"updated_group",bulk_update:"updated_records"};function gbe(){const n=_o(),e=Fi(tu);return async(t,i,r)=>{const{groupSettingsId:o,column:s,newValue:a}=r||{};return ce.processing(),Ae("POST",Te("/api/v1/clients/bulk"),{action:i,ids:t,...o&&{group_settings_id:o},...s&&{column:s},...i==="bulk_update"&&{new_value:a}}).then(()=>{const l=qhn[i]||`${i}d_client`;ce.success(l),e&&n.invalidateQueries([e]),En(["clients"]),i==="delete"&&En(["projects"])})}}const Khn=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ghn=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Yhn=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Qhn=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],kAe=(n,e,t)=>{let i=n;return typeof e=="string"||Array.isArray(e)?i=n.toLocaleString(e,t):(e===!0||t!==void 0)&&(i=n.toLocaleString(void 0,t)),i};function sGe(n,e){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);e={bits:!1,binary:!1,space:!0,...e};const t=e.bits?e.binary?Qhn:Yhn:e.binary?Ghn:Khn,i=e.space?" ":"";if(e.signed&&n===0)return` 0${i}${t[0]}`;const r=n<0,o=r?"-":e.signed?"+":"";r&&(n=-n);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),n<1){const u=kAe(n,e.locale,s);return o+u+i+t[0]}const a=Math.min(Math.floor(e.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),t.length-1);n/=(e.binary?1024:1e3)**a,s||(n=n.toPrecision(3));const l=kAe(Number(n),e.locale,s),c=t[a];return o+l+i+c}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Xhn(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[p("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("path",{fill:"#C8BDB8",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),p("circle",{cx:"18.5",cy:"47",r:"3",fill:"#FFF"}),p("circle",{cx:"28.5",cy:"47",r:"3",fill:"#FFF"}),p("circle",{cx:"38.5",cy:"47",r:"3",fill:"#FFF"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Zhn(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[p("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),p("path",{fill:"#26B99A",d:"M6.5 39L17.5 39 49.5 39 49.5 28 39.5 18.5 29 30 23.517 24.517z"}),p("path",{fill:"#14A085",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),p("g",{fill:"#FFF",children:p("path",{d:"M21.426 42.65v7.848c0 .474-.087.873-.26 1.196a2.142 2.142 0 01-.697.779 2.778 2.778 0 01-1.005.41 5.78 5.78 0 01-1.169.117c-.201 0-.436-.021-.704-.062-.269-.041-.547-.104-.834-.191s-.563-.185-.827-.294a3.022 3.022 0 01-.67-.369l.697-1.107c.091.063.221.13.39.198.168.068.353.132.554.191.2.06.41.111.629.157s.424.068.615.068c.483 0 .868-.094 1.155-.28s.439-.504.458-.95V42.65h1.668zM25.514 52.932h-1.641V42.855h2.898c.428 0 .852.068 1.271.205.419.137.795.342 1.128.615.333.273.602.604.807.991s.308.822.308 1.306c0 .511-.087.973-.26 1.388a2.9 2.9 0 01-.725 1.046c-.31.282-.684.501-1.121.656s-.921.232-1.449.232h-1.217v3.638zm0-8.832v3.992h1.504c.2 0 .398-.034.595-.103.196-.068.376-.18.54-.335s.296-.371.396-.649c.1-.278.15-.622.15-1.032 0-.164-.023-.354-.068-.567a1.637 1.637 0 00-.28-.615 1.657 1.657 0 00-.595-.492c-.256-.133-.593-.199-1.012-.199h-1.23zM39.5 47.736v3.896c-.21.265-.444.48-.704.649s-.533.308-.82.417-.583.187-.889.232c-.306.048-.608.07-.909.07-.602 0-1.155-.109-1.661-.328s-.948-.542-1.326-.971c-.378-.429-.675-.966-.889-1.613-.214-.647-.321-1.395-.321-2.242s.107-1.593.321-2.235c.214-.643.51-1.178.889-1.606a3.78 3.78 0 011.333-.978 4.069 4.069 0 011.654-.335c.547 0 1.057.091 1.531.273.474.183.897.456 1.271.82l-1.135 1.012a1.951 1.951 0 00-.752-.574 2.252 2.252 0 00-.875-.178c-.337 0-.659.063-.964.191a2.065 2.065 0 00-.82.649c-.242.306-.431.699-.567 1.183s-.21 1.075-.219 1.777c.009.684.08 1.276.212 1.777.132.501.314.911.547 1.23s.497.556.793.711c.296.155.608.232.937.232.1 0 .234-.007.403-.021a4.91 4.91 0 00.506-.068 3.29 3.29 0 00.485-.13.695.695 0 00.342-.232v-2.488h-1.709v-1.121H39.5z"})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Jhn(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[p("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("path",{fill:"#CC4B4C",d:"M19.514 33.324c-.348 0-.682-.113-.967-.326-1.041-.781-1.181-1.65-1.115-2.242.182-1.628 2.195-3.332 5.985-5.068 1.504-3.296 2.935-7.357 3.788-10.75-.998-2.172-1.968-4.99-1.261-6.643.248-.579.557-1.023 1.134-1.215a4.91 4.91 0 011.016-.172c.504 0 .947.649 1.261 1.049.295.376.964 1.173-.373 6.802 1.348 2.784 3.258 5.62 5.088 7.562 1.311-.237 2.439-.358 3.358-.358 1.566 0 2.515.365 2.902 1.117.32.622.189 1.349-.39 2.16-.557.779-1.325 1.191-2.22 1.191-1.216 0-2.632-.768-4.211-2.285-2.837.593-6.15 1.651-8.828 2.822-.836 1.774-1.637 3.203-2.383 4.251-1.025 1.435-1.909 2.105-2.784 2.105zm2.662-5.126c-2.137 1.201-3.008 2.188-3.071 2.744-.01.092-.037.334.431.692.149-.047 1.019-.444 2.64-3.436zm13.637-4.442c.815.627 1.014.944 1.547.944.234 0 .901-.01 1.21-.441.149-.209.207-.343.23-.415-.123-.065-.286-.197-1.175-.197-.505.001-1.14.023-1.812.109zm-7.47-6.582a71.291 71.291 0 01-2.674 7.564 49.966 49.966 0 016.496-2.02c-1.35-1.568-2.699-3.526-3.822-5.544zm-.607-8.462c-.098.033-1.33 1.757.096 3.216.949-2.115-.053-3.23-.096-3.216zM48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),p("g",{fill:"#FFF",children:p("path",{d:"M17.385 53h-1.641V42.924h2.898c.428 0 .852.068 1.271.205.419.137.795.342 1.128.615.333.273.602.604.807.991s.308.822.308 1.306c0 .511-.087.973-.26 1.388a2.9 2.9 0 01-.725 1.046c-.31.282-.684.501-1.121.656s-.921.232-1.449.232h-1.217V53zm0-8.832v3.992h1.504c.2 0 .398-.034.595-.103.196-.068.376-.18.54-.335.164-.155.296-.371.396-.649.1-.278.15-.622.15-1.032 0-.164-.023-.354-.068-.567a1.637 1.637 0 00-.28-.615 1.657 1.657 0 00-.595-.492c-.255-.132-.593-.198-1.012-.198h-1.23zM32.219 47.682c0 .829-.089 1.538-.267 2.126s-.403 1.08-.677 1.477-.581.709-.923.937-.672.398-.991.513a4.094 4.094 0 01-.875.219c-.264.03-.46.046-.588.046h-3.814V42.924h3.035c.848 0 1.593.135 2.235.403s1.176.627 1.6 1.073.74.955.95 1.524c.21.57.315 1.156.315 1.758zm-4.867 4.115c1.112 0 1.914-.355 2.406-1.066s.738-1.741.738-3.09c0-.419-.05-.834-.15-1.244-.101-.41-.294-.781-.581-1.114s-.677-.602-1.169-.807-1.13-.308-1.914-.308h-.957v7.629h1.627zM36.266 44.168v3.172h4.211v1.121h-4.211V53h-1.668V42.924H40.9v1.244h-4.634z"})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function efn(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[p("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),p("path",{fill:"#659C35",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("g",{fill:"#FFF",children:p("path",{d:"M17.385 53h-1.641V42.924h2.898c.428 0 .852.068 1.271.205.419.137.795.342 1.128.615.333.273.602.604.807.991s.308.822.308 1.306c0 .511-.087.973-.26 1.388a2.9 2.9 0 01-.725 1.046c-.31.282-.684.501-1.121.656s-.921.232-1.449.232h-1.217V53zm0-8.832v3.992h1.504c.2 0 .398-.034.595-.103.196-.068.376-.18.54-.335.164-.155.296-.371.396-.649.1-.278.15-.622.15-1.032 0-.164-.023-.354-.068-.567a1.637 1.637 0 00-.28-.615 1.657 1.657 0 00-.595-.492c-.255-.132-.593-.198-1.012-.198h-1.23zM31.316 42.924V53h-1.668l-3.951-6.945V53h-1.668V42.924h1.668l3.951 6.945v-6.945h1.668zM41.16 47.805v3.896c-.21.265-.444.48-.704.649s-.533.308-.82.417-.584.187-.889.233a6.096 6.096 0 01-.909.068c-.602 0-1.155-.109-1.661-.328s-.948-.542-1.326-.971c-.378-.429-.675-.966-.889-1.613-.214-.647-.321-1.395-.321-2.242s.107-1.593.321-2.235c.214-.643.51-1.178.889-1.606a3.78 3.78 0 011.333-.978 4.069 4.069 0 011.654-.335c.547 0 1.057.091 1.531.273.474.183.897.456 1.271.82l-1.135 1.012a1.951 1.951 0 00-.752-.574 2.252 2.252 0 00-.875-.178c-.337 0-.659.063-.964.191a2.065 2.065 0 00-.82.649c-.242.306-.431.699-.567 1.183s-.21 1.075-.219 1.777c.009.684.08 1.276.212 1.777.132.501.314.911.547 1.23s.497.556.793.711c.296.155.608.232.937.232.1 0 .234-.007.403-.021a4.91 4.91 0 00.506-.068 3.29 3.29 0 00.485-.13.695.695 0 00.342-.232v-2.488h-1.709v-1.121h3.336z"})}),p("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),p("path",{fill:"#88C057",d:"M6.5 39L17.5 39 49.5 39 49.5 28 39.5 18.5 29 30 23.517 24.517z"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function tfn(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[p("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("path",{fill:"#E57E25",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),p("g",{fill:"#FFF",children:p("path",{d:"M21.459 50.238c0 .364-.075.718-.226 1.06s-.362.643-.636.902-.61.467-1.012.622-.856.232-1.367.232c-.219 0-.444-.012-.677-.034s-.467-.062-.704-.116-.463-.13-.677-.226-.398-.212-.554-.349l.287-1.176c.128.073.289.144.485.212s.398.132.608.191.419.107.629.144.405.055.588.055c.556 0 .982-.13 1.278-.39.296-.26.444-.645.444-1.155 0-.31-.104-.574-.314-.793s-.472-.417-.786-.595-.654-.355-1.019-.533-.706-.388-1.025-.629-.583-.526-.793-.854-.314-.738-.314-1.23c0-.446.082-.843.246-1.189s.385-.641.663-.882.602-.426.971-.554.759-.191 1.169-.191c.419 0 .843.039 1.271.116s.774.203 1.039.376c-.055.118-.118.248-.191.39l-.205.396c-.063.123-.118.226-.164.308s-.073.128-.082.137c-.055-.027-.116-.063-.185-.109s-.166-.091-.294-.137-.296-.077-.506-.096-.479-.014-.807.014c-.183.019-.355.07-.52.157s-.31.193-.438.321-.228.271-.301.431-.109.313-.109.458c0 .364.104.658.314.882s.47.419.779.588.647.333 1.012.492.704.354 1.019.581.576.513.786.854.318.781.318 1.319zM25.861 53.055L22.73 42.924h1.873l2.338 8.695 2.475-8.695h1.859l-3.281 10.131h-2.133zM40.668 47.805v3.896c-.21.265-.444.48-.704.649s-.533.308-.82.417-.583.187-.889.233-.608.068-.909.068c-.602 0-1.155-.109-1.661-.328s-.948-.542-1.326-.971-.675-.966-.889-1.613-.321-1.395-.321-2.242.107-1.593.321-2.235.511-1.178.889-1.606.822-.754 1.333-.978 1.062-.335 1.654-.335c.547 0 1.058.091 1.531.273s.897.456 1.271.82l-1.135 1.012c-.219-.265-.47-.456-.752-.574s-.574-.178-.875-.178c-.337 0-.658.063-.964.191s-.579.344-.82.649-.431.699-.567 1.183-.21 1.075-.219 1.777c.009.684.08 1.276.212 1.777s.314.911.547 1.23.497.556.793.711.608.232.937.232c.101 0 .234-.007.403-.021s.337-.036.506-.068.33-.075.485-.13.269-.132.342-.232v-2.488h-1.709v-1.121h3.336z"})}),p("path",{fill:"#C8BDB8",d:"M45.5 22v-6h-6v2h-6v-4h-10v4h-6v-2h-6v6h6v-2h3.548c-4.566 2.636-7.548 7.588-7.548 13a1 1 0 102 0c0-5.246 3.229-9.999 8-11.995V24h10v-2.995c4.771 1.997 8 6.75 8 11.995a1 1 0 102 0c0-5.412-2.982-10.364-7.548-13H39.5v2h6zm-30-2h-2v-2h2v2zm16 2h-6v-6h6v6zm10-4h2v2h-2v-2z"})]})}function aGe(n){const e=["jpg","svg","png","pdf"],{size:t=26,type:i}=n;return N(dt,{children:[i==="jpg"&&p(Zhn,{height:t}),i==="svg"&&p(tfn,{height:t}),i==="png"&&p(efn,{height:t}),i==="pdf"&&p(Jhn,{height:t}),!e.includes(i)&&p(Xhn,{height:t})]})}function lGe(n){const[e]=pe(),t=Ha(),{disableEditableOptions:i=!1}=n,r=Lg(),o=GWe(),[s,a]=w.useState(!1),[l,c]=w.useState(),[u,d]=w.useState([]),{dateFormat:h}=lc(),f=_o(),g=_=>{var b;return(b=u.find(({documentId:y})=>y===_))==null?void 0:b.url},m=(_,b)=>{ce.processing(),f.fetchQuery(["/api/v1/documents",_.hash],()=>Ae("GET",Te("/documents/:hash",{hash:_.hash}),{headers:nS()},{responseType:"arraybuffer"}),{staleTime:1/0}).then(y=>{const C=new Blob([y.data],{type:y.headers["content-type"]}),x=URL.createObjectURL(C);if(b){window.open(x);return}const E=document.createElement("a");E.download=_.name,E.href=x,E.target="_blank",document.body.appendChild(E),E.click(),document.body.removeChild(E),ce.dismiss()})},v=(_,b)=>{ce.processing(),Ae("delete",Te("/api/v1/documents/:id",{id:l}),{},{headers:{"X-Api-Password":_}}).then(()=>{var y;ce.success("deleted_document"),(y=n.onDocumentDelete)==null||y.call(n)}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===412&&(r(b),a(!0))})};return w.useEffect(()=>{t.show_document_preview&&n.documents.forEach(async({id:_,hash:b,type:y})=>{if(!u.find(({documentId:x})=>x===_)&&(y==="png"||y==="jpg")){const x=await f.fetchQuery(["documents",b],()=>Ae("GET",Te("/documents/:hash",{hash:b}),{headers:nS()},{responseType:"arraybuffer"}),{staleTime:1/0}),E=new Blob([x.data],{type:x.headers["content-type"]}),k=URL.createObjectURL(E);d(L=>[...L,{documentId:_,url:k}])}})},[t,n.documents]),N(dt,{children:[N(eE,{children:[N(nE,{children:[p(Fa,{children:e("name")}),p(Fa,{children:e("date")}),p(Fa,{children:e("type")}),p(Fa,{children:e("size")}),!i&&p(Fa,{})]}),N(tE,{children:[!n.documents.length&&p(Ec,{children:p(ko,{colSpan:5,children:e("no_records_found")})}),n.documents.map((_,b)=>N(Ec,{children:[p(ko,{children:N("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[N("div",{className:"flex items-center space-x-2",children:[p(aGe,{type:_.type}),p("span",{children:_.name}),_.is_public?p(vt,{element:wH,size:27}):p(vt,{element:CH,size:27})]}),t.show_document_preview&&(_.type==="png"||_.type==="jpg")&&p(dt,{children:g(_.id)?p("img",{src:g(_.id),style:{width:150,height:75}}):p(ns,{})})]})}),p(ko,{children:go(_.updated_at,h)}),p(ko,{children:_.type}),p(ko,{children:sGe(_.size)}),!i&&p(ko,{children:N($m,{label:e("actions"),children:[p(tn,{onClick:()=>{m(_,!0)},icon:p(vt,{element:lme}),children:e("view")}),p(tn,{onClick:()=>{m(_,!1)},icon:p(vt,{element:sS}),children:e("download")}),_.is_public?p(tn,{onClick:()=>{o(_.id,!1).then(()=>{var y;return(y=n.onDocumentDelete)==null?void 0:y.call(n)})},icon:p(vt,{element:CH}),children:e("set_private")}):p(tn,{onClick:()=>{o(_.id,!0).then(()=>{var y;return(y=n.onDocumentDelete)==null?void 0:y.call(n)})},icon:p(vt,{element:wH}),children:e("set_public")}),p(tn,{onClick:()=>{c(_.id),a(!0)},icon:p(vt,{element:gl}),children:e("delete")})]})})]},b))]})]}),p(ap,{show:s,onClose:a,onSave:v})]})}function nfn(){const{t:n}=pe(),{dateFormat:e}=lc(),t=Ha(),i=GWe(),r=Lg(),[o,s]=w.useState(1),[a,l]=w.useState("10"),[c,u]=w.useState(""),[d,h]=w.useState(!1),[f,g]=w.useState([]),{data:m,isLoading:v}=qWe({perPage:a,currentPage:o,companyDocuments:"true"}),_=_o(),b=E=>{var k;return(k=f.find(({documentId:L})=>L===E))==null?void 0:k.url},y=()=>{En(["documents"])},C=async(E,k)=>{ce.processing();const L=await _.fetchQuery(["/api/v1/documents",E.hash],()=>Ae("GET",Te("/documents/:hash",{hash:E.hash}),{headers:nS()},{responseType:"arraybuffer"}),{staleTime:1/0});ce.dismiss();const D=new Blob([L.data],{type:L.headers["content-type"]}),A=URL.createObjectURL(D);if(k){window.open(A);return}const O=document.createElement("a");O.download=E.name,O.href=A,O.target="_blank",document.body.appendChild(O),O.click(),document.body.removeChild(O)},x=(E,k)=>{ce.processing(),Ae("delete",Te("/api/v1/documents/:id",{id:c}),{},{headers:{"X-Api-Password":E}}).then(()=>ce.success("deleted_document")).catch(L=>{var D;((D=L.response)==null?void 0:D.status)===412&&(r(k),h(!0))}).finally(()=>y())};return w.useEffect(()=>{t.show_document_preview&&m&&m.data.data.forEach(async({id:E,hash:k,type:L})=>{if(!f.find(({documentId:A})=>A===E)&&(L==="png"||L==="jpg")){const A=await _.fetchQuery(["/api/v1/documents",k],()=>Ae("GET",Te("/documents/:hash",{hash:k}),{headers:nS()},{responseType:"arraybuffer"}),{staleTime:1/0}),O=new Blob([A.data],{type:A.headers["content-type"]}),P=URL.createObjectURL(O);g(F=>[...F,{documentId:E,url:P}])}})},[t,m==null?void 0:m.data.data]),N(dt,{children:[N(eE,{children:[N(nE,{children:[p(Fa,{children:n("name")}),p(Fa,{children:n("date")}),p(Fa,{children:n("type")}),p(Fa,{children:n("size")}),p(Fa,{})]}),N(tE,{children:[v&&p(Ec,{children:p(ko,{colSpan:5,children:p(ns,{})})}),m&&m.data.data.map(E=>N(Ec,{children:[p(ko,{children:N("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[N("div",{className:"flex items-center space-x-2",children:[p(aGe,{type:E.type}),p("span",{children:E.name}),E.is_public?p(vt,{element:wH,size:27}):p(vt,{element:CH,size:27})]}),t.show_document_preview&&(E.type==="png"||E.type==="jpg")&&p(dt,{children:b(E.id)?p("img",{src:b(E.id),style:{width:150,height:75}}):p(ns,{})})]})}),p(ko,{children:go(E.updated_at,e)}),p(ko,{children:E.type}),p(ko,{children:sGe(E.size)}),p(ko,{children:N($m,{label:n("actions"),children:[p(tn,{onClick:()=>{C(E,!0)},icon:p(vt,{element:lme}),children:n("view")}),p(tn,{onClick:()=>{C(E,!1)},icon:p(vt,{element:sS}),children:n("download")}),E.is_public?p(tn,{onClick:()=>{i(E.id,!1).then(()=>y())},icon:p(vt,{element:CH}),children:n("set_private")}):p(tn,{onClick:()=>{i(E.id,!0).then(()=>y())},icon:p(vt,{element:wH}),children:n("set_public")}),p(tn,{onClick:()=>{u(E.id),h(!0)},icon:p(vt,{element:gl}),children:n("delete")})]})})]},E.id))]})]}),m&&p(JUe,{currentPage:o,onPageChange:s,onRowsChange:l,totalPages:m.data.meta.pagination.total_pages}),p(ap,{show:d,onClose:h,onSave:x})]})}function mbe(n){const[e]=pe(),{disableUpload:t=!1}=n,i=pa(),[r,o]=w.useState(new FormData),[s,a]=w.useState(),l=td({enableReinitialize:!0,initialValues:{},onSubmit:()=>{ce.processing(),a(void 0),Ae("POST",n.endpoint,r,{headers:{"Content-Type":"multipart/form-data"}}).then(()=>{var f;ce.success("uploaded_document"),o(new FormData),(f=n.onSuccess)==null||f.call(n)}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(ce.dismiss(),a(f.response.data)),o(new FormData)})}}),{getRootProps:c,getInputProps:u,isDragActive:d}=YN({disabled:!rc()&&Ro()||t,onDrop:f=>{r.append("_method","PUT"),f.forEach(g=>r.append("documents[]",g)),o(r),l.submitForm()}}),h=ni();return n.widgetOnly?N(dt,{children:[!rc()&&Ro()&&p(Ls,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center",children:[p(OT,{className:"mr-2",fontSize:20}),e("upgrade_to_upload_images"),(i==null?void 0:i.company_user)&&p(Li,{className:"ml-10",external:!0,to:i.company_user.ninja_portal_url,children:e("plan_change")})]})}),p("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[p("input",{...u()}),p(NT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium",style:{color:h.$3},children:e(d?"drop_file_here":"dropzone_default_message")})]})}),s&&Object.keys(s.errors).map((f,g)=>p(Ls,{className:"mt-2",type:"danger",children:s.errors[f]},g))]}):N(dt,{children:[!rc()&&Ro()&&p(Ls,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center",children:[p(OT,{className:"mr-2",fontSize:20}),e("upgrade_to_upload_images"),(i==null?void 0:i.company_user)&&p(Li,{className:"ml-10",external:!0,to:i.company_user.ninja_portal_url,children:e("plan_change")})]})}),p(Qt,{title:e("upload"),children:p(K,{leftSide:e("upload"),children:p("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[p("input",{...u()}),p(NT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium",style:{color:h.$3},children:d?"drop_file_here":e("dropzone_default_message")})]})})})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function EK(){const n=pa(),{isAdmin:e,isOwner:t}=Po();return(i,r)=>{if(r)return!!(n&&i&&i.user_id===n.id)||e||t;const o=n&&i&&"assigned_user_id"in i&&i.assigned_user_id===n.id;return!!(n&&i&&(i.user_id===n.id||o||e||t))}}function ifn({client:n,errors:e,setClient:t}){var v,_,b,y,C,x,E;const[i]=pe(),r=bve(),o=Bj(),s=ps(),a=EK(),{data:l}=rqe({}),{data:c}=ed(),{id:u}=il(),d=(k,L)=>{t(D=>D&&{...D,[k]:L})},h=(k,L)=>{var A;const D=un.cloneDeep(n);k!=="currency_id"&&L===""?(A=D.settings)==null||delete A[k]:un.set(D,`settings.${k}`,L),t(D)},[f,g]=w.useState([i("settings"),i("notes"),i("classify"),i("documents")]);w.useEffect(()=>{u||g(k=>k.filter(L=>L!==i("documents")))},[]);const m=()=>{En(["clients"])};return p(Qt,{title:i("additional_info"),children:N(kv,{className:"px-5",tabs:f,formatTabLabel:k=>{if(k===3)return p(P_e,{numberOfDocuments:n==null?void 0:n.documents.length})},children:[N("div",{className:"-mx-5",children:[r.length>1&&p(K,{leftSide:i("currency"),children:p(lA,{value:((v=n==null?void 0:n.settings)==null?void 0:v.currency_id)||"",onChange:k=>h("currency_id",k),errorMessage:e==null?void 0:e.errors["settings.currency_id"],dismissable:!0})}),o.length>1&&p(K,{leftSide:i("language"),children:p(QF,{value:((_=n==null?void 0:n.settings)==null?void 0:_.language_id)||"",onChange:k=>h("language_id",k),errorMessage:e==null?void 0:e.errors["settings.language_id"],dismissable:!0})}),l&&p(K,{leftSide:i("payment_terms"),children:p(Cn,{id:"settings.payment_terms",value:((b=n==null?void 0:n.settings)==null?void 0:b.payment_terms)||"",errorMessage:e==null?void 0:e.errors["settings.payment_terms"],onValueChange:k=>h("payment_terms",k),withBlank:!0,customSelector:!0,children:l.data.data.map((k,L)=>p("option",{value:k.num_days.toString(),children:k.name},L))})}),l&&p(K,{leftSide:i("quote_valid_until"),children:p(Cn,{id:"settings.valid_until",value:((y=n==null?void 0:n.settings)==null?void 0:y.valid_until)||"",onValueChange:k=>h("valid_until",k),errorMessage:e==null?void 0:e.errors["settings.valid_until"],withBlank:!0,customSelector:!0,children:l.data.data.map((k,L)=>p("option",{value:k.num_days.toString(),children:k.name},L))})}),p(K,{leftSide:i("task_rate"),children:p(wo,{value:((C=n==null?void 0:n.settings)==null?void 0:C.default_task_rate)||"",onValueChange:k=>h("default_task_rate",parseFloat(k)),errorMessage:e==null?void 0:e.errors["settings.default_task_rate"]})}),p(K,{leftSide:i("send_reminders"),children:N(Cn,{id:"settings.send_reminders",value:((x=n==null?void 0:n.settings)==null?void 0:x.send_reminders)===!0?"enabled":((E=n==null?void 0:n.settings)==null?void 0:E.send_reminders)===!1?"disabled":"",onValueChange:k=>h("send_reminders",k==="enabled"?!0:k===""?"":!1),withBlank:!0,errorMessage:e==null?void 0:e.errors["settings.send_reminders"],customSelector:!0,children:[p("option",{value:"enabled",children:i("enabled")}),p("option",{value:"disabled",children:i("disabled")})]})})]}),N("div",{className:"-mx-5",children:[p(K,{leftSide:i("public_notes"),children:p(pd,{value:n==null?void 0:n.public_notes,onChange:k=>d("public_notes",k)})}),p(K,{leftSide:i("private_notes"),children:p(pd,{value:n==null?void 0:n.private_notes,onChange:k=>d("private_notes",k)})})]}),N("div",{className:"-mx-5",children:[c&&p(K,{leftSide:i("size_id"),children:p(Cn,{id:"size_id",value:(n==null?void 0:n.size_id)||"",onValueChange:k=>d("size_id",k),errorMessage:e==null?void 0:e.errors.size_id,withBlank:!0,customSelector:!0,children:c==null?void 0:c.sizes.map((k,L)=>p("option",{value:k.id,children:k.name},L))})}),c&&p(K,{leftSide:i("industry"),children:p(Cn,{id:"industry_id",value:(n==null?void 0:n.industry_id)||"",errorMessage:e==null?void 0:e.errors.industry_id,onValueChange:k=>d("industry_id",k),withBlank:!0,customSelector:!0,children:c==null?void 0:c.industries.map((k,L)=>p("option",{value:k.id,children:k.name},L))})})]}),u?p("div",{children:N("div",{className:"px-6",children:[p(mbe,{widgetOnly:!0,endpoint:Te("/api/v1/clients/:id/upload",{id:u}),onSuccess:m}),p(lGe,{documents:(n==null?void 0:n.documents)||[],onDocumentDelete:m,disableEditableOptions:!a(n,!0)&&!s("edit_client")})]})}):p(dt,{})]})})}function rfn(n){var s,a,l,c,u,d;const[e]=pe(),{errors:t,setClient:i,setErrors:r}=n,o=h=>{r(void 0),i(f=>f&&un.set(f,h.target.id,h.target.value))};return N(dt,{children:[p(K,{leftSide:e("billing_address1"),children:p(We,{id:"address1",value:((s=n.client)==null?void 0:s.address1)||"",onChange:o,errorMessage:t==null?void 0:t.errors.address1})}),p(K,{leftSide:e("address2"),children:p(We,{id:"address2",value:((a=n.client)==null?void 0:a.address2)||"",onChange:o,errorMessage:t==null?void 0:t.errors.address2})}),p(K,{leftSide:e("city"),children:p(We,{id:"city",value:((l=n.client)==null?void 0:l.city)||"",onChange:o,errorMessage:t==null?void 0:t.errors.city})}),p(K,{leftSide:e("state"),children:p(We,{id:"state",value:((c=n.client)==null?void 0:c.state)||"",onChange:o,errorMessage:t==null?void 0:t.errors.state})}),p(K,{leftSide:e("postal_code"),children:p(We,{id:"postal_code",value:((u=n.client)==null?void 0:u.postal_code)||"",onChange:o,errorMessage:t==null?void 0:t.errors.postal_code})}),p(K,{leftSide:e("country"),children:p(FN,{value:((d=n.client)==null?void 0:d.country_id)||"",errorMessage:t==null?void 0:t.errors.country_id,onChange:h=>i(f=>f&&{...f,country_id:h}),dismissable:!0})})]})}function ofn(n){var a,l,c,u,d,h;const[e]=pe(),{errors:t,setErrors:i,setClient:r}=n,o=f=>{i(void 0),r(g=>g&&un.set(g,f.target.id,f.target.value))};return N(dt,{children:[p(Gt,{onClick:()=>{n.setClient(f=>f&&{...f,shipping_address1:f==null?void 0:f.address1,shipping_address2:f==null?void 0:f.address2,shipping_city:f==null?void 0:f.city,shipping_state:f==null?void 0:f.state,shipping_postal_code:f==null?void 0:f.postal_code,shipping_country_id:f==null?void 0:f.country_id})},type:"secondary",behavior:"button",className:"mx-4 rounded-md bg-grey h-6",children:e("copy_billing")}),p(K,{leftSide:e("shipping_address1"),children:p(We,{id:"shipping_address1",value:((a=n.client)==null?void 0:a.shipping_address1)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_address1})}),p(K,{leftSide:e("address2"),children:p(We,{id:"shipping_address2",value:((l=n.client)==null?void 0:l.shipping_address2)||"",onChange:o})}),p(K,{leftSide:e("city"),children:p(We,{id:"shipping_city",value:((c=n.client)==null?void 0:c.shipping_city)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_city})}),p(K,{leftSide:e("state"),children:p(We,{id:"shipping_state",value:((u=n.client)==null?void 0:u.shipping_state)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_state})}),p(K,{leftSide:e("postal_code"),children:p(We,{id:"shipping_postal_code",value:((d=n.client)==null?void 0:d.shipping_postal_code)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_postal_code})}),p(K,{leftSide:e("country"),children:p(FN,{onChange:f=>r(g=>g&&{...g,shipping_country_id:f}),value:((h=n.client)==null?void 0:h.shipping_country_id)||"",errorMessage:t==null?void 0:t.errors.shipping_country_id,dismissable:!0})})]})}function sfn(n){const[e]=pe();return p(Qt,{title:e("address"),children:N(kv,{className:"px-5",tabs:[e("billing_address"),e("shipping_address")],children:[p("div",{className:"-mx-5",children:p(rfn,{...n})}),p("div",{className:"-mx-5",children:p(ofn,{...n})})]})})}function afn(n){const[e]=pe(),{size:t=22}=n||{};return p(wu,{tooltipElement:SK(e("user_unsubscribed"),":link",()=>N(Li,{className:"lowercase text-xs",to:"https://invoiceninja.github.io/en/hosted-mail/",external:!0,children:[e("link"),"."]})),width:"auto",placement:"top",children:p(Tb,{color:"red",size:t})})}function lfn(n){const[e]=pe(),t=vo(),i=ci(),r=(l,c,u)=>{n.setErrors(void 0);const d=n.contacts.findIndex(h=>h.contact_key===u);un.set(n.contacts[d],c,l),n.setContacts([...n.contacts])},o=l=>{const c=[...n.contacts];c.splice(l,1),n.setContacts(c)},s=()=>{const l=[...n.contacts];l.push({contact_key:Vq().replaceAll("-",""),first_name:"",last_name:"",email:"",password:"",phone:"",send_email:!1}),n.setContacts(l)},a=ni();return p(Qt,{className:"mt-4 xl:mt-0",title:e("contacts"),children:n.contacts.map((l,c,u)=>{var d,h,f,g,m,v,_,b,y;return N("div",{className:"pb-4 mb-4 border-b",style:{borderColor:a.$5},children:[p(K,{leftSide:e("first_name"),children:p(We,{id:`first_name_${c}`,value:l.first_name,onChange:C=>r(C.target.value,"first_name",l.contact_key),errorMessage:(d=n.errors)==null?void 0:d.errors.name})}),p(K,{leftSide:e("last_name"),children:p(We,{id:`last_name_${c}`,value:l.last_name,onChange:C=>r(C.target.value,"last_name",l.contact_key),errorMessage:(h=n.errors)==null?void 0:h.errors.name})}),p(K,{leftSide:e("email"),children:p(We,{id:`email_${c}`,value:l.email,onChange:C=>r(C.target.value,"email",l.contact_key),errorMessage:(f=n.errors)==null?void 0:f.errors[`contacts.${c}.email`]})}),(i==null?void 0:i.settings.enable_client_portal_password)&&p(K,{leftSide:e("password"),children:p(We,{id:`password_${c}`,type:"password",value:l.password,onChange:C=>r(C.target.value,"password",l.contact_key),errorMessage:(g=n.errors)==null?void 0:g.errors[`contacts.${c}.password`]})}),p(K,{leftSide:e("phone"),children:p(We,{id:`phone_${c}`,value:l.phone,onChange:C=>r(C.target.value,"phone",l.contact_key),errorMessage:(m=n.errors)==null?void 0:m.errors[`contacts.${c}.phone`]})}),p(K,{leftSide:e("add_to_invoices"),children:p(ft,{checked:!!(l!=null&&l.send_email),onChange:C=>r(C,"send_email",l.contact_key)})}),((v=i==null?void 0:i.custom_fields)==null?void 0:v.contact1)&&p(ls,{field:"contact1",defaultValue:l.custom_value1,value:i.custom_fields.contact1,onValueChange:C=>r(C,"custom_value1",l.contact_key)}),((_=i==null?void 0:i.custom_fields)==null?void 0:_.contact2)&&p(ls,{field:"contact2",defaultValue:l.custom_value2,value:i.custom_fields.contact2,onValueChange:C=>r(C,"custom_value2",l.contact_key)}),((b=i==null?void 0:i.custom_fields)==null?void 0:b.contact3)&&p(ls,{field:"contact3",defaultValue:l.custom_value3,value:i.custom_fields.contact3,onValueChange:C=>r(C,"custom_value3",l.contact_key)}),((y=i==null?void 0:i.custom_fields)==null?void 0:y.contact4)&&p(ls,{field:"contact4",defaultValue:l.custom_value4,value:i.custom_fields.contact4,onValueChange:C=>r(C,"custom_value4",l.contact_key)}),p(K,{...l.is_locked&&{leftSide:p("div",{className:"flex",children:p(afn,{size:25})})},children:N("div",{className:"flex items-center",children:[p("div",{className:"flex items-center justify-between w-1/2",children:n.contacts.length>=2&&p("button",{type:"button",onClick:()=>o(c),className:"text-red-600",children:e("remove_contact")})}),p("div",{className:"w-1/2 flex justify-end",children:c+1===u.length&&p("button",{type:"button",onClick:s,style:{color:t},children:e("add_contact")})})]})})]},c)})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cGe(n){return Ti(["/api/v1/group_settings",n],()=>Ae("GET",Te("/api/v1/group_settings?status=:status&per_page=:perPage",{status:(n==null?void 0:n.status)??"active",perPage:(n==null?void 0:n.perPage)??20})).then(e=>e.data.data),{staleTime:1/0})}function cfn(n){const{id:e}=n;return Ti(["/api/v1/group_settings",e],()=>Ae("GET",Te("/api/v1/group_settings/:id",{id:e})).then(t=>t.data.data),{staleTime:1/0})}function ufn(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/group_settings/bulk"),{action:e,ids:n}).then(()=>{ce.success(`${e}d_group`),En(["group_settings"])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function dfn(){return Ti(["/api/v1/users"],()=>Ae("GET",Te("/api/v1/users")),{staleTime:1/0})}function hfn(n){return Ti(["/api/v1/users",n.id],()=>Ae("GET",Te("/api/v1/users/:id?include=company_user",{id:n.id})),{enabled:n.enabled,staleTime:1/0})}function ffn(){const{isAdmin:n}=Po();return Ti(["/api/v1/users/create"],()=>Ae("GET",Te("/api/v1/users/create")),{staleTime:1/0,enabled:n})}function pfn(n){const e=S8e(),t=Lg(),{setIsPasswordConfirmModalOpen:i}=n;return(r,o,s,a)=>{ce.processing(),Ae("POST",Te("/api/v1/users/bulk"),{action:o,ids:r},{headers:{"X-Api-Password":s}}).then(()=>{ce.success(`${o}d_user`),e(["users"])}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===412&&(t(a),i(!0))})}}function gfn(n){var a,l,c,u,d,h,f,g,m,v,_,b,y,C,x,E,k,L,D,A,O,P,F,B,M,V,U,W,q;const[e]=pe(),{data:t}=dfn(),{data:i}=cGe(),r=(H,ie)=>{n.setErrors(void 0),n.setClient(se=>se&&un.set({...se},H,ie))},o=(H,ie)=>{n.setClient(se=>se&&un.set({...se},H,ie))},s=ci();return N(Qt,{title:e("company_details"),children:[n.client&&n.page==="edit"&&p(K,{leftSide:e("status"),children:p(Hm,{entity:n.client})}),p(K,{leftSide:e("name"),children:p(We,{value:((a=n.client)==null?void 0:a.name)||"",onValueChange:H=>r("name",H),errorMessage:(l=n.errors)==null?void 0:l.errors.name})}),p(K,{leftSide:e("number"),children:p(We,{value:((c=n.client)==null?void 0:c.number)||"",onValueChange:H=>r("number",H),errorMessage:(u=n.errors)==null?void 0:u.errors.number})}),i&&p(K,{leftSide:e("group"),children:p(Cn,{value:(d=n.client)==null?void 0:d.group_settings_id,onValueChange:H=>r("group_settings_id",H),errorMessage:(h=n.errors)==null?void 0:h.errors.group_settings_id,withBlank:!0,customSelector:!0,children:i.map((H,ie)=>p("option",{value:H.id,children:H.name},ie))})}),t&&p(K,{leftSide:e("user"),children:p(Cn,{value:(f=n.client)==null?void 0:f.assigned_user_id,onValueChange:H=>r("assigned_user_id",H),errorMessage:(g=n.errors)==null?void 0:g.errors.assigned_user_id,withBlank:!0,customSelector:!0,children:t.data.data.map((H,ie)=>N("option",{value:H.id,children:[H.first_name," ",H.last_name]},ie))})}),p(K,{leftSide:e("id_number"),children:p(We,{value:((m=n.client)==null?void 0:m.id_number)||"",onValueChange:H=>r("id_number",H),errorMessage:(v=n.errors)==null?void 0:v.errors.id_number})}),p(K,{leftSide:e("vat_number"),children:p(We,{value:((_=n.client)==null?void 0:_.vat_number)||"",onValueChange:H=>r("vat_number",H),errorMessage:(b=n.errors)==null?void 0:b.errors.vat_number})}),p(K,{leftSide:e("website"),children:p(We,{value:((y=n.client)==null?void 0:y.website)||"",onValueChange:H=>r("website",H),errorMessage:(C=n.errors)==null?void 0:C.errors.website})}),p(K,{leftSide:e("phone"),children:p(We,{value:((x=n.client)==null?void 0:x.phone)||"",onValueChange:H=>r("phone",H),errorMessage:(E=n.errors)==null?void 0:E.errors.phone})}),p(K,{leftSide:e("routing_id"),children:p(We,{value:((k=n.client)==null?void 0:k.routing_id)||"",onValueChange:H=>r("routing_id",H),errorMessage:(L=n.errors)==null?void 0:L.errors.routing_id})}),p(K,{leftSide:e("valid_vat_number"),children:p(ft,{checked:!!((D=n.client)!=null&&D.has_valid_vat_number),onValueChange:H=>o("has_valid_vat_number",H)})}),p(K,{leftSide:e("tax_exempt"),children:p(ft,{checked:!!((A=n.client)!=null&&A.is_tax_exempt),onValueChange:H=>o("is_tax_exempt",H)})}),p(K,{leftSide:e("classification"),children:N(Cn,{value:((O=n.client)==null?void 0:O.classification)??"",onValueChange:H=>r("classification",H),withBlank:!0,customSelector:!0,children:[p("option",{value:"individual",children:e("individual")}),p("option",{value:"business",children:e("business")}),p("option",{value:"company",children:e("company")}),p("option",{value:"partnership",children:e("partnership")}),p("option",{value:"trust",children:e("trust")}),p("option",{value:"charity",children:e("charity")}),p("option",{value:"government",children:e("government")}),p("option",{value:"other",children:e("other")})]})}),((P=s==null?void 0:s.custom_fields)==null?void 0:P.client1)&&p(ls,{field:"client1",defaultValue:(F=n.client)==null?void 0:F.custom_value1,value:s.custom_fields.client1,onValueChange:H=>o("custom_value1",H)}),((B=s==null?void 0:s.custom_fields)==null?void 0:B.client2)&&p(ls,{field:"client2",defaultValue:(M=n.client)==null?void 0:M.custom_value2,value:s.custom_fields.client2,onValueChange:H=>o("custom_value2",H)}),((V=s==null?void 0:s.custom_fields)==null?void 0:V.client3)&&p(ls,{field:"client3",defaultValue:(U=n.client)==null?void 0:U.custom_value3,value:s.custom_fields.client3,onValueChange:H=>o("custom_value3",H)}),((W=s==null?void 0:s.custom_fields)==null?void 0:W.client4)&&p(ls,{field:"client4",defaultValue:(q=n.client)==null?void 0:q.custom_value4,value:s.custom_fields.client4,onValueChange:H=>o("custom_value4",H)})]})}function uGe({isModalOpen:n,setIsModalOpen:e,onClientCreated:t}){var _;const[i]=pe(),[r,o]=w.useState(),[s,a]=w.useState(),[l,c]=w.useState([{first_name:"",last_name:"",email:"",phone:"",send_email:!1}]),[u,d]=w.useState(!0),{data:h}=jhn({refetchOnWindowFocus:!1}),f=(b,y)=>{a(void 0),o(C=>C&&un.set({...C},b,y))},g=(b,y)=>{a(void 0);const C=l.findIndex(x=>x.contact_key===l[0].contact_key);un.set(l[C],y,b),c([...l])},m=b=>{d(!0),e(b),a(void 0),o(void 0),c(()=>[{first_name:"",last_name:"",email:"",phone:"",send_email:!1}])},v=()=>{if(un.set(r,"contacts",l),ce.processing(),a(void 0),!((r==null?void 0:r.name)!=""||l[0].first_name!=""||l[0].last_name!=""))return a({message:i("invalid_data //needs translation"),errors:{name:[i("please_enter_a_client_or_contact_name")]}}),ce.error(),v;Ae("POST",Te("/api/v1/clients"),r).then(b=>{ce.success("created_client"),t&&t(b.data.data),En(["clients"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:Te("/api/v1/clients")}})),m(!1)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(a(b.response.data),ce.dismiss())})};return w.useEffect(()=>{h&&n&&o({...h})},[n]),p(Ui,{title:i("new_client"),visible:n,onClose:()=>m(!1),size:u?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:N("div",{className:"flex flex-col space-y-7",children:[r?p(dt,{children:u?N("div",{className:"flex flex-col space-y-3",children:[p(We,{label:i("name"),value:(r==null?void 0:r.name)||"",onValueChange:b=>f("name",b),errorMessage:s==null?void 0:s.errors.name}),p(We,{label:`${i("contact")} ${i("first_name")}`,value:l[0].first_name,onValueChange:b=>g(b,"first_name"),errorMessage:s==null?void 0:s.errors.name}),p(We,{label:`${i("contact")} ${i("last_name")}`,value:l[0].last_name,onValueChange:b=>g(b,"last_name"),errorMessage:s==null?void 0:s.errors.name}),p(We,{label:`${i("contact")} ${i("email")}`,value:l[0].email,onValueChange:b=>g(b,"email"),errorMessage:s==null?void 0:s.errors["contacts.0.email"]}),p(We,{label:`${i("contact")} ${i("phone")}`,value:l[0].phone,onValueChange:b=>g(b,"phone"),errorMessage:s==null?void 0:s.errors["contacts.0.phone"]}),p(lA,{label:i("currency"),value:((_=r==null?void 0:r.settings)==null?void 0:_.currency_id)||"",onChange:b=>{const y=un.cloneDeep(r);un.set(y,"settings.currency_id",b),o(y)},errorMessage:s==null?void 0:s.errors["settings.currency_id"],dismissable:!0})]}):N("div",{className:"flex flex-col xl:flex-row xl:gap-4",children:[N("div",{className:"w-full xl:w-1/2",children:[p(gfn,{client:r,setClient:o,setErrors:a,errors:s}),p("div",{className:"mt-5",children:p(sfn,{client:r,setClient:o,setErrors:a,errors:s})})]}),N("div",{className:"w-full xl:w-1/2",children:[p(lfn,{contacts:l,setContacts:c,setErrors:a,errors:s}),p("div",{className:"mt-5",children:p(ifn,{client:r,setClient:o,setErrors:a,errors:s})})]})]})}):p(ns,{}),N("div",{className:Nt("flex",{"justify-between":u,"justify-end space-x-5":!u}),children:[p(Gt,{behavior:"button",type:"secondary",onClick:()=>d(b=>!b),children:i(u?"more_fields":"less_fields")}),p(Gt,{behavior:"button",onClick:v,children:i("save")})]})]})})}function xK(n){var s;const[e]=pe(),[t,i]=w.useState(!1),r=ps(),{dropdownLabelFn:o}=n;return N(dt,{children:[p(uGe,{isModalOpen:t,setIsModalOpen:i,onClientCreated:a=>n.onChange(a)}),p(Fh,{inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value||null},endpoint:Te("/api/v1/clients"),readonly:n.readonly,onDismiss:n.onClearButtonClick,querySpecificEntry:"/api/v1/clients/:id",initiallyVisible:n.initiallyVisible,entryOptions:{id:"id",label:"display_name",value:"id",customSearchableValue:a=>a.contacts.map(({email:l})=>l).join(","),dropdownLabelFn:o},onChange:a=>a.resource&&n.onChange(a.resource),staleTime:n.staleTime||1/0,sortBy:null,exclude:n.exclude,action:{label:e("new_client"),visible:!(n.withoutAction||!r("create_client")),onClick:()=>i(!0)},clearInputAfterSelection:n.clearInputAfterSelection},"client_selector"),n.errorMessage&&p(Ls,{className:"mt-2",type:"danger",children:n.errorMessage})]})}const TK=Oo(void 0);function mfn(n){const[e]=pe(),t=vo(),i=Fi(TK),{schedule:r,handleChange:o,errors:s,page:a}=n,{data:l}=oGe({enabled:a==="edit"||!!i}),[c,u]=w.useState([]),d=f=>{const g={...r.parameters};g.clients=f.map(({id:m})=>m),o("parameters",g)},h=f=>{const g=c.filter((m,v)=>v!==f);d(g),u(g)};return w.useEffect(()=>{if((a==="edit"||i)&&l){const f=l==null?void 0:l.filter(g=>{var m;return(m=r.parameters.clients)==null?void 0:m.includes(g.id)});u(f)}},[l]),N(dt,{children:[p(K,{leftSide:e("date_range"),children:N(Cn,{value:r.parameters.date_range,onValueChange:f=>o("parameters.date_range",f),errorMessage:s==null?void 0:s.errors["parameters.date_range"],children:[p("option",{value:"last7_days",children:e("last7_days")}),p("option",{value:"last30_days",children:e("last30_days")}),p("option",{value:"last365_days",children:e("last365_days")}),p("option",{value:"this_month",children:e("this_month")}),p("option",{value:"last_month",children:e("last_month")}),p("option",{value:"this_quarter",children:e("this_quarter")}),p("option",{value:"last_quarter",children:e("last_quarter")}),p("option",{value:"this_year",children:e("this_year")}),p("option",{value:"last_year",children:e("last_year")}),p("option",{value:"all_time",children:e("all_time")})]})}),p(K,{leftSide:e("status"),children:N(Cn,{value:r.parameters.status,onValueChange:f=>o("parameters.status",f),errorMessage:s==null?void 0:s.errors["parameters.status"],children:[p("option",{value:"all",children:e("all")}),p("option",{value:"paid",children:e("paid")}),p("option",{value:"unpaid",children:e("unpaid")})]})}),p(K,{leftSide:e("show_aging_table"),children:p(ft,{checked:r.parameters.show_aging_table,onValueChange:f=>o("parameters.show_aging_table",f)})}),p(K,{leftSide:e("show_payments_table"),children:p(ft,{checked:r.parameters.show_payments_table,onValueChange:f=>o("parameters.show_payments_table",f)})}),p(K,{leftSide:e("show_credits_table"),children:p(ft,{checked:r.parameters.show_credits_table,onValueChange:f=>o("parameters.show_credits_table",f)})}),p(K,{leftSide:e("only_clients_with_invoices"),children:p(ft,{checked:r.parameters.only_clients_with_invoices,onValueChange:f=>o("parameters.only_clients_with_invoices",f)})}),N(K,{leftSide:e("client"),children:[p(xK,{onChange:f=>{u(g=>{const m=[...g,f];return d(m),m})},withoutAction:!0,clearInputAfterSelection:!0,exclude:r.parameters.clients}),N("div",{className:"flex justify-center",children:[p("div",{className:"flex flex-col space-y-2 pt-3",children:c==null?void 0:c.map((f,g)=>N("div",{className:"flex items-center justify-between",children:[p("span",{children:f.display_name}),p(t0,{className:"cursor-pointer ml-16",fontSize:20,color:t,onClick:()=>h(g)})]},f.id))}),!(c!=null&&c.length)&&p("span",{className:"text-gray-500 self-center text-xl mt-4",children:e("all_clients")})]})]})]})}function _fn(n){const[e]=pe(),t=tf(),{schedule:i,handleChange:r,errors:o}=n,s=a=>{var l,c;return`${a.number} (${t(a.amount,(l=a==null?void 0:a.client)==null?void 0:l.country_id,(c=a==null?void 0:a.client)==null?void 0:c.settings.currency_id)})`};return N(dt,{children:[p(K,{leftSide:e("type"),children:N(Cn,{value:i.parameters.entity,onValueChange:a=>r("parameters.entity",a),errorMessage:o==null?void 0:o.errors["parameters.entity"],children:[p("option",{value:"invoice",defaultChecked:!0,children:e("invoice")}),p("option",{value:"quote",children:e("quote")}),p("option",{value:"credit",children:e("credit")}),p("option",{value:"purchase_order",children:e("purchase_order")})]})}),i.parameters.entity==="invoice"&&p(K,{leftSide:e("invoice"),children:p(Fh,{endpoint:Te("/api/v1/invoices?include=client.group_settings&filter_deleted_clients=true&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>s(a),inputLabelFn:a=>a?s(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})}),i.parameters.entity==="quote"&&p(K,{leftSide:e("quote"),children:p(Fh,{endpoint:Te("/api/v1/quotes?include=client&filter_deleted_clients=true&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>s(a),inputLabelFn:a=>a?s(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})}),i.parameters.entity==="credit"&&p(K,{leftSide:e("credit"),children:p(Fh,{endpoint:Te("/api/v1/credits?include=client&filter_deleted_clients=true&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>s(a),inputLabelFn:a=>a?s(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})}),i.parameters.entity==="purchase_order"&&p(K,{leftSide:e("purchase_order"),children:p(Fh,{endpoint:Te("/api/v1/purchase_orders?include=vendor&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>{var l,c;return`${a.number} (${t(a.amount,(l=a==null?void 0:a.vendor)==null?void 0:l.country_id,(c=a==null?void 0:a.vendor)==null?void 0:c.currency_id)})`},inputLabelFn:a=>{var l,c;return a?`${a.number} (${t(a.amount,(l=a==null?void 0:a.vendor)==null?void 0:l.country_id,(c=a==null?void 0:a.vendor)==null?void 0:c.currency_id)})`:""}},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const vfn={email_statement:["template","next_run","frequency","remaining_cycles"],email_record:["template","next_run"],email_report:["template","next_run","frequency","remaining_cycles"]};function bfn(n){const{template:e}=n;return t=>vfn[e].includes(t)}function dGe(n){const[e]=pe(),t=ni(),i=_o(),r=Yk(),{value:o,onValueChange:s,errorMessage:a}=n,l=w.useRef(void 0),[c,u]=w.useState(""),[d,h]=w.useState(!!o),[f,g]=w.useState(),{data:m,isLoading:v}=Ti({queryKey:["/api/v1/products","perPage=500","status=active",c],queryFn:()=>Ae("GET",Te("/api/v1/products?per_page=:perPage&include=&status=active&filter=:filter",{filter:c,perPage:500})).then(b=>b.data.data),enabled:!d,staleTime:1/0});w.useEffect(()=>{m&&!d&&g(m.map(b=>({value:b.product_key,label:b.product_key,color:t.$3,backgroundColor:t.$1})))},[m,d]),w.useEffect(()=>{o&&d&&(async()=>{for(let b=0;b<o.split(",").length;b++){const y=o.split(",")[b],C=await i.fetchQuery(["/api/v1/products","perPage=500","status=active",y],()=>Ae("GET",Te("/api/v1/products?per_page=:perPage&include=&status=active&filter=:filter",{filter:y,perPage:500})).then(x=>x.data.data),{staleTime:1/0});g(x=>{const E=x||[],k=E.find(({value:L})=>L===y)?[]:C.map(L=>({value:L.product_key,label:L.product_key,color:t.$3,backgroundColor:t.$1})).filter(L=>L.value===y);return k[0]?[...E,k[0]]:[...E]})}h(!1)})()},[o]);const _=b=>b.map(y=>y.value).join(",");return N(dt,{children:[f&&!d?p(K,{leftSide:e("products"),children:N("div",{className:"flex space-x-3",children:[p("div",{className:"flex-1",children:p(mv,{id:"productItemSelector",placeholder:e("products"),...o&&{defaultValue:f==null?void 0:f.filter(b=>o.split(",").find(y=>y===b.value))},onChange:b=>s(_(b)),options:f,onInputChange:b=>{clearTimeout(l.current);const y=setTimeout(()=>u(b),600);l.current=y},isMulti:!0,styles:r,isSearchable:!0})}),v&&p("div",{className:"flex justify-center items-center",children:p(ns,{})})]})}):p("div",{className:"flex justify-center items-center",children:p(ns,{})}),a&&p(Ls,{className:"mt-2",type:"danger",children:a})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function yfn(){const[n]=pe(),e=Dg();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("paid"),value:"paid",color:"white",backgroundColor:e.$3||"#22C55E"},{label:n("unpaid"),value:"unpaid",color:"white",backgroundColor:"#F97316"},{label:n("past_due"),value:"overdue",color:"white",backgroundColor:e.$5||"#CA8A04"},{label:n("cancelled"),value:"cancelled",color:"white",backgroundColor:"#000000"}]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Cfn(){const[n]=pe(),e=Dg();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("sent"),value:"sent",color:"white",backgroundColor:e.$1||"#93C5FD"},{label:n("partial"),value:"partial",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("applied"),value:"applied",color:"white",backgroundColor:e.$3||"#22C55E"}]}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var yr=(n=>(n.BANK_TRANSFER="1",n.CASH="2",n.CREDIT="32",n.ACH="4",n.VISA="5",n.MASTERCARD="6",n.AMERICAN_EXPRESS="7",n.DISCOVER="8",n.DINERS="9",n.EUROCARD="10",n.NOVA="11",n.CREDIT_CARD_OTHER="12",n.PAYPAL="13",n.CHECK="15",n.CARTE_BLANCHE="16",n.UNIONPAY="17",n.JCB="18",n.LASER="19",n.MAESTRO="20",n.SOLO="21",n.SWITCH="22",n.ALIPAY="27",n.SOFORT="28",n.SEPA="29",n.GOCARDLESS="30",n.CRYPTO="31",n.ZELLE="33",n.MOLLIE_BANK_TRANSFER="34",n.KBC="35",n.BANCONTACT="36",n.IDEAL="37",n.HOSTED_PAGE="38",n.GIROPAY="39",n.PRZELEWY24="40",n.EPS="41",n.DIRECT_DEBIT="42",n.BECS="43",n.ACSS="44",n.INSTANT_BANK_PAY="45",n.FPX="46",n.KLARNA="47",n.INTERAC="48",n.BACS="49",n.STRIPE_BANK_TRANSFER="50",n.CASH_APP="51",n.VENMO="25",n.IZETTLE="23",n.DEBIT="3",n.GOOGLE_WALLET="14",n.MONEY_ORDER="26",n.SWISH="24",n))(yr||{});/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const wfn={[yr.ACH]:"payment_type_ACH",[yr.ACSS]:"payment_type_ACSS",[yr.ALIPAY]:"payment_type_Alipay",[yr.AMERICAN_EXPRESS]:"payment_type_American Express",[yr.BANCONTACT]:"bancontact",[yr.BACS]:"payment_type_BACS",[yr.BECS]:"becs",[yr.BANK_TRANSFER]:"payment_type_Bank Transfer",[yr.CARTE_BLANCHE]:"payment_type_Carte Blanche",[yr.CASH]:"payment_type_Cash",[yr.CASH_APP]:"payment_type_Cash App",[yr.CHECK]:"payment_type_Check",[yr.CREDIT]:"payment_type_Credit",[yr.CREDIT_CARD_OTHER]:"payment_type_Credit Card Other",[yr.CRYPTO]:"payment_type_Crypto",[yr.DINERS]:"payment_type_Diners Card",[yr.DIRECT_DEBIT]:"payment_type_direct_debit",[yr.DISCOVER]:"payment_type_Discover Card",[yr.EPS]:"eps",[yr.EUROCARD]:"payment_type_EuroCard",[yr.FPX]:"fpx",[yr.GIROPAY]:"giropay",[yr.GOCARDLESS]:"payment_type_GoCardless",[yr.HOSTED_PAGE]:"payment_type_Hosted Page",[yr.IDEAL]:"ideal",[yr.IZETTLE]:"payment_type_iZettle",[yr.INSTANT_BANK_PAY]:"instant_bank_pay",[yr.INTERAC]:"payment_type_Interac E-Transfer",[yr.JCB]:"payment_type_JCB",[yr.KBC]:"kbc_cbc",[yr.KLARNA]:"payment_type_Klarna",[yr.LASER]:"payment_type_Laser",[yr.MAESTRO]:"payment_type_Maestro",[yr.MASTERCARD]:"payment_type_MasterCard",[yr.MOLLIE_BANK_TRANSFER]:"payment_type_Mollie Bank Transfer",[yr.NOVA]:"payment_type_Nova",[yr.PAYPAL]:"payment_type_PayPal",[yr.PRZELEWY24]:"przelewy24",[yr.SEPA]:"payment_type_SEPA",[yr.SOFORT]:"payment_type_Sofort",[yr.SOLO]:"payment_type_Solo",[yr.SWITCH]:"payment_type_Switch",[yr.UNIONPAY]:"payment_type_UnionPay",[yr.VENMO]:"payment_type_Venmo",[yr.VISA]:"payment_type_Visa Card",[yr.ZELLE]:"payment_type_Zelle",[yr.DEBIT]:"payment_type_Debit",[yr.GOOGLE_WALLET]:"payment_type_Google Wallet",[yr.MONEY_ORDER]:"payment_type_Money Order",[yr.SWISH]:"payment_type_Swish"};function a3(n){const[e]=pe();return p("span",{className:Nt({"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800":!n.headless}),style:n.style,onClick:n.onClick,children:e(n.for[n.code])||e(n.code.toString())})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Sfn=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Efn=Oo(void 0);function xfn(n){const[e]=pe(),{invoice_id:t,should_be_invoiced:i,payment_date:r,payment_type_id:o,transaction_reference:s,archived_at:a,is_deleted:l}=n.entity,c=Dg(),u=!!t,d=r||o||s;return l?p(pr,{variant:"red",children:e("deleted")}):a?p(pr,{variant:"orange",children:e("archived")}):u?p(pr,{variant:"dark-blue",style:{backgroundColor:c.$3},children:e("invoiced")}):i?p(pr,{variant:"light-blue",children:e("pending")}):d?p(pr,{variant:"green",style:{backgroundColor:c.$1},children:e("paid")}):p(pr,{variant:"generic",children:e("logged")})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cp(n){const[e]=pe(),t=ci(),i=t==null?void 0:t.custom_fields,{entity:r}=n,o=[];if(i)for(let s=1;s<5;s++){const a=i[r+s.toString()]?dW(i[r+s.toString()]).label():e(`custom${s.toString()}`);o.push(a)}return o}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cLr(n){const e=ps();return Ti(bt("/api/v1/expenses/create"),()=>Ae("GET",Te("/api/v1/expenses/create")).then(t=>t.data.data),{enabled:e("create_expense")?n.enabled??!0:!1,staleTime:1/0})}function uLr(n){return Ti(["/api/v1/expenses",n.id],()=>Ae("GET",Te("/api/v1/expenses/:id?include=category",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function dLr(n){return Ti(["/api/v1/expenses",n],()=>Ae("GET",Te("/api/v1/expenses?filter=:filter&per_page=:per_page&status=:status&page=:page&match_transactions=:match_transactions&include=:include",{per_page:n.perPage??"100",page:n.currentPage??"1",status:n.status??"active",filter:n.filter??"",match_transactions:n.matchTransactions??!1,includes:"category",include:n.include||""})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}const Tfn={bulk_update:"updated_records"};function hGe(){const n=_o(),e=Fi(tu);return(t,i,r)=>(ce.processing(),Ae("POST",Te("/api/v1/expenses/bulk"),{action:i,ids:t,...r}).then(()=>{const o=Tfn[i]||`${i}d_expense`;ce.success(o),e&&n.invalidateQueries([e]),En(["expenses"])}))}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function hLr(n){const{includeIsLocked:e}=n,t=e?"&is_locked=true":"";return Ti(["/api/v1/invoices",n.id],()=>Ae("GET",Te(`/api/v1/invoices/:id?include=client.group_settings${t}`,{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:!!n.id})}function _be(n){const e=ps();return Ti(["/api/v1/invoices/create"],()=>Ae("GET",Te("/api/v1/invoices/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_invoice")?(n==null?void 0:n.enabled)??!0:!1})}const kfn={mark_sent:"marked_sent_invoices",email:"emailed_invoices",mark_paid:"marked_invoices_as_paid",download:"exported_data",cancel:"cancelled_invoices",auto_bill:"auto_billed_invoices"};function fLr(n){const e=_o(),t=Fi(tu);return(i,r,o)=>{ce.processing(),Ae("POST",Te("/api/v1/invoices/bulk"),{action:r,ids:i,...o&&{email_type:o}}).then(()=>{var a;const s=kfn[r]||`${r}d_invoice`;ce.success(s),(a=n==null?void 0:n.onSuccess)==null||a.call(n),En(["invoices"]),t&&e.invalidateQueries([t])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const A1=Oo(void 0),pLr=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var i0=(n=>(n.Product="1",n.Task="2",n.UnpaidFee="3",n.PaidFee="4",n.LateFee="5",n.Expense="6",n))(i0||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const oE=()=>({_id:Vq(),quantity:0,cost:0,product_key:"",product_cost:0,notes:"",discount:0,is_amount_discount:!1,tax_name1:"",tax_rate1:0,tax_name2:"",tax_rate2:0,tax_name3:"",tax_rate3:0,sort_id:0,line_total:0,tax_amount:0,gross_line_total:0,date:"",custom_value1:"",custom_value2:"",custom_value3:"",custom_value4:"",type_id:i0.Product,tax_id:"1"});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function fGe(n){const e=wi(),{data:t}=_be(),i=Ar(A1),{onlyAddToInvoice:r}=n||{},o=(a,l,c)=>a.calculate_tax_by_amount?a.uses_inclusive_taxes?Math.round(l/a.amount*100*1e3/10)/100:Math.round(l/a.amount*1e3/10)/1:c;return{create:a=>{var l,c,u,d,h;if(t){const f={...t};r||(f.date=(l=a[0])==null?void 0:l.date,f.client_id=(c=a[0])==null?void 0:c.client_id),f.uses_inclusive_taxes=(u=a[0])==null?void 0:u.uses_inclusive_taxes,f.project_id=(d=a[0])==null?void 0:d.project_id,f.vendor_id=(h=a[0])==null?void 0:h.vendor_id;const g=a.map(m=>{var v;return{...oE(),type_id:i0.Product,cost:(m==null?void 0:m.foreign_amount)>0?m.foreign_amount:m.amount,quantity:1,product_key:((v=m==null?void 0:m.category)==null?void 0:v.name)??"",notes:m.public_notes,line_total:Number(((m==null?void 0:m.foreign_amount)>0?m.foreign_amount:m.amount*1).toPrecision(2)),expense_id:m.id,tax_name1:m.tax_name1,tax_rate1:o(m,m.tax_amount1,m.tax_rate1),tax_name2:m.tax_name2,tax_rate2:o(m,m.tax_amount2,m.tax_rate2),tax_name3:m.tax_name3,tax_rate3:o(m,m.tax_amount3,m.tax_rate3),custom_value1:m.custom_value1,custom_value2:m.custom_value2,custom_value3:m.custom_value3,custom_value4:m.custom_value4}});r?i(m=>m&&{...m,line_items:[...m.line_items,...g]}):(i({...f,line_items:g}),e(bt("/invoices/create?table=products&action=invoice_expense",{})))}},calculatedTaxRate:o}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function N1(n){const{entity:e,editPageTabs:t}=n,i=Tl(),o=il().id||"",s=i.pathname.startsWith(`/${e}s`),a=o&&i.pathname.includes(o),l=i.pathname.endsWith("/edit"),c=t==null?void 0:t.some(f=>i.pathname.endsWith(`/${f}`)),u=s&&a&&(c||l),d=s&&a&&!l&&!c;return{isEditPage:u,isShowPage:d,isEditOrShowPage:u||d}}const Ifn=rl.div` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Lfn(n){const[e]=pe(),{expenses:t,bulkAction:i}=n,r=wi(),o=tf(),s=ps(),a=EK(),{calculatedTaxRate:l}=fGe(),c=ni(),u=_o(),d=Ar(A1),[h,f]=w.useState([]),[g,m]=w.useState(!1),[v,_]=w.useState(!1),b=()=>{if(i&&el(t).pluck("client_id").unique().toArray().length>1)return ce.error("multiple_client_error");_(!0)},y=C=>{d(()=>C&&{...C,line_items:[...C.line_items,...t.map(x=>{var E;return{...oE(),type_id:i0.Product,cost:x.amount,quantity:1,product_key:((E=x==null?void 0:x.category)==null?void 0:E.name)??"",notes:x.public_notes,line_total:Number((x.amount*1).toPrecision(2)),expense_id:x.id,tax_name1:x.tax_name1,tax_rate1:l(x,x.tax_amount1,x.tax_rate1),tax_name2:x.tax_name2,tax_rate2:l(x,x.tax_amount2,x.tax_rate2),tax_name3:x.tax_name3,tax_rate3:l(x,x.tax_amount3,x.tax_rate3),custom_value1:x.custom_value1,custom_value2:x.custom_value2,custom_value3:x.custom_value3,custom_value4:x.custom_value4}})]}),r(bt("/invoices/:id/edit?action=invoice_expense",{id:C.id}))};return w.useEffect(()=>{var C;v&&(m(!0),u.fetchQuery(["/api/v1/invoices",`include=client&status_id=1,2,3&is_deleted=true&filter_deleted_clients=true&client_id=${(C=t[0])==null?void 0:C.client_id}`],()=>{var x;return Ae("GET",Te("/api/v1/invoices?include=client.group_settings&status_id=1,2,3&is_deleted=true&filter_deleted_clients=true&client_id=:clientId",{clientId:((x=t[0])==null?void 0:x.client_id)||""}))},{staleTime:1/0}).then(x=>{s("edit_invoice")?f(x.data.data):f(x.data.data.filter(E=>a(E)))}).finally(()=>m(!1))),v||f([])},[v]),N(dt,{children:[N(Ui,{title:e("action_add_to_invoice"),onClose:()=>_(!1),visible:v,children:[p("div",{className:"flex flex-col space-y-1",children:h.map(C=>{var x,E;return N(Ifn,{theme:{hoverColor:c.$5},onClick:()=>y(C),className:"flex items-center justify-between cursor-pointer rounded py-1 px-2",children:[p("p",{children:C==null?void 0:C.number}),p("p",{children:o(C.amount,(x=C.client)==null?void 0:x.country_id,(E=C.client)==null?void 0:E.settings.currency_id)})]},C.id)})}),g&&p("div",{className:"flex justify-center",children:p(ns,{})}),!g&&!h.length&&p("div",{className:"flex justify-center font-medium text-lg",children:e("no_invoices_found")})]}),p(tn,{onClick:b,icon:p(vt,{element:Pk}),children:e("action_add_to_invoice")})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Dfn(n){const{setErrors:e,isFormBusy:t,setIsFormBusy:i}=n;return r=>{t||(ce.processing(),e==null||e(void 0),i==null||i(!0),Ae("PUT",Te("/api/v1/expenses/:id",{id:r.id}),r).then(()=>{ce.success("updated_expense"),En(["expenses"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(e==null||e(o.response.data),ce.dismiss())}).finally(()=>i==null?void 0:i(!1)))}}function Afn(n){var y,C,x;const[e]=pe(),t=ni(),i=ps(),r=RF(),{visible:o,isFormBusy:s,setIsFormBusy:a,expense:l,setVisible:c}=n,[u,d]=w.useState(!1),{data:h}=ube({status:["active"]}),f=Dfn({isFormBusy:s,setIsFormBusy:a}),{red:g,green:m,blue:v,hex:_}=DN(((y=l.category)==null?void 0:y.color)||""),b=NF(g,m,v)?-220:220;return N("div",{onClick:E=>E.stopPropagation(),children:[p(AF,{placement:"bottom",interactive:!0,render:()=>N("div",{className:"border box rounded-md shadow-lg focus:outline-none",style:{backgroundColor:t.$1,borderColor:t.$4,minWidth:"15rem",maxWidth:"20rem"},onClick:E=>E.stopPropagation(),children:[i("create_expense")&&p(tn,{className:"font-medium text-center py-3",onClick:()=>{d(!0),c(!1)},cypressRef:"newExpenseCategoryAction",children:e("new_expense_category")}),p("div",{className:"flex flex-col max-h-80 overflow-y-auto",children:h==null?void 0:h.map((E,k)=>E.id!==l.category_id&&p(tn,{onClick:()=>{c(!1),f({...l,category_id:E.id})},children:E.name},k))})]}),visible:o,children:p("div",{className:"cursor-pointer","data-cy":"expenseCategoryBadge",children:p(a3,{for:{},code:((C=l.category)==null?void 0:C.name)||e("uncategorized"),style:{color:r(_,b),backgroundColor:((x=l.category)==null?void 0:x.color)||""},onClick:()=>!s&&c(E=>!E)})})}),p(QKe,{visible:u,setVisible:d,onCreatedCategory:E=>f({...l,category_id:E.id})})]})}function Nfn(n){const e=w.useRef(null),{expense:t}=n,[i,r]=w.useState(!1),[o,s]=w.useState(!1);return zk(e,()=>{i&&r(!1)}),p("div",{ref:e,children:p(Afn,{visible:i,isFormBusy:o,setIsFormBusy:s,expense:t,setVisible:r})})}function vbe({apiEndpoint:n,entityId:e,cacheEndpoint:t,component:i,preCheck:r,componentCallbackFn:o}){const s=pa(),a=_o(),[l,c]=w.useState(r??!1),[u,d]=w.useState();return w.useEffect(()=>{s&&e&&!l&&(async()=>{const h=await a.fetchQuery([t,e],()=>Ae("GET",Te(n,{id:e})).then(f=>f.data.data),{staleTime:1/0});h&&(h.user_id===s.id||h.assigned_user_id===s.id)&&(o&&d(h),c(!0))})()},[]),o&&l&&u?p(dt,{children:o(u)}):l?p(dt,{children:i}):p(dt,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function sE(){const n=ps(),e=EK();return(t,i)=>!n(`view_${t}`)&&!n(`edit_${t}`)&&!e(i)}function Rf(n){const e=vo(),{renderSpan:t}=n;return t?p("span",{className:n.className,children:n.children}):p(C0,{className:`text-sm hover:underline ${n.className}`,style:{color:e},to:n.to,children:n.children})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Zk(){const[n]=pe(),e=ci(),{dateFormat:t}=lc(),i=e==null?void 0:e.custom_fields;return(r,o)=>{if(i&&i[r]){const s=i[r];if((s==null?void 0:s.split("|")[1])===PC.Date&&o)return go(o,t);if((s==null?void 0:s.split("|")[1])===PC.Switch)return n(o?"yes":"no")}return o}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Rfn(){return n=>{if(n.uses_inclusive_taxes)return n.amount;if(n.calculate_tax_by_amount)return n.amount+n.tax_amount1+n.tax_amount2+n.tax_amount3;let e=n.amount;return n.tax_name1&&(e+=n.amount*(n.tax_rate1/100)),n.tax_name2&&(e+=n.amount*(n.tax_rate2/100)),n.tax_name3&&(e+=n.amount*(n.tax_rate3/100)),e}}/*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */const{entries:pGe,setPrototypeOf:IAe,isFrozen:Ofn,getPrototypeOf:Pfn,getOwnPropertyDescriptor:Mfn}=Object;let{freeze:Qh,seal:Wm,create:gGe}=Object,{apply:Eae,construct:xae}=typeof Reflect<"u"&&Reflect;Qh||(Qh=function(e){return e});Wm||(Wm=function(e){return e});Eae||(Eae=function(e,t,i){return e.apply(t,i)});xae||(xae=function(e,t){return new e(...t)});const u9=ep(Array.prototype.forEach),LAe=ep(Array.prototype.pop),mO=ep(Array.prototype.push),N$=ep(String.prototype.toLowerCase),uee=ep(String.prototype.toString),DAe=ep(String.prototype.match),_O=ep(String.prototype.replace),Ffn=ep(String.prototype.indexOf),Bfn=ep(String.prototype.trim),w_=ep(Object.prototype.hasOwnProperty),kh=ep(RegExp.prototype.test),vO=$fn(TypeError),AAe=ep(Number.isNaN);function ep(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Eae(n,e,i)}}function $fn(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return xae(n,t)}}function Uo(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:N$;IAe&&IAe(n,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const o=t(r);o!==r&&(Ofn(e)||(e[i]=o),r=o)}n[r]=!0}return n}function Vfn(n){for(let e=0;e<n.length;e++)w_(n,e)||(n[e]=null);return n}function rx(n){const e=gGe(null);for(const[t,i]of pGe(n))w_(n,t)&&(Array.isArray(i)?e[t]=Vfn(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=rx(i):e[t]=i);return e}function d9(n,e){for(;n!==null;){const i=Mfn(n,e);if(i){if(i.get)return ep(i.get);if(typeof i.value=="function")return ep(i.value)}n=Pfn(n)}function t(){return null}return t}const NAe=Qh(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),dee=Qh(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hee=Qh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Hfn=Qh(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fee=Qh(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wfn=Qh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),RAe=Qh(["#text"]),OAe=Qh(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),pee=Qh(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),PAe=Qh(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),h9=Qh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zfn=Wm(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ufn=Wm(/<%[\w\W]*|[\w\W]*%>/gm),jfn=Wm(/\${[\w\W]*}/gm),qfn=Wm(/^data-[\-\w.\u00B7-\uFFFF]/),Kfn=Wm(/^aria-[\-\w]+$/),mGe=Wm(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gfn=Wm(/^(?:\w+script|data):/i),Yfn=Wm(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_Ge=Wm(/^html$/i),Qfn=Wm(/^[a-z][.\w]*(-[.\w]+)+$/i);var MAe=Object.freeze({__proto__:null,MUSTACHE_EXPR:zfn,ERB_EXPR:Ufn,TMPLIT_EXPR:jfn,DATA_ATTR:qfn,ARIA_ATTR:Kfn,IS_ALLOWED_URI:mGe,IS_SCRIPT_OR_DATA:Gfn,ATTR_WHITESPACE:Yfn,DOCTYPE_NAME:_Ge,CUSTOM_ELEMENT:Qfn});const FE={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Xfn=function(){return typeof window>"u"?null:window},Zfn=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(i=t.getAttribute(r));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function vGe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xfn();const e=Ve=>vGe(Ve);if(e.version="3.1.3",e.removed=[],!n||!n.document||n.document.nodeType!==FE.document)return e.isSupported=!1,e;let{document:t}=n;const i=t,r=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=n,g=l.prototype,m=d9(g,"cloneNode"),v=d9(g,"nextSibling"),_=d9(g,"childNodes"),b=d9(g,"parentNode");if(typeof s=="function"){const Ve=t.createElement("template");Ve.content&&Ve.content.ownerDocument&&(t=Ve.content.ownerDocument)}let y,C="";const{implementation:x,createNodeIterator:E,createDocumentFragment:k,getElementsByTagName:L}=t,{importNode:D}=i;let A={};e.isSupported=typeof pGe=="function"&&typeof b=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:P,TMPLIT_EXPR:F,DATA_ATTR:B,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:W}=MAe;let{IS_ALLOWED_URI:q}=MAe,H=null;const ie=Uo({},[...NAe,...dee,...hee,...fee,...RAe]);let se=null;const Q=Uo({},[...OAe,...pee,...PAe,...h9]);let Ee=Object.seal(gGe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Fe=null,He=null,ke=!0,Me=!0,je=!1,qe=!0,Be=!1,_t=!0,Wt=!1,Tt=!1,rn=!1,_n=!1,wt=!1,pt=!1,ot=!0,we=!1;const Se="user-content-";let re=!0,Y=!1,Z={},le=null;const te=Uo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let me=null;const Oe=Uo({},["audio","video","img","source","image","track"]);let et=null;const Et=Uo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Qe="http://www.w3.org/1998/Math/MathML",At="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let fe=Ut,Re=!1,Je=null;const Ot=Uo({},[Qe,At,Ut],uee);let Ft=null;const jt=["application/xhtml+xml","text/html"],Jt="text/html";let ei=null,sr=null;const zn=255,Tn=t.createElement("form"),pi=function(ye){return ye instanceof RegExp||ye instanceof Function},Ei=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(sr&&sr===ye)){if((!ye||typeof ye!="object")&&(ye={}),ye=rx(ye),Ft=jt.indexOf(ye.PARSER_MEDIA_TYPE)===-1?Jt:ye.PARSER_MEDIA_TYPE,ei=Ft==="application/xhtml+xml"?uee:N$,H=w_(ye,"ALLOWED_TAGS")?Uo({},ye.ALLOWED_TAGS,ei):ie,se=w_(ye,"ALLOWED_ATTR")?Uo({},ye.ALLOWED_ATTR,ei):Q,Je=w_(ye,"ALLOWED_NAMESPACES")?Uo({},ye.ALLOWED_NAMESPACES,uee):Ot,et=w_(ye,"ADD_URI_SAFE_ATTR")?Uo(rx(Et),ye.ADD_URI_SAFE_ATTR,ei):Et,me=w_(ye,"ADD_DATA_URI_TAGS")?Uo(rx(Oe),ye.ADD_DATA_URI_TAGS,ei):Oe,le=w_(ye,"FORBID_CONTENTS")?Uo({},ye.FORBID_CONTENTS,ei):te,Fe=w_(ye,"FORBID_TAGS")?Uo({},ye.FORBID_TAGS,ei):{},He=w_(ye,"FORBID_ATTR")?Uo({},ye.FORBID_ATTR,ei):{},Z=w_(ye,"USE_PROFILES")?ye.USE_PROFILES:!1,ke=ye.ALLOW_ARIA_ATTR!==!1,Me=ye.ALLOW_DATA_ATTR!==!1,je=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=ye.SAFE_FOR_TEMPLATES||!1,_t=ye.SAFE_FOR_XML!==!1,Wt=ye.WHOLE_DOCUMENT||!1,_n=ye.RETURN_DOM||!1,wt=ye.RETURN_DOM_FRAGMENT||!1,pt=ye.RETURN_TRUSTED_TYPE||!1,rn=ye.FORCE_BODY||!1,ot=ye.SANITIZE_DOM!==!1,we=ye.SANITIZE_NAMED_PROPS||!1,re=ye.KEEP_CONTENT!==!1,Y=ye.IN_PLACE||!1,q=ye.ALLOWED_URI_REGEXP||mGe,fe=ye.NAMESPACE||Ut,Ee=ye.CUSTOM_ELEMENT_HANDLING||{},ye.CUSTOM_ELEMENT_HANDLING&&pi(ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ee.tagNameCheck=ye.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&pi(ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ee.attributeNameCheck=ye.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ye.CUSTOM_ELEMENT_HANDLING&&typeof ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ee.allowCustomizedBuiltInElements=ye.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(Me=!1),wt&&(_n=!0),Z&&(H=Uo({},RAe),se=[],Z.html===!0&&(Uo(H,NAe),Uo(se,OAe)),Z.svg===!0&&(Uo(H,dee),Uo(se,pee),Uo(se,h9)),Z.svgFilters===!0&&(Uo(H,hee),Uo(se,pee),Uo(se,h9)),Z.mathMl===!0&&(Uo(H,fee),Uo(se,PAe),Uo(se,h9))),ye.ADD_TAGS&&(H===ie&&(H=rx(H)),Uo(H,ye.ADD_TAGS,ei)),ye.ADD_ATTR&&(se===Q&&(se=rx(se)),Uo(se,ye.ADD_ATTR,ei)),ye.ADD_URI_SAFE_ATTR&&Uo(et,ye.ADD_URI_SAFE_ATTR,ei),ye.FORBID_CONTENTS&&(le===te&&(le=rx(le)),Uo(le,ye.FORBID_CONTENTS,ei)),re&&(H["#text"]=!0),Wt&&Uo(H,["html","head","body"]),H.table&&(Uo(H,["tbody"]),delete Fe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw vO('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vO('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=ye.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=Zfn(f,r)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));Qh&&Qh(ye),sr=ye}},$i=Uo({},["mi","mo","mn","ms","mtext"]),Pr=Uo({},["foreignobject","annotation-xml"]),ro=Uo({},["title","style","font","a","script"]),Vo=Uo({},[...dee,...hee,...Hfn]),oo=Uo({},[...fee,...Wfn]),ta=function(ye){let Xe=b(ye);(!Xe||!Xe.tagName)&&(Xe={namespaceURI:fe,tagName:"template"});const yt=N$(ye.tagName),it=N$(Xe.tagName);return Je[ye.namespaceURI]?ye.namespaceURI===At?Xe.namespaceURI===Ut?yt==="svg":Xe.namespaceURI===Qe?yt==="svg"&&(it==="annotation-xml"||$i[it]):!!Vo[yt]:ye.namespaceURI===Qe?Xe.namespaceURI===Ut?yt==="math":Xe.namespaceURI===At?yt==="math"&&Pr[it]:!!oo[yt]:ye.namespaceURI===Ut?Xe.namespaceURI===At&&!Pr[it]||Xe.namespaceURI===Qe&&!$i[it]?!1:!oo[yt]&&(ro[yt]||!Vo[yt]):!!(Ft==="application/xhtml+xml"&&Je[ye.namespaceURI]):!1},Mr=function(ye){mO(e.removed,{element:ye});try{ye.parentNode.removeChild(ye)}catch{ye.remove()}},er=function(ye,Xe){try{mO(e.removed,{attribute:Xe.getAttributeNode(ye),from:Xe})}catch{mO(e.removed,{attribute:null,from:Xe})}if(Xe.removeAttribute(ye),ye==="is"&&!se[ye])if(_n||wt)try{Mr(Xe)}catch{}else try{Xe.setAttribute(ye,"")}catch{}},on=function(ye){let Xe=null,yt=null;if(rn)ye="<remove></remove>"+ye;else{const In=DAe(ye,/^[\r\n\t ]+/);yt=In&&In[0]}Ft==="application/xhtml+xml"&&fe===Ut&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");const it=y?y.createHTML(ye):ye;if(fe===Ut)try{Xe=new h().parseFromString(it,Ft)}catch{}if(!Xe||!Xe.documentElement){Xe=x.createDocument(fe,"template",null);try{Xe.documentElement.innerHTML=Re?C:it}catch{}}const fn=Xe.body||Xe.documentElement;return ye&&yt&&fn.insertBefore(t.createTextNode(yt),fn.childNodes[0]||null),fe===Ut?L.call(Xe,Wt?"html":"body")[0]:Wt?Xe.documentElement:fn},hi=function(ye){return E.call(ye.ownerDocument||ye,ye,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},to=function(ye){return ye instanceof d&&(typeof ye.__depth<"u"&&typeof ye.__depth!="number"||typeof ye.__removalCount<"u"&&typeof ye.__removalCount!="number"||typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||!(ye.attributes instanceof u)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function")},Ge=function(ye){return typeof a=="function"&&ye instanceof a},xt=function(ye,Xe,yt){A[ye]&&u9(A[ye],it=>{it.call(e,Xe,yt,sr)})},qt=function(ye){let Xe=null;if(xt("beforeSanitizeElements",ye,null),to(ye))return Mr(ye),!0;const yt=ei(ye.nodeName);if(xt("uponSanitizeElement",ye,{tagName:yt,allowedTags:H}),ye.hasChildNodes()&&!Ge(ye.firstElementChild)&&kh(/<[/\w]/g,ye.innerHTML)&&kh(/<[/\w]/g,ye.textContent)||ye.nodeType===FE.progressingInstruction||_t&&ye.nodeType===FE.comment&&kh(/<[/\w]/g,ye.data))return Mr(ye),!0;if(!H[yt]||Fe[yt]){if(!Fe[yt]&&ut(yt)&&(Ee.tagNameCheck instanceof RegExp&&kh(Ee.tagNameCheck,yt)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(yt)))return!1;if(re&&!le[yt]){const it=b(ye)||ye.parentNode,fn=_(ye)||ye.childNodes;if(fn&&it){const In=fn.length;for(let ti=In-1;ti>=0;--ti){const gi=m(fn[ti],!0);gi.__removalCount=(ye.__removalCount||0)+1,it.insertBefore(gi,v(ye))}}}return Mr(ye),!0}return ye instanceof l&&!ta(ye)||(yt==="noscript"||yt==="noembed"||yt==="noframes")&&kh(/<\/no(script|embed|frames)/i,ye.innerHTML)?(Mr(ye),!0):(Be&&ye.nodeType===FE.text&&(Xe=ye.textContent,u9([O,P,F],it=>{Xe=_O(Xe,it," ")}),ye.textContent!==Xe&&(mO(e.removed,{element:ye.cloneNode()}),ye.textContent=Xe)),xt("afterSanitizeElements",ye,null),!1)},hn=function(ye,Xe,yt){if(ot&&(Xe==="id"||Xe==="name")&&(yt in t||yt in Tn||yt==="__depth"||yt==="__removalCount"))return!1;if(!(Me&&!He[Xe]&&kh(B,Xe))){if(!(ke&&kh(M,Xe))){if(!se[Xe]||He[Xe]){if(!(ut(ye)&&(Ee.tagNameCheck instanceof RegExp&&kh(Ee.tagNameCheck,ye)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(ye))&&(Ee.attributeNameCheck instanceof RegExp&&kh(Ee.attributeNameCheck,Xe)||Ee.attributeNameCheck instanceof Function&&Ee.attributeNameCheck(Xe))||Xe==="is"&&Ee.allowCustomizedBuiltInElements&&(Ee.tagNameCheck instanceof RegExp&&kh(Ee.tagNameCheck,yt)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(yt))))return!1}else if(!et[Xe]){if(!kh(q,_O(yt,U,""))){if(!((Xe==="src"||Xe==="xlink:href"||Xe==="href")&&ye!=="script"&&Ffn(yt,"data:")===0&&me[ye])){if(!(je&&!kh(V,_O(yt,U,"")))){if(yt)return!1}}}}}}return!0},ut=function(ye){return ye!=="annotation-xml"&&DAe(ye,W)},Ie=function(ye){xt("beforeSanitizeAttributes",ye,null);const{attributes:Xe}=ye;if(!Xe)return;const yt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se};let it=Xe.length;for(;it--;){const fn=Xe[it],{name:In,namespaceURI:ti,value:gi}=fn,Vi=ei(In);let Hn=In==="value"?gi:Bfn(gi);if(yt.attrName=Vi,yt.attrValue=Hn,yt.keepAttr=!0,yt.forceKeepAttr=void 0,xt("uponSanitizeAttribute",ye,yt),Hn=yt.attrValue,yt.forceKeepAttr||(er(In,ye),!yt.keepAttr))continue;if(!qe&&kh(/\/>/i,Hn)){er(In,ye);continue}if(_t&&kh(/((--!?|])>)|<\/(style|title)/i,Hn)){er(In,ye);continue}Be&&u9([O,P,F],ii=>{Hn=_O(Hn,ii," ")});const pn=ei(ye.nodeName);if(hn(pn,Vi,Hn)){if(we&&(Vi==="id"||Vi==="name")&&(er(In,ye),Hn=Se+Hn),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ti)switch(f.getAttributeType(pn,Vi)){case"TrustedHTML":{Hn=y.createHTML(Hn);break}case"TrustedScriptURL":{Hn=y.createScriptURL(Hn);break}}try{ti?ye.setAttributeNS(ti,In,Hn):ye.setAttribute(In,Hn),to(ye)?Mr(ye):LAe(e.removed)}catch{}}}xt("afterSanitizeAttributes",ye,null)},nt=function Ve(ye){let Xe=null;const yt=hi(ye);for(xt("beforeSanitizeShadowDOM",ye,null);Xe=yt.nextNode();){if(xt("uponSanitizeShadowNode",Xe,null),qt(Xe))continue;const it=b(Xe);Xe.nodeType===FE.element&&(it&&it.__depth?Xe.__depth=(Xe.__removalCount||0)+it.__depth+1:Xe.__depth=1),(Xe.__depth>=zn||Xe.__depth<0||AAe(Xe.__depth))&&Mr(Xe),Xe.content instanceof o&&(Xe.content.__depth=Xe.__depth,Ve(Xe.content)),Ie(Xe)}xt("afterSanitizeShadowDOM",ye,null)};return e.sanitize=function(Ve){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Xe=null,yt=null,it=null,fn=null;if(Re=!Ve,Re&&(Ve="<!-->"),typeof Ve!="string"&&!Ge(Ve))if(typeof Ve.toString=="function"){if(Ve=Ve.toString(),typeof Ve!="string")throw vO("dirty is not a string, aborting")}else throw vO("toString is not a function");if(!e.isSupported)return Ve;if(Tt||Ei(ye),e.removed=[],typeof Ve=="string"&&(Y=!1),Y){if(Ve.nodeName){const gi=ei(Ve.nodeName);if(!H[gi]||Fe[gi])throw vO("root node is forbidden and cannot be sanitized in-place")}}else if(Ve instanceof a)Xe=on("<!---->"),yt=Xe.ownerDocument.importNode(Ve,!0),yt.nodeType===FE.element&&yt.nodeName==="BODY"||yt.nodeName==="HTML"?Xe=yt:Xe.appendChild(yt);else{if(!_n&&!Be&&!Wt&&Ve.indexOf("<")===-1)return y&&pt?y.createHTML(Ve):Ve;if(Xe=on(Ve),!Xe)return _n?null:pt?C:""}Xe&&rn&&Mr(Xe.firstChild);const In=hi(Y?Ve:Xe);for(;it=In.nextNode();){if(qt(it))continue;const gi=b(it);it.nodeType===FE.element&&(gi&&gi.__depth?it.__depth=(it.__removalCount||0)+gi.__depth+1:it.__depth=1),(it.__depth>=zn||it.__depth<0||AAe(it.__depth))&&Mr(it),it.content instanceof o&&(it.content.__depth=it.__depth,nt(it.content)),Ie(it)}if(Y)return Ve;if(_n){if(wt)for(fn=k.call(Xe.ownerDocument);Xe.firstChild;)fn.appendChild(Xe.firstChild);else fn=Xe;return(se.shadowroot||se.shadowrootmode)&&(fn=D.call(i,fn,!0)),fn}let ti=Wt?Xe.outerHTML:Xe.innerHTML;return Wt&&H["!doctype"]&&Xe.ownerDocument&&Xe.ownerDocument.doctype&&Xe.ownerDocument.doctype.name&&kh(_Ge,Xe.ownerDocument.doctype.name)&&(ti="<!DOCTYPE "+Xe.ownerDocument.doctype.name+`> `+ti),Be&&u9([O,P,F],gi=>{ti=_O(ti,gi," ")}),y&&pt?y.createHTML(ti):ti},e.setConfig=function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ei(Ve),Tt=!0},e.clearConfig=function(){sr=null,Tt=!1},e.isValidAttribute=function(Ve,ye,Xe){sr||Ei({});const yt=ei(Ve),it=ei(ye);return hn(yt,it,Xe)},e.addHook=function(Ve,ye){typeof ye=="function"&&(A[Ve]=A[Ve]||[],mO(A[Ve],ye))},e.removeHook=function(Ve){if(A[Ve])return LAe(A[Ve])},e.removeHooks=function(Ve){A[Ve]&&(A[Ve]=[])},e.removeAllHooks=function(){A={}},e}var Jfn=vGe();/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function r0(n){return new DOMParser().parseFromString(n,"text/html").documentElement.textContent||""}function Xc(n){return Jfn.sanitize(n,{USE_PROFILES:{html:!0}})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function a6(){const n=JS(),e=ci();return t=>{const i=n(e==null?void 0:e.settings.currency_id);return i?yve.formatValue(isNaN(Number(t))?0:t,i):t}}function gLr(){const[n]=pe(),e=ps(),t=wi(),i=hGe(),r=Ar(Efn),o=Ar(Sfn),{isEditPage:s}=N1({entity:"expense",editPageTabs:["documents"]}),{create:a}=fGe(),l=d=>{r({...d,id:"",documents:[],number:"",date:Un().format("YYYY-MM-DD")}),t("/expenses/create?action=clone")},c=d=>{o({...d,id:"",documents:[],number:"",date:Un().format("YYYY-MM-DD")}),t("/recurring_expenses/create?action=clone")};return[d=>d.should_be_invoiced===!0&&d.invoice_id.length===0&&e("create_invoice")&&p(tn,{onClick:()=>a([d]),icon:p(vt,{element:Pk}),children:n("invoice_expense")}),d=>d.should_be_invoiced===!0&&d.invoice_id.length===0&&p(Lfn,{expenses:[d]}),d=>e("create_expense")&&p(tn,{onClick:()=>l(d),icon:p(vt,{element:e0}),children:n("clone")}),d=>e("create_recurring_expense")&&p(tn,{onClick:()=>c(d),icon:p(vt,{element:e0}),children:n("clone_to_recurring")}),()=>s&&p(_i,{withoutPadding:!0}),d=>Sr(d)===Zi.Active&&s&&p(tn,{onClick:()=>i([d.id],"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),d=>(Sr(d)===Zi.Archived||Sr(d)===Zi.Deleted)&&s&&p(tn,{onClick:()=>i([d.id],"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),d=>(Sr(d)===Zi.Active||Sr(d)===Zi.Archived)&&s&&p(tn,{onClick:()=>i([d.id],"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}const epn=["status","number","client","vendor","date","amount","public_notes"];function tpn(){const[n,e,t,i]=cp({entity:"expense"});return["status","number","vendor","client","date","amount","public_notes","entity_state","archived_at","category","created_at",n,e,t,i,"documents","exchange_rate","is_deleted","net_amount","payment_date","payment_type","private_notes","project","should_be_invoiced","tax_name1","tax_name2","tax_name3","tax_rate1","tax_rate2","tax_rate3","transaction_reference","updated_at"]}function mLr(){var v;const{t:n}=pe(),{dateFormat:e}=lc(),t=a6(),i=ps(),r=sE(),o=wi(),s=tf(),a=Ha(),l=Zk(),c=Rfn();tpn();const[u,d,h,f]=cp({entity:"expense"}),g=[{column:"category",id:"category_id",label:n("category"),format:(_,b)=>b&&p(Nfn,{expense:b})},{column:"status",id:"id",label:n("status"),format:(_,b)=>N("div",{className:"flex items-center space-x-2",children:[p(Rf,{to:bt("/expenses/:id/edit",{id:b.id}),renderSpan:r("expense",b),children:p("span",{className:"inline-flex items-center space-x-4",children:p(xfn,{entity:b})})}),b.invoice_id&&p(vbe,{entityId:b.invoice_id,cacheEndpoint:"/api/v1/invoices",apiEndpoint:"/api/v1/invoices/:id?include=client.group_settings",preCheck:i("view_invoice")||i("edit_invoice"),component:p(vt,{element:Pk,size:19,onClick:()=>o(bt("/invoices/:id/edit",{id:b.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(_,b)=>p(Rf,{to:bt("/expenses/:id/edit",{id:b.id}),renderSpan:r("expense",b),children:_})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(_,b)=>b.vendor&&p(Rf,{to:bt("/vendors/:id",{id:_.toString()}),renderSpan:r("vendor",b.vendor),children:b.vendor.name})},{column:"client",id:"client_id",label:n("client"),format:(_,b)=>b.client&&p(Rf,{to:bt("/clients/:id",{id:_.toString()}),renderSpan:r("client",b.client),children:b.client.display_name})},{column:"date",id:"date",label:n("date"),format:_=>go(_,e)},{column:"amount",id:"amount",label:n("amount"),format:(_,b)=>{var y,C;return s(c(b),(y=b.client)==null?void 0:y.country_id,b.currency_id||((C=b.client)==null?void 0:C.settings.currency_id))}},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:_=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(_)}})}),children:p("span",{children:r0(Xc(_)).slice(0,50)})})},{column:"entity_state",id:"id",label:n("entity_state"),format:(_,b)=>p(Hm,{entity:b})},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:_=>go(_,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:_=>go(_,e)},{column:u,id:"custom_value1",label:u,format:_=>l("expense1",_==null?void 0:_.toString())},{column:d,id:"custom_value2",label:d,format:_=>l("expense2",_==null?void 0:_.toString())},{column:h,id:"custom_value3",label:h,format:_=>l("expense3",_==null?void 0:_.toString())},{column:f,id:"custom_value4",label:f,format:_=>l("expense4",_==null?void 0:_.toString())},{column:"documents",id:"documents",label:n("documents"),format:(_,b)=>b.documents.length},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:_=>t(_)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(_,b)=>b.is_deleted?n("yes"):n("no")},{column:"net_amount",id:"amount",label:n("net_amount"),format:(_,b)=>{var y,C;return s(_,(y=b.client)==null?void 0:y.country_id,b.currency_id||((C=b.client)==null?void 0:C.settings.currency_id))}},{column:"payment_date",id:"payment_date",label:n("payment_date"),format:_=>go(_,e)},{column:"payment_type",id:"payment_type_id",label:n("payment_type"),format:_=>p(a3,{for:wfn,code:_,headless:!0})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:_=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(_)}})}),children:p("span",{children:r0(Xc(_)).slice(0,50)})})},{column:"should_be_invoiced",id:"should_be_invoiced",label:n("should_be_invoiced"),format:(_,b)=>b.should_be_invoiced?n("yes"):n("no")},{column:"tax_name1",id:"tax_name1",label:n("tax_name1")},{column:"tax_name2",id:"tax_name2",label:n("tax_name2")},{column:"tax_name3",id:"tax_name3",label:n("tax_name3")},{column:"tax_rate1",id:"tax_rate1",label:n("tax_rate1"),format:_=>t(_)},{column:"tax_rate2",id:"tax_rate2",label:n("tax_rate2"),format:_=>t(_)},{column:"tax_rate3",id:"tax_rate3",label:n("tax_rate3"),format:_=>t(_)},{column:"transaction_reference",id:"transaction_reference",label:n("transaction_reference")},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:_=>go(_,e)},{column:"project",id:"project",label:n("project"),format:(_,b)=>{var y,C;return p(Li,{to:bt("/projects/:id",{id:(y=b==null?void 0:b.project)==null?void 0:y.id}),children:(C=b==null?void 0:b.project)==null?void 0:C.name})}}],m=((v=a==null?void 0:a.react_table_columns)==null?void 0:v.expense)||epn;return g.filter(_=>m.includes(_.column)).sort((_,b)=>m.indexOf(_.column)-m.indexOf(b.column))}function _Lr(n){const{setExpense:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function npn(){const[n]=pe(),e=Dg(),t=RF(),{data:i}=ube({status:["active"],perPage:500}),r=[{label:n("logged"),value:"logged",color:"white",backgroundColor:"#6B7280",dropdownKey:"0"},{label:n("pending"),value:"pending",color:"white",backgroundColor:"#93C5FD",dropdownKey:"0"},{label:n("invoiced"),value:"invoiced",color:"white",backgroundColor:e.$3||"#1D4ED8",dropdownKey:"0"},{label:n("paid"),value:"paid",color:"white",backgroundColor:e.$1||"#22C55E",dropdownKey:"0"},{label:n("unpaid"),value:"unpaid",color:"white",backgroundColor:e.$4||"#e6b05c",dropdownKey:"0"},{label:n("uncategorized"),value:"uncategorized",color:"white",backgroundColor:"#b5812c",dropdownKey:"0"}];return i==null||i.forEach(o=>{const{red:s,green:a,blue:l,hex:c}=DN(o.color||""),u=NF(s,a,l)?-220:220;r.push({value:o.id,label:o.name,color:t(c,u),backgroundColor:o.color||"",queryKey:"categories",dropdownKey:"1",placeHolder:"expense_categories"})}),r}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var XC=(n=>(n.Viewed="-1",n.Draft="1",n.Sent="2",n.Accepted="3",n.Received="4",n.Cancelled="5",n))(XC||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ipn(n){return e=>{if(e.invitations.length!==0){if(e.invitations.length>0&&n.resourceType==="purchase_order")return Te("/vendor/purchase_order/:invitation/download",{resource:n.resourceType,invitation:e.invitations[0].key});if(e.invitations.length>0)return Te("/client/:resource/:invitation/download_pdf",{resource:n.resourceType,invitation:e.invitations[0].key})}}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function bGe(n){const e=_o(),t=ipn({resourceType:n.resource});return i=>{const r=t(i);r&&(ce.processing(),e.fetchQuery(r,()=>Ae("GET",r,{},{responseType:"arraybuffer"}).then(o=>{const s=new Blob([o.data],{type:"application/pdf"}),a=URL.createObjectURL(s),[,l]=o.headers["content-disposition"].split("filename="),c=document.createElement("a");c.download=l,c.href=a,c.target="_blank",document.body.appendChild(c),c.click(),document.body.removeChild(c),ce.dismiss()})))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const kK=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function rpn(n){if(n.invitations.length>0){const e=n.client?n.client:"";return`${n.invitations[0].link}?silent=true${e?`&client_hash=${e.client_hash}`:""}`}return null}function yGe(n){var t;const e=rpn(n);e&&((t=window.open(e,"_blank"))==null||t.focus())}function opn(n){const[e]=pe(),{status_id:t,archived_at:i,is_deleted:r,invitations:o}=n.entity,s=Dg(),a=()=>o.some(f=>f.viewed_date),l=t===XC.Draft,c=!l,u=a(),d=t===XC.Cancelled,h=t===XC.Accepted;return r?p(pr,{variant:"red",children:e("deleted")}):i?p(pr,{variant:"orange",children:e("archived")}):d?p(pr,{variant:"black",style:{backgroundColor:s.$5},children:e("cancelled")}):t===XC.Received?p(pr,{variant:"green",style:{backgroundColor:s.$3},children:e("received")}):h?p(pr,{variant:"dark-blue",style:{backgroundColor:s.$2},children:e("accepted")}):c?p(pr,{variant:"light-blue",style:{backgroundColor:s.$1},children:e("sent")}):l?p(pr,{variant:"generic",children:e("draft")}):u&&!d&&!h?p(pr,{variant:"yellow",style:{backgroundColor:s.$4},children:e("viewed")}):p(dt,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function CGe(){const{isAdmin:n,isOwner:e}=Po();return Ti(["/api/v1/task_schedulers","create"],()=>Ae("GET",Te("/api/v1/task_schedulers/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function spn(n){const{isAdmin:e,isOwner:t}=Po();return Ti(["/api/v1/task_schedulers",n.id],()=>Ae("GET",Te("/api/v1/task_schedulers/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function apn(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/task_schedulers/bulk"),{action:e,ids:n}).then(()=>{ce.success(`${e}d_schedule`),En(["task_schedulers"])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const l3={clients:[],date_range:"last7_days",show_aging_table:!1,show_credits_table:!1,show_payments_table:!1,only_clients_with_invoices:!1,status:"all",entity:"invoice",entity_id:"",report_name:"activity",start_date:"",end_date:"",product_key:"",send_email:!0,is_expense_billed:!1,is_income_billed:!1,include_tax:!1,document_email_attachment:!1,client_id:"",vendors:"",projects:"",categories:"",report_keys:[],pdf_email_attachment:!1};function wGe(n){const{data:e}=CGe();return(t,i)=>{const{setErrors:r,setSchedule:o}=n;r(void 0);const s=un.cloneDeep(n.schedule);t==="template"&&e?o(()=>({...e,template:i,frequency_id:Zd.Monthly,remaining_cycles:-1,parameters:{...l3}})):t==="parameters.report_name"&&e?o(a=>a&&{...a,parameters:{...l3,report_name:i}}):(t==="parameters.entity"&&o(un.set(s,"parameters.entity_id","")),o(un.set(s,t,i)))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function SGe({entity:n}){const e=wi(),t=Ar(TK);return i=>{t({...l3,entity:n,entity_id:i}),e("/settings/schedules/create?template=email_record")}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const EGe=({entity:n})=>{const e=_o(),t=i=>new Promise(r=>{const o=()=>{i.removeEventListener("load",o),r()};document.body.appendChild(i),i.addEventListener("load",o)});return i=>{i.length&&(ce.processing(),e.fetchQuery([`/api/v1/${n}s/bulk`],()=>Ae("POST",Te(`/api/v1/${n}s/bulk`),{action:"bulk_print",ids:i},{responseType:"arraybuffer"}).then(async r=>{const o=new Blob([r.data],{type:"application/pdf"}),s=URL.createObjectURL(o),a=document.createElement("iframe");a.style.display="none",a.src=s,await t(a),a&&a.contentWindow&&(a.contentWindow.focus(),a.contentWindow.print()),ce.dismiss()})))}};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const lpn={item:"product_key",service:"product_key",description:"notes",unit_cost:"cost",rate:"cost",hours:"quantity"};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function xGe(n,e="."){const[t,i]=n.split(e);return{resource:t,property:i}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function TGe(n){const{property:e}=xGe(n);return lpn[e]||e}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function IK(){const n=_o();return{find:t=>n.fetchQuery({queryKey:["/api/v1/clients",t],queryFn:()=>Ae("GET",Te("/api/v1/clients/:id?include=group_settings",{id:t})).then(i=>i.data.data),staleTime:1/0})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cpn(n){const e=ci(),t=JS(),i=IK(),r=n.resource;return async(o,s,a)=>{const l={...r.line_items[o]};if(l.product_key=(a==null?void 0:a.product_key)||s,!a)return n.onChange(o,l);const c=(a==null?void 0:a.cost)>0&&n.relationType==="vendor_id"?a==null?void 0:a.cost:(a==null?void 0:a.price)||0;return e.fill_products&&(e!=null&&e.enable_product_quantity?l.quantity=e!=null&&e.default_quantity?1:(a==null?void 0:a.quantity)??1:l.quantity=1,r.client_id?await i.find(r.client_id).then(u=>{const d=u.settings.currency_id;if(e.convert_products&&d!==e.settings.currency_id){const h=t(d),f=t(e.settings.currency_id);h&&f&&(l.cost=c*(h.exchange_rate/f.exchange_rate))}else l.cost=c}):l.cost=c),a||(l.notes=""),n.type=="product"&&(a!=null&&a.notes)&&e.fill_products&&(l.notes=a==null?void 0:a.notes),n.type=="task"&&(a!=null&&a.notes)&&!l.notes&&(l.notes=a.notes),l.tax_name1=(a==null?void 0:a.tax_name1)||"",l.tax_name2=(a==null?void 0:a.tax_name2)||"",l.tax_name3=(a==null?void 0:a.tax_name3)||"",l.tax_rate1=(a==null?void 0:a.tax_rate1)||0,l.tax_rate2=(a==null?void 0:a.tax_rate2)||0,l.tax_rate3=(a==null?void 0:a.tax_rate3)||0,l.custom_value1=(a==null?void 0:a.custom_value1)||"",l.custom_value2=(a==null?void 0:a.custom_value2)||"",l.custom_value3=(a==null?void 0:a.custom_value3)||"",l.custom_value4=(a==null?void 0:a.custom_value4)||"",l.tax_id=(a==null?void 0:a.tax_id)||"1",l.product_cost=a==null?void 0:a.cost,n.onChange(o,l)}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function kGe(){const n=_o();return{find:t=>n.fetchQuery(["/api/v1/vendors",t],()=>Ae("GET",Te("/api/v1/vendors/:id",{id:t})).then(i=>i.data.data),{staleTime:1/0})}}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function IGe(){const n=ed();return{find:t=>{var i;return n?Promise.resolve((i=n.data)==null?void 0:i.currencies.find(r=>r.id===t)):Promise.resolve(void 0)}}}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function upn(){const n=ed();return{find:t=>{var i;return n?Promise.resolve((i=n.data)==null?void 0:i.countries.find(r=>r.id===t)):Promise.resolve(void 0)}}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function dpn(n){const e=ci(),t=IGe(),i=upn(),r=kGe(),o=IK(),[s,a]=w.useState(""),[l,c]=w.useState(""),{resource:u,relationType:d}=n,[h,f]=w.useState(),[g,m]=w.useState(),[v,_]=w.useState();return w.useEffect(()=>{s&&d==="client_id"&&o.find(s).then(b=>_(b)),l&&d==="vendor_id"&&r.find(l).then(b=>_(b))},[s,l]),w.useEffect(()=>{u!=null&&u.vendor_id&&c(u.vendor_id),u!=null&&u.client_id&&a(u.client_id)},[u==null?void 0:u.client_id,u==null?void 0:u.vendor_id]),w.useEffect(()=>{if(d==="client_id"){const b=v;t.find((b==null?void 0:b.settings.currency_id)||(e==null?void 0:e.settings.currency_id)).then(y=>m(y)),i.find((b==null?void 0:b.country_id)||(e==null?void 0:e.settings.country_id)).then(y=>f(y))}if(d==="vendor_id"){const b=v;t.find((b==null?void 0:b.currency_id)||(e==null?void 0:e.settings.currency_id)).then(y=>m(y)),i.find((b==null?void 0:b.country_id)||(e==null?void 0:e.settings.country_id)).then(y=>f(y))}},[v]),b=>g&&h?yve.formatMoney(isNaN(Number(b))?0:b,g,h):b}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function bbe(n){const e=ci(),t=IK(),i=kGe(),r=IGe(),o=ZS();return async(s,a)=>{var c;let l;return s.length>=1&&a==="client_id"?await t.find(s).then(async u=>{var d;await r.find(u.settings.currency_id||((d=e.settings)==null?void 0:d.currency_id)).then(h=>{const f=o(e.settings.country_id),g={thousandSeparator:(f==null?void 0:f.thousand_separator)||(h==null?void 0:h.thousand_separator)||",",decimalSeparator:(f==null?void 0:f.decimal_separator)||(h==null?void 0:h.decimal_separator)||".",precision:(h==null?void 0:h.precision)||2};n?n(g):l=g})}):s.length>=1&&a==="vendor_id"?await i.find(s).then(async u=>{var d;await r.find(u.currency_id||((d=e.settings)==null?void 0:d.currency_id)).then(h=>{const f=o(e.settings.country_id),g={thousandSeparator:(f==null?void 0:f.thousand_separator)||(h==null?void 0:h.thousand_separator)||",",decimalSeparator:(f==null?void 0:f.decimal_separator)||(h==null?void 0:h.decimal_separator)||".",precision:(h==null?void 0:h.precision)||2};n?n(g):l=g})}):await r.find((c=e.settings)==null?void 0:c.currency_id).then(u=>{const d=o(e.settings.country_id),h={thousandSeparator:(d==null?void 0:d.thousand_separator)||(u==null?void 0:u.thousand_separator)||",",decimalSeparator:(d==null?void 0:d.decimal_separator)||(u==null?void 0:u.decimal_separator)||".",precision:(u==null?void 0:u.precision)||2};n?n(h):l=h}),l}}function hpn(n){var o,s;const[e,t]=w.useState(),[i]=pe(),r=td({initialValues:{name:"",rate:""},onSubmit:a=>{t(void 0),Ae("POST",Te("/api/v1/tax_rates"),a).then(l=>{ce.success("created_tax_rate"),n.onClose(!1),En(["tax_rates"]),n.onTaxCreated&&n.onTaxCreated(l.data.data)}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(t(l.response.data),ce.dismiss())}).finally(()=>r.setSubmitting(!1))}});return N(Ui,{title:i("create_tax_rate"),visible:n.isVisible,onClose:n.onClose,children:[p(We,{type:"text",id:"name",label:i("name"),errorMessage:(o=e==null?void 0:e.errors)==null?void 0:o.name,onChange:r.handleChange,required:!0}),p(We,{type:"text",id:"rate",label:i("tax_rate"),errorMessage:(s=e==null?void 0:e.errors)==null?void 0:s.rate,onChange:r.handleChange,required:!0}),p(Gt,{behavior:"button",type:"primary",onClick:()=>{r.submitForm()},children:i("save")})]})}function Yy(n){const[e]=pe(),[t,i]=w.useState(!1),{isAdmin:r,isOwner:o}=Po(),{resourceTaxName:s,resourceTaxRate:a}=n;return N(dt,{children:[p(Fh,{inputOptions:{value:n.defaultValue??null},endpoint:Te("/api/v1/tax_rates?status=active"),onChange:l=>n.onChange&&n.onChange(l),action:{label:e("create_tax_rate"),onClick:()=>i(!0),visible:r||o},entryOptions:{id:"id",value:"name",label:"name",customValue:l=>`${l.name}||${l.rate}`,inputLabelFn:l=>l?s===l.name?`${l.name} ${a}%`:`${l.name} ${l.rate}%`:"",dropdownLabelFn:l=>s===l.name?`${l.name} ${a}%`:`${l.name} ${l.rate}%`},sortBy:"name|asc",onDismiss:n.onClearButtonClick,compareOnlyByValue:!0}),p(hpn,{isVisible:t,onClose:i,onTaxCreated:n.onTaxCreated})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const fpn=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function l6(){const n=Ha();return n!=null&&n.number_precision&&(n==null?void 0:n.number_precision)>0&&(n==null?void 0:n.number_precision)<=100?n.number_precision:2}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const ppn=n=>{const{onlyAddToInvoice:e}=n||{},t=wi(),i=ci(),r=l6(),{data:o}=_be(),s=Ar(A1);return a=>{if(o){const l=a.map(c=>({...oE(),type_id:i0.Product,product_key:c.product_key,quantity:i!=null&&i.fill_products?c.quantity:1,...(i==null?void 0:i.fill_products)&&{line_total:Number((c.price*c.quantity).toFixed(r)),cost:c.price,notes:c.notes,tax_name1:c.tax_name1,tax_rate1:c.tax_rate1,tax_name2:c.tax_name2,tax_rate2:c.tax_rate2,tax_name3:c.tax_name3,tax_rate3:c.tax_rate3,tax_id:"",custom_value1:c.custom_value1,custom_value2:c.custom_value2,custom_value3:c.custom_value3,custom_value4:c.custom_value4}}));e?s(c=>c&&{...c,line_items:[...c.line_items,...l]}):(s({...o,line_items:l}),t("/invoices/create?action=invoice_product"))}}};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function gpn(n){const e=ps();return Ti(["/api/v1/purchase_orders","create"],()=>Ae("GET",Te("/api/v1/purchase_orders/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_purchase_order")?(n==null?void 0:n.enabled)??!0:!1})}function vLr(n){return Ti(["/api/v1/purchase_orders",n.id],()=>Ae("GET",Te("/api/v1/purchase_orders/:id",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}const mpn={expense:"converted_to_expense",email:"emailed_purchase_orders",mark_sent:"marked_purchase_orders_as_sent",add_to_inventory:"added_purchase_orders_to_inventory"};function _pn(){const n=_o(),e=Fi(tu);return(t,i)=>{ce.processing(),Ae("POST",Te("/api/v1/purchase_orders/bulk"),{action:i,ids:t}).then(()=>{const r=mpn[i]||`${i}d_purchase_order`;ce.success(r),En(["purchase_orders"]),i==="expense"&&En(["expenses"]),e&&n.invalidateQueries([e])})}}function vpn(){const n=_o(),e=Fi(tu);return t=>{ce.processing(),Ae("PUT",Te("/api/v1/purchase_orders/:id?mark_sent=true",{id:t.id}),t).then(()=>{ce.success("marked_purchase_order_as_sent"),En(["purchase_orders"]),e&&n.invalidateQueries([e])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const bpn=()=>{const n=wi(),e=ci(),t=l6(),{data:i}=gpn(),r=Ar(kK);return o=>{if(i){const s=o.map(a=>({...oE(),type_id:i0.Product,product_key:a.product_key,quantity:e!=null&&e.fill_products?a.quantity:1,...(e==null?void 0:e.fill_products)&&{line_total:Number((a.price*a.quantity).toFixed(t)),cost:a.price,notes:a.notes,tax_name1:a.tax_name1,tax_rate1:a.tax_rate1,tax_name2:a.tax_name2,tax_rate2:a.tax_rate2,tax_name3:a.tax_name3,tax_rate3:a.tax_rate3,tax_id:"",custom_value1:a.custom_value1,custom_value2:a.custom_value2,custom_value3:a.custom_value3,custom_value4:a.custom_value4}}));r({...i,line_items:s}),n("/purchase_orders/create?action=purchase_order_product")}}},ypn=["product_key","description","price","quantity"];function Cpn(){const[n,e,t,i]=cp({entity:"product"});return["product_key","description","price","quantity","archived_at","created_at",n,e,t,i,"documents","entity_state","is_deleted","notification_threshold","stock_quantity","tax_name1","tax_name2","tax_name3","tax_rate1","tax_rate2","tax_rate3","updated_at"]}function bLr(){var f;const{t:n}=pe();Cpn();const{dateFormat:e}=lc(),t=tf(),i=a6(),r=Ha(),o=sE(),s=Zk(),[a,l,c,u]=cp({entity:"product"}),d=[{column:"product_key",id:"product_key",label:n("product"),format:(g,m)=>N("span",{className:"inline-flex items-center space-x-4",children:[p(Hm,{entity:m}),p(Rf,{to:bt("/products/:id/edit",{id:m.id}),renderSpan:o("product",m),children:g})]})},{column:"description",id:"notes",label:n("notes"),format:g=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(g)}})}),children:p("span",{children:r0(Xc(g)).slice(0,50)})})},{column:"price",id:"price",label:n("price"),format:(g,m)=>{var v,_;return t(g,(v=m.company)==null?void 0:v.settings.country_id,(_=m.company)==null?void 0:_.settings.currency_id)}},{column:"quantity",id:"quantity",label:n("default_quantity"),format:g=>i(g)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:g=>go(g,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:g=>go(g,e)},{column:a,id:"custom_value1",label:a,format:g=>s("product1",g==null?void 0:g.toString())},{column:l,id:"custom_value2",label:l,format:g=>s("product2",g==null?void 0:g.toString())},{column:c,id:"custom_value3",label:c,format:g=>s("product3",g==null?void 0:g.toString())},{column:u,id:"custom_value4",label:u,format:g=>s("product4",g==null?void 0:g.toString())},{column:"documents",id:"documents",label:n("documents"),format:(g,m)=>m.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(g,m)=>p(Hm,{entity:m})},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(g,m)=>m.is_deleted?n("yes"):n("no")},{column:"notification_threshold",id:"stock_notification_threshold",label:n("notification_threshold")},{column:"stock_quantity",id:"in_stock_quantity",label:n("stock_quantity")},{column:"tax_name1",id:"tax_name1",label:n("tax_name1")},{column:"tax_name2",id:"tax_name2",label:n("tax_name2")},{column:"tax_name3",id:"tax_name3",label:n("tax_name3")},{column:"tax_rate1",id:"tax_rate1",label:n("tax_rate1"),format:g=>i(g)},{column:"tax_rate2",id:"tax_rate2",label:n("tax_rate2"),format:g=>i(g)},{column:"tax_rate3",id:"tax_rate3",label:n("tax_rate3"),format:g=>i(g)},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:g=>go(g,e)}],h=((f=r==null?void 0:r.react_table_columns)==null?void 0:f.product)||ypn;return d.filter(g=>h.includes(g.column)).sort((g,m)=>h.indexOf(g.column)-h.indexOf(m.column))}function yLr(){const[n]=pe(),e=wi(),t=ps(),i=Ar(fpn),r=ppn(),o=bpn(),{isEditPage:s}=N1({entity:"product",editPageTabs:["documents","product_fields"]}),a=u=>{i({...u,id:"",documents:[]}),e("/products/create?action=clone")},l=(u,d)=>{ce.processing(),Bhn([d],u).then(()=>{ce.success(`${u}d_product`),En(["products"])})};return[u=>!u.is_deleted&&t("create_invoice")&&p(tn,{onClick:()=>r([u]),icon:p(vt,{element:qp}),children:n("new_invoice")}),u=>!u.is_deleted&&t("create_purchase_order")&&p(tn,{onClick:()=>o([u]),icon:p(vt,{element:qp}),children:n("new_purchase_order")}),u=>!u.is_deleted&&t("create_product")&&p(tn,{onClick:()=>a(u),icon:p(vt,{element:e0}),children:n("clone")}),()=>s&&p(_i,{withoutPadding:!0}),u=>Sr(u)===Zi.Active&&s&&p(tn,{onClick:()=>l("archive",u.id),icon:p(vt,{element:Ac}),children:n("archive")}),u=>(Sr(u)===Zi.Archived||Sr(u)===Zi.Deleted)&&s&&p(tn,{onClick:()=>l("restore",u.id),icon:p(vt,{element:Dc}),children:n("restore")}),u=>(Sr(u)===Zi.Active||Sr(u)===Zi.Archived)&&s&&p(tn,{onClick:()=>l("delete",u.id),icon:p(vt,{element:gl}),children:n("delete")})]}function wpn(n){const{setErrors:e,setProduct:t}=n;return(i,r)=>{e(void 0),t(o=>o&&{...o,[i]:r})}}function ybe(){const[n]=pe();return[{id:"1",value:"1",label:n("physical_goods"),resource:null,eventType:"external",searchable:n("physical_goods")},{id:"2",value:"2",label:n("services"),resource:null,eventType:"external",searchable:n("services")},{id:"3",value:"3",label:n("digital_products"),resource:null,eventType:"external",searchable:n("digital_products")},{id:"4",value:"4",label:n("shipping"),resource:null,eventType:"external",searchable:n("shipping")},{id:"5",value:"5",label:n("tax_exempt"),resource:null,eventType:"external",searchable:n("tax_exempt")},{id:"6",value:"6",label:n("reduced_tax"),resource:null,eventType:"external",searchable:n("reduced_tax")},{id:"7",value:"7",label:n("override_tax"),resource:null,eventType:"external",searchable:n("override_tax")},{id:"8",value:"8",label:n("zero_rated"),resource:null,eventType:"external",searchable:n("zero_rated")},{id:"9",value:"9",label:n("reverse_tax"),resource:null,eventType:"external",searchable:n("reverse_tax")}]}function Spn({value:n,label:e,onChange:t}){const i=ybe();return p(KKe,{inputOptions:{value:n,label:e},entries:i,entryOptions:{id:"id",value:"id",label:"label"},onChange:t,onEmptyValues:()=>null})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Lw(n,e){if(!e)return"";const t=e.replace("name","rate");return n&&n[t]?`${n[e]}||${n[t]}`:""}function Epn(n){var c,u,d,h;const[e]=pe(),[,t]=dF(),i=ci(),r=ybe(),{errors:o,handleChange:s,type:a,product:l}=n;return N(dt,{children:[a==="edit"&&p(K,{leftSide:e("status"),children:p(Hm,{entity:l})}),p(K,{leftSide:e("item"),required:!0,children:p(We,{required:!0,value:l.product_key,onValueChange:f=>s("product_key",f),errorMessage:o==null?void 0:o.errors.product_key})}),p(K,{leftSide:e("description"),children:p(We,{element:"textarea",value:l.notes,onValueChange:f=>s("notes",f),errorMessage:o==null?void 0:o.errors.notes})}),p(K,{leftSide:e("price"),children:p(wo,{value:l.price||"",onValueChange:f=>s("price",parseFloat(f)),errorMessage:o==null?void 0:o.errors.price})}),(i==null?void 0:i.enable_product_cost)&&p(K,{leftSide:e("cost"),children:p(We,{value:l.cost,onValueChange:f=>s("cost",f),errorMessage:o==null?void 0:o.errors.cost})}),(i==null?void 0:i.enable_product_quantity)&&p(K,{leftSide:e("default_quantity"),children:p(wo,{value:l.quantity||"",onValueChange:f=>s("quantity",parseFloat(f)),errorMessage:o==null?void 0:o.errors.quantity})}),p(K,{leftSide:e("max_quantity"),children:p(wo,{value:l.max_quantity||"",onValueChange:f=>s("max_quantity",parseFloat(f)),errorMessage:o==null?void 0:o.errors.max_quantity})}),N(K,{leftSide:e("tax_category"),children:[p(Cn,{value:l.tax_id,onValueChange:f=>s("tax_id",f),customSelector:!0,dismissable:!1,children:r.map((f,g)=>p("option",{value:f.value,children:f.label},g))}),o!=null&&o.errors.tax_id?p(Ls,{className:"mt-2",type:"danger",children:o.errors.tax_id}):null]}),p(K,{leftSide:e("image_url"),children:p(We,{value:l.product_image,onValueChange:f=>s("product_image",f),errorMessage:o==null?void 0:o.errors.product_image})}),(i==null?void 0:i.track_inventory)&&N(dt,{children:[p(K,{leftSide:e("stock_quantity"),children:p(wo,{value:l.in_stock_quantity||"",onValueChange:f=>{s("in_stock_quantity",Number(f)),a==="edit"&&t(g=>({...g,update_in_stock_quantity:"true"}))},errorMessage:o==null?void 0:o.errors.in_stock_quantity})}),p(K,{leftSide:e("stock_notifications"),children:p(ft,{checked:l.stock_notification,onValueChange:f=>s("stock_notification",f)})}),p(K,{leftSide:e("notification_threshold"),children:p(wo,{value:l.stock_notification_threshold||"",onValueChange:f=>s("stock_notification_threshold",parseFloat(f)),errorMessage:o==null?void 0:o.errors.stock_notification_threshold})})]}),i&&i.enabled_item_tax_rates>0&&p(K,{leftSide:e("tax"),children:p(Yy,{onChange:f=>{var g,m;s("tax_rate1",(g=f.resource)==null?void 0:g.rate),s("tax_name1",(m=f.resource)==null?void 0:m.name)},defaultValue:Lw(l,"tax_name1"),onClearButtonClick:()=>{s("tax_rate1",0),s("tax_name1","")},onTaxCreated:f=>{s("tax_rate1",f.rate),s("tax_name1",f.name)}})}),i&&i.enabled_item_tax_rates>1&&p(K,{leftSide:e("tax"),children:p(Yy,{onChange:f=>{var g,m;s("tax_rate2",(g=f.resource)==null?void 0:g.rate),s("tax_name2",(m=f.resource)==null?void 0:m.name)},defaultValue:Lw(l,"tax_name2"),onClearButtonClick:()=>{s("tax_rate2",0),s("tax_name2","")},onTaxCreated:f=>{s("tax_rate2",f.rate),s("tax_name2",f.name)}})}),i&&i.enabled_item_tax_rates>2&&p(K,{leftSide:e("tax"),children:p(Yy,{onChange:f=>{var g,m;s("tax_rate3",(g=f.resource)==null?void 0:g.rate),s("tax_name3",(m=f.resource)==null?void 0:m.name)},defaultValue:Lw(l,"tax_name3"),onClearButtonClick:()=>{s("tax_rate3",0),s("tax_name3","")},onTaxCreated:f=>{s("tax_rate3",f.rate),s("tax_name3",f.name)}})}),((c=i==null?void 0:i.custom_fields)==null?void 0:c.product1)&&p(ls,{field:"custom_value1",defaultValue:l.custom_value1,value:i.custom_fields.product1,onValueChange:f=>s("custom_value1",f)}),((u=i==null?void 0:i.custom_fields)==null?void 0:u.product2)&&p(ls,{field:"custom_value2",defaultValue:l.custom_value2,value:i.custom_fields.product2,onValueChange:f=>s("custom_value2",f)}),((d=i==null?void 0:i.custom_fields)==null?void 0:d.product3)&&p(ls,{field:"custom_value3",defaultValue:l.custom_value3,value:i.custom_fields.product3,onValueChange:f=>s("custom_value3",f)}),((h=i==null?void 0:i.custom_fields)==null?void 0:h.product4)&&p(ls,{field:"custom_value4",defaultValue:l.custom_value4,value:i.custom_fields.product4,onValueChange:f=>s("custom_value4",f)})]})}function xpn(n){const[e]=pe(),{data:t}=Fhn(),[i,r]=w.useState(),[o,s]=w.useState(!1),[a,l]=w.useState(),c=wpn({setErrors:r,setProduct:l}),u=()=>{o||(s(!0),Ae("POST",Te("/api/v1/products"),a).then(d=>{ce.success("created_product"),En(["products"]),setTimeout(()=>{var h;(h=n.onProductCreated)==null||h.call(n,d.data.data)},200),n.setIsModalOpen(!1)}).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(r(d.response.data),ce.dismiss())}).finally(()=>s(!1)))};return w.useEffect(()=>{t&&l(t)},[t]),N(Ui,{title:e("new_product"),visible:n.isModalOpen,onClose:n.setIsModalOpen,backgroundColor:"gray",size:"small",children:[a&&p(Epn,{product:a,errors:i,handleChange:c}),p(Gt,{type:"primary",behavior:"button",onClick:u,children:e("save")})]})}function Tpn(n){const[e]=pe(),[t,i]=w.useState(!1),r=ci(),o=ps();return N(dt,{children:[p(xpn,{setIsModalOpen:i,isModalOpen:t,onProductCreated:n.onProductCreated}),p(Fh,{endpoint:Te("/api/v1/products?per_page=800"),inputOptions:{value:n.defaultValue??null,label:n.label},entryOptions:{id:"id",label:"product_key",value:"id",searchable:"notes",dropdownLabelFn:s=>N("div",{children:[N("div",{className:"flex space-x-1",children:[p("p",{className:"font-semibold",children:s.product_key}),(r==null?void 0:r.track_inventory)&&n.displayStockQuantity&&N("p",{className:Nt({"text-red-700":s.in_stock_quantity<=0}),children:["(",Ms("stock_quantity_number",{quantity:s.in_stock_quantity}),")"]})]}),p("p",{className:"text-sm truncate",children:s.notes.length>35?s.notes.substring(0,35).concat("..."):s.notes})]})},onChange:s=>n.onChange&&n.onChange(s),onInputValueChange:n.onInputValueChange,action:{label:e("new_product"),onClick:()=>i(!0),visible:o("create_product")&&!n.withoutAction},onDismiss:n.onClearButtonClick,sortBy:"product_key|asc",nullable:!0,clearInputAfterSelection:n.clearInputAfterSelection},"product_selector"),n.errorMessage&&p(Ls,{type:"danger",className:"mt-2",children:n.errorMessage})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function kpn(n){const e=n.resource,t=Ar(aE);return(i,r,o)=>{t(!1);const s={...e.line_items[r]};return s[i]=(o==null?void 0:o.rate)??0,s[i.replace("rate","name")]=(o==null?void 0:o.name)||"",n.onChange(r,s)}}const Ipn=["discount","cost","unit_cost","quantity","rate","hours"],Lpn=["tax_rate1","tax_rate2","tax_rate3"],Dpn={decimalSeparator:".",precision:2,thousandSeparator:","},R$=n=>!Object.keys(n).some(t=>t!=="_id"&&t!=="type_id"&&t!=="is_amount_discount"&&n[t]);function Apn(n){const e=Tl(),[t,i]=w.useState(),[r,o]=Yo(aE),s=y=>y.filter((x,E)=>E!==y.length-1).some(x=>R$(x));w.useCallback(y=>{let C=i0.Product;n.type==="task"&&(C=i0.Task);const x=y.filter(({type_id:L})=>L===C),E=x.length,k=x[E-1];if(E>0&&(!s(x)&&!R$(k)&&n.createItem(),s(x)&&R$(k))){const L=y.indexOf(x[E-1]);L>-1&&n.deleteLineItem(L)}},[n.resource.line_items]);const a=cpn({relationType:n.relationType,resource:n.resource,type:n.type,onChange:n.onLineItemChange}),l=kpn({resource:n.resource,type:n.type,onChange:n.onLineItemChange}),c=async(y,C,x)=>{o(!1),await n.onLineItemPropertyChange(y,C,x)},u=ci(),d=Ha(),h=n.resource,f=async(y,C,x)=>{o(!1);const E=un.cloneDeep(x);x&&u&&u.enabled_item_tax_rates===0&&(E.tax_name1="",E.tax_rate1=0,E.tax_name2="",E.tax_rate2=0,E.tax_name3="",E.tax_rate3=0),x&&u&&u.enabled_item_tax_rates===1&&(E.tax_name2="",E.tax_rate2=0,E.tax_name3="",E.tax_rate3=0),x&&u&&u.enabled_item_tax_rates===2&&(E.tax_name3="",E.tax_rate3=0),await a(y,C,E)},g=dpn({resource:n.resource,relationType:n.relationType}),m=bbe(i);w.useEffect(()=>{h[n.relationType]?m(h[n.relationType],n.relationType):i(Dpn)},[h==null?void 0:h[n.relationType]]),w.useEffect(()=>{},[h==null?void 0:h.line_items,r]);const v=ybe(),{preferences:_}=L1(),b=(y,C)=>{if(u.calculate_taxes){const x=h==null?void 0:h.line_items[C];return x.tax_id==="7"||x.tax_id===""?N(iA,{children:[p(Yy,{onChange:k=>k.resource&&l(y,C,k.resource),onTaxCreated:k=>l(y,C,k),defaultValue:Lw(h==null?void 0:h.line_items[C],y.replace("rate","name")),onClearButtonClick:()=>l(y,C)},`${y}${h==null?void 0:h.line_items[C][y]}`),y==="tax_rate1"?p("button",{type:"button",onClick:()=>c("tax_id","1",C),children:p(iQt,{})}):null]}):el(v).pluck("value").filter(k=>k!=="7").toArray().includes(x.tax_id)&&y==="tax_rate1"?p(iA,{children:p(Spn,{value:x.tax_id,onChange:k=>c("tax_id",k.value,C)})}):null}return p(Yy,{onChange:x=>x.resource&&l(y,C,x.resource),onTaxCreated:x=>l(y,C,x),defaultValue:Lw(h==null?void 0:h.line_items[C],y.replace("rate","name")),onClearButtonClick:()=>l(y,C)},`${y}${h==null?void 0:h.line_items[C][y]}`)};return(y,C)=>{var E,k,L,D;const x=TGe(y);if(x==="product_key")return p(Tpn,{onChange:A=>f(C,A.label,A.resource),className:"w-auto",defaultValue:h==null?void 0:h.line_items[C][x],onProductCreated:A=>A&&f(C,A.product_key,A),clearButton:!0,onInputValueChange:A=>c("product_key",A,C),onClearButtonClick:()=>a(C,"",null),displayStockQuantity:e.pathname.startsWith("/invoices")},`${x}${h==null?void 0:h.line_items[C][x]}`);if(x==="notes")return p(We,{id:x,element:"textarea",value:h==null?void 0:h.line_items[C][x],onChange:A=>c(x,A.target.value,C),style:{marginTop:"4px"},textareaRows:_.auto_expand_product_table_notes?1:3},`${x}${C}`);if(Ipn.includes(x))return t&&p(wo,{precision:x==="quantity"?6:d!=null&&d.number_precision&&(d==null?void 0:d.number_precision)>0&&(d==null?void 0:d.number_precision)<=100?d.number_precision:(t==null?void 0:t.precision)||2,id:x,value:(h==null?void 0:h.line_items[C][x])||"",className:"auto",onValueChange:A=>{c(x,isNaN(parseFloat(A))?0:parseFloat(A),C)}});if(x==="gross_line_total"||x==="tax_amount")return g((h==null?void 0:h.line_items[C][x])??0);if(Lpn.includes(x))return b(x,C);if(["line_total"].includes(x))return g(h==null?void 0:h.line_items[C][x]);if(["product1","product2","product3","product4"].includes(x)){const A=x.replace("product","custom_value");return(E=u.custom_fields)!=null&&E[x]?p(ls,{field:x,defaultValue:h==null?void 0:h.line_items[C][A],value:(k=u.custom_fields)==null?void 0:k[x],onValueChange:O=>c(A,O,C),fieldOnly:!0}):p(We,{id:x,value:h==null?void 0:h.line_items[C][x],onChange:O=>c(x,O.target.value,C)})}if(["task1","task2","task3","task4"].includes(x)){const A=x.replace("task","custom_value");return(L=u.custom_fields)!=null&&L[x]?p(ls,{field:x,defaultValue:h==null?void 0:h.line_items[C][A],value:(D=u.custom_fields)==null?void 0:D[x],onValueChange:O=>c(A,O,C),fieldOnly:!0}):p(We,{id:x,value:h==null?void 0:h.line_items[C][x],onChange:O=>c(x,O.target.value,C)})}return p(We,{id:x,value:h==null?void 0:h.line_items[C][x],onChange:A=>c(x,A.target.value,C)})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Npn(n){const[e]=pe(),t=ci(),{type:i}=n||{},r=i==="product"||!i?["product1","product2","product3","product4"]:["task1","task2","task3","task4"],o={"$product.tax_rate1":e("tax_rate1"),"$product.tax_rate2":e("tax_rate2"),"$product.tax_rate3":e("tax_rate3")};return(s,a=".")=>{var c;if(Object.prototype.hasOwnProperty.call(o,s))return o[s];const{property:l}=xGe(s,a);if(r.includes(l)){const u=(c=t.custom_fields)==null?void 0:c[l];if(u)return u.split("|")[0]}return e(l||s)}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Rpn(n){const e=n.resource;return t=>{var r,o;if(t.source.index===((r=t.destination)==null?void 0:r.index))return;const i=e?Hve(e.line_items,t.source.index,(o=t.destination)==null?void 0:o.index):[];return n.onSort(i)}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Opn(n){const e=TGe(n);return{product_key:"15%",notes:"30%",cost:"10%",quantity:"10%",line_total:"5%",discount:"10%",tax_rate1:"12%"}[e]||""}const aE=Oo(void 0);function CLr(n){const[e]=pe(),t=ni(),i=Xme(),{resource:r,items:o,columns:s,relationType:a}=n,l=Ar(aE),c=Npn({type:n.type}),u=Apn({type:n.type,resource:n.resource,onLineItemChange:n.onLineItemChange,onLineItemPropertyChange:n.onLineItemPropertyChange,relationType:a,createItem:n.onCreateItemClick,deleteLineItem:n.onDeleteRowClick}),d=Rpn({resource:n.resource,onSort:n.onSort}),h=()=>o.some(g=>R$(g)),f=g=>r.line_items.indexOf(g);return N(eE,{children:[p(nE,{backgroundColor:i.$5,children:s.map((g,m)=>p(Fa,{textColor:i.$6,children:c(g)},m))}),p(cK,{onDragEnd:d,children:p(dK,{droppableId:"product-table",children:g=>N(tE,{...g.droppableProps,innerRef:g.innerRef,children:[o.map((m,v)=>p(uK,{draggableId:f(m).toString(),index:f(m),children:_=>p(Ec,{innerRef:_.innerRef,tabIndex:v+1,..._.draggableProps,children:s.map((b,y,{length:C})=>N(ko,{width:Opn(b),children:[C-1!==y&&N("div",{className:Nt({"flex justify-between items-center space-x-3":y===0}),children:[y===0?p("button",{..._.dragHandleProps,children:p(S1t,{size:18})}):null,u(b,f(m))]}),C-1===y&&N("div",{className:"flex justify-between items-center",children:[u(b,f(m)),r&&p("button",{style:{color:t.$3},className:"ml-2 text-gray-600 hover:text-red-600",onClick:()=>{l(!0),n.onDeleteRowClick(f(m))},children:p(cwt,{size:18})})]})]},y))},f(m))},f(m))),g.placeholder,p(Ec,{className:"bg-slate-100 hover:bg-slate-200",children:p(ko,{colSpan:100,children:N("button",{onClick:()=>!h()&&n.onCreateItemClick(),className:"w-full py-2 inline-flex justify-center items-center space-x-2",children:[p(QCt,{size:18}),p("span",{children:n.type==="product"?e("add_item"):e("add_line")})]})})})]})})})]})}function mm(n){const{onClick:e,icon:t,label:i}=n;return N(Gt,{behavior:"button",type:"secondary",className:"w-3/4",onClick:e,children:[p(vt,{element:t,style:{width:"1.1rem",height:"1.1rem"}}),p("span",{children:i})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ppn(n){const e=pa(),{commonActionsSection:t,entity:i}=n,{isEditPage:r}=N1({entity:i});return o=>{var a,l,c;if(!r)return!0;const s=(a=e==null?void 0:e.company_user)==null?void 0:a.react_settings.common_actions;return!t&&!(s!=null&&s[i])||!t&&(s!=null&&s[i])&&!((l=s[i])!=null&&l.includes(o))?!0:s!=null&&s[i]&&t?(c=s[i])==null?void 0:c.includes(o):!1}}function Ur(n){const e=wi(),t=Mk({disablePrevention:n.disablePreventNavigation}),{isCommonActionSection:i,onClick:r,to:o,icon:s,tooltipText:a,entity:l,actionKey:c,excludePreferences:u,setVisible:d}=n;return!Ppn({commonActionsSection:i,entity:l})(c)&&!u?p(dt,{}):i?p(wu,{width:"auto",placement:"bottom",message:a,withoutArrow:!0,children:p("div",{onClick:()=>t({fn:()=>o?e(o):r==null?void 0:r()}),children:p(vt,{element:s,size:23.5})})}):p(tn,{to:o,icon:p(vt,{element:n.icon}),onClick:r,setVisible:d,disablePreventNavigation:n.disablePreventNavigation,children:n.children})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Cbe=Oo(void 0),wLr=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const LK=Oo(void 0),Mpn=Oo(void 0);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const DK=Oo(void 0),Fpn=Oo(void 0);function Bpn(n){const[e]=pe(),t=wi(),{purchaseOrder:i,dropdown:r}=n,o=ps(),s=Ar(LK),a=Ar(Cbe),l=Ar(A1),c=Ar(DK),u=ji(),[d,h]=w.useState(!1),f=()=>{l({...i,id:"",number:"",documents:[],due_date:"",partial_due_date:"",date:Un().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",paid_to_date:0,po_number:i.number,design_id:u.settings.invoice_design_id}),t("/invoices/create?action=clone")},g=()=>{s({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),due_date:"",partial_due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",paid_to_date:0,po_number:i.number,design_id:u.settings.quote_design_id}),t("/quotes/create?action=clone")},m=()=>{c({...i,id:"",number:"",documents:[],frequency_id:"5",paid_to_date:0,total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",due_date:"",partial_due_date:"",po_number:i.number,design_id:u.settings.invoice_design_id}),t("/recurring_invoices/create?action=clone")},v=()=>{a({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),due_date:"",partial_due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",paid_to_date:0,po_number:i.number,design_id:u.settings.credit_design_id}),t("/credits/create?action=clone")};return N(dt,{children:[(o("create_invoice")||o("create_quote")||o("create_recurring_invoice")||o("create_credit"))&&p(Ur,{entity:"purchase_order",actionKey:"clone_to_other",isCommonActionSection:!r,tooltipText:e("clone_to_other"),onClick:()=>h(!0),icon:e0,children:e("clone_to_other")}),p(Ui,{title:e("clone_to"),visible:d,onClose:()=>h(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:p("div",{className:"flex justify-center",children:N("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[o("create_invoice")&&p(mm,{label:e("invoice"),icon:oS,onClick:f}),o("create_quote")&&p(mm,{label:e("quote"),icon:wge,onClick:g}),o("create_recurring_invoice")&&p(mm,{label:e("recurring_invoice"),icon:_H,onClick:m}),o("create_credit")&&p(mm,{label:e("credit"),icon:oS,onClick:v})]})})})]})}Oo(!1);const $pn=Oo(null),Vpn=Oo(!1),Hpn=Oo([]),Wpn=Oo(null);function SLr({entity:n,entities:e,visible:t,bulkUrl:i,setVisible:r,labelFn:o}){const[s]=pe(),[a,l]=w.useState(null),[c,u]=w.useState(!1),[d,h]=Yo($pn),f=_o(),g=w.useRef(null),m=()=>{const _=el(e).pluck("id").toArray();h(null),ce.processing(),Ae("POST",Te(i),{ids:_,entity:n,template_id:a,send_email:c,action:"template"}).then(b=>{const y=b.data.message;if(dfe.emit("bulk.completed"),c){r(!1),ce.success();return}g.current&&(g.current.disabled=!0),f.fetchQuery({queryKey:["reports",y],queryFn:()=>Ae("POST",Te(`/api/v1/templates/preview/${y}`),{},{responseType:"arraybuffer"}).then(C=>C.data),retry:10,retryDelay:5e3}).then(C=>{const x=new Blob([C],{type:"application/pdf"}),E=URL.createObjectURL(x);h(E),ce.success(),dfe.emit("bulk.completed")}).finally(()=>{g.current&&(g.current.disabled=!1)})})},v=_=>{const b=document.createElement("a");b.download="template.pdf",b.href=_,b.target="_blank",document.body.appendChild(b),b.click(),document.body.removeChild(b)};return N(Ui,{title:s("load_template"),visible:t,onClose:r,size:"small",children:[p(K,{leftSide:s("design"),noExternalPadding:!0,children:p(Fh,{endpoint:Te(`/api/v1/designs?template=true&entities=${n}`),inputOptions:{value:a??"",label:""},entryOptions:{id:"id",label:"name",value:"id"},onChange:_=>_.resource?l(_.resource.id):null})}),N("p",{className:"capitalize",children:[s("entities"),":"]}),p("ul",{children:e.map((_,b)=>p("li",{children:o(_)},b))}),p(ft,{label:s("send_email"),checked:c,onChange:u}),p(Gt,{innerRef:g,behavior:"button",onClick:m,disabled:!a,disableWithoutIcon:!0,children:s("run_template")}),d?p(Gt,{type:"secondary",behavior:"button",onClick:()=>v(d),children:s("download_pdf")}):null]})}function QN(){const[n,e]=Yo(Vpn),[t,i]=Yo(Hpn),[r,o]=Yo(Wpn);return{changeTemplateVisible:n,changeTemplateResources:t,changeTemplateEntityContext:r,setChangeTemplateVisible:e,setChangeTemplateResources:i,setChangeTemplateEntityContext:o}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function zpn(n){return e=>{if(e.invitations.length!==0&&e.invitations.length>0)return Te("/api/v1/:resource/:invitation/:downloadType",{resource:n.resourceType,invitation:e.invitations[0].key,downloadType:n.downloadType||"download_e_invoice"})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function LGe(n){const e=_o(),t=zpn({resourceType:n.resource,downloadType:n.downloadType});return i=>{const r=t(i);r&&(ce.processing(),e.fetchQuery(r,()=>Ae("GET",r,{},{responseType:"arraybuffer"}).then(o=>{const s=new Blob([o.data],{type:"application/xml"}),a=URL.createObjectURL(s),[,l]=o.headers["content-disposition"].split("filename="),c=document.createElement("a");c.download=l,c.href=a,c.target="_blank",document.body.appendChild(c),c.click(),document.body.removeChild(c),ce.dismiss()})))}}const Upn=rl.div` border-color: ${n=>n.theme.borderColor}; &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function ELr(){const[n]=pe(),{timeFormat:e}=MN(),{dateFormat:t}=lc(),i=o=>{var d,h,f,g,m,v,_,b,y,C,x,E,k,L,D,A,O,P,F,B,M,V,U,W,q,H,ie,se,Q,Ee;let s=Ms(`activity_${o.activity_type_id}`,{});o.activity_type_id===10&&o.contact&&(s=Ms("activity_10_online",{})),o.activity_type_id===54&&o.contact&&(s=s.replace(":user",":contact"));const a=["invoice","quote","recurring_invoice","vendor","credit","payment","project","task","expense","recurring_expense","bank_transaction","purchase_order"],c=(()=>{const Fe=Object.keys(o||{}).find(He=>a.includes(He));return!Fe&&(o!=null&&o.client)?"client":Fe||""})(),u={client:p(Li,{to:bt("/clients/:id",{id:(d=o.client)==null?void 0:d.hashed_id}),children:(h=o.client)==null?void 0:h.label}),contact:p(Li,{to:bt(`/${(f=o==null?void 0:o.contact)==null?void 0:f.contact_entity}/:id`,{id:(g=o.contact)==null?void 0:g.hashed_id}),children:(m=o.contact)==null?void 0:m.label}),quote:p(Li,{to:bt("/quotes/:id/edit",{id:(v=o.quote)==null?void 0:v.hashed_id}),children:(_=o.quote)==null?void 0:_.label}),user:((b=o.user)==null?void 0:b.label)??n("system"),expense:p(Li,{to:bt("/expenses/:id/edit",{id:(y=o.expense)==null?void 0:y.hashed_id}),children:(C=o==null?void 0:o.expense)==null?void 0:C.label}),recurring_invoice:p(Li,{to:bt("/recurring_invoices/:id/edit",{id:(x=o.recurring_invoice)==null?void 0:x.hashed_id}),children:(E=o==null?void 0:o.recurring_invoice)==null?void 0:E.label}),recurring_expense:p(Li,{to:bt("/recurring_expenses/:id/edit",{id:(k=o.recurring_expense)==null?void 0:k.hashed_id}),children:(L=o==null?void 0:o.recurring_expense)==null?void 0:L.label}),purchase_order:p(Li,{to:bt("/purchase_orders/:id/edit",{id:(D=o.purchase_order)==null?void 0:D.hashed_id}),children:(A=o==null?void 0:o.purchase_order)==null?void 0:A.label}),invoice:p(Li,{to:bt("/invoices/:id/edit",{id:(O=o.invoice)==null?void 0:O.hashed_id}),children:(P=o==null?void 0:o.invoice)==null?void 0:P.label}),payment_amount:(F=o==null?void 0:o.payment_amount)==null?void 0:F.label,payment:p(Li,{to:bt("/payments/:id/edit",{id:(B=o.payment)==null?void 0:B.hashed_id}),children:(M=o==null?void 0:o.payment)==null?void 0:M.label}),credit:p(Li,{to:bt("/credits/:id/edit",{id:(V=o.credit)==null?void 0:V.hashed_id}),children:(U=o==null?void 0:o.credit)==null?void 0:U.label}),task:p(Li,{to:bt("/tasks/:id/edit",{id:(W=o.task)==null?void 0:W.hashed_id}),children:(q=o==null?void 0:o.task)==null?void 0:q.label}),vendor:p(Li,{to:bt("/vendors/:id/edit",{id:(H=o.vendor)==null?void 0:H.hashed_id}),children:(ie=o==null?void 0:o.vendor)==null?void 0:ie.label}),subscription:p(Li,{to:bt("/settings/subscriptions/:id/edit",{id:(se=o.subscription)==null?void 0:se.hashed_id}),children:(Q=o==null?void 0:o.subscription)==null?void 0:Q.label}),adjustment:(Ee=o==null?void 0:o.adjustment)==null?void 0:Ee.label,notes:!!(c&&o[c])&&N(dt,{children:[p("br",{}),p(Li,{to:bt(`/${c}s/${o[c].hashed_id}/edit`),children:o==null?void 0:o.notes})]})};for(const[Fe,He]of Object.entries(u))s=SK(s,`:${Fe}`,()=>He);return s},r=ni();return o=>p(Upn,{theme:{borderColor:r.$4,hoverColor:r.$2},className:"flex flex-col py-2 border border-t-0 border-x-0 last:border-b-0",children:N("div",{className:"flex flex-col space-y-2",children:[p("span",{className:"text-sm",children:i(o)}),N("div",{className:"flex space-x-3",children:[p("span",{className:"dark:text-white text-sm",children:go(o.created_at,`${t} ${e.replace(":ss","")}`)}),p("span",{className:"text-gray-500 text-sm",children:o.ip})]})]})})}function AK(n){const[e]=pe(),{entity:t,entityId:i,label:r,labelElement:o}=n,[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(""),h=()=>{c(!1),d("")},f=()=>{s||(a(!0),ce.processing(),Ae("POST",Te("/api/v1/activities/notes"),{entity:`${t}s`,entity_id:i,notes:u}).then(()=>{ce.success("saved_comment"),En(["activities"])}).finally(()=>{a(!1),h()}))};return N(dt,{children:[i&&p("div",{className:"cursor-pointer",onClick:()=>c(!0),children:o||p(Gt,{behavior:"button",type:"secondary",onClick:()=>{},children:e("add_comment")})}),N(Ui,{size:"regular",title:`${e("comment")} | ${e(t)} | ${r}`,visible:l,onClose:h,children:[p(We,{element:"textarea",value:u,onValueChange:g=>d(g),changeOverride:!0}),p("div",{className:"flex self-end",children:p(Gt,{behavior:"button",onClick:f,disabled:s||!u,disableWithoutIcon:!0,children:e("add")})})]})]})}function xLr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=wi(),o=GS(),s=Ar(aE);return a=>{ce.processing(),e(void 0);let l="/api/v1/purchase_orders?";t?(l+="save_default_terms=true",i&&(l+="&save_default_footer=true")):i&&(l+="save_default_footer=true"),Ae("POST",Te(l),a).then(async c=>{(t||i)&&await o(),ce.success("created_purchase_order"),En(["purchase_orders"]),r(bt("/purchase_orders/:id/edit",{id:c.data.data.id}))}).catch(c=>{var u;if(((u=c.response)==null?void 0:u.status)===422){const d=c.response.data;d.errors.amount?ce.error(d.errors.amount[0]):ce.dismiss(),e(d)}}).finally(()=>s(void 0))}}const jpn=["status","number","vendor","expense","amount","date","due_date"];function qpn(){const[n,e,t,i]=cp({entity:"invoice"});return["status","number","vendor","expense","amount","date","due_date","archived_at","contact_email","contact_name","created_at",n,e,t,i,"discount","documents","entity_state","exchange_rate"]}function TLr(){var f;const{t:n}=pe(),{dateFormat:e}=lc(),t=tf(),i=a6(),r=Ha(),o=sE(),s=Zk();qpn();const[a,l,c,u]=cp({entity:"invoice"}),d=[{column:"status",id:"status_id",label:n("status"),format:(g,m)=>p(Li,{to:bt("/purchase_orders/:id/edit",{id:m.id}),children:p(opn,{entity:m})})},{column:"number",id:"number",label:n("number"),format:(g,m)=>N("div",{className:"flex space-x-2",children:[p(Rf,{to:bt("/purchase_orders/:id/edit",{id:m.id}),renderSpan:o("purchase_order",m),children:g}),p(pbe,{text:m.number})]})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(g,m)=>m.vendor&&p(Li,{to:bt("/vendors/:id",{id:m.vendor.id}),children:m.vendor.name})},{column:"expense",id:"expense_id",label:n("expense"),format:(g,m)=>m.expense&&p(Li,{to:bt("/expenses/:id/edit",{id:m.expense.id}),children:m.expense.number})},{column:"amount",id:"amount",label:n("amount"),format:(g,m)=>{var v,_;return t(g,(v=m.vendor)==null?void 0:v.country_id,(_=m.vendor)==null?void 0:_.currency_id)}},{column:"date",id:"date",label:n("date"),format:g=>go(g,e)},{column:"due_date",id:"due_date",label:n("due_date"),format:g=>go(g,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:g=>go(g,e)},{column:"contact_name",id:"id",label:n("contact_name"),format:(g,m)=>{var v,_;return m.vendor&&((_=(v=m.vendor)==null?void 0:v.contacts)==null?void 0:_.length)>0&&N(Li,{to:bt("/vendors/:id",{id:m.id}),children:[m.vendor.contacts[0].first_name," ",m.vendor.contacts[0].last_name]})}},{column:"contact_email",id:"id",label:n("contact_name"),format:(g,m)=>m.vendor&&p(Fl,{text:m.vendor.contacts[0].email})},{column:"created_at",id:"created_at",label:n("created_at"),format:g=>go(g,e)},{column:a,id:"custom_value1",label:a,format:g=>s("invoice1",g==null?void 0:g.toString())},{column:l,id:"custom_value2",label:l,format:g=>s("invoice2",g==null?void 0:g.toString())},{column:c,id:"custom_value3",label:c,format:g=>s("invoice3",g==null?void 0:g.toString())},{column:u,id:"custom_value4",label:u,format:g=>s("invoice4",g==null?void 0:g.toString())},{column:"discount",id:"discount",label:n("discount"),format:(g,m)=>{var v,_;return m.is_amount_discount?t(g,(v=m.vendor)==null?void 0:v.country_id,(_=m.vendor)==null?void 0:_.currency_id):`${i(g)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(g,m)=>m.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(g,m)=>p(Hm,{entity:m})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:g=>i(g)}],h=((f=r==null?void 0:r.react_table_columns)==null?void 0:f.purchaseOrder)||jpn;return d.filter(g=>h.includes(g.column)).sort((g,m)=>h.indexOf(g.column)-h.indexOf(m.column))}function Kpn(){const[n]=pe(),e=Dg();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("sent"),value:"sent",color:"white",backgroundColor:e.$1||"#93C5FD"},{label:n("accepted"),value:"accepted",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("cancelled"),value:"cancelled",color:"white",backgroundColor:e.$5||"#e6b05c"}]}function kLr(n={}){const{dropdown:e=!0}=n,[t]=pe(),i=ci(),{isAdmin:r,isOwner:o}=Po(),{isEditPage:s}=N1({entity:"purchase_order"}),[,a]=Yo(kK),l=_pn(),c=wi(),u=vpn(),d=ps(),h=sE(),f=EGe({entity:"purchase_order"}),g=bGe({resource:"purchase_order"}),m=SGe({entity:"purchase_order"}),v=LGe({resource:"purchase_order",downloadType:"download_e_purchase_order"}),{setChangeTemplateResources:_,setChangeTemplateVisible:b,setChangeTemplateEntityContext:y}=QN(),C=E=>{a({...E,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"1",client_id:"",paid_to_date:0,vendor:void 0}),c("/purchase_orders/create?action=clone")};return[E=>p(Ur,{...!e&&{key:"send_email"},entity:"purchase_order",actionKey:"send_email",isCommonActionSection:!e,tooltipText:t("send_email"),to:bt("/purchase_orders/:id/email",{id:E.id}),icon:dme,children:t("send_email")}),E=>p(Ur,{...!e&&{key:"view_pdf"},entity:"purchase_order",actionKey:"view_pdf",isCommonActionSection:!e,tooltipText:t("view_pdf"),to:bt("/purchase_orders/:id/pdf",{id:E.id}),icon:Yj,children:t("view_pdf")}),E=>Sr(E)!==Zi.Deleted&&p(Ur,{...!e&&{key:"print_pdf"},entity:"purchase_order",actionKey:"print_pdf",isCommonActionSection:!e,tooltipText:t("print_pdf"),onClick:()=>f([E.id]),icon:N9e,disablePreventNavigation:!0,children:t("print_pdf")}),E=>E.status_id!==XC.Accepted&&(r||o)&&p(Ur,{...!e&&{key:"schedule"},entity:"purchase_order",actionKey:"schedule",isCommonActionSection:!e,tooltipText:t("schedule"),onClick:()=>m(E.id),icon:cme,children:t("schedule")}),E=>p(AK,{...!e&&{key:"add_comment"},entity:"purchase_order",entityId:E.id,label:`#${E.number}`,labelElement:p(Ur,{entity:"purchase_order",actionKey:"add_comment",isCommonActionSection:!e,tooltipText:t("add_comment"),icon:Gj,children:t("add_comment")})}),E=>p(Ur,{...!e&&{key:"download"},entity:"purchase_order",actionKey:"download",isCommonActionSection:!e,tooltipText:t("download"),onClick:()=>g(E),icon:sS,disablePreventNavigation:!0,children:t("download")}),E=>!!(i!=null&&i.settings.enable_e_invoice)&&p(Ur,{...!e&&{key:"download_e_purchase_order"},entity:"purchase_order",actionKey:"download_e_purchase_order",isCommonActionSection:!e,tooltipText:t("download_e_purchase_order"),onClick:()=>v(E),icon:sS,disablePreventNavigation:!0,children:t("download_e_purchase_order")}),E=>E.status_id!==XC.Accepted&&p(Ur,{...!e&&{key:"mark_sent"},entity:"purchase_order",actionKey:"mark_sent",isCommonActionSection:!e,tooltipText:t("mark_sent"),onClick:()=>u(E),icon:R9e,disablePreventNavigation:!0,children:t("mark_sent")}),E=>!E.expense_id.length&&p(Ur,{...!e&&{key:"convert_to_expense"},entity:"purchase_order",actionKey:"convert_to_expense",isCommonActionSection:!e,tooltipText:t("convert_to_expense"),onClick:()=>l([E.id],"expense"),icon:ext,disablePreventNavigation:!0,children:t("convert_to_expense")}),E=>E.status_id===XC.Accepted&&p(Ur,{...!e&&{key:"add_to_inventory"},entity:"purchase_order",actionKey:"add_to_inventory",isCommonActionSection:!e,tooltipText:t("add_to_inventory"),onClick:()=>l([E.id],"add_to_inventory"),icon:KEt,disablePreventNavigation:!0,children:t("add_to_inventory")}),E=>!!E.expense_id.length&&!h("expense",E.expense)&&p(Ur,{...!e&&{key:"view_expense"},entity:"purchase_order",actionKey:"view_expense",isCommonActionSection:!e,tooltipText:`${t("view")} ${t("expense")}`,onClick:()=>c(bt("/expenses/:id/edit",{id:E.expense_id})),icon:lme,children:`${t("view")} ${t("expense")}`}),E=>p(Ur,{...!e&&{key:"vendor_portal"},entity:"purchase_order",actionKey:"vendor_portal",isCommonActionSection:!e,tooltipText:t("vendor_portal"),onClick:()=>yGe(E),icon:hme,disablePreventNavigation:!0,children:t("vendor_portal")}),()=>p(_i,{withoutPadding:!0}),E=>d("create_purchase_order")&&p(Ur,{...!e&&{key:"clone_to_purchase_order"},entity:"purchase_order",actionKey:"clone_to_purchase_order",isCommonActionSection:!e,tooltipText:t("clone_to_purchase_order"),onClick:()=>C(E),icon:e0,children:t("clone_to_purchase_order")}),E=>p(Bpn,{...!e&&{key:"clone_to_other"},purchaseOrder:E,dropdown:e}),E=>p(Ur,{...!e&&{key:"run_template"},entity:"purchase_order",actionKey:"run_template",isCommonActionSection:!e,tooltipText:t("run_template"),onClick:()=>{b(!0),_([E]),y({endpoint:"/api/v1/purchase_orders/bulk",entity:"purchase_order"})},icon:EN,children:t("run_template")}),()=>s&&p(_i,{withoutPadding:!0}),E=>!E.archived_at&&s&&p(Ur,{...!e&&{key:"archive"},entity:"purchase_order",actionKey:"archive",isCommonActionSection:!e,tooltipText:t("archive"),onClick:()=>l([E.id],"archive"),icon:Ac,excludePreferences:!0,disablePreventNavigation:!0,children:t("archive")}),E=>!!E.archived_at&&s&&p(Ur,{...!e&&{key:"restore"},entity:"purchase_order",actionKey:"restore",isCommonActionSection:!e,tooltipText:t("restore"),onClick:()=>l([E.id],"restore"),icon:Dc,disablePreventNavigation:!0,excludePreferences:!0,children:t("restore")}),E=>!E.is_deleted&&s&&p(Ur,{...!e&&{key:"delete"},entity:"purchase_order",actionKey:"delete",isCommonActionSection:!e,tooltipText:t("delete"),onClick:()=>l([E.id],"delete"),icon:gl,disablePreventNavigation:!0,excludePreferences:!0,children:t("delete")})]}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var Sf=(n=>(n.Viewed="-2",n.Expired="-1",n.Draft="1",n.Sent="2",n.Approved="3",n.Converted="4",n))(Sf||{});/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */class Gpn{constructor(e,t){this.invoice=e,this.currency=t,this.taxCollection=el(),this.lineItems=[],this.items=new Map,this.subTotal=0,this.grossSubTotal=0,this.totalTaxes=0}async process(){var e,t;return!((e=this.invoice)!=null&&e.line_items)||((t=this.invoice.line_items)==null?void 0:t.length)===0?this.items:(this.calculateLineItems(),this)}calculateLineItems(){return this.invoice.line_items.map(e=>{this.item=e,this.cleanLineItem().sumLineItem().setDiscount().calculateTaxes().push()}),this}cleanLineItem(){return this}sumLineItem(){return this.item.line_total=this.item.cost*this.item.quantity+4e-15,this}setDiscount(){if(this.invoice.is_amount_discount)this.item.line_total=parseFloat((this.item.line_total-this.item.discount).toFixed(2));else{const e=this.item.line_total*(this.item.discount/100);this.item.line_total=parseFloat((this.item.line_total-e).toFixed(2))}return this.item.is_amount_discount=this.invoice.is_amount_discount,this}calculateTaxes(){let e=0;const t=this.item.line_total-this.item.line_total*(this.invoice.discount/100),i=this.calculateAmountLineTax(this.item.tax_rate1,t);e+=i,this.item.tax_name1.length>=1&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,i);const r=this.calculateAmountLineTax(this.item.tax_rate2,t);e+=r,this.item.tax_name2.length>=1&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,r);const o=this.calculateAmountLineTax(this.item.tax_rate3,t);return e+=o,this.item.tax_name3.length>=1&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,o),this.item.gross_line_total=this.item.line_total+(isNaN(e)?0:e),this.totalTaxes+=isNaN(e)?0:e,this}groupTax(e,t,i){if(e.length===0)return;let r={};r={key:e+t.toString().replace(" ",""),total:i,name:`${e} ${parseFloat(t.toString())} %`},this.taxCollection.push(el(r))}calculateAmountLineTax(e,t){return Math.round(t*e/100*1e3/10)/100}push(){var e,t;return this.subTotal+=parseFloat((this.item.line_total+4e-15).toFixed(((e=this.currency)==null?void 0:e.precision)||2)),this.subTotal=parseFloat(this.subTotal.toFixed(((t=this.currency)==null?void 0:t.precision)||2)),this.grossSubTotal+=this.item.gross_line_total,this.lineItems.push(this.item),this}calculateTaxesWithAmountDiscount(){this.taxCollection=el(),this.totalTaxes=0,this.lineItems.map((e,t)=>{let i=0;if(this.item=e,e.line_total!=0){const r=this.item.line_total-this.item.line_total*(this.invoice.discount/this.subTotal),o=this.calculateAmountLineTax(this.item.tax_rate1,r);i+=o,o!==0&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,o);const s=this.calculateAmountLineTax(this.item.tax_rate2,r);i+=s,s!==0&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,s);const a=this.calculateAmountLineTax(this.item.tax_rate3,r);i+=a,a!==0&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,a),this.item.gross_line_total=this.item.line_total+(isNaN(i)?0:i),this.item.tax_amount=isNaN(i)?0:i}this.lineItems[t]=this.item,this.totalTaxes+=isNaN(i)?0:i})}}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */class TW{static formatValue(e,t){return Zse(e,t,".","")}}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */class DGe{constructor(e,t){this.invoice=e,this.currency=t,this.taxMap=el(),this.totalTaxMap=[],this.totalDiscount=0,this.total=0,this.totalTaxes=0,this.totalCustomValues=0,this.subTotal=0,this.invoiceItems=new Gpn(this.invoice,this.currency)}build(){return this.calculateLineItems().calculateDiscount().calculateInvoiceTaxes().calculateCustomValues().setTaxMap().calculateTotals().calculateBalance(),this}getTaxMap(){return this.taxMap}calculateLineItems(){return this.invoiceItems.process(),this.invoice.line_items=this.invoiceItems.lineItems,this.total=this.invoiceItems.subTotal,this.subTotal=this.invoiceItems.subTotal,this}calculateDiscount(){return this.totalDiscount=this.discount(this.invoiceItems.subTotal),this.total-=this.totalDiscount,this}peppolSurchargeTaxes(){const e=this.invoice.line_items[0],t=e==null?void 0:e.tax_name1,i=(e==null?void 0:e.tax_rate1)??0,r=this.invoice.custom_surcharge1+this.invoice.custom_surcharge2+this.invoice.custom_surcharge3+this.invoice.custom_surcharge4;if(i>0&&r!=0){const o=Math.round(r*i/100*1e3/10)/100;let s={};s={key:t+i.toString().replace(" ",""),total:o,name:`${t} ${parseFloat(i.toString())} %`},this.invoiceItems.taxCollection.push(el(s))}return this}calculateInvoiceTaxes(){var e,t,i;if(this.invoice.tax_name1.length>=1){let r=this.taxer(this.total,this.invoice.tax_rate1);r+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name1,this.invoice.tax_rate1),this.totalTaxes+=r,this.totalTaxMap.push({name:`${this.invoice.tax_name1} ${parseFloat(this.invoice.tax_rate1.toFixed(((e=this.currency)==null?void 0:e.precision)||2))} %`})}if(this.invoice.tax_name2.length>=1){let r=this.taxer(this.total,this.invoice.tax_rate2);r+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name2,this.invoice.tax_rate2),this.totalTaxes+=r,this.totalTaxMap.push({name:`${this.invoice.tax_name2} ${parseFloat(this.invoice.tax_rate2.toFixed(((t=this.currency)==null?void 0:t.precision)||2))} %`})}if(this.invoice.tax_name3.length>=1){let r=this.taxer(this.total,this.invoice.tax_rate3);r+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name3,this.invoice.tax_rate3),this.totalTaxes+=r,this.totalTaxMap.push({name:`${this.invoice.tax_name3} ${parseFloat(this.invoice.tax_rate3.toFixed(((i=this.currency)==null?void 0:i.precision)||2))} %`})}return this}calculateCustomValues(){return this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge1),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge2),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge3),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge4),this.total+=this.totalCustomValues,this}getSurchargeTaxTotalForKey(e,t){var r,o,s,a;let i=0;return this.invoice.custom_surcharge_tax1&&(i+=parseFloat((this.invoice.custom_surcharge1*(t/100)).toFixed(((r=this.currency)==null?void 0:r.precision)||2))),this.invoice.custom_surcharge_tax2&&(i+=parseFloat((this.invoice.custom_surcharge2*(t/100)).toFixed(((o=this.currency)==null?void 0:o.precision)||2))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(((s=this.currency)==null?void 0:s.precision)||2))),this.invoice.custom_surcharge_tax4&&(i+=parseFloat((this.invoice.custom_surcharge4*(t/100)).toFixed(((a=this.currency)==null?void 0:a.precision)||2))),i}setTaxMap(){this.invoice.is_amount_discount&&(this.invoiceItems.calculateTaxesWithAmountDiscount(),this.invoice.line_items=this.invoiceItems.lineItems),this.invoice.tax_name1.length==0&&this.invoice.custom_surcharge1!=0&&this.invoice.custom_surcharge_tax1&&this.peppolSurchargeTaxes(),this.taxMap=el();let e=el();return e=this.invoiceItems.taxCollection.pluck("items"),e.pluck("key").unique().map(i=>{const r=e.filter(s=>s.key===i).pluck("name").first(),o=e.filter(s=>s.key===i).sum("total");this.taxMap.push({name:r,total:o})}),this.totalTaxes+=this.invoiceItems.totalTaxes,this}calculateTotals(){var e;return this.total+=this.totalTaxes,this.total.toFixed(((e=this.currency)==null?void 0:e.precision)||2),this}calculateBalance(){return this.setCalculatedAttributes(),this}setCalculatedAttributes(){var e,t;return this.invoice.amount=parseFloat(TW.formatValue(this.total,((e=this.currency)==null?void 0:e.precision)||2)),this.invoice.balance=parseFloat(TW.formatValue(this.total,((t=this.currency)==null?void 0:t.precision)||2))-(this.invoice.paid_to_date??0),this.invoice.total_taxes=this.totalTaxes,this}getBalanceDue(){return this.invoice.partial&&this.invoice.partial>0?Math.min(this.invoice.partial,this.invoice.balance):this.invoice.balance}discount(e){var t;return this.invoice.is_amount_discount?this.invoice.discount:parseFloat((e*(this.invoice.discount/100)).toFixed(((t=this.currency)==null?void 0:t.precision)||2))}taxer(e,t){return Math.round(e*((t??0)/100)*1e3/10)/100}valuer(e){return typeof e=="number"?e:0}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ypn(){const n=_o(),e=Fi(tu);return t=>{ce.processing(),Ae("PUT",Te("/api/v1/quotes/:id?approve=true",{id:t.id}),t).then(()=>{ce.success("approved_quote"),En(["quotes"]),e&&n.invalidateQueries([e])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Qpn={convert_to_invoice:"converted_quote",convert_to_project:"converted_quote",email:"emailed_quotes",mark_sent:"marked_quote_as_sent"},AGe=n=>{const{onSuccess:e}=n||{},t=wi(),i=_o(),r=Fi(tu);return(o,s,a)=>{ce.processing(),Ae("POST",Te("/api/v1/quotes/bulk"),{action:s,ids:o,...a}).then(l=>{const c=Qpn[s]||`${s}d_quote`;s==="approve"?ce.success(Ms("approved_quotes",{value:o.length})):ce.success(c),En(["quotes"]),r&&i.invalidateQueries([r]),s==="convert_to_invoice"&&En(["invoices"]),s==="convert_to_project"&&(En(["projects"]),t(bt("/projects/:id",{id:l.data.data[0].project_id}))),e==null||e()})}};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Xpn(){const n=_o(),e=Fi(tu);return t=>{ce.processing(),Ae("PUT",Te("/api/v1/quotes/:id?mark_sent=true",{id:t.id}),t).then(()=>{ce.success("quote_sent"),En(["quotes"]),e&&n.invalidateQueries([e])})}}function Zpn(n){const[e]=pe(),{status_id:t,is_deleted:i,archived_at:r,invoice_id:o,invitations:s}=n.entity,a=Dg(),l=()=>s==null?void 0:s.some(f=>f.viewed_date),c=t===Sf.Approved||t===Sf.Converted,u=!c,d=l(),h=t===Sf.Expired;return i?p(pr,{variant:"red",children:e("deleted")}):r?p(pr,{variant:"orange",children:e("archived")}):o?p(pr,{variant:"green",style:{backgroundColor:a.$3},children:e("converted")}):h?p(pr,{variant:"red",style:{backgroundColor:a.$5},children:e("expired")}):d&&u&&!c?p(pr,{variant:"yellow",children:e("viewed")}):t===Sf.Draft?p(pr,{variant:"generic",children:e("draft")}):t===Sf.Sent?p(pr,{variant:"light-blue",style:{backgroundColor:a.$1},children:e("sent")}):t===Sf.Approved?p(pr,{variant:"dark-blue",style:{backgroundColor:a.$2},children:e("approved")}):p(dt,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */class Jpn{constructor(e){this.invoice=e,this.taxCollection=el(),this.lineItems=[],this.items=new Map,this.subTotal=0,this.grossSubTotal=0,this.totalTaxes=0}async process(){var e,t;return!((e=this.invoice)!=null&&e.line_items)||((t=this.invoice.line_items)==null?void 0:t.length)===0?this.items:(this.calculateLineItems(),this)}calculateLineItems(){return this.invoice.line_items.map(e=>{this.item=e,this.cleanLineItem().sumLineItem().setDiscount().calculateTaxes().push()}),this}cleanLineItem(){return this}sumLineItem(){return this.item.line_total=this.item.cost*this.item.quantity,this}setDiscount(){return this.invoice.is_amount_discount?this.item.line_total=parseFloat((this.item.line_total-this.item.discount).toFixed(2)):this.item.line_total=parseFloat((this.item.line_total-this.item.line_total*(this.item.discount/100)).toFixed(2)),this.item.is_amount_discount=this.invoice.is_amount_discount,this}calculateTaxes(){let e=0;const t=this.item.line_total-this.item.line_total*(this.invoice.discount/100),i=this.calcInclusiveLineTax(this.item.tax_rate1,t);e+=i,this.item.tax_name1.length>=1&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,i);const r=this.calcInclusiveLineTax(this.item.tax_rate2,t);e+=r,this.item.tax_name2.length>=1&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,r);const o=this.calcInclusiveLineTax(this.item.tax_rate3,t);return e+=o,this.item.tax_name3.length>=1&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,o),this.item.gross_line_total=this.item.line_total,this.totalTaxes+=e,this}groupTax(e,t,i){let r={};r={key:e+t.toString().replace(" ",""),total:i,name:`${e} ${parseFloat(t.toString())} %`},this.taxCollection.push(el(r))}calcInclusiveLineTax(e,t){return t-t/(1+e/100)}push(){return this.subTotal+=this.item.line_total,this.grossSubTotal+=this.item.gross_line_total,this.lineItems.push(this.item),this}calculateTaxesWithAmountDiscount(){this.taxCollection=el(),this.lineItems.map((e,t)=>{let i=0;if(this.item=e,e.line_total>0){const r=this.subTotal>0?this.item.line_total-this.invoice.discount*(this.item.line_total/this.subTotal):0,o=this.calcInclusiveLineTax(this.item.tax_rate1,r);i+=o,o!==0&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,o);const s=this.calcInclusiveLineTax(this.item.tax_rate2,r);i+=s,s!==0&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,s);const a=this.calcInclusiveLineTax(this.item.tax_rate3,r);i+=a,a!==0&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,a),this.item.gross_line_total=this.item.line_total,this.item.tax_amount=isNaN(i)?0:i}this.lineItems[t]=this.item,this.totalTaxes+=i})}}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */class NGe{constructor(e,t){this.invoice=e,this.currency=t,this.taxMap=el(),this.totalTaxMap=[],this.totalDiscount=0,this.total=0,this.totalTaxes=0,this.totalCustomValues=0,this.subTotal=0,this.invoiceItems=new Jpn(this.invoice)}build(){return this.calculateLineItems().calculateDiscount().calculateCustomValues().calculateInvoiceTaxes().setTaxMap().calculateTotals().calculateBalance(),this}calculateLineItems(){return this.invoiceItems.process(),this.invoice.line_items=this.invoiceItems.lineItems,this.total=this.invoiceItems.subTotal,this.subTotal=this.invoiceItems.subTotal,this}calculateDiscount(){return this.totalDiscount=this.discount(this.invoiceItems.subTotal),this.total-=this.totalDiscount,this}calculateInvoiceTaxes(){var t,i,r;let e=this.total;if(this.invoice.discount>0&&this.invoice.is_amount_discount&&(e=this.subTotal-this.invoice.discount),this.invoice.discount>0&&!this.invoice.is_amount_discount&&(e=this.subTotal-this.subTotal*(this.invoice.discount/100)),this.invoice.tax_rate1>0){const o=this.calcInclusiveLineTax(e,this.invoice.tax_rate1);this.totalTaxes+=o,this.totalTaxMap.push({name:`${this.invoice.tax_name1} ${parseFloat(this.invoice.tax_rate1.toFixed(((t=this.currency)==null?void 0:t.precision)||2))} %`})}if(this.invoice.tax_rate2>0){const o=this.calcInclusiveLineTax(e,this.invoice.tax_rate2);this.totalTaxes+=o,this.totalTaxMap.push({name:`${this.invoice.tax_name2} ${parseFloat(this.invoice.tax_rate2.toFixed(((i=this.currency)==null?void 0:i.precision)||2))} %`})}if(this.invoice.tax_rate3>0){const o=this.calcInclusiveLineTax(e,this.invoice.tax_rate3);this.totalTaxes+=o,this.totalTaxMap.push({name:`${this.invoice.tax_name3} ${parseFloat(this.invoice.tax_rate3.toFixed(((r=this.currency)==null?void 0:r.precision)||2))} %`})}return this}getTaxMap(){return this.taxMap}calculateCustomValues(){return this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge1),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge2),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge3),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge4),this.total+=this.totalCustomValues,this}getSurchargeTaxTotalForKey(e,t){var r,o,s,a;let i=0;return this.invoice.custom_surcharge_tax1&&(i+=parseFloat((this.invoice.custom_surcharge1*(t/100)).toFixed(((r=this.currency)==null?void 0:r.precision)||2))),this.invoice.custom_surcharge_tax2&&(i+=parseFloat((this.invoice.custom_surcharge2*(t/100)).toFixed(((o=this.currency)==null?void 0:o.precision)||2))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(((s=this.currency)==null?void 0:s.precision)||2))),this.invoice.custom_surcharge_tax4&&(i+=parseFloat((this.invoice.custom_surcharge4*(t/100)).toFixed(((a=this.currency)==null?void 0:a.precision)||2))),i}setTaxMap(){this.invoice.is_amount_discount&&(this.invoiceItems.calculateTaxesWithAmountDiscount(),this.invoice.line_items=this.invoiceItems.lineItems),this.taxMap=el();let e=el();return e=this.invoiceItems.taxCollection.pluck("items"),e.pluck("key").unique().map(i=>{const r=e.filter(s=>s.key===i).pluck("name").first(),o=e.filter(s=>s.key===i).sum("total");this.taxMap.push({name:r,total:o}),this.totalTaxes+=o}),this}calculateTotals(){var e;return this.totalTaxes=Number(this.totalTaxes.toFixed(((e=this.currency)==null?void 0:e.precision)||2)),this}calculateBalance(){return this.setCalculatedAttributes(),this}setCalculatedAttributes(){var e,t;return this.invoice.amount=parseFloat(TW.formatValue(this.total,((e=this.currency)==null?void 0:e.precision)||2)),this.invoice.balance=parseFloat(TW.formatValue(this.total,((t=this.currency)==null?void 0:t.precision)||2))-(this.invoice.paid_to_date??0),this.invoice.total_taxes=this.totalTaxes,this}getBalanceDue(){return this.invoice.partial&&this.invoice.partial>0?Math.min(this.invoice.partial,this.invoice.balance):this.invoice.balance}discount(e){var t;return this.invoice.is_amount_discount?this.invoice.discount:parseFloat((e*(this.invoice.discount/100)).toFixed(((t=this.currency)==null?void 0:t.precision)||2))}taxer(e,t){var i;return parseFloat((e*((t??0)/100)).toFixed(((i=this.currency)==null?void 0:i.precision)||2))}valuer(e){return typeof e=="number"?e:0}calcInclusiveLineTax(e,t){return e-e/(1+t/100)}}const egn=n=>{const[e]=pe(),[t,i]=w.useState(!1),{selectedIds:r,setSelected:o,dropdown:s}=n,a=ni(),l=AGe();return N(dt,{children:[p(Ur,{entity:"quote",actionKey:"convert_to_project",isCommonActionSection:!s,tooltipText:e("convert_to_project"),onClick:()=>i(!0),icon:sxt,disablePreventNavigation:n.disablePreventNavigation,children:e("convert_to_project")}),N(Ui,{title:e("convert_to_project"),visible:t,onClose:()=>i(!1),children:[p("span",{className:"text-lg",style:{backgroundColor:a.$2,color:a.$3,colorScheme:a.$0},children:e("are_you_sure")}),p("div",{className:"flex justify-end space-x-4 mt-5",children:p(Gt,{behavior:"button",onClick:()=>{l(r,"convert_to_project"),o==null||o([]),i(!1)},children:p("span",{className:"text-base mx-3",children:e("yes")})})})]})]})};function tgn(n){const[e]=pe(),t=wi(),{quote:i,dropdown:r}=n,o=ps(),s=Ar(A1),a=Ar(Cbe),l=Ar(DK),c=Ar(kK),u=ji(),[d,h]=w.useState(!1),f=()=>{a({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),due_date:"",partial_due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",paid_to_date:0,design_id:u.settings.credit_design_id}),t("/credits/create?action=clone")},g=()=>{l({...i,id:"",number:"",documents:[],frequency_id:"5",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",due_date:"",partial_due_date:"",design_id:u.settings.invoice_design_id}),t("/recurring_invoices/create?action=clone")},m=()=>{c({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"1",vendor_id:"",due_date:"",partial_due_date:"",design_id:u.settings.purchase_order_design_id}),t("/purchase_orders/create?action=clone")},v=()=>{s({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",paid_to_date:0,partial_due_date:"",design_id:u.settings.invoice_design_id}),t("/invoices/create?action=clone")};return N(dt,{children:[(o("create_invoice")||o("create_credit")||o("create_recurring_invoice")||o("create_purchase_order"))&&p(Ur,{entity:"quote",actionKey:"clone_to_other",isCommonActionSection:!r,tooltipText:e("clone_to_other"),onClick:()=>h(!0),icon:e0,children:e("clone_to_other")}),p(Ui,{title:e("clone_to"),visible:d,onClose:()=>h(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:p("div",{className:"flex justify-center",children:N("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[o("create_invoice")&&p(mm,{label:e("invoice"),icon:oS,onClick:v}),o("create_credit")&&p(mm,{label:e("credit"),icon:oS,onClick:f}),o("create_recurring_invoice")&&p(mm,{label:e("recurring_invoice"),icon:_H,onClick:g}),o("create_purchase_order")&&p(mm,{label:e("purchase_order"),icon:Fme,onClick:m})]})})})]})}function ILr(n){const e=JS(),t=ci(),[i,r]=Yo(LK),[,o]=Yo(Mpn),s=(f,g)=>{r(m=>m&&{...m,[f]:g})};return{handleChange:s,handleInvitationChange:(f,g)=>{let m=[...i.invitations];const v=(m==null?void 0:m.find(_=>_.client_contact_id===f))||-1;if(v!==-1&&g===!1&&(m=m.filter(_=>_.client_contact_id!==f)),v===-1){const _={client_contact_id:f};m.push(_)}s("invitations",m)},handleLineItemChange:(f,g)=>{const m=(i==null?void 0:i.line_items)||[];m[f]=g,r(v=>v&&{...v,line_items:m})},handleLineItemPropertyChange:(f,g,m)=>{const v=(i==null?void 0:i.line_items)||[];v[m][f]=g,r(_=>_&&{..._,line_items:v})},handleCreateLineItem:f=>{r(g=>g&&{...g,line_items:[...g.line_items,{...oE(),type_id:f,quantity:1}]})},handleDeleteLineItem:f=>{const g=(i==null?void 0:i.line_items)||[];g.splice(f,1),r(m=>m&&{...m,line_items:g})},calculateInvoiceSum:f=>{var m;const g=e(((m=n.client)==null?void 0:m.settings.currency_id)||(t==null?void 0:t.settings.currency_id));if(g&&f){const v=f.uses_inclusive_taxes?new NGe(f,g).build():new DGe(f,g).build();o(v)}}}}function LLr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=GS(),o=wi(),s=Tu(),a=Ar(aE);return async l=>{ce.processing(),e(void 0),await s(!0);let c="/api/v1/quotes?";t?(c+="save_default_terms=true",i&&(c+="&save_default_footer=true")):i&&(c+="save_default_footer=true"),Ae("POST",Te(c),l).then(async u=>{(t||i)&&await r(),ce.success("created_quote"),En(["quotes"]),o(bt("/quotes/:id/edit",{id:u.data.data.id}))}).catch(u=>{var d;if(((d=u.response)==null?void 0:d.status)===422){const h=u.response.data;h.errors.amount?ce.error(h.errors.amount[0]):ce.dismiss(),e(h)}}).finally(()=>a(void 0))}}function DLr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=GS(),o=Ar(aE),s=Tu();return async a=>{ce.processing(),e(void 0),await s(!0);let l="/api/v1/quotes/:id?";t?(l+="save_default_terms=true",i&&(l+="&save_default_footer=true")):i&&(l+="save_default_footer=true"),Ae("PUT",Te(l,{id:a.id}),a).then(async()=>{(t||i)&&await r(),ce.success("updated_quote"),En(["quotes"])}).catch(c=>{var u;if(((u=c.response)==null?void 0:u.status)===422){const d=c.response.data;d.errors.amount?ce.error(d.errors.amount[0]):ce.dismiss(),e(d)}}).finally(()=>o(void 0))}}function ALr(n){const[e]=pe(),{showCommonBulkAction:t,showEditAction:i,dropdown:r=!0}=n||{},o=Ar(LK),s=ci(),{isAdmin:a,isOwner:l}=Po(),{isEditPage:c}=N1({entity:"quote",editPageTabs:["documents","settings","activity","history","email_history"]}),u=Ypn(),d=AGe(),h=wi(),f=Xpn(),g=ps(),m=EGe({entity:"quote"}),v=bGe({resource:"quote"}),_=LGe({resource:"quote",downloadType:"download_e_quote"}),b=SGe({entity:"quote"}),{setChangeTemplateResources:y,setChangeTemplateVisible:C,setChangeTemplateEntityContext:x}=QN(),E=L=>{o({...L,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",paid_to_date:0}),h("/quotes/create?action=clone")};return[L=>!!i&&p(tn,{to:bt("/quotes/:id/edit",{id:L.id}),icon:p(vt,{element:_F}),children:e("edit")}),()=>!!i&&p(_i,{withoutPadding:!0}),L=>p(Ur,{...!r&&{key:"view_pdf"},entity:"quote",actionKey:"view_pdf",isCommonActionSection:!r,tooltipText:e("view_pdf"),to:bt("/quotes/:id/pdf",{id:L.id}),icon:Yj,children:e("view_pdf")}),L=>Sr(L)!==Zi.Deleted&&p(Ur,{...!r&&{key:"print_pdf"},entity:"quote",actionKey:"print_pdf",isCommonActionSection:!r,tooltipText:e("print_pdf"),onClick:()=>m([L.id]),icon:N9e,disablePreventNavigation:!0,children:e("print_pdf")}),L=>p(Ur,{...!r&&{key:"download_pdf"},entity:"quote",actionKey:"download_pdf",isCommonActionSection:!r,tooltipText:e("download_pdf"),onClick:()=>v(L),icon:sS,disablePreventNavigation:!0,children:e("download_pdf")}),L=>!!(s!=null&&s.settings.enable_e_invoice)&&p(Ur,{...!r&&{key:"download_e_quote"},entity:"quote",actionKey:"download_e_quote",isCommonActionSection:!r,tooltipText:e("download_e_quote"),onClick:()=>_(L),icon:sS,disablePreventNavigation:!0,children:e("download_e_quote")}),L=>L.status_id!==Sf.Converted&&L.status_id!==Sf.Approved&&(a||l)&&p(Ur,{...!r&&{key:"schedule"},entity:"quote",actionKey:"schedule",isCommonActionSection:!r,tooltipText:e("schedule"),onClick:()=>b(L.id),icon:cme,children:e("schedule")}),L=>p(AK,{...!r&&{key:"add_comment"},entity:"quote",entityId:L.id,label:`#${L.number}`,labelElement:p(Ur,{entity:"quote",actionKey:"add_comment",isCommonActionSection:!r,tooltipText:e("add_comment"),icon:Gj,children:e("add_comment")})}),L=>p(Ur,{...!r&&{key:"email_quote"},entity:"quote",actionKey:"email_quote",isCommonActionSection:!r,tooltipText:e("email_quote"),to:bt("/quotes/:id/email",{id:L.id}),icon:dme,children:e("email_quote")}),L=>p(Ur,{...!r&&{key:"client_portal"},entity:"quote",actionKey:"client_portal",isCommonActionSection:!r,tooltipText:e("client_portal"),onClick:()=>L&&yGe(L),icon:hme,disablePreventNavigation:!0,children:e("client_portal")}),L=>L.status_id===Sf.Draft&&p(Ur,{...!r&&{key:"mark_sent"},entity:"quote",actionKey:"mark_sent",isCommonActionSection:!r,tooltipText:e("mark_sent"),onClick:()=>f(L),icon:R9e,disablePreventNavigation:!0,children:e("mark_sent")}),L=>(L.status_id===Sf.Draft||L.status_id===Sf.Sent)&&p(Ur,{...!r&&{key:"approve"},entity:"quote",actionKey:"approve",isCommonActionSection:!r,tooltipText:e("approve"),onClick:()=>u(L),icon:sme,disablePreventNavigation:!0,children:e("approve")}),L=>L.status_id!==Sf.Converted&&g("create_invoice")&&p(Ur,{...!r&&{key:"convert_to_invoice"},entity:"quote",actionKey:"convert_to_invoice",isCommonActionSection:!r,tooltipText:e("convert_to_invoice"),onClick:()=>d([L.id],"convert_to_invoice"),icon:i2t,disablePreventNavigation:!0,children:e("convert_to_invoice")}),L=>!L.project_id&&g("create_project")&&p(egn,{...!r&&{key:"convert_to_project"},selectedIds:[L.id],disablePreventNavigation:!0,dropdown:r}),L=>p(Ur,{...!r&&{key:"run_template"},entity:"quote",actionKey:"run_template",isCommonActionSection:!r,tooltipText:e("run_template"),onClick:()=>{C(!0),y([L]),x({endpoint:"/api/v1/quotes/bulk",entity:"quote"})},icon:EN,children:e("run_template")}),()=>p(_i,{withoutPadding:!0}),L=>g("create_quote")&&p(Ur,{...!r&&{key:"clone_to_quote"},entity:"quote",actionKey:"clone_to_quote",isCommonActionSection:!r,tooltipText:e("clone_to_quote"),onClick:()=>E(L),icon:e0,children:e("clone_to_quote")}),L=>p(tgn,{...!r&&{key:"clone_to_other"},dropdown:r,quote:L}),()=>(c||!!t)&&p(_i,{withoutPadding:!0}),L=>(c||!!t)&&L.archived_at===0&&p(Ur,{...!r&&{key:"archive"},entity:"quote",actionKey:"archive",isCommonActionSection:!r,tooltipText:e("archive"),onClick:()=>d([L.id],"archive"),icon:Ac,excludePreferences:!0,disablePreventNavigation:!0,children:e("archive")}),L=>(c||!!t)&&L.archived_at>0&&p(Ur,{...!r&&{key:"restore"},entity:"quote",actionKey:"restore",isCommonActionSection:!r,tooltipText:e("restore"),onClick:()=>d([L.id],"restore"),icon:Dc,excludePreferences:!0,disablePreventNavigation:!0,children:e("restore")}),L=>(c||!!t)&&!(L!=null&&L.is_deleted)&&p(Ur,{...!r&&{key:"delete"},entity:"quote",actionKey:"delete",isCommonActionSection:!r,tooltipText:e("delete"),onClick:()=>d([L.id],"delete"),icon:gl,excludePreferences:!0,disablePreventNavigation:!0,children:e("delete")})]}const ngn=["status","number","client","amount","date","valid_until"];function ign(){const[n,e,t,i]=cp({entity:"invoice"});return["status","number","client","amount","date","valid_until","archived_at","client_city","client_country","client_postal_code","client_state","contact_email","contact_name","created_at",n,e,t,i,"discount","documents","entity_state","exchange_rate","is_deleted","is_viewed","last_sent_date","partial","partial_due_date","po_number","private_notes","public_notes","tax_amount","updated_at"]}function NLr(){var b;const{t:n}=pe(),{dateFormat:e}=lc();ign();const t=vo(),i=wi(),r=a6(),o=ps(),s=sE(),a=tf(),l=Ha(),c=ZS(),u=Zk(),d=w.useCallback(y=>{let C="";return y.invitations.map(x=>{x.viewed_date&&(C=x.viewed_date)}),C},[]),[h,f,g,m]=cp({entity:"invoice"}),v=[{column:"status",id:"status_id",label:n("status"),format:(y,C)=>N("div",{className:"flex items-center space-x-2",children:[p(Zpn,{entity:C}),C.status_id===Sf.Converted&&C.invoice_id&&p(vbe,{entityId:C.invoice_id,cacheEndpoint:"/api/v1/invoices",apiEndpoint:"/api/v1/invoices/:id?include=client.group_settings",preCheck:o("view_invoice")||o("edit_invoice"),component:p(Pk,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>i(bt("/invoices/:id/edit",{id:C.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(y,C)=>N("div",{className:"flex space-x-2",children:[p(Rf,{to:bt("/quotes/:id/edit",{id:C.id}),renderSpan:s("quote",C),children:y}),p(pbe,{text:C.number})]})},{column:"client",id:"client_id",label:n("client"),format:(y,C)=>{var x;return p(Rf,{to:bt("/clients/:id",{id:C.client_id}),renderSpan:s("client",C.client),children:(x=C.client)==null?void 0:x.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(y,C)=>{var x,E;return a(y,(x=C.client)==null?void 0:x.country_id,(E=C.client)==null?void 0:E.settings.currency_id)}},{column:"date",id:"date",label:n("date"),format:y=>go(y,e)},{column:"valid_until",id:"due_date",label:n("valid_until"),format:(y,C)=>go(C.due_date,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:y=>go(y,e)},{column:"client_city",id:"client_id",label:n("client_city"),format:(y,C)=>{var x;return(x=C.client)==null?void 0:x.city}},{column:"client_country",id:"client_id",label:n("client_country"),format:(y,C)=>{var x,E,k;return((x=C.client)==null?void 0:x.country_id)&&((k=c((E=C.client)==null?void 0:E.country_id))==null?void 0:k.name)}},{column:"client_postal_code",id:"client_id",label:n("client_postal_code"),format:(y,C)=>{var x;return(x=C.client)==null?void 0:x.postal_code}},{column:"client_state",id:"client_id",label:n("client_state"),format:(y,C)=>{var x;return(x=C.client)==null?void 0:x.state}},{column:"contact_email",id:"client_id",label:n("contact_email"),format:(y,C)=>{var x;return C.client&&C.client.contacts.length>0&&p(Fl,{text:(x=C.client)==null?void 0:x.contacts[0].email})}},{column:"contact_name",id:"client_id",label:n("contact_name"),format:(y,C)=>{var x,E;return C.client&&C.client.contacts.length>0&&`${(x=C.client)==null?void 0:x.contacts[0].first_name} ${(E=C.client)==null?void 0:E.contacts[0].last_name}`}},{column:"created_at",id:"created_at",label:n("created_at"),format:y=>go(y,e)},{column:h,id:"custom_value1",label:h,format:y=>u("invoice1",y==null?void 0:y.toString())},{column:f,id:"custom_value2",label:f,format:y=>u("invoice2",y==null?void 0:y.toString())},{column:g,id:"custom_value3",label:g,format:y=>u("invoice3",y==null?void 0:y.toString())},{column:m,id:"custom_value4",label:m,format:y=>u("invoice4",y==null?void 0:y.toString())},{column:"discount",id:"discount",label:n("discount"),format:(y,C)=>{var x,E;return C.is_amount_discount?a(y,(x=C.client)==null?void 0:x.country_id,(E=C.client)==null?void 0:E.settings.currency_id):`${r(y)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(y,C)=>C.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(y,C)=>p(Hm,{entity:C})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:y=>r(y)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(y,C)=>C.is_deleted?n("yes"):n("no")},{column:"is_viewed",id:"id",label:n("is_viewed"),format:(y,C)=>d(C).length>0?go(d(C),e):n("no")},{column:"last_sent_date",id:"last_sent_date",label:n("last_sent_date"),format:y=>go(y,e)},{column:"partial",id:"partial",label:n("partial"),format:(y,C)=>{var x,E;return a(y,(x=C.client)==null?void 0:x.country_id,(E=C.client)==null?void 0:E.settings.currency_id)}},{column:"partial_due_date",id:"partial_due_date",label:n("partial_due_date"),format:y=>go(y,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:y=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(y)}})}),children:p("span",{children:r0(Xc(y)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:y=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(y)}})}),children:p("span",{children:r0(Xc(y)).slice(0,50)})})},{column:"tax_amount",id:"total_taxes",label:n("total_taxes"),format:(y,C)=>{var x,E;return a(y,(x=C.client)==null?void 0:x.country_id,(E=C.client)==null?void 0:E.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("last_updated"),format:y=>go(y,e)}],_=((b=l==null?void 0:l.react_table_columns)==null?void 0:b.quote)||ngn;return v.filter(y=>_.includes(y.column)).sort((y,C)=>_.indexOf(y.column)-_.indexOf(C.column))}function rgn(){const[n]=pe(),e=Dg();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("sent"),value:"sent",color:"white",backgroundColor:e.$1||"#93C5FD"},{label:n("approved"),value:"approved",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("expired"),value:"expired",color:"white",backgroundColor:e.$5||"#DC2626"},{label:n("upcoming"),value:"upcoming",color:"white",backgroundColor:e.$4||"#e6b05c"},{label:n("converted"),value:"converted",color:"white",backgroundColor:e.$3||"#22C55E"}]}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var ZC=(n=>(n.DRAFT="1",n.ACTIVE="2",n.PAUSED="3",n.COMPLETED="4",n.PENDING="-1",n))(ZC||{});function ogn(n){const[e]=pe(),t=Dg(),{status_id:i,is_deleted:r,archived_at:o,last_sent_date:s,remaining_cycles:a}=n.entity,l=i===ZC.DRAFT,c=!!r,u=!!o,d=i===ZC.ACTIVE&&!s,h=a===-1?"endless":a;return c?p(pr,{variant:"red",children:e("deleted")}):u?p(pr,{variant:"orange",children:e("archived")}):!l&&h===0?p(pr,{variant:"light-blue",style:{backgroundColor:t.$1},children:e("completed")}):d?p(pr,{variant:"dark-blue",style:{backgroundColor:t.$2},children:e("pending")}):l?p(pr,{variant:"generic",children:e("draft")}):i===ZC.ACTIVE?p(pr,{variant:"green",style:{backgroundColor:t.$3},children:e("active")}):i===ZC.PAUSED?p(pr,{variant:"orange",style:{backgroundColor:t.$4},children:e("paused")}):p(dt,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var mf=(n=>(n.FREQUENCY_DAILY="1",n.FREQUENCY_WEEKLY="2",n.FREQUENCY_TWO_WEEKS="3",n.FREQUENCY_FOUR_WEEKS="4",n.FREQUENCY_MONTHLY="5",n.FREQUENCY_TWO_MONTHS="6",n.FREQUENCY_THREE_MONTHS="7",n.FREQUENCY_FOUR_MONTHS="8",n.FREQUENCY_SIX_MONTHS="9",n.FREQUENCY_ANNUALLY="10",n.FREQUENCY_TWO_YEARS="11",n.FREQUENCY_THREE_YEARS="12",n.RECURS_INDEFINITELY="-1",n))(mf||{});/** * Invoice Ninja (https://invoiceninja.com). * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const sgn={[mf.FREQUENCY_ANNUALLY]:"freq_annually",[mf.FREQUENCY_DAILY]:"freq_daily",[mf.FREQUENCY_FOUR_MONTHS]:"freq_four_months",[mf.FREQUENCY_FOUR_WEEKS]:"freq_four_weeks",[mf.FREQUENCY_MONTHLY]:"freq_monthly",[mf.FREQUENCY_SIX_MONTHS]:"freq_six_months",[mf.FREQUENCY_THREE_MONTHS]:"freq_three_months",[mf.FREQUENCY_THREE_YEARS]:"freq_three_years",[mf.FREQUENCY_TWO_MONTHS]:"freq_two_months",[mf.FREQUENCY_TWO_WEEKS]:"freq_two_weeks",[mf.FREQUENCY_TWO_YEARS]:"freq_two_years",[mf.FREQUENCY_WEEKLY]:"freq_weekly",[mf.RECURS_INDEFINITELY]:"freq_indefinetley"};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function RLr(n){return Ti(["/api/v1/recurring_invoices",n.id],()=>Ae("GET",Te("/api/v1/recurring_invoices/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:!!n.id})}function OLr(n){const e=ps();return Ti(["/api/v1/recurring_invoices","create"],()=>Ae("GET",Te("/api/v1/recurring_invoices/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_recurring_invoice")?(n==null?void 0:n.enabled)??!0:!1})}const agn={start:"started_recurring_invoice",stop:"stopped_recurring_invoice",update_prices:"updated_prices",increase_prices:"updated_prices",bulk_update:"updated_records"};function NK(n){const e=_o(),t=Fi(tu),{onSuccess:i,setErrors:r}=n||{};return async(o,s,a)=>(ce.processing(),Ae("POST",Te("/api/v1/recurring_invoices/bulk"),{action:s,ids:o,...a}).then(()=>{const l=agn[s]||`${s}d_recurring_invoice`;ce.success(l),i==null||i(),t&&e.invalidateQueries([t]),En(["recurring_invoices"])}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(r==null||r(l.response.data),ce.dismiss())}))}const lgn=n=>{const[e]=pe(),[t,i]=w.useState(!1),o=NK({onSuccess:()=>{i(!1)}}),{selectedIds:s,setSelected:a,dropdown:l}=n,c=()=>{o(s,"update_prices"),a==null||a([])};return N(dt,{children:[p(Ur,{entity:"recurring_invoice",actionKey:"update_prices",isCommonActionSection:!l,tooltipText:e("update_prices"),onClick:()=>i(!0),icon:txt,children:e("update_prices")}),N(Ui,{title:e("update_prices"),visible:t,onClose:()=>i(!1),children:[p("span",{className:"text-lg text-gray-900",children:e("are_you_sure")}),p(Gt,{className:"self-end",onClick:c,children:e("yes")})]})]})},cgn=n=>{const[e]=pe(),[t,i]=w.useState(!1),[r,o]=w.useState(0),[s,a]=w.useState(),l=()=>{i(!1),o(0)},c=NK({onSuccess:l,setErrors:a}),{selectedIds:u,setSelected:d,dropdown:h}=n,f=()=>{c(u,"increase_prices",{percentage_increase:r}),d==null||d([])};return N(dt,{children:[p(Ur,{entity:"recurring_invoice",actionKey:"increase_prices",isCommonActionSection:!h,tooltipText:e("increase_prices"),onClick:()=>i(!0),icon:jAt,children:e("increase_prices")}),N(Ui,{title:e("increase_prices"),visible:t,onClose:l,children:[p(wo,{label:e("percent"),value:r||"",onValueChange:g=>{o(parseFloat(g)),s&&a(void 0)},errorMessage:s==null?void 0:s.errors.percentage_increase}),p(Gt,{className:"self-end",onClick:f,children:e("submit")})]})]})};function ugn(n){const[e]=pe(),t=wi(),{recurringInvoice:i,dropdown:r}=n,o=ps(),s=Ar(LK),a=Ar(Cbe),l=Ar(A1),c=Ar(kK),u=ji(),[d,h]=w.useState(!1),f=()=>{l({...i,id:"",documents:[],number:"",due_date:"",partial_due_date:"",date:Un().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",design_id:u.settings.invoice_design_id}),t("/invoices/create?action=clone")},g=()=>{s({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",design_id:u.settings.quote_design_id}),t("/quotes/create?action=clone")},m=()=>{a({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",due_date:"",partial_due_date:"",design_id:u.settings.credit_design_id}),t("/credits/create?action=clone")},v=()=>{c({...i,id:"",number:"",documents:[],date:Un().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"1",vendor_id:"",paid_to_date:0,due_date:"",partial_due_date:"",design_id:u.settings.purchase_order_design_id}),t("/purchase_orders/create?action=clone")};return N(dt,{children:[(o("create_invoice")||o("create_quote")||o("create_credit")||o("create_purchase_order"))&&p(Ur,{entity:"recurring_invoice",actionKey:"clone_to_other",isCommonActionSection:!r,tooltipText:e("clone_to_other"),onClick:()=>h(!0),icon:e0,children:e("clone_to_other")}),p(Ui,{title:e("clone_to"),visible:d,onClose:()=>h(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:p("div",{className:"flex justify-center",children:N("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[o("create_invoice")&&p(mm,{label:e("invoice"),icon:oS,onClick:f}),o("create_quote")&&p(mm,{label:e("quote"),icon:wge,onClick:g}),o("create_credit")&&p(mm,{label:e("credit"),icon:oS,onClick:m}),o("create_purchase_order")&&p(mm,{label:e("purchase_order"),icon:Fme,onClick:v})]})})})]})}var RGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(o,s,a){var l=s.prototype;a.utc=function(m){var v={date:m,utc:!0,args:arguments};return new s(v)},l.utc=function(m){var v=a(this.toDate(),{locale:this.$L,utc:!0});return m?v.add(this.utcOffset(),t):v},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),c.call(this,m)};var u=l.init;l.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else u.call(this)};var d=l.utcOffset;l.utcOffset=function(m,v){var _=this.$utils().u;if(_(m))return this.$u?0:_(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(x){x===void 0&&(x="");var E=x.match(i);if(!E)return null;var k=(""+E[0]).match(r)||["-",0,0],L=k[0],D=60*+k[1]+ +k[2];return D===0?0:L==="+"?D:-D}(m),m===null))return this;var b=Math.abs(m)<=16?60*m:m,y=this;if(v)return y.$offset=b,y.$u=m===0,y;if(m!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(y=this.local().add(b+C,t)).$offset=b,y.$x.$localOffset=C}else y=this.utc();return y};var h=l.format;l.format=function(m){var v=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},l.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(m){return m==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var g=l.diff;l.diff=function(m,v,_){if(m&&this.$u===m.$u)return g.call(this,m,v,_);var b=this.local(),y=a(m).local();return g.call(b,y,v,_)}}})})(RGe);var dgn=RGe.exports;const hgn=nl(dgn);var OGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},i={};return function(r,o,s){var a,l=function(h,f,g){g===void 0&&(g={});var m=new Date(h),v=function(_,b){b===void 0&&(b={});var y=b.timeZoneName||"short",C=_+"|"+y,x=i[C];return x||(x=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:_,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:y}),i[C]=x),x}(f,g);return v.formatToParts(m)},c=function(h,f){for(var g=l(h,f),m=[],v=0;v<g.length;v+=1){var _=g[v],b=_.type,y=_.value,C=t[b];C>=0&&(m[C]=parseInt(y,10))}var x=m[3],E=x===24?0:x,k=m[0]+"-"+m[1]+"-"+m[2]+" "+E+":"+m[4]+":"+m[5]+":000",L=+h;return(s.utc(k).valueOf()-(L-=L%1e3))/6e4},u=o.prototype;u.tz=function(h,f){h===void 0&&(h=a);var g=this.utcOffset(),m=this.toDate(),v=m.toLocaleString("en-US",{timeZone:h}),_=Math.round((m-new Date(v))/1e3/60),b=s(v,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(m.getTimezoneOffset()/15)-_,!0);if(f){var y=b.utcOffset();b=b.add(g-y,"minute")}return b.$x.$timezone=h,b},u.offsetName=function(h){var f=this.$x.$timezone||s.tz.guess(),g=l(this.valueOf(),f,{timeZoneName:h}).find(function(m){return m.type.toLowerCase()==="timezonename"});return g&&g.value};var d=u.startOf;u.startOf=function(h,f){if(!this.$x||!this.$x.$timezone)return d.call(this,h,f);var g=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(g,h,f).tz(this.$x.$timezone,!0)},s.tz=function(h,f,g){var m=g&&f,v=g||f||a,_=c(+s(),v);if(typeof h!="string")return s(h).tz(v);var b=function(E,k,L){var D=E-60*k*1e3,A=c(D,L);if(k===A)return[D,k];var O=c(D-=60*(A-k)*1e3,L);return A===O?[D,A]:[E-60*Math.min(A,O)*1e3,Math.max(A,O)]}(s.utc(h,m).valueOf(),_,v),y=b[0],C=b[1],x=s(y).utcOffset(C);return x.$x.$timezone=v,x},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){a=h}}})})(OGe);var fgn=OGe.exports;const pgn=nl(fgn);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function ggn(){const n=ci(),{data:e}=ed(),[t,i]=w.useState("1"),[r,o]=w.useState("America/Tijuana");return w.useEffect(()=>{if(e!=null&&e.timezones){const s=e.timezones.find(a=>{var l;return a.id===((l=n==null?void 0:n.settings)==null?void 0:l.timezone_id)});s&&(o(s.name),i(s.id))}},[n,e]),{timeZoneId:t,timeZone:r}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */Un.extend(hgn);Un.extend(pgn);function mgn(n){const{formatOnlyTime:e=!1,withTimezone:t=!1,formatOnlyDate:i=!1}=n||{},{timeZone:r}=ggn(),{timeFormat:o}=MN(),{dateFormat:s}=lc();return(a,l,c,u)=>{if(a===0||a===""||a===void 0)return"";let d=`${l||s} ${c||o}`;return i&&(d=l||s),e&&(d=c||o),typeof a=="number"&&!t?Un.unix(a).format(d):typeof a!="number"&&!t?Un(a).format(d):Un.utc(a).tz(u||r).format(d)}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function _gn(){const n=ci(),{data:e}=cGe({perPage:1e3});return(t,i)=>{if(e&&t){if(t.settings[i]!==void 0)return t.settings[i];if(t.group_settings&&t.group_settings.settings[i]!==void 0)return t.group_settings.settings[i];if(t.group_settings_id&&!t.group_settings){const r=e.find(({id:o})=>o===t.group_settings_id);if(r&&r.settings[i]!==void 0)return r.settings[i]}return n.settings[i]}}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function vgn(){const{data:n}=ed();return e=>{if(n!=null&&n.timezones&&e){const t=n.timezones.find(i=>i.id===e);if(t)return{timeZoneId:t.id,timeZone:t.name}}return{timeZoneId:"32",timeZone:"Europe/Lisbon"}}}function PLr(n){const e=JS(),t=ci(),[i,r]=Yo(DK),[,o]=Yo(Fpn),s=(f,g)=>{r(m=>m&&{...m,[f]:g})};return{handleChange:s,handleInvitationChange:(f,g)=>{let m=[...i.invitations];const v=(m==null?void 0:m.find(_=>_.client_contact_id===f))||-1;if(v!==-1&&g===!1&&(m=m.filter(_=>_.client_contact_id!==f)),v===-1){const _={client_contact_id:f};m.push(_)}s("invitations",m)},handleLineItemChange:(f,g)=>{const m=(i==null?void 0:i.line_items)||[];m[f]=g,r(v=>v&&{...v,line_items:m})},handleLineItemPropertyChange:(f,g,m)=>{const v=(i==null?void 0:i.line_items)||[];v[m][f]=g,r(_=>_&&{..._,line_items:v})},handleCreateLineItem:f=>{r(g=>g&&{...g,line_items:[...g.line_items,{...oE(),type_id:f,quantity:1}]})},handleDeleteLineItem:f=>{const g=(i==null?void 0:i.line_items)||[];g.splice(f,1),r(m=>m&&{...m,line_items:g})},calculateInvoiceSum:f=>{var m;const g=e(((m=n.client)==null?void 0:m.settings.currency_id)||(t==null?void 0:t.settings.currency_id));if(g&&f){const v=f.uses_inclusive_taxes?new NGe(f,g).build():new DGe(f,g).build();o(v)}}}}function MLr(n){const{setErrors:e}=n,t=Ar(aE);return(i,r)=>{ce.processing(),e(void 0);const o=r?`/api/v1/recurring_invoices/:id?${r}=true`:"/api/v1/recurring_invoices/:id";Ae("PUT",Te(o,{id:i.id}),i).then(()=>{En(["recurring_invoices"]),ce.success("updated_recurring_invoice")}).catch(s=>{var a;if(((a=s.response)==null?void 0:a.status)===422){const l=s.response.data;l.errors.amount?ce.error(l.errors.amount[0]):ce.dismiss(),e(l)}}).finally(()=>t(void 0))}}function bgn(){const n=_o(),e=Fi(tu);return(t,i)=>{ce.processing(),Ae("PUT",Te(i==="start"?"/api/v1/recurring_invoices/:id?start=true":"/api/v1/recurring_invoices/:id?stop=true",{id:t.id}),t).then(()=>{En(["recurring_invoices"]),e&&n.invalidateQueries([e]),ce.success(i==="start"?"started_recurring_invoice":"stopped_recurring_invoice")})}}function FLr(n){const[e]=pe(),t=NK(),i=wi(),r=ps(),o=bgn(),s=Ar(DK),{showEditAction:a,showCommonBulkActions:l,dropdown:c=!0}=n||{},{isEditPage:u}=N1({entity:"recurring_invoice",editPageTabs:["documents","settings","activity","history","schedule"]}),d=f=>{s({...f,id:"",documents:[],number:""}),i("/recurring_invoices/create?action=clone")};return[f=>!!a&&p(tn,{to:bt("/recurring_invoices/:id/edit",{id:f.id}),icon:p(vt,{element:_F}),children:e("edit")}),()=>!!a&&p(_i,{withoutPadding:!0}),f=>p(Ur,{...!c&&{key:"view_pdf"},entity:"recurring_invoice",actionKey:"view_pdf",isCommonActionSection:!c,tooltipText:e("view_pdf"),to:bt("/recurring_invoices/:id/pdf",{id:f.id}),icon:Yj,children:e("view_pdf")}),f=>(f.status_id===ZC.DRAFT||f.status_id===ZC.PAUSED)&&p(Ur,{...!c&&{key:"start"},entity:"recurring_invoice",actionKey:"start",isCommonActionSection:!c,tooltipText:e("start"),onClick:()=>o(f,"start"),icon:ame,children:e("start")}),f=>f.status_id===ZC.ACTIVE&&p(Ur,{...!c&&{key:"stop"},entity:"recurring_invoice",actionKey:"stop",isCommonActionSection:!c,tooltipText:e("stop"),onClick:()=>o(f,"stop"),icon:ume,children:e("stop")}),f=>!f.is_deleted&&p(lgn,{...!c&&{key:"update_prices"},selectedIds:[f.id],dropdown:c}),f=>!f.is_deleted&&p(cgn,{...!c&&{key:"increase_prices"},selectedIds:[f.id],dropdown:c}),f=>p(AK,{...!c&&{key:"add_comment"},entity:"recurring_invoice",entityId:f.id,label:`#${f.number}`,labelElement:p(Ur,{entity:"recurring_invoice",actionKey:"add_comment",isCommonActionSection:!c,tooltipText:e("add_comment"),icon:Gj,children:e("add_comment")})}),()=>p(_i,{withoutPadding:!0}),f=>r("create_recurring_invoice")&&p(Ur,{...!c&&{key:"clone_to_recurring"},entity:"recurring_invoice",actionKey:"clone_to_recurring",isCommonActionSection:!c,tooltipText:e("clone_to_recurring"),onClick:()=>d(f),icon:e0,children:e("clone_to_recurring")}),f=>p(ugn,{...!c&&{key:"clone_to_other"},recurringInvoice:f,dropdown:c}),()=>(u||!!l)&&p(_i,{withoutPadding:!0}),f=>(u||!!l)&&Sr(f)===Zi.Active&&p(Ur,{...!c&&{key:"archive"},entity:"recurring_invoice",actionKey:"archive",isCommonActionSection:!c,tooltipText:e("archive"),onClick:()=>t([f.id],"archive"),icon:Ac,excludePreferences:!0,disablePreventNavigation:!0,children:e("archive")}),f=>(u||!!l)&&(Sr(f)===Zi.Archived||Sr(f)===Zi.Deleted)&&p(Ur,{...!c&&{key:"restore"},entity:"recurring_invoice",actionKey:"restore",isCommonActionSection:!c,tooltipText:e("restore"),onClick:()=>t([f.id],"restore"),icon:Dc,excludePreferences:!0,disablePreventNavigation:!0,children:e("restore")}),f=>(u||!!l)&&(Sr(f)===Zi.Active||Sr(f)===Zi.Archived)&&p(Ur,{...!c&&{key:"delete"},entity:"recurring_invoice",actionKey:"delete",isCommonActionSection:!c,tooltipText:e("delete"),onClick:()=>t([f.id],"delete"),icon:gl,excludePreferences:!0,disablePreventNavigation:!0,children:e("delete")})]}function BLr({setErrors:n}){const e=wi(),t=Ar(aE);return(i,r)=>{n(void 0),ce.processing();const o=r?`/api/v1/recurring_invoices?${r}=true`:"/api/v1/recurring_invoices";Ae("POST",Te(o),i).then(s=>{ce.success("created_recurring_invoice"),En(["recurring_invoices"]),e(bt("/recurring_invoices/:id/edit",{id:s.data.data.id}))}).catch(s=>{var a;if(((a=s.response)==null?void 0:a.status)===422){const l=s.response.data;l.errors.amount?ce.error(l.errors.amount[0]):ce.dismiss(),n(l)}}).finally(()=>t(void 0))}}const ygn=["status","number","client","amount","remaining_cycles","next_send_date","frequency","due_date_days","auto_bill"];function Cgn(){const[n,e,t,i]=cp({entity:"invoice"});return["status","number","client","amount","remaining_cycles","next_send_date","frequency","due_date_days","auto_bill","archived_at","created_at",n,e,t,i,"discount","documents","entity_state","exchange_rate","is_deleted","po_number","private_notes","public_notes","updated_at"]}function $Lr(){var v;const{t:n}=pe(),{dateFormat:e}=lc(),t=_gn(),i=vgn(),r=a6(),o=sE(),s=mgn({withTimezone:!0});Cgn();const a=tf(),l=Ha(),c=Zk(),[u,d,h,f]=cp({entity:"invoice"}),g=[{column:"status",id:"status_id",label:n("status"),format:(_,b)=>p(ogn,{entity:b})},{column:"number",id:"number",label:n("number"),format:(_,b)=>p(Rf,{to:bt("/recurring_invoices/:id/edit",{id:b.id}),renderSpan:o("recurring_invoice",b),children:_})},{column:"client",id:"client_id",label:n("client"),format:(_,b)=>{var y;return p(Rf,{to:bt("/clients/:id",{id:b.client_id}),renderSpan:o("client",b.client),children:(y=b.client)==null?void 0:y.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(_,b)=>{var y,C;return a(_,(y=b.client)==null?void 0:y.country_id,(C=b.client)==null?void 0:C.settings.currency_id)}},{column:"remaining_cycles",id:"remaining_cycles",label:n("remaining_cycles"),format:_=>Number(_)<0?n("endless"):_},{column:"next_send_date",id:"next_send_datetime",label:n("next_send_date"),format:(_,b)=>s(_,"","",i(t(b.client,"timezone_id")).timeZone)},{column:"frequency",id:"frequency_id",label:n("frequency"),format:_=>p(a3,{for:sgn,code:_,headless:!0})},{column:"due_date_days",id:"due_date_days",label:n("due_date"),format:_=>_==="terms"?n("use_payment_terms"):Number(_)===1?n("first_day_of_the_month"):_},{column:"auto_bill",id:"auto_bill",label:n("auto_bill"),format:_=>n(String(_))},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:_=>go(_,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:_=>go(_,e)},{column:u,id:"custom_value1",label:u,format:_=>c("invoice1",_==null?void 0:_.toString())},{column:d,id:"custom_value2",label:d,format:_=>c("invoice2",_==null?void 0:_.toString())},{column:h,id:"custom_value3",label:h,format:_=>c("invoice3",_==null?void 0:_.toString())},{column:f,id:"custom_value4",label:f,format:_=>c("invoice4",_==null?void 0:_.toString())},{column:"discount",id:"discount",label:n("discount"),format:(_,b)=>{var y,C;return b.is_amount_discount?a(_,(y=b.client)==null?void 0:y.country_id,(C=b.client)==null?void 0:C.settings.currency_id):`${r(_)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(_,b)=>b.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(_,b)=>p(Hm,{entity:b})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:_=>r(_)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:_=>go(_,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:_=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(_)}})}),children:p("span",{children:r0(Xc(_)).slice(0,50)})})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:_=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(_)}})}),children:p("span",{children:r0(Xc(_)).slice(0,50)})})},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:_=>go(_,e)}],m=((v=l==null?void 0:l.react_table_columns)==null?void 0:v.recurringInvoice)||ygn;return g.filter(_=>m.includes(_.column)).sort((_,b)=>m.indexOf(_.column)-m.indexOf(b.column))}function wgn(){const[n]=pe(),e=Dg();return[{label:n("active"),value:"active",color:"white",backgroundColor:e.$3||"#22C55E"},{label:n("paused"),value:"paused",color:"white",backgroundColor:e.$4||"#F97316"},{label:n("completed"),value:"completed",color:"white",backgroundColor:e.$1||"#93C5FD"}]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Sgn(){const[n]=pe(),e=Dg();return[{label:n("pending"),value:"pending",color:"white",backgroundColor:"#6B7280"},{label:n("cancelled"),value:"cancelled",color:"white",backgroundColor:e.$4||"#93C5FD"},{label:n("failed"),value:"failed",color:"white",backgroundColor:e.$5||"#DC2626"},{label:n("completed"),value:"completed",color:"white",backgroundColor:e.$3||"#22C55E"},{label:n("partially_refunded"),value:"partially_refunded",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("refunded"),value:"refunded",color:"white",backgroundColor:"#6B7280"},{label:n("partially_unapplied"),value:"partially_unapplied",color:"white",backgroundColor:"#bf83cc"}]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Egn=Oo(void 0);var PGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){var t,i,r=1e3,o=6e4,s=36e5,a=864e5,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=31536e6,u=2628e6,d=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:c,months:u,days:a,hours:s,minutes:o,seconds:r,milliseconds:1,weeks:6048e5},f=function(E){return E instanceof C},g=function(E,k,L){return new C(E,L,k.$l)},m=function(E){return i.p(E)+"s"},v=function(E){return E<0},_=function(E){return v(E)?Math.ceil(E):Math.floor(E)},b=function(E){return Math.abs(E)},y=function(E,k){return E?v(E)?{negative:!0,format:""+b(E)+k}:{negative:!1,format:""+E+k}:{negative:!1,format:""}},C=function(){function E(L,D,A){var O=this;if(this.$d={},this.$l=A,L===void 0&&(this.$ms=0,this.parseFromMilliseconds()),D)return g(L*h[m(D)],this);if(typeof L=="number")return this.$ms=L,this.parseFromMilliseconds(),this;if(typeof L=="object")return Object.keys(L).forEach(function(B){O.$d[m(B)]=L[B]}),this.calMilliseconds(),this;if(typeof L=="string"){var P=L.match(d);if(P){var F=P.slice(2).map(function(B){return B!=null?Number(B):0});return this.$d.years=F[0],this.$d.months=F[1],this.$d.weeks=F[2],this.$d.days=F[3],this.$d.hours=F[4],this.$d.minutes=F[5],this.$d.seconds=F[6],this.calMilliseconds(),this}}return this}var k=E.prototype;return k.calMilliseconds=function(){var L=this;this.$ms=Object.keys(this.$d).reduce(function(D,A){return D+(L.$d[A]||0)*h[A]},0)},k.parseFromMilliseconds=function(){var L=this.$ms;this.$d.years=_(L/c),L%=c,this.$d.months=_(L/u),L%=u,this.$d.days=_(L/a),L%=a,this.$d.hours=_(L/s),L%=s,this.$d.minutes=_(L/o),L%=o,this.$d.seconds=_(L/r),L%=r,this.$d.milliseconds=L},k.toISOString=function(){var L=y(this.$d.years,"Y"),D=y(this.$d.months,"M"),A=+this.$d.days||0;this.$d.weeks&&(A+=7*this.$d.weeks);var O=y(A,"D"),P=y(this.$d.hours,"H"),F=y(this.$d.minutes,"M"),B=this.$d.seconds||0;this.$d.milliseconds&&(B+=this.$d.milliseconds/1e3,B=Math.round(1e3*B)/1e3);var M=y(B,"S"),V=L.negative||D.negative||O.negative||P.negative||F.negative||M.negative,U=P.format||F.format||M.format?"T":"",W=(V?"-":"")+"P"+L.format+D.format+O.format+U+P.format+F.format+M.format;return W==="P"||W==="-P"?"P0D":W},k.toJSON=function(){return this.toISOString()},k.format=function(L){var D=L||"YYYY-MM-DDTHH:mm:ss",A={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return D.replace(l,function(O,P){return P||String(A[O])})},k.as=function(L){return this.$ms/h[m(L)]},k.get=function(L){var D=this.$ms,A=m(L);return A==="milliseconds"?D%=1e3:D=A==="weeks"?_(D/h[A]):this.$d[A],D||0},k.add=function(L,D,A){var O;return O=D?L*h[m(D)]:f(L)?L.$ms:g(L,this).$ms,g(this.$ms+O*(A?-1:1),this)},k.subtract=function(L,D){return this.add(L,D,!0)},k.locale=function(L){var D=this.clone();return D.$l=L,D},k.clone=function(){return g(this.$ms,this)},k.humanize=function(L){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!L)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},E}(),x=function(E,k,L){return E.add(k.years()*L,"y").add(k.months()*L,"M").add(k.days()*L,"d").add(k.hours()*L,"h").add(k.minutes()*L,"m").add(k.seconds()*L,"s").add(k.milliseconds()*L,"ms")};return function(E,k,L){t=L,i=L().$utils(),L.duration=function(O,P){var F=L.locale();return g(O,{$l:F},P)},L.isDuration=f;var D=k.prototype.add,A=k.prototype.subtract;k.prototype.add=function(O,P){return f(O)?x(this,O,1):D.bind(this)(O,P)},k.prototype.subtract=function(O,P){return f(O)?x(this,O,-1):A.bind(this)(O,P)}}})})(PGe);var xgn=PGe.exports;const Tgn=nl(xgn);var MGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Bo,function(){return function(t,i,r){t=t||{};var o=i.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,u,d,h){return o.fromToBase(c,u,d,h)}r.en.relativeTime=s,o.fromToBase=function(c,u,d,h,f){for(var g,m,v,_=d.$locale().relativeTime||s,b=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],y=b.length,C=0;C<y;C+=1){var x=b[C];x.d&&(g=h?r(c).diff(d,x.d,!0):d.diff(c,x.d,!0));var E=(t.rounding||Math.round)(Math.abs(g));if(v=g>0,E<=x.r||!x.r){E<=1&&C>0&&(x=b[C-1]);var k=_[x.l];f&&(E=f(""+E)),m=typeof k=="string"?k.replace("%d",E):k(E,u,x.l,v);break}}if(u)return m;var L=v?_.future:_.past;return typeof L=="function"?L(m):L.replace("%s",m)},o.to=function(c,u){return a(c,u,this,!0)},o.from=function(c,u){return a(c,u,this)};var l=function(c){return c.$u?r.utc():r()};o.toNow=function(c){return this.to(l(this),c)},o.fromNow=function(c){return this.from(l(this),c)}}})})(MGe);var kgn=MGe.exports;const Ign=nl(kgn);/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function _v(n){if(n===""||n==="[]")return[];const e=[[0,0,"",!0]],t=JSON.parse(n);return t.length?t:e}function Lgn(n,e=!1){const t=_v(n);let i=0;for(const[a,l]of t){if(a>l&&!e)continue;const u=(l!==0?typeof l=="number"?l:0:Math.floor(Date.now()/1e3))-(typeof a=="number"?a:0);i+=Math.max(u,0)}const r=Math.floor(i/3600),o=Math.floor(i%3600/60),s=i%60;return r<24?`${r}:${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${r}h`}function VLr(n,e){const t=_v(n);Un.extend(Tgn),Un.extend(Ign);let i=0;if(e!=null&&e.calculateLastTimeLog){const r=t.length-1,o=t[r][0],s=o?Un.unix(o):Un();i+=Un().diff(s,"seconds")}else t.map(([r,o])=>{const s=r?Un.unix(r):Un(),a=o?Un.unix(o):Un();i+=a.diff(s,"seconds")});return e!=null&&e.inSeconds?i.toString():i>86400?Un.duration(i,"seconds").humanize():Un.duration(i,"seconds").format("HH:mm:ss")}function HLr(n,e){const i=_v(n)[e],r=i?Un.unix(i[0]):Un(),s=(i?Un.unix(i[1]):Un()).diff(r,"seconds");return new Date(s*1e3).toISOString().slice(11,19)}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function FGe(n){const{isAdmin:e}=Po();return Ti(["/api/v1/task_statuses","create"],()=>Ae("GET",Te("/api/v1/task_statuses/create")).then(t=>t.data.data),{staleTime:1/0,enabled:e?(n==null?void 0:n.enabled)??!0:!1})}function BGe(n){return Ti(["/api/v1/task_statuses",n],()=>Ae("GET",Te("/api/v1/task_statuses?status=:status",{status:(n==null?void 0:n.status)||"all"})).then(e=>e.data),{staleTime:1/0})}function Dgn(n){return Ti(["/api/v1/task_statuses",n.id],()=>Ae("GET",Te("/api/v1/task_statuses/:id",{id:n.id})),{staleTime:1/0})}function Agn(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/task_statuses/bulk"),{action:e,ids:[n]}).then(()=>{ce.success(`${e}d_task_status`),En(["task_statuses"])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $Ge(n){let e=!1;const i=_v(n.time_log).sort((o,s)=>o[0]-s[0]);let r=0;return i.forEach(([o,s],a)=>{const l=i[a+1];s==0&&l&&(e=!0),l&&s>l[0]&&(e=!0),s!==0&&o>s&&(e=!0),s===0&&r++,r>1&&(e=!0)}),e}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ngn(n){const{isFormBusy:e,setErrors:t,setIsFormBusy:i}=n;return r=>{if(!e){if(i(!0),ce.processing(),$Ge(r))return i(!1),ce.error("task_errors");Ae("PUT",Te("/api/v1/tasks/:id",{id:r.id}),r).then(()=>{ce.success("updated_task"),En(["tasks"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(ce.dismiss(),t==null||t(o.response.data))}).finally(()=>i(!1))}}}function wbe(n){return(e,t)=>{n.setErrors(void 0),n.setTaskStatus(i=>i&&{...i,[e]:t})}}function Rgn(){const[n]=pe(),e=Agn();return[i=>i.archived_at===0&&p(tn,{onClick:()=>e(i.id,"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),i=>i.archived_at>0&&p(tn,{onClick:()=>e(i.id,"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),i=>!i.is_deleted&&p(tn,{onClick:()=>e(i.id,"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function Ogn(n){const[e]=pe(),t=vo(),{data:i}=FGe(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState(),u=wbe({setErrors:o,setTaskStatus:c}),d=()=>{s||(ce.processing(),o(void 0),a(!0),Ae("POST",Te("/api/v1/task_statuses"),l).then(h=>{var f;ce.success("created_task_status"),En(["task_statuses"]),c(i),(f=n.onCreatedTaskStatus)==null||f.call(n,h.data.data),n.setVisible(!1)}).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===422&&(o(h.response.data),ce.dismiss())}).finally(()=>a(!1)))};return w.useEffect(()=>{i&&c(i)},[i]),N(Ui,{title:e("new_task_status"),visible:n.visible,onClose:()=>{n.setVisible(!1),c(i)},children:[p(We,{required:!0,label:e("name"),value:l==null?void 0:l.name,onValueChange:h=>u("name",h),errorMessage:r==null?void 0:r.errors.name}),p(pg,{children:e("color")}),p(Gk,{value:(l==null?void 0:l.color)||t,onValueChange:h=>u("color",h)}),p(Gt,{className:"self-end",behavior:"button",disabled:s,onClick:d,children:e("save")})]})}function FAe(n){const[e]=pe(),t=ni(),{isAdmin:i,isOwner:r}=Po(),{visible:o,isFormBusy:s,setIsFormBusy:a,task:l,setVisible:c}=n,[u,d]=w.useState(!1),{data:h}=BGe({status:"active"}),f=Ngn({isFormBusy:s,setIsFormBusy:a});return N(dt,{children:[p(AF,{placement:"bottom",interactive:!0,render:()=>N("div",{className:"border box rounded-md shadow-lg focus:outline-none",style:{backgroundColor:t.$1,borderColor:t.$4,minWidth:"12rem",maxWidth:"14.7rem"},children:[(i||r)&&p(tn,{className:"font-medium text-center py-3",onClick:()=>{d(!0),c(!1)},children:e("new_task_status")}),h==null?void 0:h.data.map((g,m)=>g.id!==l.status_id&&p(tn,{onClick:()=>{c(!1),f({...l,status_id:g.id})},children:g.name},m)),!(h!=null&&h.data.length)&&p("div",{className:"font-medium text-center py-2 text-xs",children:e("no_records_found")})]}),visible:o,children:p("div",{})}),p(Ogn,{visible:u,setVisible:d,onCreatedTaskStatus:g=>f({...l,status_id:g.id})})]})}function Pgn(n){const[e]=pe(),t=w.useRef(null),i=RF(),r=Dg(),{invoice_id:o,archived_at:s,is_deleted:a,time_log:l,status:c}=n.entity,[u,d]=w.useState(!1),[h,f]=w.useState(!1);zk(t,()=>{u&&d(!1)});const g=()=>{const m=_v(l),v=m.length;return v?m[v-1][1]===0:!1};if(a)return p(pr,{variant:"red",children:e("deleted")});if(s)return p(pr,{variant:"orange",children:e("archived")});if(o)return p(pr,{variant:"green",style:{backgroundColor:r.$3},children:e("invoiced")});if(g())return p(pr,{variant:"light-blue",style:{backgroundColor:r.$2},children:e("running")});if(c){const{red:m,green:v,blue:_,hex:b}=DN(c.color),y=NF(m,v,_)?-220:220;return N("div",{ref:t,onClick:C=>C.stopPropagation(),children:[p(wu,{width:"auto",message:e("change_status"),withoutArrow:!0,placement:"bottom",children:p(a3,{for:{},code:c.name,style:{color:i(b,y),backgroundColor:c.color},onClick:()=>!h&&d(C=>!C)})}),p(FAe,{visible:u,isFormBusy:h,setIsFormBusy:f,task:n.entity,setVisible:d})]})}return N("div",{ref:t,onClick:m=>m.stopPropagation(),children:[p(wu,{width:"auto",message:e("change_status"),withoutArrow:!0,placement:"bottom",children:p(a3,{for:{},code:"logged",onClick:()=>!h&&d(m=>!m)})}),p(FAe,{visible:u,isFormBusy:h,setIsFormBusy:f,task:n.entity,setVisible:d})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Oy(n){let e=!1;return _v(n.time_log).forEach(([,t])=>{t===0&&(e=!0)}),e}function Mgn(n){return n.invoice_id?"invoiced":Oy(n)?"active":"logged"}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function VGe(){const n=ci(),e=l6(),t=r=>r||(n!=null&&n.use_comma_as_decimal_place?".":","),i=r=>r||(n!=null&&n.use_comma_as_decimal_place?",":".");return(r,o,s,a)=>Xse(r,{thousandSeparator:t(o),decimalSeparator:i(s),decimalScale:a||e})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Fgn(){const n=ed();return e=>{var t;if(n)return(t=n.data)==null?void 0:t.date_formats.find(i=>i.id===e)}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function HGe(){const n=ci(),e=IK(),{timeFormat:t}=MN(),i=Fgn();return async r=>{const s={dateFormat:i(n==null?void 0:n.settings.date_format_id),timeFormat:t};return r.length>=1&&await e.find(r).then(a=>{a.settings.date_format_id&&(s.dateFormat=i(a.settings.date_format_id)),s.timeFormat=t}),s}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function WGe(n){const[e]=pe(),{onlyAddToInvoice:t}=n||{},i=wi(),r=VGe(),o=bbe(),s=ci(),{data:a}=_be(),{timeFormat:l}=MN(),c=l6(),{dateFormat:u}=lc(),d=Ar(A1),h=HGe(),f=(g,m)=>{const v=_v(g);let _=0;return v.length&&v.forEach(([b,y,,C])=>{if(C||!(s!=null&&s.settings.allow_billable_task_items)||typeof C>"u"){const x=Un.unix(b),E=Un.unix(y);_+=E.diff(x,"seconds")/3600,_=Number(_.toFixed(m||c))}}),_};return async g=>{var m,v,_,b,y,C,x,E,k,L,D;if(a){const A={...a};if(s&&s.enabled_tax_rates>0&&(A.tax_name1=(m=s.settings)==null?void 0:m.tax_name1,A.tax_rate1=(v=s.settings)==null?void 0:v.tax_rate1),s&&s.enabled_tax_rates>1&&(A.tax_name2=(_=s.settings)==null?void 0:_.tax_name2,A.tax_rate2=(b=s.settings)==null?void 0:b.tax_rate2),s&&s.enabled_tax_rates>2&&(A.tax_name3=(y=s.settings)==null?void 0:y.tax_name3,A.tax_rate3=(C=s.settings)==null?void 0:C.tax_rate3),A.uses_inclusive_taxes=((x=s==null?void 0:s.settings)==null?void 0:x.inclusive_taxes)??!1,el(g).pluck("client_id").unique().toArray().length>1)return ce.error("multiple_client_error");A.client_id=g[0].client_id,(E=g[0])!=null&&E.project_id&&(A.project_id=(k=g[0])==null?void 0:k.project_id);const P=await o((L=g[0])==null?void 0:L.client_id,"client_id"),{dateFormat:F,timeFormat:B}=await h((D=g[0])==null?void 0:D.client_id);g.forEach(M=>{var ie,se;const V=_v(M.time_log),U=[];V.forEach(([Q,Ee,Fe,He])=>{if(He||!(s!=null&&s.settings.allow_billable_task_items)||typeof He>"u"){let ke="";if(s.invoice_task_hours){const je=Un.unix(Q),qe=Un.unix(Ee);ke=`• ${r((qe.diff(je,"seconds")/3600).toString(),P==null?void 0:P.thousandSeparator,P==null?void 0:P.decimalSeparator,P==null?void 0:P.precision)} ${e("hours")}`}const Me=[];(s.invoice_task_datelog||s.invoice_task_timelog)&&Me.push(`<div class="task-time-details"> `),s.invoice_task_datelog&&Me.push(Un.unix(Q).format(F!=null&&F.format_moment?F.format_moment:u)),s.invoice_task_timelog&&Me.push(Un.unix(Q).format(B||l)+" - "),s.invoice_task_timelog&&Me.push(Un.unix(Ee).format(B||l)),s.invoice_task_hours&&Me.push(ke),s.invoice_task_item_description&&Fe&&Me.push(` ${Fe}`),(s.invoice_task_datelog||s.invoice_task_timelog)&&(Me.push(` `),Me.push(`</div> `)),U.push(Me.join(" "))}});const W=f(M.time_log,c),q={...oE(),type_id:i0.Task,cost:M.rate,quantity:W,line_total:Number((M.rate*W).toFixed(c)),task_id:M.id,tax_id:"",custom_value1:M.custom_value1,custom_value2:M.custom_value2,custom_value3:M.custom_value3,custom_value4:M.custom_value4},H=s.invoice_task_project&&((ie=M==null?void 0:M.project)!=null&&ie.name)?"## "+((se=M.project)==null?void 0:se.name)+` `:"";U.length&&(q.notes=H+(M==null?void 0:M.description)+" "+U.join(" ")),typeof A.line_items=="string"&&(A.line_items=[]),A.line_items.push(q)}),t?d(M=>M&&{...M,line_items:[...M.line_items,...A.line_items]}):(d(A),i(bt("/invoices/create?table=tasks&project=:projectAssigned&action=invoice_task",{projectAssigned:!!g[0].project_id})))}}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Bgn(){const n=_o(),e=Fi(tu),t=Tl();return i=>{ce.processing(),Ae("PUT",Te("/api/v1/tasks/:id?start=true",{id:i.id}),i).then(()=>{t.pathname.endsWith("/create")?ce.dismiss():ce.success("started_task"),En(["tasks"]),e&&n.invalidateQueries([e])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $gn(){const n=_o(),e=Fi(tu);return t=>{ce.processing();const i=_v(t.time_log),r=i[i.length-1][0],o=Un().unix();if(r&&r>o)i[i.length-1][1]=r+1,t.time_log=JSON.stringify(i);else if($Ge(t))return ce.error("task_errors");Ae("PUT",Te("/api/v1/tasks/:id?stop=true",{id:t.id}),t).then(()=>{ce.success("stopped_task"),En(["tasks"]),e&&n.invalidateQueries([e])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function WLr(n){return Ti(["/api/v1/tasks",n.id],()=>Ae("GET",Te("/api/v1/tasks/:id?include=status",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:n.enabled??!0})}function zLr(n){const e=ps();return Ti(["/api/v1/tasks/create"],()=>Ae("GET",Te("/api/v1/tasks/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_task")?(n==null?void 0:n.enabled)??!0:!1})}function ULr(n){return Ti(["/api/v1/tasks",n],()=>Ae("GET",Te(":endpoint",{endpoint:n.endpoint||"/api/v1/tasks"})).then(e=>e.data),{staleTime:1/0})}const zGe=()=>{const n=_o(),e=Fi(tu);return(t,i)=>{ce.processing(),Ae("POST",Te("/api/v1/tasks/bulk"),{action:i,ids:t}).then(()=>{i!=="start"&&i!=="stop"&&ce.success(`${i}d_task`),i==="start"&&ce.success(Ms("started_tasks",{value:t.length})),i==="stop"&&ce.success(Ms("stopped_tasks",{value:t.length})),e&&n.invalidateQueries([e]),En(["tasks"])})}};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Vgn(){const n=_o(),e=Fi(tu);return async(t,i)=>(ce.processing(),Ae("POST",Te("/api/v1/projects/bulk"),{action:i,ids:t}).then(r=>(i!=="invoice"&&ce.success(`${i}d_project`),r)).finally(()=>{En(["projects"]),e&&n.invalidateQueries([e])}))}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Hgn=(n,e)=>{const t=_v(n);let i=0;return t.length&&t.forEach(([r,o])=>{if(r&&o){const s=Un.unix(r),a=Un.unix(o);i+=Number((a.diff(s,"seconds")/3600).toFixed(e))}}),i};function jLr(){const n=wi(),e=Vgn(),t=Ar(A1);return i=>{ce.processing(),e(i,"invoice").then(r=>{t(r.data.data),n(bt("/invoices/create?table=tasks&project=true&action=invoice_project"))})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Wgn(n){const[e]=pe(),{tasks:t}=n,i=wi(),r=VGe(),o=bbe(),s=HGe(),a=ci(),{timeFormat:l}=MN(),c=l6(),{dateFormat:u}=lc(),d=Ar(A1);return async h=>{var g,m;const f=un.cloneDeep(h);if(t){const v=await o((g=t[0])==null?void 0:g.client_id,"client_id"),{dateFormat:_,timeFormat:b}=await s((m=t[0])==null?void 0:m.client_id);t.forEach(y=>{var D,A;const C=_v(y.time_log),x=[];C.forEach(([O,P,F,B])=>{if(B||!(a!=null&&a.settings.allow_billable_task_items)||typeof B>"u"){let M="";if(a.invoice_task_hours){const U=Un.unix(O),W=Un.unix(P);M=`• ${r((W.diff(U,"seconds")/3600).toString(),v==null?void 0:v.thousandSeparator,v==null?void 0:v.decimalSeparator,v==null?void 0:v.precision)} ${e("hours")}`}const V=[];(a.invoice_task_datelog||a.invoice_task_timelog)&&V.push(`<div class="task-time-details"> `),a.invoice_task_datelog&&V.push(Un.unix(O).format(_!=null&&_.format_moment?_.format_moment:u)),a.invoice_task_timelog&&V.push(Un.unix(O).format(b||l)+" - "),a.invoice_task_timelog&&V.push(Un.unix(P).format(b||l)),a.invoice_task_hours&&V.push(M),a.invoice_task_item_description&&F&&V.push(` ${F}`),(a.invoice_task_datelog||a.invoice_task_timelog)&&(V.push(` `),V.push(`</div> `)),x.push(V.join(" "))}});const E=Hgn(y.time_log,c),k={...oE(),type_id:i0.Task,cost:y.rate,quantity:E,line_total:Number((y.rate*E).toFixed(c)),task_id:y.id,tax_id:"",custom_value1:y.custom_value1,custom_value2:y.custom_value2,custom_value3:y.custom_value3,custom_value4:y.custom_value4},L=a.invoice_task_project&&((D=y==null?void 0:y.project)!=null&&D.name)?"## "+((A=y.project)==null?void 0:A.name)+` `:"";x.length&&(k.notes=L+(y==null?void 0:y.description)+" "+x.join(" ")),typeof f.line_items=="string"&&(f.line_items=[]),f.line_items.push(k)}),d(f),i(bt("/invoices/:id/edit?action=add_tasks&table=tasks",{id:f.id}))}}}function zgn(n){const{visible:e,setVisible:t,tasks:i,invoices:r}=n,o=tf(),s=Wgn({tasks:i});return p(Ui,{title:Ms("add_to_invoice",{invoice:""}),visible:e,onClose:()=>t(!1),children:p("div",{className:"flex flex-col overflow-y-auto max-h-96",children:r==null?void 0:r.map((a,l)=>{var c,u;return N("div",{className:"flex justify-between py-2 cursor-pointer hover:bg-gray-100 px-3",onClick:()=>s(a),children:[p("span",{children:a.number}),p("span",{children:o(a.amount,(c=a.client)==null?void 0:c.country_id,(u=a.client)==null?void 0:u.settings.currency_id)})]},l)})})})}function UGe(n){const{tasks:e,isBulkAction:t,setSelected:i}=n,r=_o(),o=ps(),s=EK(),[a,l]=w.useState(!1),[c,u]=w.useState([]),d=()=>{if(!e.length)return ce.error("no_invoices_found");const h=e.map(g=>g.client_id);if(h.some(g=>!g))return ce.error("no_invoices_found");if(h.length){const g=h[0];if(h.some(v=>v!==g))return ce.error("multiple_client_error")}ce.processing(),r.fetchQuery(["/api/v1/invoices","client_id",e[0].client_id],()=>Ae("GET",Te("/api/v1/invoices?client_id=:clientId&include=client&status=active&per_page=100",{clientId:e[0].client_id})),{staleTime:1/0}).then(g=>{if(ce.dismiss(),!g.data.data.length)return ce.error("no_invoices_found");o("edit_invoice")?u(g.data.data):u(g.data.data.filter(m=>s(m))),l(!0)})};return w.useEffect(()=>{!a&&(i==null||i([]))},[a]),(e.length&&e[0].client_id&&!e[0].invoice_id||t)&&(o("create_invoice")||o("edit_invoice"))?N(dt,{children:[p(zgn,{visible:a,setVisible:l,tasks:e,invoices:c}),p(tn,{onClick:d,icon:p(vt,{element:jEt}),children:Ms("add_to_invoice",{invoice:""})})]}):p(dt,{})}const Ugn=["status","number","client","description","duration","entity_state"];function jgn(){const[n,e,t,i]=cp({entity:"task"});return["status","number","client","project","description","duration","entity_state","archived_at","calculated_rate","created_at",n,e,t,i,"date","documents","is_deleted","is_invoiced","is_running","rate","updated_at","user","assigned_user"]}function qLr(){var _;const{t:n}=pe(),{dateFormat:e}=lc(),t=vo(),i=ps(),r=sE(),o=Zk(),s=ci(),a=Ha(),l=wi(),c=tf();jgn();const u=b=>{const y=(b==null?void 0:b.first_name)??"",C=(b==null?void 0:b.last_name)??"";return y.length===0&&C.length===0?(b==null?void 0:b.email)??"Unknown User":`${y} ${C}`},[d,h,f,g]=cp({entity:"task"}),m=[{column:"project",id:"project_id",label:n("project"),format:(b,y)=>{var C,x;return p(vbe,{entityId:y.project_id,cacheEndpoint:"/api/v1/projects",apiEndpoint:"/api/v1/projects/:id?include=client",preCheck:i("view_project")||i("edit_project"),component:p(Li,{to:bt("/projects/:id",{id:(C=y==null?void 0:y.project)==null?void 0:C.id}),children:(x=y==null?void 0:y.project)==null?void 0:x.name})})}},{column:"status",id:"status_id",label:n("status"),format:(b,y)=>N("div",{className:"flex items-center space-x-2",children:[p(Pgn,{entity:y}),y.invoice_id&&p(wu,{width:"auto",message:n("view_invoice"),withoutArrow:!0,placement:"bottom",children:p(Pk,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>l(bt("/invoices/:id/edit",{id:y.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(b,y)=>p(Rf,{to:bt("/tasks/:id/edit",{id:y.id}),renderSpan:r("task",y),children:b})},{column:"client",id:"client_id",label:n("client"),format:(b,y)=>y.client&&p(Rf,{to:bt("/clients/:id",{id:b.toString()}),renderSpan:r("client",y.client),children:y.client.display_name})},{column:"description",id:"description",label:n("description"),format:b=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(b)}})}),children:p("span",{children:r0(Xc(b)).slice(0,50)})})},{column:"duration",id:"time_log",label:n("duration"),format:b=>Lgn(b.toString(),!0)},{column:"entity_state",id:"id",label:n("entity_state"),format:(b,y)=>n(Mgn(y))},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>go(b,e)},{column:"calculated_rate",id:"rate",label:n("calculated_rate"),format:(b,y)=>{var C,x;return c(y.rate||s.settings.default_task_rate,(C=y.client)==null?void 0:C.country_id,(x=y.client)==null?void 0:x.settings.currency_id)}},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>go(b,e)},{column:d,id:"custom_value1",label:d,format:b=>o("task1",b==null?void 0:b.toString())},{column:h,id:"custom_value2",label:h,format:b=>o("task2",b==null?void 0:b.toString())},{column:f,id:"custom_value3",label:f,format:b=>o("task3",b==null?void 0:b.toString())},{column:g,id:"custom_value4",label:g,format:b=>o("task4",b==null?void 0:b.toString())},{column:"date",id:"calculated_start_date",label:n("date"),format:(b,y)=>go(y.date,e)},{column:"documents",id:"documents",label:n("documents"),format:(b,y)=>y.documents.length},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(b,y)=>y.is_deleted?n("yes"):n("no")},{column:"is_invoiced",id:"invoice_id",label:n("is_invoiced"),format:(b,y)=>y.invoice_id?n("yes"):n("no")},{column:"is_running",id:"is_running",label:n("is_running"),format:(b,y)=>Oy(y)?n("yes"):n("no")},{column:"rate",id:"rate",label:n("rate"),format:(b,y)=>{var C,x;return c(b,(C=y.client)==null?void 0:C.country_id,(x=y.client)==null?void 0:x.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:b=>go(b,e)},{column:"user",id:"user_id",label:n("user"),format:(b,y)=>u(y==null?void 0:y.user)},{column:"assigned_user",id:"assigned_user_id",label:n("assigned_user"),format:(b,y)=>y!=null&&y.assigned_user?u(y==null?void 0:y.assigned_user):""}],v=((_=a==null?void 0:a.react_table_columns)==null?void 0:_.task)||Ugn;return m.filter(b=>v.includes(b.column)).sort((b,y)=>v.indexOf(b.column)-v.indexOf(y.column))}function KLr(){return n=>{Ae("PUT",Te("/api/v1/tasks/:id",{id:n.id}),n).then(()=>{ce.success("updated_task"),En(["tasks"])})}}function qgn(){const[n]=pe(),e=RF(),t=Dg(),{data:i}=BGe({status:"active"}),r=[{label:n("invoiced"),value:"invoiced",color:"white",backgroundColor:t.$3||"#22C55E"},{label:n("uninvoiced"),value:"uninvoiced",color:"white",backgroundColor:t.$4||"#F87171"}];return i==null||i.data.forEach(o=>{const{red:s,green:a,blue:l,hex:c}=DN(o.color),u=NF(s,a,l)?-220:220;r.push({label:o.name,value:o.id,color:e(c,u),backgroundColor:o.color,queryKey:"task_status"})}),r}function GLr(n){const[e]=pe(),t=wi(),i=ps(),{showCommonBulkAction:r,showEditAction:o}=n||{},{isEditPage:s}=N1({entity:"task",editPageTabs:["documents"]}),a=Bgn(),l=$gn(),c=zGe(),u=WGe(),d=Ar(Egn),h=_=>{d({..._,id:"",documents:[],number:"",invoice_id:""}),t("/tasks/create?action=clone")},{setChangeTemplateResources:f,setChangeTemplateVisible:g,setChangeTemplateEntityContext:m}=QN();return[_=>!!o&&p(tn,{to:bt("/tasks/:id/edit",{id:_.id}),icon:p(vt,{element:_F}),children:e("edit")}),()=>!!o&&p(_i,{withoutPadding:!0}),_=>!Oy(_)&&!_.invoice_id&&p(tn,{onClick:()=>a(_),icon:p(vt,{element:ame}),children:e("start")}),_=>Oy(_)&&!_.invoice_id&&p(tn,{onClick:()=>l(_),icon:p(vt,{element:ume}),children:e("stop")}),_=>!Oy(_)&&!_.invoice_id&&i("create_invoice")&&p(tn,{onClick:()=>u([_]),icon:p(vt,{element:Pk}),children:e("invoice_task")}),_=>p(UGe,{tasks:[_]}),_=>i("create_task")&&p(tn,{onClick:()=>h(_),icon:p(vt,{element:e0}),children:e("clone")}),_=>p(tn,{onClick:()=>{g(!0),f([_]),m({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:p(vt,{element:EN}),children:e("run_template")}),()=>(s||!!r)&&p(_i,{withoutPadding:!0}),_=>(s||!!r)&&Sr(_)===Zi.Active&&p(tn,{onClick:()=>c([_.id],"archive"),icon:p(vt,{element:Ac}),children:e("archive")}),_=>(s||!!r)&&(Sr(_)===Zi.Archived||Sr(_)===Zi.Deleted)&&p(tn,{onClick:()=>c([_.id],"restore"),icon:p(vt,{element:Dc}),children:e("restore")}),_=>(s||!!r)&&(Sr(_)===Zi.Active||Sr(_)===Zi.Archived)&&p(tn,{onClick:()=>c([_.id],"delete"),icon:p(vt,{element:gl}),children:e("delete")})]}const YLr=()=>{const[n]=pe(),e=WGe(),t=zGe(),i=ps(),r=KWe(),o=v=>v.some(({documents:_})=>_.length),s=v=>v.flatMap(({documents:_})=>_.map(({id:b})=>b)),a=v=>v.every(_=>!Oy(_)&&!_.invoice_id),l=v=>v.every(_=>Oy(_)&&!_.invoice_id),c=v=>v.every(_=>!Oy(_)&&!_.invoice_id),u=v=>v.every(_=>!Oy(_)&&!_.invoice_id&&_.client_id),d=(v,_)=>{const b=s(v);r(b,"download"),_==null||_([])},{setChangeTemplateVisible:h,setChangeTemplateResources:f,setChangeTemplateEntityContext:g}=QN();return[({selectedIds:v,selectedResources:_,setSelected:b})=>_&&a(_)&&p(tn,{onClick:()=>{t(v,"start"),b([])},icon:p(vt,{element:ame}),children:n("start")}),({selectedIds:v,selectedResources:_,setSelected:b})=>_&&l(_)&&p(tn,{onClick:()=>{t(v,"stop"),b([])},icon:p(vt,{element:ume}),children:n("stop")}),({selectedResources:v,setSelected:_})=>v&&u(v)&&p(UGe,{tasks:v,isBulkAction:!0,setSelected:_}),({selectedResources:v,setSelected:_})=>v&&c(v)&&i("create_invoice")?p(tn,{onClick:()=>{e(v),_([])},icon:p(vt,{element:Pk}),children:n("invoice_task")}):null,({selectedResources:v,setSelected:_})=>p(tn,{onClick:()=>v&&o(v)?d(v,_):ce.error("no_documents_to_download"),icon:p(vt,{element:sS}),children:n("documents")}),({selectedResources:v})=>p(tn,{onClick:()=>{h(!0),f(v),g({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:p(vt,{element:EN}),children:n("run_template")})]};function jGe(n){const[e]=pe(),{value:t,onValueChange:i,errorMessage:r,report:o}=n,s=Yk(),a=qgn(),l=rgn(),c=Cfn(),u=Sgn(),d=yfn(),h=npn(),f=Kpn(),g=wgn(),[m,v]=w.useState([]),_=b=>b.map(y=>y.value).join(",");return w.useEffect(()=>{(o==="invoice"||o==="invoice_item")&&v(d),o==="credit"&&v(c),o==="expense"&&v(h),(o==="purchase_order"||o==="purchase_order_item")&&v(f),(o==="quote"||o==="quote_item")&&v(l),o==="recurring_invoice"&&v(g),o==="payment"&&v(u),o==="task"&&v(a)},[o]),N(dt,{children:[p(mv,{id:"statusSelector",styles:s,...t&&{value:m.filter(b=>t.split(",").find(y=>b.value===y))},onChange:b=>i(_(b)),placeholder:e("status"),options:m,isMulti:!0}),r&&p(Ls,{className:"mt-2",type:"danger",children:r})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function qGe(){return[{identifier:"activity",label:"activity",endpoint:"/api/v1/reports/activities",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1},preview:"/api/v1/reports/activities?output=json",supports_previews:!1},{identifier:"client",label:"client",endpoint:"/api/v1/reports/clients",allow_custom_column:!0,custom_columns:["client"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1},preview:"/api/v1/reports/clients?output=json",supports_previews:!0},{identifier:"contact",label:"contact",endpoint:"/api/v1/reports/contacts",allow_custom_column:!0,custom_columns:["contact"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1},preview:"/api/v1/reports/contacts?output=json",supports_previews:!0},{identifier:"credit",label:"credit",endpoint:"/api/v1/reports/credits",allow_custom_column:!0,custom_columns:["client","credit","payment"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/credits?output=json",supports_previews:!0},{identifier:"document",label:"document",endpoint:"/api/v1/reports/documents",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1},preview:"/api/v1/reports/documents?output=json",supports_previews:!0},{identifier:"expense",label:"expense",endpoint:"/api/v1/reports/expenses",allow_custom_column:!0,custom_columns:["expense","client","vendor"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,clients:"",vendors:"",categories:"",projects:"",include_deleted:!1,status:""},preview:"/api/v1/reports/expenses?output=json",supports_previews:!0},{identifier:"invoice",label:"invoice",endpoint:"/api/v1/reports/invoices",allow_custom_column:!0,custom_columns:["client","invoice","payment"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,status:"",document_email_attachment:!1,include_deleted:!1,client_id:""},preview:"/api/v1/reports/invoices?output=json",supports_previews:!0},{identifier:"invoice_item",label:"invoice_item",endpoint:"/api/v1/reports/invoice_items",allow_custom_column:!0,custom_columns:["client","invoice","payment","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/invoice_items?output=json",supports_previews:!0},{identifier:"purchase_order",label:"purchase_order",endpoint:"/api/v1/reports/purchase_orders",allow_custom_column:!0,custom_columns:["vendor","purchase_order"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,status:"",document_email_attachment:!1,include_deleted:!1},preview:"/api/v1/reports/purchase_orders?output=json",supports_previews:!0},{identifier:"purchase_order_item",label:"purchase_order_item",endpoint:"/api/v1/reports/purchase_order_items",allow_custom_column:!0,custom_columns:["vendor","purchase_order","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:""},preview:"/api/v1/reports/purchase_order_items?output=json",supports_previews:!0},{identifier:"quote",label:"quote",endpoint:"/api/v1/reports/quotes",allow_custom_column:!0,custom_columns:["client","quote"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/quotes?output=json",supports_previews:!0},{identifier:"quote_item",label:"quote_item",endpoint:"/api/v1/reports/quote_items",allow_custom_column:!0,custom_columns:["client","quote","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/quote_items?output=json",supports_previews:!0},{identifier:"recurring_invoice",label:"recurring_invoice",endpoint:"/api/v1/reports/recurring_invoices",allow_custom_column:!0,custom_columns:["recurring_invoice","client","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/recurring_invoices?output=json",supports_previews:!0},{identifier:"payment",label:"payment",endpoint:"/api/v1/reports/payments",allow_custom_column:!0,custom_columns:["client","invoice","payment"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,status:"",client_id:""},preview:"/api/v1/reports/payments?output=json",supports_previews:!0},{identifier:"product",label:"product",endpoint:"/api/v1/reports/products",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1},preview:"/api/v1/reports/products?output=json",supports_previews:!0},{identifier:"product_sales",label:"product_sales",endpoint:"/api/v1/reports/product_sales",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",client_id:"",date_key:"",date_range:"all",report_keys:[],send_email:!1},preview:"/api/v1/reports/product_sales?output=json",supports_previews:!1},{identifier:"task",label:"task",endpoint:"/api/v1/reports/tasks",allow_custom_column:!0,custom_columns:["task","client","invoice"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/tasks?output=json",supports_previews:!0},{identifier:"vendor",label:"vendor",endpoint:"/api/v1/reports/vendors",allow_custom_column:!0,custom_columns:["vendor"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1},preview:"/api/v1/reports/vendors?output=json",supports_previews:!0},{identifier:"profitloss",label:"profitloss",endpoint:"/api/v1/reports/profitloss",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/profitloss?output=json",supports_previews:!1},{identifier:"aged_receivable_detailed_report",schedule_identifier:"ar_detailed",label:"aged_receivable_detailed_report",endpoint:"/api/v1/reports/ar_detail_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/ar_detail_report?output=json",supports_previews:!1},{identifier:"aged_receivable_summary_report",schedule_identifier:"ar_summary",label:"aged_receivable_summary_report",endpoint:"/api/v1/reports/ar_summary_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/ar_summary_report?output=json",supports_previews:!1},{identifier:"client_balance_report",label:"client_balance_report",schedule_identifier:"client_balance",endpoint:"/api/v1/reports/client_balance_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/client_balance_report?output=json",supports_previews:!1},{identifier:"client_sales_report",label:"client_sales_report",schedule_identifier:"client_sales",endpoint:"/api/v1/reports/client_sales_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/client_sales_report?output=json",supports_previews:!1},{identifier:"tax_summary_report",label:"tax_summary_report",schedule_identifier:"tax_summary",endpoint:"/api/v1/reports/tax_summary_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/tax_summary_report?output=json",supports_previews:!1},{identifier:"user_sales_report",label:"user_sales_report",schedule_identifier:"user_sales",endpoint:"/api/v1/reports/user_sales_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/user_sales_report?output=json",supports_previews:!1}]}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Kgn=[{trans:"name",value:"client.name",map:"client"},{trans:"number",value:"client.number",map:"client"},{trans:"user",value:"client.user",map:"client"},{trans:"assigned_user",value:"client.assigned_user",map:"client"},{trans:"balance",value:"client.balance",map:"client"},{trans:"paid_to_date",value:"client.paid_to_date",map:"client"},{trans:"currency",value:"client.currency_id",map:"client"},{trans:"website",value:"client.website",map:"client"},{trans:"private_notes",value:"client.private_notes",map:"client"},{trans:"industry",value:"client.industry_id",map:"client"},{trans:"size",value:"client.size_id",map:"client"},{trans:"address1",value:"client.address1",map:"client"},{trans:"address2",value:"client.address2",map:"client"},{trans:"city",value:"client.city",map:"client"},{trans:"state",value:"client.state",map:"client"},{trans:"postal_code",value:"client.postal_code",map:"client"},{trans:"country",value:"client.country_id",map:"client"},{trans:"custom_value1",value:"client.custom_value1",map:"client"},{trans:"custom_value2",value:"client.custom_value2",map:"client"},{trans:"custom_value3",value:"client.custom_value3",map:"client"},{trans:"custom_value4",value:"client.custom_value4",map:"client"},{trans:"shipping_address1",value:"client.shipping_address1",map:"client"},{trans:"shipping_address2",value:"client.shipping_address2",map:"client"},{trans:"shipping_city",value:"client.shipping_city",map:"client"},{trans:"shipping_state",value:"client.shipping_state",map:"client"},{trans:"shipping_postal_code",value:"client.shipping_postal_code",map:"client"},{trans:"shipping_country",value:"client.shipping_country_id",map:"client"},{trans:"payment_terms",value:"client.payment_terms",map:"client"},{trans:"vat_number",value:"client.vat_number",map:"client"},{trans:"id_number",value:"client.id_number",map:"client"},{trans:"public_notes",value:"client.public_notes",map:"client"},{trans:"phone",value:"client.phone",map:"client"},{trans:"classification",value:"client.classification",map:"client"},{trans:"credit_balance",value:"client.credit_balance",map:"client"},{trans:"payment_balance",value:"client.payment_balance",map:"client"},{trans:"first_name",value:"contact.first_name",map:"client"},{trans:"last_name",value:"contact.last_name",map:"client"},{trans:"email",value:"contact.email",map:"client"},{trans:"phone",value:"contact.phone",map:"client"},{trans:"custom_value1",value:"contact.custom_value1",map:"client"},{trans:"custom_value2",value:"contact.custom_value2",map:"client"},{trans:"custom_value3",value:"contact.custom_value3",map:"client"},{trans:"custom_value4",value:"contact.custom_value4",map:"client"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Ggn=[{trans:"date",value:"payment.date",map:"payment"},{trans:"amount",value:"payment.amount",map:"payment"},{trans:"refunded",value:"payment.refunded",map:"payment"},{trans:"applied",value:"payment.applied",map:"payment"},{trans:"transaction_reference",value:"payment.transaction_reference",map:"payment"},{trans:"currency",value:"payment.currency",map:"payment"},{trans:"exchange_rate",value:"payment.exchange_rate",map:"payment"},{trans:"number",value:"payment.number",map:"payment"},{trans:"method",value:"payment.method",map:"payment"},{trans:"status",value:"payment.status",map:"payment"},{trans:"private_notes",value:"payment.private_notes",map:"payment"},{trans:"custom_value1",value:"payment.custom_value1",map:"payment"},{trans:"custom_value2",value:"payment.custom_value2",map:"payment"},{trans:"custom_value3",value:"payment.custom_value3",map:"payment"},{trans:"custom_value4",value:"payment.custom_value4",map:"payment"},{trans:"user",value:"payment.user_id",map:"payment"},{trans:"assigned_user",value:"payment.assigned_user_id",map:"payment"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const BAe=[{trans:"quote_number",value:"quote.number",map:"quote"},{trans:"amount",value:"quote.amount",map:"quote"},{trans:"balance",value:"quote.balance",map:"quote"},{trans:"paid_to_date",value:"quote.paid_to_date",map:"quote"},{trans:"discount",value:"invoice.discount",map:"quote"},{trans:"po_number",value:"quote.po_number",map:"quote"},{trans:"date",value:"quote.date",map:"quote"},{trans:"due_date",value:"quote.due_date",map:"quote"},{trans:"terms",value:"quote.terms",map:"quote"},{trans:"footer",value:"quote.footer",map:"quote"},{trans:"status",value:"quote.status",map:"quote"},{trans:"public_notes",value:"quote.public_notes",map:"quote"},{trans:"private_notes",value:"quote.private_notes",map:"quote"},{trans:"uses_inclusive_taxes",value:"quote.uses_inclusive_taxes",map:"quote"},{trans:"is_amount_discount",value:"quote.is_amount_discount",map:"quote"},{trans:"partial",value:"quote.partial",map:"quote"},{trans:"partial_due_date",value:"quote.partial_due_date",map:"quote"},{trans:"custom_value1",value:"quote.custom_value1",map:"quote"},{trans:"custom_value2",value:"quote.custom_value2",map:"quote"},{trans:"custom_value3",value:"quote.custom_value3",map:"quote"},{trans:"custom_value4",value:"quote.custom_value4",map:"quote"},{trans:"surcharge1",value:"quote.custom_surcharge1",map:"quote"},{trans:"surcharge2",value:"quote.custom_surcharge2",map:"quote"},{trans:"surcharge3",value:"quote.custom_surcharge3",map:"quote"},{trans:"surcharge4",value:"quote.custom_surcharge4",map:"quote"},{trans:"exchange_rate",value:"quote.exchange_rate",map:"quote"},{trans:"tax_amount",value:"quote.total_taxes",map:"quote"},{trans:"assigned_user",value:"quote.assigned_user_id",map:"quote"},{trans:"user",value:"quote.user_id",map:"quote"},{trans:"tax_name1",value:"quote.tax_name1",map:"quote"},{trans:"tax_rate1",value:"quote.tax_rate1",map:"quote"},{trans:"tax_name2",value:"quote.tax_name2",map:"quote"},{trans:"tax_rate2",value:"quote.tax_rate2",map:"quote"},{trans:"tax_name3",value:"quote.tax_name3",map:"quote"},{trans:"tax_rate3",value:"quote.tax_rate3",map:"quote"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const $Ae=[{trans:"credit_number",value:"credit.number",map:"credit"},{trans:"amount",value:"credit.amount",map:"credit"},{trans:"balance",value:"credit.balance",map:"credit"},{trans:"paid_to_date",value:"credit.paid_to_date",map:"credit"},{trans:"discount",value:"credit.discount",map:"credit"},{trans:"po_number",value:"credit.po_number",map:"credit"},{trans:"date",value:"credit.date",map:"credit"},{trans:"due_date",value:"credit.due_date",map:"credit"},{trans:"terms",value:"credit.terms",map:"credit"},{trans:"footer",value:"credit.footer",map:"credit"},{trans:"status",value:"credit.status",map:"credit"},{trans:"public_notes",value:"credit.public_notes",map:"credit"},{trans:"private_notes",value:"credit.private_notes",map:"credit"},{trans:"uses_inclusive_taxes",value:"credit.uses_inclusive_taxes",map:"credit"},{trans:"is_amount_discount",value:"credit.is_amount_discount",map:"credit"},{trans:"partial",value:"credit.partial",map:"credit"},{trans:"partial_due_date",value:"credit.partial_due_date",map:"credit"},{trans:"custom_value1",value:"credit.custom_value1",map:"credit"},{trans:"custom_value2",value:"credit.custom_value2",map:"credit"},{trans:"custom_value3",value:"credit.custom_value3",map:"credit"},{trans:"custom_value4",value:"credit.custom_value4",map:"credit"},{trans:"surcharge1",value:"credit.custom_surcharge1",map:"credit"},{trans:"surcharge2",value:"credit.custom_surcharge2",map:"credit"},{trans:"surcharge3",value:"credit.custom_surcharge3",map:"credit"},{trans:"surcharge4",value:"credit.custom_surcharge4",map:"credit"},{trans:"exchange_rate",value:"credit.exchange_rate",map:"credit"},{trans:"tax_amount",value:"credit.total_taxes",map:"credit"},{trans:"assigned_user",value:"credit.assigned_user_id",map:"credit"},{trans:"user",value:"credit.user_id",map:"credit"},{trans:"tax_name1",value:"credit.tax_name1",map:"credit"},{trans:"tax_rate1",value:"credit.tax_rate1",map:"credit"},{trans:"tax_name2",value:"credit.tax_name2",map:"credit"},{trans:"tax_rate2",value:"credit.tax_rate2",map:"credit"},{trans:"tax_name3",value:"credit.tax_name3",map:"credit"},{trans:"tax_rate3",value:"credit.tax_rate3",map:"credit"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const bO=[{trans:"quantity",value:"item.quantity",map:""},{trans:"discount",value:"item.discount",map:""},{trans:"cost",value:"item.cost",map:""},{trans:"product_key",value:"item.product_key",map:""},{trans:"notes",value:"item.notes",map:""},{trans:"custom_value1",value:"item.custom_value1",map:""},{trans:"custom_value2",value:"item.custom_value2",map:""},{trans:"custom_value3",value:"item.custom_value3",map:""},{trans:"custom_value4",value:"item.custom_value4",map:""},{trans:"item_tax1",value:"item.tax_name1",map:""},{trans:"item_tax_rate1",value:"item.tax_rate1",map:""},{trans:"item_tax2",value:"item.tax_name2",map:""},{trans:"item_tax_rate2",value:"item.tax_rate2",map:""},{trans:"item_tax3",value:"item.tax_name3",map:""},{trans:"item_tax_rate3",value:"item.tax_rate3",map:""},{trans:"type",value:"item.type_id",map:""},{trans:"tax_category",value:"item.tax_id",map:""},{trans:"tax_amount",value:"item.tax_amount",map:""}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Ygn=[{trans:"name",value:"vendor.name",map:"vendor"},{trans:"address1",value:"vendor.address1",map:"vendor"},{trans:"address2",value:"vendor.address2",map:"vendor"},{trans:"city",value:"vendor.city",map:"vendor"},{trans:"country",value:"vendor.country_id",map:"vendor"},{trans:"custom_value1",value:"vendor.custom_value1",map:"vendor"},{trans:"custom_value2",value:"vendor.custom_value2",map:"vendor"},{trans:"custom_value3",value:"vendor.custom_value3",map:"vendor"},{trans:"custom_value4",value:"vendor.custom_value4",map:"vendor"},{trans:"id_number",value:"vendor.id_number",map:"vendor"},{trans:"number",value:"vendor.number",map:"vendor"},{trans:"phone",value:"vendor.phone",map:"vendor"},{trans:"postal_code",value:"vendor.postal_code",map:"vendor"},{trans:"private_notes",value:"vendor.private_notes",map:"vendor"},{trans:"public_notes",value:"vendor.public_notes",map:"vendor"},{trans:"state",value:"vendor.state",map:"vendor"},{trans:"vat_number",value:"vendor.vat_number",map:"vendor"},{trans:"website",value:"vendor.website",map:"vendor"},{trans:"currency",value:"vendor.currency",map:"vendor"},{trans:"first_name",value:"vendor_contact.first_name",map:"vendor"},{trans:"last_name",value:"vendor_contact.last_name",map:"vendor"},{trans:"contact_phone",value:"vendor_contact.phone",map:"vendor"},{trans:"contact_custom_value1",value:"vendor_contact.custom_value1",map:"vendor"},{trans:"contact_custom_value2",value:"vendor_contact.custom_value2",map:"vendor"},{trans:"contact_custom_value3",value:"vendor_contact.custom_value3",map:"vendor"},{trans:"contact_custom_value4",value:"vendor_contact.custom_value4",map:"vendor"},{trans:"email",value:"vendor_contact.email",map:"vendor"},{trans:"status",value:"vendor.status",map:"vendor"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const VAe=[{trans:"purchase_order_number",value:"purchase_order.number",map:"purchase_order"},{trans:"amount",value:"purchase_order.amount",map:"purchase_order"},{trans:"balance",value:"purchase_order.balance",map:"purchase_order"},{trans:"paid_to_date",value:"purchase_order.paid_to_date",map:"purchase_order"},{trans:"discount",value:"purchase_order.discount",map:"purchase_order"},{trans:"po_number",value:"purchase_order.po_number",map:"purchase_order"},{trans:"date",value:"purchase_order.date",map:"purchase_order"},{trans:"due_date",value:"purchase_order.due_date",map:"purchase_order"},{trans:"terms",value:"purchase_order.terms",map:"purchase_order"},{trans:"footer",value:"purchase_order.footer",map:"purchase_order"},{trans:"status",value:"purchase_order.status",map:"purchase_order"},{trans:"public_notes",value:"purchase_order.public_notes",map:"purchase_order"},{trans:"private_notes",value:"purchase_order.private_notes",map:"purchase_order"},{trans:"uses_inclusive_taxes",value:"purchase_order.uses_inclusive_taxes",map:"purchase_order"},{trans:"is_amount_discount",value:"purchase_order.is_amount_discount",map:"purchase_order"},{trans:"partial",value:"purchase_order.partial",map:"purchase_order"},{trans:"partial_due_date",value:"purchase_order.partial_due_date",map:"purchase_order"},{trans:"surcharge1",value:"purchase_order.custom_surcharge1",map:"purchase_order"},{trans:"surcharge2",value:"purchase_order.custom_surcharge2",map:"purchase_order"},{trans:"surcharge3",value:"purchase_order.custom_surcharge3",map:"purchase_order"},{trans:"surcharge4",value:"purchase_order.custom_surcharge4",map:"purchase_order"},{trans:"exchange_rate",value:"purchase_order.exchange_rate",map:"purchase_order"},{trans:"tax_amount",value:"purchase_order.total_taxes",map:"purchase_order"},{trans:"assigned_user",value:"purchase_order.assigned_user_id",map:"purchase_order"},{trans:"user",value:"purchase_order.user_id",map:"purchase_order"},{trans:"tax_name1",value:"purchase_order.tax_name1",map:"purchase_order"},{trans:"tax_rate1",value:"purchase_order.tax_rate1",map:"purchase_order"},{trans:"tax_name2",value:"purchase_order.tax_name2",map:"purchase_order"},{trans:"tax_rate2",value:"purchase_order.tax_rate2",map:"purchase_order"},{trans:"tax_name3",value:"purchase_order.tax_name3",map:"purchase_order"},{trans:"tax_rate3",value:"purchase_order.tax_rate3",map:"purchase_order"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Qgn=[{trans:"start_date",value:"task.start_date",map:"task"},{trans:"start_time",value:"task.start_time",map:"task"},{trans:"end_date",value:"task.end_date",map:"task"},{trans:"end_time",value:"task.end_time",map:"task"},{trans:"duration",value:"task.duration",map:"task"},{trans:"duration_words",value:"task.duration_words",map:"task"},{trans:"log_duration",value:"task.time_log",map:"task"},{trans:"log_duration_words",value:"task.time_log_duration_words",map:"task"},{trans:"rate",value:"task.rate",map:"task"},{trans:"number",value:"task.number",map:"task"},{trans:"description",value:"task.description",map:"task"},{trans:"custom_value1",value:"task.custom_value1",map:"task"},{trans:"custom_value2",value:"task.custom_value2",map:"task"},{trans:"custom_value3",value:"task.custom_value3",map:"task"},{trans:"custom_value4",value:"task.custom_value4",map:"task"},{trans:"status",value:"task.status_id",map:"task"},{trans:"project",value:"task.project_id",map:"task"},{trans:"billable",value:"task.billable",map:"task"},{trans:"item_notes",value:"task.item_notes",map:"task"},{trans:"assigned_user",value:"task.assigned_user_id",map:"task"},{trans:"user",value:"task.user_id",map:"task"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Xgn=[{trans:"amount",value:"expense.amount",map:"expense"},{trans:"category",value:"expense.category",map:"expense"},{trans:"custom_value1",value:"expense.custom_value1",map:"expense"},{trans:"custom_value2",value:"expense.custom_value2",map:"expense"},{trans:"custom_value3",value:"expense.custom_value3",map:"expense"},{trans:"custom_value4",value:"expense.custom_value4",map:"expense"},{trans:"currency",value:"expense.currency_id",map:"expense"},{trans:"date",value:"expense.date",map:"expense"},{trans:"exchange_rate",value:"expense.exchange_rate",map:"expense"},{trans:"converted_amount",value:"expense.foreign_amount",map:"expense"},{trans:"invoice_currency_id",value:"expense.invoice_currency_id",map:"expense"},{trans:"payment_date",value:"expense.payment_date",map:"expense"},{trans:"number",value:"expense.number",map:"expense"},{trans:"payment_type_id",value:"expense.payment_type_id",map:"expense"},{trans:"private_notes",value:"expense.private_notes",map:"expense"},{trans:"project",value:"expense.project_id",map:"expense"},{trans:"public_notes",value:"expense.public_notes",map:"expense"},{trans:"tax_amount1",value:"expense.tax_amount1",map:"expense"},{trans:"tax_amount2",value:"expense.tax_amount2",map:"expense"},{trans:"tax_amount3",value:"expense.tax_amount3",map:"expense"},{trans:"tax_name1",value:"expense.tax_name1",map:"expense"},{trans:"tax_name2",value:"expense.tax_name2",map:"expense"},{trans:"tax_name3",value:"expense.tax_name3",map:"expense"},{trans:"tax_rate1",value:"expense.tax_rate1",map:"expense"},{trans:"tax_rate2",value:"expense.tax_rate2",map:"expense"},{trans:"tax_rate3",value:"expense.tax_rate3",map:"expense"},{trans:"transaction_reference",value:"expense.transaction_reference",map:"expense"},{trans:"invoice",value:"expense.invoice_id",map:"expense"},{trans:"user",value:"expense.user",map:"expense"},{trans:"assigned_user",value:"expense.assigned_user",map:"expense"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const HAe=[{trans:"invoice_number",value:"recurring_invoice.number",map:"recurring_invoice"},{trans:"amount",value:"recurring_invoice.amount",map:"recurring_invoice"},{trans:"balance",value:"recurring_invoice.balance",map:"recurring_invoice"},{trans:"paid_to_date",value:"recurring_invoice.paid_to_date",map:"recurring_invoice"},{trans:"discount",value:"recurring_invoice.discount",map:"recurring_invoice"},{trans:"po_number",value:"recurring_invoice.po_number",map:"recurring_invoice"},{trans:"date",value:"recurring_invoice.date",map:"recurring_invoice"},{trans:"due_date",value:"recurring_invoice.due_date",map:"recurring_invoice"},{trans:"terms",value:"recurring_invoice.terms",map:"recurring_invoice"},{trans:"footer",value:"recurring_invoice.footer",map:"recurring_invoice"},{trans:"status",value:"recurring_invoice.status",map:"recurring_invoice"},{trans:"public_notes",value:"recurring_invoice.public_notes",map:"recurring_invoice"},{trans:"private_notes",value:"recurring_invoice.private_notes",map:"recurring_invoice"},{trans:"uses_inclusive_taxes",value:"recurring_invoice.uses_inclusive_taxes",map:"recurring_invoice"},{trans:"is_amount_discount",value:"recurring_invoice.is_amount_discount",map:"recurring_invoice"},{trans:"partial",value:"recurring_invoice.partial",map:"recurring_invoice"},{trans:"partial_due_date",value:"recurring_invoice.partial_due_date",map:"recurring_invoice"},{trans:"custom_value1",value:"recurring_invoice.custom_value1",map:"recurring_invoice"},{trans:"custom_value2",value:"recurring_invoice.custom_value2",map:"recurring_invoice"},{trans:"custom_value3",value:"recurring_invoice.custom_value3",map:"recurring_invoice"},{trans:"custom_value4",value:"recurring_invoice.custom_value4",map:"recurring_invoice"},{trans:"surcharge1",value:"recurring_invoice.custom_surcharge1",map:"recurring_invoice"},{trans:"surcharge2",value:"recurring_invoice.custom_surcharge2",map:"recurring_invoice"},{trans:"surcharge3",value:"recurring_invoice.custom_surcharge3",map:"recurring_invoice"},{trans:"surcharge4",value:"recurring_invoice.custom_surcharge4",map:"recurring_invoice"},{trans:"exchange_rate",value:"recurring_invoice.exchange_rate",map:"recurring_invoice"},{trans:"tax_amount",value:"recurring_invoice.total_taxes",map:"recurring_invoice"},{trans:"assigned_user",value:"recurring_invoice.assigned_user_id",map:"recurring_invoice"},{trans:"user",value:"recurring_invoice.user_id",map:"recurring_invoice"},{trans:"frequency",value:"recurring_invoice.frequency_id",map:"recurring_invoice"},{trans:"next_send_date",value:"recurring_invoice.next_send_date",map:"recurring_invoice"},{trans:"auto_bill",value:"recurring_invoice.auto_bill",map:"recurring_invoice"},{trans:"auto_bill_enabled",value:"recurring_invoice.auto_bill_enabled",map:"recurring_invoice"},{trans:"tax_name1",value:"recurring_invoice.tax_name1",map:"recurring_invoice"},{trans:"tax_rate1",value:"recurring_invoice.tax_rate1",map:"recurring_invoice"},{trans:"tax_name2",value:"recurring_invoice.tax_name2",map:"recurring_invoice"},{trans:"tax_rate2",value:"recurring_invoice.tax_rate2",map:"recurring_invoice"},{trans:"tax_name3",value:"recurring_invoice.tax_name3",map:"recurring_invoice"},{trans:"tax_rate3",value:"recurring_invoice.tax_rate3",map:"recurring_invoice"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Zgn=[{trans:"first_name",value:"contact.first_name",map:"contact"},{trans:"last_name",value:"contact.last_name",map:"contact"},{trans:"email",value:"contact.email",map:"contact"},{trans:"phone",value:"contact.phone",map:"contact"},{trans:"custom_value1",value:"contact.custom_value1",map:"contact"},{trans:"custom_value2",value:"contact.custom_value2",map:"contact"},{trans:"custom_value3",value:"contact.custom_value3",map:"contact"},{trans:"custom_value4",value:"contact.custom_value4",map:"contact"},{trans:"name",value:"client.name",map:"contact"},{trans:"user",value:"client.user",map:"contact"},{trans:"assigned_user",value:"client.assigned_user",map:"contact"},{trans:"balance",value:"client.balance",map:"contact"},{trans:"paid_to_date",value:"client.paid_to_date",map:"contact"},{trans:"currency",value:"client.currency_id",map:"contact"},{trans:"website",value:"client.website",map:"contact"},{trans:"private_notes",value:"client.private_notes",map:"contact"},{trans:"industry",value:"client.industry_id",map:"contact"},{trans:"size",value:"client.size_id",map:"contact"},{trans:"address1",value:"client.address1",map:"contact"},{trans:"address2",value:"client.address2",map:"contact"},{trans:"city",value:"client.city",map:"contact"},{trans:"state",value:"client.state",map:"contact"},{trans:"postal_code",value:"client.postal_code",map:"contact"},{trans:"country",value:"client.country_id",map:"contact"},{trans:"custom_value1",value:"client.custom_value1",map:"contact"},{trans:"custom_value2",value:"client.custom_value2",map:"contact"},{trans:"custom_value3",value:"client.custom_value3",map:"contact"},{trans:"custom_value4",value:"client.custom_value4",map:"contact"},{trans:"shipping_address1",value:"client.shipping_address1",map:"contact"},{trans:"shipping_address2",value:"client.shipping_address2",map:"contact"},{trans:"shipping_city",value:"client.shipping_city",map:"contact"},{trans:"shipping_state",value:"client.shipping_state",map:"contact"},{trans:"shipping_postal_code",value:"client.shipping_postal_code",map:"contact"},{trans:"shipping_country",value:"client.shipping_country_id",map:"contact"},{trans:"payment_terms",value:"client.payment_terms",map:"contact"},{trans:"vat_number",value:"client.vat_number",map:"contact"},{trans:"id_number",value:"client.id_number",map:"contact"},{trans:"public_notes",value:"client.public_notes",map:"contact"},{trans:"phone",value:"client.phone",map:"contact"}];/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const WAe=[{trans:"invoice_number",value:"invoice.number",map:"invoice"},{trans:"amount",value:"invoice.amount",map:"invoice"},{trans:"balance",value:"invoice.balance",map:"invoice"},{trans:"paid_to_date",value:"invoice.paid_to_date",map:"invoice"},{trans:"discount",value:"invoice.discount",map:"invoice"},{trans:"po_number",value:"invoice.po_number",map:"invoice"},{trans:"date",value:"invoice.date",map:"invoice"},{trans:"due_date",value:"invoice.due_date",map:"invoice"},{trans:"terms",value:"invoice.terms",map:"invoice"},{trans:"footer",value:"invoice.footer",map:"invoice"},{trans:"status",value:"invoice.status",map:"invoice"},{trans:"public_notes",value:"invoice.public_notes",map:"invoice"},{trans:"private_notes",value:"invoice.private_notes",map:"invoice"},{trans:"uses_inclusive_taxes",value:"invoice.uses_inclusive_taxes",map:"invoice"},{trans:"is_amount_discount",value:"invoice.is_amount_discount",map:"invoice"},{trans:"partial",value:"invoice.partial",map:"invoice"},{trans:"partial_due_date",value:"invoice.partial_due_date",map:"invoice"},{trans:"custom_value1",value:"invoice.custom_value1",map:"invoice"},{trans:"custom_value2",value:"invoice.custom_value2",map:"invoice"},{trans:"custom_value3",value:"invoice.custom_value3",map:"invoice"},{trans:"custom_value4",value:"invoice.custom_value4",map:"invoice"},{trans:"surcharge1",value:"invoice.custom_surcharge1",map:"invoice"},{trans:"surcharge2",value:"invoice.custom_surcharge2",map:"invoice"},{trans:"surcharge3",value:"invoice.custom_surcharge3",map:"invoice"},{trans:"surcharge4",value:"invoice.custom_surcharge4",map:"invoice"},{trans:"exchange_rate",value:"invoice.exchange_rate",map:"invoice"},{trans:"tax_amount",value:"invoice.total_taxes",map:"invoice"},{trans:"assigned_user",value:"invoice.assigned_user_id",map:"invoice"},{trans:"user",value:"invoice.user_id",map:"invoice"},{trans:"recurring_invoice",value:"invoice.recurring_id",map:"invoice"},{trans:"auto_bill",value:"invoice.auto_bill_enabled",map:"invoice"},{trans:"tax_name1",value:"invoice.tax_name1",map:"invoice"},{trans:"tax_rate1",value:"invoice.tax_rate1",map:"invoice"},{trans:"tax_name2",value:"invoice.tax_name2",map:"invoice"},{trans:"tax_rate2",value:"invoice.tax_rate2",map:"invoice"},{trans:"tax_name3",value:"invoice.tax_name3",map:"invoice"},{trans:"tax_rate3",value:"invoice.tax_rate3",map:"invoice"}],ob=11;function Jgn(){const[n]=pe(),e=ci(),t=e==null?void 0:e.custom_fields,i={credit:"invoice",quote:"invoice",recurring_invoice:"invoice",purchase_order:"invoice",recurring_expense:"expense",item:"product"},r=(o,s)=>{const a=o.includes("custom_value")?o.replace("custom_value","custom"):o;return t[a]?dW(t[a]).label():`${s?"contact_custom_value":"custom"}${a.charAt(a.length-1)}`};return(o,s)=>{const a=i[s]||s;return{custom_value1:r(`${a}1`),custom_value2:r(`${a}2`),custom_value3:r(`${a}3`),custom_value4:r(`${a}4`),surcharge1:t.surcharge1,surcharge2:t.surcharge2,surcharge3:t.surcharge3,surcharge4:t.surcharge4,contact_custom_value1:r("vendor_contact1",!0),contact_custom_value2:r("vendor_contact2",!0),contact_custom_value3:r("vendor_contact3",!0),contact_custom_value4:r("vendor_contact4",!0)}[o]||n(o)}}function nm({title:n,droppableId:e,isDropDisabled:t,data:i,onRemove:r}){const[o]=pe(),s=ni(),a=Jgn(),l=c=>{const u=c.value.split(".");return`${o(`${u[0]}`)} - ${a(c.trans,u[0])}`};return N("div",{children:[p("h2",{className:"text-gray-500 font-medium",children:typeof n=="string"?p("p",{children:n}):n()}),p(dK,{droppableId:e,isDropDisabled:t,children:c=>N("div",{style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},className:"w-80 flex-column",ref:c.innerRef,...c.droppableProps,children:[p("div",{className:"overflow-y-scroll h-96 mt-2 border rounded-md divide-y",children:i&&i.map((u,d)=>p(uK,{index:d,draggableId:`left-word-${u.value}`,children:h=>p("div",{ref:h.innerRef,...h.draggableProps,...h.dragHandleProps,children:N("span",{style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},className:"p-2 flex justify-between items-center cursor-move ml-2 text-sm",children:[l(u),e===ob.toString()&&p("button",{style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},type:"button",onClick:()=>r?r(u):null,children:p(kg,{size:15})})]},d)})},u.value))}),c.placeholder]})})]})}const emn=["client","invoice","credit","quote","payment","vendor","purchase_order","task","expense","recurring_invoice","contact"];function tmn({report:n,columns:e}){const{preferences:t}=L1(),i=[e.includes("client")?Kgn:[],e.includes("invoice")?e.includes("item")?WAe.concat(bO.map(o=>({...o,origin:"invoice"}))):WAe:[],e.includes("credit")?e.includes("item")?$Ae.concat(bO.map(o=>({...o,origin:"credit"}))):$Ae:[],e.includes("quote")?e.includes("item")?BAe.concat(bO.map(o=>({...o,origin:"quote"}))):BAe:[],e.includes("payment")?Ggn:[],e.includes("vendor")?Ygn:[],e.includes("purchase_order")?e.includes("item")?VAe.concat(bO.map(o=>({...o,origin:"purchase_order"}))):VAe:[],e.includes("task")?Qgn:[],e.includes("expense")?Xgn:[],e.includes("recurring_invoice")?e.includes("item")?HAe.concat(bO.map(o=>({...o,origin:"recurring_invoice"}))):HAe:[],e.includes("contact")?Zgn:[],[]];return{data:n in t.reports.columns&&t.reports.columns[n].length!==0?t.reports.columns[n]:i,defaultColumns:i}}function nmn({report:n,columns:e}){const[t]=pe(),{update:i}=L1(),{data:r,defaultColumns:o}=tmn({report:n,columns:e}),s=d=>{if(d.destination)try{const h=un.cloneDeep(r),f=parseInt(d.source.droppableId),g=h[f][d.source.index];h[f].splice(d.source.index,1);const m=parseInt(d.destination.droppableId);h[m].splice(d.destination.index,0,g),i(`preferences.reports.columns.${n}`,[...h])}catch{i(`preferences.reports.columns.${n}`,o)}},a=d=>{const h=emn.indexOf(d.map),f=un.cloneDeep(r);f[ob]=f[ob].filter(g=>g.value!==d.value),f[h].push(d),i(`preferences.reports.columns.${n}`,[...f])},l=()=>{i(`preferences.reports.columns.${n}`,o)},c=d=>{const h=un.cloneDeep(r);h[ob]=[...h[ob],...h[d]],h[d]=[],i(`preferences.reports.columns.${n}`,[...h])},u=ni();return p("div",{className:"min-w-min",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(Qt,{className:"my-6",children:p(cK,{onDragEnd:s,children:N("div",{className:"flex w-full py-2 px-6 space-x-4",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[e.includes("client")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("client")}),p("button",{type:"button",onClick:()=>c(0),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[0],droppableId:"0",isDropDisabled:!0}),e.includes("invoice")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",children:[p("p",{children:t("invoice")}),p("button",{type:"button",onClick:()=>c(1),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[1],droppableId:"1",isDropDisabled:!0}),e.includes("credit")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("credit")}),p("button",{type:"button",onClick:()=>c(2),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[2],droppableId:"2",isDropDisabled:!0}),e.includes("quote")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("quote")}),p("button",{type:"button",onClick:()=>c(3),children:p(rm,{size:16})})]}),data:r[3],droppableId:"3",isDropDisabled:!0}),e.includes("payment")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("payment")}),p("button",{type:"button",onClick:()=>c(4),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[4],droppableId:"4",isDropDisabled:!0}),e.includes("vendor")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("vendor")}),p("button",{type:"button",onClick:()=>c(5),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[5],droppableId:"5",isDropDisabled:!0}),e.includes("purchase_order")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("purchase_order")}),p("button",{type:"button",onClick:()=>c(6),children:p(rm,{size:16})})]}),data:r[6],droppableId:"6",isDropDisabled:!0}),e.includes("task")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("task")}),p("button",{type:"button",onClick:()=>c(7),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[7],droppableId:"7",isDropDisabled:!0}),e.includes("expense")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("expense")}),p("button",{type:"button",onClick:()=>c(8),children:p(rm,{size:16})})]}),data:r[8],droppableId:"8",isDropDisabled:!0}),e.includes("recurring_invoice")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("recurring_invoice")}),p("button",{type:"button",onClick:()=>c(9),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[9],droppableId:"9",isDropDisabled:!0}),e.includes("contact")&&p(nm,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("contact")}),p("button",{type:"button",onClick:()=>c(10),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(rm,{size:16})})]}),data:r[10],droppableId:"10",isDropDisabled:!0}),p(nm,{title:()=>N("div",{className:"flex items-center justify-between",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[N("p",{children:[t("report")," ",t("columns")]}),N("div",{style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},className:"flex items-end space-x-1 cursor-pointer",onClick:l,children:[p(kg,{size:19}),N("span",{className:"text-xs",children:["(",t("reset"),")"]})]})]}),data:r[ob],droppableId:ob.toString(),isDropDisabled:!1,onRemove:a})]})})})})}const KGe=Oo(null);function imn(){const[n]=Yo(KGe),[e,t]=w.useState(null),i=[{identifier:"credit.number",format:r=>p(Li,{to:`/credits/${r.value}`,children:r.display_value})}];return w.useEffect(()=>{if(!n)return;const r=un.cloneDeep(n);r.rows.map(o=>{o.map(s=>{const a=i.find(l=>l.identifier===s.identifier);a&&(s.display_value=a.format(s))})}),t(r)},[n]),e}function rmn(){const n=imn(),[e,t]=w.useState(null),[i,r]=w.useState(),[o]=pe();if(!n)return null;const s=(u,d)=>{const h=un.cloneDeep(n);h.rows=h.rows.filter(f=>f.some(g=>{if(g.identifier!==u)return!1;if(typeof g.display_value=="number")return g.display_value.toString().toLowerCase().includes(d.toLowerCase());if(typeof g.display_value=="string")return g.display_value.toLowerCase().includes(d.toLowerCase());if(typeof g.display_value=="object")return g.display_value.props.children.toLowerCase().includes(d.toLowerCase())})),t(h)},a=u=>{const d=(i==null?void 0:i[u])==="asc"?"desc":"asc";r(f=>({...f,[u]:d}));const h=un.cloneDeep(n);h.rows=h.rows.sort((f,g)=>{const m=f.find(_=>_.identifier===u),v=g.find(_=>_.identifier===u);if(m&&v)return d==="asc"?m.display_value>v.display_value?1:-1:m.display_value<v.display_value?1:-1}),t(h)},l=(e==null?void 0:e.rows)||n.rows,c=()=>{const u=[n.columns.map(v=>v.display_value).join(",")];(e?e.rows:n.rows).map(v=>{u.push(v.map(_=>_.display_value.toString()==="true"?"Yes":_.display_value.toString()==="false"?"No":`"${_.display_value}"`).join(","))});const h=u.join(` `),f=new Blob([h],{type:"text/csv;charset=utf-8;"}),g=document.createElement("a"),m=URL.createObjectURL(f);g.setAttribute("href",m),g.setAttribute("download","example.csv"),g.click()};return n?N("div",{id:"preview-table my-4",children:[p("div",{className:"flex justify-end",children:N(Gt,{behavior:"button",onClick:c,children:[o("download")," ",o("csv_file")]})}),N(eE,{children:[p(nE,{children:n.columns.map((u,d)=>p(Fa,{children:N("div",{onClick:()=>a(u.identifier),className:"cursor-pointer inline-flex items-center space-x-2",children:[p("p",{children:u.display_value})," ",p(KAt,{})]})},d))}),N(tE,{children:[p(Ec,{children:n.columns.map((u,d)=>p(ko,{children:p(We,{onValueChange:h=>s(u.identifier,h)})},d))}),l.map((u,d)=>p(Ec,{children:u.map((h,f)=>p(ko,{children:h.display_value},f))},d))]})]})]}):null}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const omn={last7:"last7_days",last30:"last30_days"};function smn(){const n=wi(),{preferences:e}=L1(),t=Ar(TK);return(i,r)=>{let o=[];i.identifier in e.reports.columns&&r&&(o=el(e.reports.columns[i.identifier][ob]).pluck("value").toArray()),t({...l3,report_name:i.identifier,start_date:i.payload.start_date,end_date:i.payload.end_date,client_id:i.payload.client_id||"",date_range:omn[i.payload.date_range]||i.payload.date_range,send_email:!0,is_income_billed:i.payload.is_income_billed??!1,is_expense_billed:i.payload.is_expense_billed??!1,include_tax:i.payload.include_tax??!1,status:i.payload.status||"",product_key:i.payload.product_key||"",document_email_attachment:i.payload.document_email_attachment??!1,clients:i.payload.clients?i.payload.clients.split(","):[],vendors:i.payload.vendors||"",projects:i.payload.projects||"",categories:i.payload.categories||"",report_keys:o,include_deleted:i.payload.include_deleted??!1,pdf_email_attachment:i.payload.pdf_email_attachment??!1}),n("/settings/schedules/create?template=email_report")}}function GGe(n){const[e]=pe(),t=ni(),i=Yk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=oGe({status:["active"]});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.display_name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(dt,{children:[a?p(K,{leftSide:e("clients"),children:p(mv,{id:"clientItemSelector",placeholder:e("clients"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):p("div",{className:"flex justify-center items-center",children:p(ns,{})}),s&&p(Ls,{className:"mt-2",type:"danger",children:s})]})}function YGe(n){const[e]=pe(),t=ni(),i=Yk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=ube({status:["active"]});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(dt,{children:[a?p(K,{leftSide:e("expense_categories"),children:p(mv,{id:"expenseCategoryItemSelector",placeholder:e("expense_categories"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):p("div",{className:"flex justify-center items-center",children:p(ns,{})}),s&&p(Ls,{className:"mt-2",type:"danger",children:s})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function QLr(n){const e=ps();return Ti(["/api/v1/projects/create"],()=>Ae("GET",Te("/api/v1/projects/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_project")?(n==null?void 0:n.enabled)??!0:!1})}function XLr(n){return Ti(["/api/v1/projects",n.id],()=>Ae("GET",Te("/api/v1/projects/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}function amn(n){return Ti(["/api/v1/projects",n],()=>{var e;return Ae("GET",Te("/api/v1/projects?status=:status",{status:((e=n==null?void 0:n.status)==null?void 0:e.join(","))??"all"})).then(t=>t.data.data)},{staleTime:1/0})}function QGe(n){const[e]=pe(),t=ni(),i=Yk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=amn({status:["active"]});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(dt,{children:[a?p(K,{leftSide:e("projects"),children:p(mv,{id:"projectItemSelector",placeholder:e("projects"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):p("div",{className:"flex justify-center items-center",children:p(ns,{})}),s&&p(Ls,{className:"mt-2",type:"danger",children:s})]})}function XGe(n){const[e]=pe(),t=ni(),i=Yk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=xhn({});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(dt,{children:[a?p(K,{leftSide:e("vendors"),children:p(mv,{id:"vendorItemSelector",placeholder:e("vendors"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):p("div",{className:"flex justify-center items-center",children:p(ns,{})}),s&&p(Ls,{className:"mt-2",type:"danger",children:s})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const lmn={client:["document_email_attachment","include_deleted"],invoice:["document_email_attachment","status","include_deleted","client","pdf_email_attachment"],invoice_item:["document_email_attachment","product_key","include_deleted","status","client"],quote:["document_email_attachment","include_deleted","status","client","pdf_email_attachment"],quote_item:["document_email_attachment","include_deleted","status","client"],credit:["document_email_attachment","include_deleted","status","client","pdf_email_attachment"],document:["document_email_attachment"],payment:["document_email_attachment","status","client"],expense:["document_email_attachment","clients","vendors","projects","categories","include_deleted","status"],task:["document_email_attachment","include_deleted","status","client"],product:["document_email_attachment"],vendor:["document_email_attachment"],purchase_order:["document_email_attachment","include_deleted","status","pdf_email_attachment"],purchase_order_item:["document_email_attachment","include_deleted","status"],activity:[],contact:[],recurring_invoice:["include_deleted","status","client"],product_sales:["product_key","client"],aged_receivable_detailed_report:[],aged_receivable_summary_report:[],client_balance_report:[],client_sales_report:[],profitloss:["is_expense_billed","is_income_billed","include_tax"],tax_summary_report:[],user_sales_report:[]};function cmn(n){const{report:e}=n;return t=>!!lmn[e].includes(t)}function umn(n){const[e]=pe(),t=pa();return p(dt,{children:!Vm()&&!rc()&&p("div",{className:n==null?void 0:n.className,children:p(Ls,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center justify-between",children:[N("p",{className:"inline-flex items-center space-x-1",children:[p(OT,{fontSize:18}),N("span",{children:[e("start_free_trial_message"),"."]})]}),(t==null?void 0:t.company_user)&&p(Li,{to:t.company_user.ninja_portal_url||bt("/settings/account_management"),className:"ml-10",external:!0,children:e("plan_change")})]})})})})}const kW=[{identifier:"all",label:"all",scheduleIdentifier:"all"},{identifier:"last7",label:"last_7_days",scheduleIdentifier:"last7_days"},{identifier:"last30",label:"last_30_days",scheduleIdentifier:"last30_days"},{identifier:"this_month",label:"this_month",scheduleIdentifier:"this_month"},{identifier:"last_month",label:"last_month",scheduleIdentifier:"last_month"},{identifier:"this_quarter",label:"this_quarter",scheduleIdentifier:"this_quarter"},{identifier:"last_quarter",label:"last_quarter",scheduleIdentifier:"last_quarter"},{identifier:"this_year",label:"this_year",scheduleIdentifier:"this_year"},{identifier:"custom",label:"custom",scheduleIdentifier:"custom"}],dmn=(n,e)=>{const t=new Blob([n],{type:"text/csv"}),i=URL.createObjectURL(t),r=document.createElement("a");r.download=`${e}.csv`,r.href=i,r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r)};function hmn(){var P,F;const{documentTitle:n}=Pi("reports"),{t:e}=pe(),t=qGe(),i=_o(),r=smn(),[o,s]=w.useState(t[0]),[a,l]=w.useState(!1),[c,u]=w.useState(),[d,h]=w.useState(!1),f=cmn({report:o.identifier}),{save:g,preferences:m}=L1(),v=[{name:e("reports"),href:"/reports"}],_=B=>{const M=t.find(V=>V.identifier===B);h(!1),M&&s(M)},b=(B,M)=>{s(V=>({...V,payload:{...V.payload,[B]:M}}))},y=B=>{const M=kW.find(V=>V.identifier===B);M&&s(V=>({...V,payload:{...V.payload,date_range:M.identifier}}))},C=(B,M)=>{s(V=>({...V,payload:{...V.payload,[B]:M}}))},x=B=>{s(M=>({...M,payload:{...M.payload,send_email:B}}))},E=()=>{ce.processing(),l(!0),u(void 0);const{client_id:B}=o.payload;let M=o.identifier==="product_sales"?{...o.payload,client_id:B||null}:o.payload,V=[];o.identifier in m.reports.columns&&d&&(V=el(m.reports.columns[o.identifier][ob]).pluck("value").toArray()),M={...M,report_keys:V},Ae("POST",Te(o.endpoint),M,{}).then(U=>{if(o.payload.send_email)return l(!1),ce.success();const W=U.data.message;i.fetchQuery({queryKey:["exports",W],queryFn:()=>Ae("POST",Te(`/api/v1/exports/preview/${W}`)).then(q=>q.data),retry:50,retryDelay:2e3}).then(q=>{dmn(q,o.identifier),ce.success()}).catch(q=>{console.error(q),ce.error()}).finally(()=>{l(!1)})}).catch(U=>{var W;((W=U.response)==null?void 0:W.status)===422&&u(U.response.data),l(!1)}).finally(()=>{d&&g({silent:!0})})},[k,L]=Yo(KGe),D=B=>{if(typeof B!="string")return B;const M=parseFloat(B.toString());return!isNaN(M)&&typeof M=="number"?parseFloat(B.toString().replace(/\./g,"").replace(",",".")):B},A=async()=>{u(void 0),L(null);const{client_id:B}=o.payload;let M=o.identifier==="product_sales"?{...o.payload,client_id:B||null}:o.payload,V=[];o.identifier in m.reports.columns&&d&&(V=el(m.reports.columns[o.identifier][ob]).pluck("value").toArray()),M={...M,report_keys:V},Ae("POST",Te(o.preview),M,{}).then(U=>{const W=U.data.message;i.fetchQuery({queryKey:["reports",W],queryFn:()=>Ae("POST",Te(`/api/v1/reports/preview/${W}`)).then(q=>q.data),retry:10,retryDelay:5e3}).then(q=>{const{columns:H,...ie}=q;L({columns:H,rows:Object.values(ie).map(se=>se.map(Q=>({...Q,display_value:D(Q.display_value)})))}),ce.success()})})};w.useEffect(()=>()=>{i.cancelQueries(["reports"]),ce.dismiss(),L(null)},[]);const O=ni();return N(BN,{title:n,breadcrumbs:v,onSaveClick:E,saveButtonLabel:e("export"),disableSaveButton:a||!Vm()&&!rc(),navigationTopRight:N($m,{label:e("more_actions"),disabled:!Vm()&&!rc(),children:[o.supports_previews&&p(tn,{icon:p(vt,{element:ixt}),onClick:A,children:e("preview")}),p(tn,{icon:p(vt,{element:cme}),onClick:()=>r(o,d),children:e("schedule")})]}),children:[p(umn,{}),N("div",{className:"grid grid-cols-12 gap-4",style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},children:[N(Qt,{className:"col-span-6 h-max",children:[p(K,{leftSide:e("report"),children:p(Cn,{onValueChange:B=>{_(B),L(null)},value:o.identifier,cypressRef:"reportNameSelector",children:t.map((B,M)=>p("option",{value:B.identifier,children:e(B.label)},M))})}),p(K,{leftSide:e("send_email"),children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:o.payload.send_email,onValueChange:x})}),f("document_email_attachment")&&p(K,{leftSide:e("document_email_attachment"),children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:o.payload.document_email_attachment,onValueChange:B=>b("document_email_attachment",B),cypressRef:"scheduleDocumentEmailAttachment"})}),f("pdf_email_attachment")&&p(K,{leftSide:e("attach_pdf"),children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:o.payload.pdf_email_attachment,onValueChange:B=>b("pdf_email_attachment",B)})}),f("is_expense_billed")&&p(K,{leftSide:e("expense_paid_report"),children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:o.payload.is_expense_billed,onValueChange:B=>b("is_expense_billed",B),cypressRef:"expenseBilled"})}),f("is_income_billed")&&p(K,{leftSide:e("cash_vs_accrual"),children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:o.payload.is_income_billed,onValueChange:B=>b("is_income_billed",B),cypressRef:"incomeBilled"})}),f("include_tax")&&p(K,{leftSide:e("include_tax"),children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:o.payload.include_tax,onValueChange:B=>b("include_tax",B),cypressRef:"includeTax"})}),f("include_deleted")&&p(K,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:o.payload.include_deleted,onValueChange:B=>b("include_deleted",B),cypressRef:"includeDeleted"})}),f("status")&&p(K,{leftSide:e("status"),className:"mb-50 py-50",children:p(jGe,{report:o.identifier,onValueChange:B=>b("status",B)})}),f("product_key")&&p(dGe,{onValueChange:B=>b("product_key",B)}),f("clients")&&p(GGe,{value:o.payload.clients,onValueChange:B=>b("clients",B)}),f("vendors")&&p(XGe,{value:o.payload.vendors,onValueChange:B=>b("vendors",B)}),f("projects")&&p(QGe,{value:o.payload.projects,onValueChange:B=>b("projects",B)}),f("categories")&&p(YGe,{value:o.payload.categories,onValueChange:B=>b("categories",B)})]}),N(Qt,{className:"col-span-6 h-max",children:[p(K,{leftSide:e("range"),children:p(Cn,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1},onValueChange:B=>y(B),value:o.payload.date_range,cypressRef:"reportDateRange",children:kW.map((B,M)=>p("option",{value:B.identifier,children:e(B.label)},M))})}),o.payload.date_range==="custom"&&p(K,{leftSide:e("start_date"),children:p(We,{type:"date",value:o.payload.start_date,onValueChange:B=>C("start_date",B),errorMessage:(P=c==null?void 0:c.errors)==null?void 0:P.start_date,cypressRef:"reportStartDate"})}),o.payload.date_range==="custom"&&p(K,{leftSide:e("end_date"),children:p(We,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},type:"date",value:o.payload.end_date,onValueChange:B=>C("end_date",B),errorMessage:(F=c==null?void 0:c.errors)==null?void 0:F.end_date,cypressRef:"reportEndDate"})}),f("client")&&p(K,{leftSide:e("client"),children:p(xK,{value:o.payload.client_id,onChange:B=>b("client_id",B.id),clearButton:!0,onClearButtonClick:()=>b("client_id",""),withoutAction:!0})}),o.allow_custom_column&&p(K,{leftSide:`${e("customize")} ${e("columns")}`,children:p(ft,{style:{color:O.$3,colorScheme:O.$0,backgroundColor:O.$1,borderColor:O.$4},checked:d,onValueChange:B=>h(!!B)})})]})]}),d&&p(nmn,{report:o.identifier,columns:o.custom_columns}),k&&p(rmn,{})]})}const fmn=Object.freeze(Object.defineProperty({__proto__:null,default:hmn,ranges:kW},Symbol.toStringTag,{value:"Module"})),Fc=["send_email","range","start_date","end_date"],ZGe={invoice:[...Fc,"status","document_email_attachment","report_keys","include_deleted","client","pdf_email_attachment"],invoice_item:[...Fc,"products","document_email_attachment","report_keys","status","include_deleted","client"],product_sales:[...Fc,"products","client"],profitloss:[...Fc,"expense_billed","income_billed","include_tax"],client:[...Fc,"document_email_attachment","report_keys","include_deleted"],contact:[...Fc,"report_keys"],recurring_invoice:[...Fc,"report_keys","status","include_deleted","client"],quote:[...Fc,"document_email_attachment","report_keys","status","include_deleted","client","pdf_email_attachment"],quote_item:[...Fc,"document_email_attachment","report_keys","status","include_deleted","client"],credit:[...Fc,"document_email_attachment","report_keys","include_deleted","status","client","pdf_email_attachment"],document:[...Fc,"document_email_attachment"],payment:[...Fc,"document_email_attachment","report_keys","status","client"],expense:[...Fc,"document_email_attachment","clients","vendors","projects","categories","report_keys","status","include_deleted"],task:[...Fc,"document_email_attachment","report_keys","status","include_deleted","client"],product:[...Fc,"document_email_attachment"],vendor:[...Fc,"document_email_attachment","report_keys"],purchase_order:[...Fc,"document_email_attachment","report_keys","status","include_deleted","pdf_email_attachment"],purchase_order_item:[...Fc,"document_email_attachment","report_keys","status","include_deleted"]};function pmn(n){const[e]=pe(),t=qGe(),{schedule:i,handleChange:r,errors:o}=n,s=a=>(ZGe[i.parameters.report_name]||Fc).includes(a);return N(dt,{children:[p(K,{leftSide:e("report"),children:p(Cn,{value:i.parameters.report_name,onValueChange:a=>r("parameters.report_name",a),errorMessage:o==null?void 0:o.errors["parameters.report_name"],cypressRef:"scheduleReportName",children:t.map((a,l)=>p("option",{value:a.schedule_identifier||a.identifier,children:e(a.label)},l))})}),s("send_email")&&p(K,{leftSide:e("send_email"),children:p(ft,{checked:i.parameters.send_email,onValueChange:a=>r("parameters.send_email",a),disabled:!0,cypressRef:"scheduleSendEmail"})}),s("document_email_attachment")&&p(K,{leftSide:e("document_email_attachment"),children:p(ft,{checked:i.parameters.document_email_attachment,onValueChange:a=>r("parameters.document_email_attachment",a),cypressRef:"scheduleDocumentEmailAttachment"})}),s("pdf_email_attachment")&&p(K,{leftSide:e("attach_pdf"),children:p(ft,{checked:i.parameters.pdf_email_attachment,onValueChange:a=>r("parameters.pdf_email_attachment",a)})}),s("expense_billed")&&p(K,{leftSide:e("expense_paid_report"),children:p(ft,{checked:i.parameters.is_expense_billed,onValueChange:a=>r("parameters.is_expense_billed",a),cypressRef:"expenseBilled"})}),s("income_billed")&&p(K,{leftSide:e("cash_vs_accrual"),children:p(ft,{checked:i.parameters.is_income_billed,onValueChange:a=>r("parameters.is_income_billed",a),cypressRef:"incomeBilled"})}),s("include_tax")&&p(K,{leftSide:e("include_tax"),children:p(ft,{checked:i.parameters.include_tax,onValueChange:a=>r("parameters.include_tax",a),cypressRef:"includeTax"})}),s("include_deleted")&&p(K,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:p(ft,{checked:i.parameters.include_deleted,onValueChange:a=>r("parameters.include_deleted",a),cypressRef:"includeDeleted"})}),s("status")&&p(K,{leftSide:e("status"),children:p(jGe,{report:i.parameters.report_name,value:i.parameters.status,onValueChange:a=>r("parameters.status",a),errorMessage:o==null?void 0:o.errors["parameters.status"]})}),s("products")&&p(dGe,{value:i.parameters.product_key,onValueChange:a=>r("parameters.product_key",a),errorMessage:o==null?void 0:o.errors["parameters.product_key"]}),s("range")&&p(K,{leftSide:e("range"),children:p(Cn,{value:i.parameters.date_range,onValueChange:a=>r("parameters.date_range",a),errorMessage:o==null?void 0:o.errors["parameters.date_range"],cypressRef:"scheduleDateRange",children:kW.map((a,l)=>p("option",{value:a.scheduleIdentifier,children:e(a.label)},l))})}),s("range")&&i.parameters.date_range==="custom"&&N(dt,{children:[p(K,{leftSide:e("start_date"),children:p(We,{type:"date",value:i.parameters.start_date,onValueChange:a=>r("parameters.start_date",a),errorMessage:o==null?void 0:o.errors["parameters.start_date"],cypressRef:"scheduleStartDate"})}),p(K,{leftSide:e("end_date"),children:p(We,{type:"date",value:i.parameters.end_date,onValueChange:a=>r("parameters.end_date",a),errorMessage:o==null?void 0:o.errors["parameters.end_date"],cypressRef:"scheduleEndDate"})})]}),s("client")&&p(K,{leftSide:e("client"),children:p(xK,{value:i.parameters.client_id,onChange:a=>r("parameters.client_id",a.id),clearButton:!0,onClearButtonClick:()=>r("parameters.client_id",""),withoutAction:!0,errorMessage:o==null?void 0:o.errors["parameters.client_id"]})}),s("clients")&&p(GGe,{value:i.parameters.clients.join(","),onValueChange:a=>{const l={...i.parameters};l.clients=a?[...a.split(",")]:[],r("parameters",l)},errorMessage:o==null?void 0:o.errors["parameters.clients"]}),s("vendors")&&p(XGe,{value:i.parameters.vendors,onValueChange:a=>r("parameters.vendors",a),errorMessage:o==null?void 0:o.errors["parameters.vendors"]}),s("projects")&&p(QGe,{value:i.parameters.projects,onValueChange:a=>r("parameters.projects",a),errorMessage:o==null?void 0:o.errors["parameters.projects"]}),s("categories")&&p(YGe,{value:i.parameters.categories,onValueChange:a=>r("parameters.categories",a),errorMessage:o==null?void 0:o.errors["parameters.categories"]})]})}var Tae=(n=>(n.EMAIL_STATEMENT="email_statement",n.EMAIL_RECORD="email_record",n.EMAIL_REPORT="email_report",n))(Tae||{});function JGe(n){const[e]=pe(),{schedule:t,handleChange:i,errors:r,page:o}=n,s=bfn({template:t.template});return N(Qt,{title:e(o==="edit"?"edit_schedule":"new_schedule"),children:[s("template")&&p(K,{leftSide:e("template"),required:!0,children:N(Cn,{value:t.template,onValueChange:a=>i("template",a),errorMessage:r==null?void 0:r.errors.template,children:[p("option",{value:"email_statement",children:e("email_statement")}),p("option",{value:"email_record",children:e("email_record")}),p("option",{value:"email_report",children:e("email_report")})]})}),s("next_run")&&p(K,{leftSide:e("next_run"),required:!0,children:p(We,{type:"date",value:t.next_run,onValueChange:a=>i("next_run",a),errorMessage:r==null?void 0:r.errors.next_run})}),s("frequency")&&p(K,{leftSide:e("frequency"),children:p(Cn,{value:t.frequency_id,onValueChange:a=>i("frequency_id",a),errorMessage:r==null?void 0:r.errors.frequency_id,children:Object.keys(zT).map((a,l)=>p("option",{value:a,children:e(zT[a])},l))})}),s("remaining_cycles")&&p(K,{leftSide:e("remaining_cycles"),children:N(Cn,{value:t.remaining_cycles,onValueChange:a=>i("remaining_cycles",parseInt(a)),errorMessage:r==null?void 0:r.errors.remaining_cycles,children:[p("option",{value:"-1",children:e("endless")}),[...Array(60).keys()].map((a,l)=>p("option",{value:a,children:a},l))]})}),t.template&&p(_i,{}),t.template==="email_statement"&&p(mfn,{schedule:t,handleChange:i,errors:r,page:o}),t.template==="email_record"&&p(_fn,{schedule:t,handleChange:i,errors:r}),t.template==="email_report"&&p(pmn,{schedule:t,handleChange:i,errors:r})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function gmn(){const[n]=pe();return[{id:"name",label:n("name"),format:(t,i)=>i.template===Tae.EMAIL_RECORD?`${n(i.template)}: ${n(i.parameters.entity)}`:i.template===Tae.EMAIL_REPORT?`${n(i.template)}: ${n(i.parameters.report_name)} | ${n(i.parameters.date_range)}`:`${n(i.template)}: ${n(i.parameters.date_range)}`},{id:"next_run",label:n("next_run")},{id:"frequency_id",label:n("frequency"),format:t=>n(zT[t])}]}function mmn(){const{documentTitle:n}=Pi("schedules"),[e]=pe(),t=gmn(),i=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"}];return p(ir,{title:n,docsLink:"en/advanced-settings/#schedules",breadcrumbs:i,children:p(Ng,{resource:"schedule",endpoint:"/api/v1/task_schedulers?sort=id|desc",bulkRoute:"/api/v1/task_schedulers/bulk",columns:t,linkToCreate:"/settings/schedules/create",linkToEdit:"/settings/schedules/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const _mn={range:"date_range",expense_billed:"is_expense_billed",income_billed:"is_income_billed",products:"product_key",client:"client_id"};function vmn(n){const{schedule:e}=n;return{email_statement:["date_range","status","show_aging_table","show_credits_table","show_payments_table","only_clients_with_invoices","clients"],email_record:["entity","entity_id"],email_report:["report_name",...(()=>{if(e){let r=(ZGe[e.parameters.report_name]||Fc).map(o=>_mn[o]||o);return e.parameters.date_range!=="custom"&&(r=r.filter(o=>o!=="start_date"&&o!=="end_date")),r}return[]})()]}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const bmn={email_statement:["template","next_run","frequency_id","remaining_cycles","parameters"],email_record:["template","next_run","parameters"],email_report:["template","next_run","frequency_id","remaining_cycles","parameters"]},ymn=["vendors","projects","categories"];function eYe(n){const{schedule:e}=n,t=vmn({schedule:e});return()=>{if(e){let i={};const r=bmn[e.template],o=t[e.template];return Object.entries(e.parameters).forEach(([s])=>{o.includes(s)||delete e.parameters[s]}),Object.entries(e).forEach(([s,a])=>{r.includes(s)&&(i={...i,[s]:a})}),Object.entries(e.parameters).forEach(([s,a])=>{ymn.includes(s)&&(i={...i,parameters:{...i.parameters,[s]:a||""}})}),i}}}function Cmn(){const{documentTitle:n}=Pi("new_schedule"),[e]=pe(),t=wi(),[i]=dF(),r=I0(),o=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("new_schedule"),href:"/settings/schedules/create"}],{data:s}=CGe(),[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=Yo(TK),[f,g]=w.useState(!1),m=wGe({setErrors:u,setSchedule:l,schedule:a}),v=eYe({schedule:a});return w.useEffect(()=>{s&&l(()=>{let b=d;return i.get("template")||(b=void 0,h(void 0)),{...s,template:i.get("template")||"email_statement",frequency_id:Zd.Monthly,remaining_cycles:-1,parameters:b||{...l3}}})},[s]),N(ir,{title:n,breadcrumbs:o,disableSaveButton:f||!a||r,onSaveClick:()=>{!f&&a&&(g(!0),u(void 0),ce.processing(),Ae("POST",Te("/api/v1/task_schedulers"),v()).then(b=>{ce.success("created_schedule"),En(["task_schedulers"]),t(bt("/settings/schedules/:id/edit",{id:b.data.data.id}))}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(u(b.response.data),ce.dismiss())}).finally(()=>g(!1)))},children:[r&&p(Iv,{}),a?p(JGe,{schedule:a,handleChange:m,errors:c}):p(ns,{})]})}function wmn(){const[n]=pe(),e=apn();return[i=>Sr(i)===Zi.Active&&p(tn,{onClick:()=>e([i.id],"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),i=>(Sr(i)===Zi.Archived||Sr(i)===Zi.Deleted)&&p(tn,{onClick:()=>e([i.id],"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),i=>(Sr(i)===Zi.Active||Sr(i)===Zi.Archived)&&p(tn,{onClick:()=>e([i.id],"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function Smn(){const{documentTitle:n}=Pi("edit_schedule"),[e]=pe(),{id:t}=il(),i=wmn(),r=I0(),o=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("edit_schedule"),href:bt("/settings/schedules/:id/edit")}],{data:s}=spn({id:t}),[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=w.useState(!1),f=wGe({setErrors:u,setSchedule:l,schedule:a}),g=eYe({schedule:a}),m=()=>{!d&&a&&(h(!0),u(void 0),ce.processing(),Ae("PUT",Te("/api/v1/task_schedulers/:id",{id:t}),g()).then(()=>{ce.success("updated_schedule"),En(["task_schedulers"])}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(u(v.response.data),ce.dismiss())}).finally(()=>h(!1)))};return w.useEffect(()=>{s&&l(s)},[s]),N(ir,{title:n,breadcrumbs:o,navigationTopRight:a&&p(D1,{resource:a,onSaveClick:m,actions:i,disableSaveButton:d||!a||r}),children:[r&&p(Iv,{}),a?p(JGe,{schedule:a,handleChange:f,errors:c,page:"edit"}):p(ns,{})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Emn(){const{t:n}=pe();return[{name:n("backup"),href:"/settings/backup_restore"},{name:n("restore"),href:"/settings/backup_restore/restore"}]}function xmn(){const[n]=pe(),e=Emn(),t=[{name:n("settings"),href:"/settings"},{name:n("backup_restore"),href:"/settings/backup_restore"}];return N(ir,{title:n("backup_restore"),breadcrumbs:t,children:[p(QS,{tabs:e,className:"mt-6"}),p("div",{className:"my-4",children:p(Tg,{})})]})}function Tmn(n){const[e]=pe(),{data:t}=xWe(),[i,r]=w.useState(!1),[o,s]=w.useState(),[a,l]=w.useState(),c=YKe(a,s,r,i,n.setIsModalOpen,n.onCreatedBankAccount),u=(f,g)=>{l(m=>m&&{...m,[f]:g})},d=()=>{i||n.setIsModalOpen(!1)};w.useEffect(()=>{t&&l(t)},[t]);const h=ni();return N(Ui,{title:e("new_bank_account"),visible:n.isModalOpen,onClose:d,children:[p(We,{style:{color:h.$3,colorScheme:h.$0},label:e("name"),value:a==null?void 0:a.bank_account_name,onValueChange:f=>u("bank_account_name",f),errorMessage:o==null?void 0:o.errors.bank_account_name}),p("div",{className:"flex justify-end",children:p(Gt,{onClick:c,style:{color:h.$3,colorScheme:h.$0},children:e("save")})})]})}function kmn(n){var s;const[e]=pe(),[t,i]=w.useState(!1),{isAdmin:r,isOwner:o}=Po();return N(dt,{children:[p(Tmn,{isModalOpen:t,setIsModalOpen:i,onCreatedBankAccount:a=>n.onChange(a)}),p(Fh,{endpoint:Te("/api/v1/bank_integrations?status=active"),onChange:a=>a.resource&&n.onChange(a.resource),inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value||null},entryOptions:{id:"id",label:"bank_account_name",value:"id"},action:{label:e("new_bank_account"),onClick:()=>i(!0),visible:r||o},readonly:n.readonly,onDismiss:n.onClearButtonClick,sortBy:"bank_account_name|desc",staleTime:n.staleTime,errorMessage:n.errorMessage})]})}function Imn(n){const[e]=pe(),t=Qi(),i=wi(),{onImport:r,importMap:o,entity:s}=n,a=aF(),l=Ha(),[c,u]=w.useState(!1),[d,h]=w.useState(!1),[f,g]=w.useState(!1),[m,v]=w.useState(""),_=()=>{v(""),u(!1),i(`/${s}s`)},b=()=>{var k,L;if(!((k=l==null?void 0:l.import_templates)!=null&&k[s]))return!0;if(!Object.keys(o.column_map).length)return!1;let E=!1;return Object.values((L=l==null?void 0:l.import_templates)==null?void 0:L[s]).forEach(D=>{var A,O;un.isEqual(Object.values(D).map(P=>P||""),Object.values((O=(A=o.column_map)==null?void 0:A[s])==null?void 0:O.mapping).map(P=>P||""))&&(E=!0)}),!E},y=()=>{var k,L;if(!((k=l==null?void 0:l.import_templates)!=null&&k[s]))return!1;let E=!1;return Object.keys((L=l==null?void 0:l.import_templates)==null?void 0:L[s]).forEach(D=>{D===m&&(E=!0)}),E},C=()=>{var E,k,L,D;if(!f&&m){ce.processing(),g(!0);const A=un.cloneDeep(a);if(A){const O=un.cloneDeep((k=(E=A.company_user)==null?void 0:E.react_settings.import_templates)==null?void 0:k[n.entity])||{},P={};Array.isArray(O)||Object.entries(O).forEach(([F,B])=>{!F||!B||!Array.isArray(B)||(P[F]=B)}),P[m]=Object.values((D=(L=o.column_map)==null?void 0:L[n.entity])==null?void 0:D.mapping).map(F=>F||""),un.set(A,`company_user.react_settings.import_templates.${n.entity}`,P),Ae("PUT",Te("/api/v1/company_users/:id",{id:A.id}),A).then(F=>{ce.success("updated_settings"),un.set(A,"company_user",F.data.data),En(["company_users"]),t(qy(A)),_(),i(`/${s}s`)}).finally(()=>g(!1))}}};return N(dt,{children:[p(Gt,{className:"flex float-right",behavior:"button",onClick:()=>{var E;(E=r())==null||E.then(()=>b()?h(!0):i(`/${s}s`))},children:e("import")}),N(Ui,{title:e("save_as_template"),visible:c,onClose:_,children:[p(We,{label:e("name"),value:m,onValueChange:E=>v(E),changeOverride:!0}),p(Gt,{behavior:"button",onClick:C,disabled:!m||y()||f,disableWithoutIcon:!0,children:e("save")})]}),N(Ui,{title:e("save_as_template"),visible:d,onClose:()=>{h(!1),i(`/${s}s`)},children:[p("span",{className:"font-medium text-base",children:e("save_template_body")}),N("div",{className:"flex justify-between",children:[p(Gt,{behavior:"button",type:"secondary",onClick:()=>{h(!1),i(`/${s}s`)},children:e("no")}),p(Gt,{behavior:"button",onClick:()=>{h(!1),setTimeout(()=>{u(!0)},310)},children:e("yes")})]})]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Lmn(n){var o,s;const e=Ha(),{entity:t}=n,i=Object.keys(((o=e==null?void 0:e.import_templates)==null?void 0:o[t])||{}).length,r=Object.keys(((s=e==null?void 0:e.import_templates)==null?void 0:s[t])||{});return{numberOfTemplates:i,templates:r}}function Dmn(n){const e=Qi(),{name:t,entity:i,onDeletedTemplate:r}=n,o=aF(),[s,a]=w.useState(!1),l=()=>{var c,u,d,h,f,g,m,v,_,b,y,C,x;if(!s){ce.processing(),a(!0);const E=un.cloneDeep(o);E&&(Object.keys(((d=(u=(c=E==null?void 0:E.company_user)==null?void 0:c.react_settings)==null?void 0:u.import_templates)==null?void 0:d[i])||{}).length>1?(g=(f=(h=E==null?void 0:E.company_user)==null?void 0:h.react_settings)==null?void 0:f.import_templates)==null||delete g[i][t]:Object.keys(((v=(m=E==null?void 0:E.company_user)==null?void 0:m.react_settings)==null?void 0:v.import_templates)||{}).length>1?(y=(b=(_=E==null?void 0:E.company_user)==null?void 0:_.react_settings)==null?void 0:b.import_templates)==null||delete y[i]:(x=(C=E==null?void 0:E.company_user)==null?void 0:C.react_settings)==null||delete x.import_templates,Ae("PUT",Te("/api/v1/company_users/:id",{id:E.id}),E).then(L=>{ce.success("updated_settings"),un.set(E,"company_user",L.data.data),En(["company_users"]),e(qy(E)),r()}).finally(()=>a(!1)))}};return p(K,{children:N("div",{className:"flex items-center space-x-10",children:[p("span",{className:"font-medium",children:t}),p("div",{className:Nt({"cursor-pointer":!s,"cursor-not-allowed":s}),onClick:()=>!s&&l(),children:p(vt,{element:gl,size:22})})]})})}function tYe(n){const[e]=pe(),t=n.type==="zip",i={...!t&&{"text/*":[".csv"]},...t&&{"application/zip":[".zip"]}},r=ni(),o=Ha(),{numberOfTemplates:s,templates:a}=Lmn({entity:n.entity}),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,f]=w.useState(new FormData),[g,m]=w.useState([]),[v,_]=w.useState(),[b,y]=w.useState({hash:"",import_type:n.type,skip_header:!0,column_map:{[n.entity]:{mapping:{}}}}),[C,x]=w.useState(),[E,k]=w.useState(""),[L,D]=w.useState({}),A=ke=>{b.column_map[n.entity].mapping[ke.target.id]=ke.target.value,y({...b}),k("")},O=()=>{var Me,je;const ke={};Object.entries(((je=(Me=o==null?void 0:o.import_templates)==null?void 0:Me[n.entity])==null?void 0:je[E])||{}).forEach(([qe,Be])=>{ke[qe]=Be||""}),y(qe=>({...qe,column_map:{[n.entity]:{mapping:ke}}}))},P=()=>{k(""),y(ke=>({...ke,column_map:{[n.entity]:{mapping:{...L}}}}))},F=ke=>{const Me=ke.split(".");let je=Me[1];return Me[1]=="user_id"&&(je="user"),Me[1]=="shipping_country_id"&&(je="shipping_country"),`${e(Me[0])} - ${e(je)}`},B=()=>{if(!g.length&&t){ce.error("select_file");return}ce.processing(),x(void 0);let ke="/api/v1/import",Me={};if(t)if(!l&&!u){ce.error("settings_or_data");return}else ke="/api/v1/import_json?",l&&(ke+="&import_settings=:import_settings",Me={import_settings:!0}),u&&(ke+="&import_data=:import_data",Me={...Me,import_data:!0});else b.hash=v.hash;const je=t?h:b;return Ae("POST",Te(ke,Me),je).then(qe=>{var Be,_t;ce.success(((Be=qe==null?void 0:qe.data)==null?void 0:Be.message)??"error_title"),(_t=n.onFileImported)==null||_t.call(n),n.onSuccess}).catch(qe=>{var Be;((Be=qe.response)==null?void 0:Be.status)===422&&(ce.dismiss(),x(qe.response.data))})},M=ke=>{b.column_map[n.entity].mapping[ke]&&(b.column_map[n.entity].mapping[ke]="",k(""),y({...b}))},V=td({enableReinitialize:!0,initialValues:{},onSubmit:()=>{ce.processing(),x(void 0),Ae("POST",Te("/api/v1/preimport"),h).then(ke=>{var Me,je,qe,Be;_(ke.data),n.onSuccess,ce.dismiss(),(je=(Me=ke.data)==null?void 0:Me.mappings[n.entity])!=null&&je.hints&&((Be=(qe=ke.data)==null?void 0:qe.mappings[n.entity])==null||Be.hints.forEach((_t,Wt)=>{var Tt,rn,_n;b.column_map[n.entity].mapping[Wt]=((Tt=ke.data)==null?void 0:Tt.mappings[n.entity].available[_t])??"",y(b),D({...(_n=(rn=b==null?void 0:b.column_map)==null?void 0:rn[n.entity])==null?void 0:_n.mapping})})),k("")}).catch(ke=>{var Me;((Me=ke.response)==null?void 0:Me.status)===422&&(ce.dismiss(),x(ke.response.data))})}}),U=()=>{g.forEach(ke=>{h.append("files",ke)}),f(h)},W=ke=>{var Me,je;return Object.keys((Me=b==null?void 0:b.column_map[n.entity])==null?void 0:Me.mapping).length?((je=b==null?void 0:b.column_map[n.entity])==null?void 0:je.mapping[ke])??null:null},q=ke=>{const Me=g.filter((qe,Be)=>ke!==Be),je=new FormData;Me.forEach(qe=>{je.append("files",qe)}),m(Me),f(je)},H=ke=>new Promise(Me=>{try{const je=new FileReader;je.onload=qe=>{var Wt;const _t=(((Wt=qe.target)==null?void 0:Wt.result)||"").split(` `);!_t.length||_t.length===1||_t.length===2&&!_t[1]?Me(!1):Me(!0)},je.readAsText(ke)}catch{Me(!1)}}),ie=async ke=>{for(let Me=0;Me<ke.length;Me++)if(!await H(ke[Me]))return!1;return!0},{getRootProps:se,getInputProps:Q,isDragActive:Ee}=YN({accept:i,onDrop:async ke=>{await ie(ke)?ke.every(({type:qe})=>qe.includes(n.type))?(await Promise.all(ke.map(async qe=>{if(t)m(Be=>[...Be,qe]);else{const Be=await qe.arrayBuffer(),Wt=new TextDecoder().decode(Be),rn=new TextEncoder().encode(Wt),_n=new File([rn],qe.name,{type:qe.type});qe.path&&Object.defineProperty(_n,"path",{value:qe.path,writable:!1,enumerable:!0,configurable:!0}),h.append(`files[${n.entity}]`,_n)}})),t||(h.append("import_type",n.entity),V.submitForm(),f(h))):ce.error("wrong_file_extension"):ce.error("csv_rows_length")}});w.useEffect(()=>{U()},[g]),w.useEffect(()=>{E&&O()},[E]),w.useEffect(()=>()=>k(""),[]);const Fe=vo(),He=()=>{n.exampleUrl&&window.open(n.exampleUrl,"_blank")};return N(dt,{children:[N(Qt,{title:e(n.entity),children:[N(K,{leftSide:e(t?"company_backup_file":"csv_file"),leftSideHelp:t&&e("company_backup_file_help"),children:[n.exampleUrl?p("button",{type:"button",style:{color:Fe},className:"inline-flex items-center space-x-1 mb-4",onClick:He,children:p("span",{children:e("download_example_file")})}):null,g.length?p("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:g.map((ke,Me)=>N("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[ke.name," - ",(ke.size/1024).toPrecision(2)," KB"," ",p(t0,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>q(Me)})]},Me))}):N("div",{...se(),className:"flex flex-col md:flex-row md:items-center",children:[N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[p("input",{...Q()}),p(NT,{className:"mx-auto h-12 w-12",style:{color:r.$3,colorScheme:r.$0}}),p("span",{className:"mt-2 block text-sm font-medium",style:{color:r.$3,colorScheme:r.$0},children:e(Ee?"drop_file_here":"dropzone_default_message")})]}),C&&Object.keys(C.errors).map((ke,Me)=>p(Ls,{type:"danger",children:C.errors[ke]},Me))]}),n.postWidgetSlot??null]}),t&&N(dt,{children:[p(K,{leftSide:e("import_settings"),children:p(ft,{checked:l,onValueChange:ke=>c(ke)})}),p(K,{leftSide:e("import_data"),children:p(ft,{checked:u,onValueChange:ke=>d(ke)})}),p("div",{className:"flex justify-end pr-5",children:p(Gt,{behavior:"button",onClick:B,disableWithoutIcon:!0,disabled:!l&&!u||!g.length,children:e("import")})})]})]}),v&&!t&&!!s&&N(Qt,{className:"mt-4",children:[p(K,{leftSide:e("template"),children:p(Cn,{value:E,onValueChange:ke=>{k(ke),ke||y(Me=>({...Me,column_map:{[n.entity]:{mapping:{...L}}}}))},withBlank:!0,children:a.filter(ke=>ke).map((ke,Me)=>p("option",{value:ke,children:ke},Me))})}),E&&p(Dmn,{name:E,entity:n.entity,onDeletedTemplate:P})]}),v&&!t&&N(eE,{children:[N(nE,{children:[p(Fa,{children:e("header")}),p(Fa,{children:e("columns")})]}),N(tE,{children:[v.mappings[n.entity].headers[0].map((ke,Me)=>N(Ec,{children:[N(ko,{className:"space-x-2",children:[p("span",{children:ke}),p("span",{className:"text-gray-400",children:v.mappings[n.entity].headers[1][Me].substring(0,20)})]}),p(ko,{children:N("div",{className:"flex items-center space-x-2",children:[p("div",{className:"flex-1",children:p(Cn,{id:Me,value:W(Me),onChange:A,withBlank:!0,children:v.mappings[n.entity].available.map((je,qe)=>p("option",{value:je,children:F(je)},qe))})}),p(vt,{className:"cursor-pointer",element:t0,size:24,onClick:()=>M(Me)})]})})]},Me)),n.entity==="bank_transaction"&&N(Ec,{children:[p(ko,{className:"space-x-2",children:p("span",{children:e("bank_account")})}),p(ko,{colSpan:2,children:p(kmn,{value:b.bank_integration_id,onChange:ke=>y(Me=>({...Me,bank_integration_id:ke==null?void 0:ke.id})),onClearButtonClick:()=>y(ke=>({...ke,bank_integration_id:""})),errorMessage:C==null?void 0:C.errors.bank_integration_id})})]}),p(Ec,{children:p(ko,{colSpan:2,children:p(Imn,{entity:n.entity,importMap:b,onImport:B})})})]})]})]})}function Amn(){const[n]=pe(),[e,t]=w.useState(!1);return p("div",{className:"grid grid-cols-12",children:p("div",{className:"col-span-12",children:e?p(Qt,{title:n("restore"),children:p("span",{className:"text-gray-600 pl-6",children:n("import_started")})}):p(tYe,{entity:"company",onSuccess:!1,type:"zip",onFileImported:()=>t(!0)})})})}function Nmn(){const[n]=pe(),e=t=>{t.preventDefault(),ce.processing(),Ae("POST",Te("/api/v1/export"),{send_email:!0,report_keys:[]}).then(i=>{ce.success(i.data.message)})};return p(Qt,{children:p(K,{leftSide:n("export_company"),leftSideHelp:n("exported_data"),children:p(Gt,{onClick:e,children:n("export")})})})}function Rmn(n){const e=Object.prototype.toString.call(n).slice(8,-1);return e==="Object"&&typeof n[Symbol.iterator]=="function"?"Iterable":e==="Custom"&&n.constructor!==Object&&n instanceof Object?"Object":e}function nYe(n){let{styling:e,arrowStyle:t="single",expanded:i,nodeType:r,onClick:o}=n;return ae.createElement("div",Ct({},e("arrowContainer",t),{onClick:o}),ae.createElement("div",e(["arrow","arrowSign"],r,i,t),"▶",t==="double"&&ae.createElement("div",e(["arrowSign","arrowSignInner"]),"▶")))}function Omn(n,e){return n==="Object"?Object.keys(e).length:n==="Array"?e.length:1/0}function Pmn(n){return typeof n.set=="function"}function Mmn(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1/0,o;if(n==="Object"){let s=Object.getOwnPropertyNames(e);t&&s.sort(t===!0?void 0:t),s=s.slice(i,r+1),o={entries:s.map(a=>({key:a,value:e[a]}))}}else if(n==="Array")o={entries:e.slice(i,r+1).map((s,a)=>({key:a+i,value:s}))};else{let s=0;const a=[];let l=!0;const c=Pmn(e);for(const u of e){if(s>r){l=!1;break}i<=s&&(c&&Array.isArray(u)?typeof u[0]=="string"||typeof u[0]=="number"?a.push({key:u[0],value:u[1]}):a.push({key:`[entry ${s}]`,value:{"[key]":u[0],"[value]":u[1]}}):a.push({key:s,value:u})),s++}o={hasMore:!l,entries:a}}return o}function gee(n,e,t){const i=[];for(;e-n>t*t;)t=t*t;for(let r=n;r<=e;r+=t)i.push({from:r,to:Math.min(e,r+t-1)});return i}function Fmn(n,e,t,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:1/0;const s=Mmn.bind(null,n,e,t);if(!i)return s().entries;const a=o<1/0,l=Math.min(o-r,Omn(n,e));if(n!=="Iterable"){if(l<=i||i<7)return s(r,o).entries}else if(l<=i&&!a)return s(r,o).entries;let c;if(n==="Iterable"){const{hasMore:u,entries:d}=s(r,r+i-1);c=u?[...d,...gee(r+i,r+2*i-1,i)]:d}else c=a?gee(r,o,i):[...s(0,i-5).entries,...gee(i-4,l-5,i),...s(l-4,l-1).entries];return c}function Bmn(n){const{styling:e,from:t,to:i,renderChildNodes:r,nodeType:o}=n,[s,a]=w.useState(!1),l=w.useCallback(()=>{a(!s)},[s]);return s?ae.createElement("div",e("itemRange",s),r(n,t,i)):ae.createElement("div",Ct({},e("itemRange",s),{onClick:l}),ae.createElement(nYe,{nodeType:o,styling:e,expanded:!1,onClick:l,arrowStyle:"double"}),`${t} ... ${i}`)}function $mn(n){return n.to!==void 0}function iYe(n,e,t){const{nodeType:i,data:r,collectionLimit:o,circularCache:s,keyPath:a,postprocessValue:l,sortObjectKeys:c}=n,u=[];return Fmn(i,r,c,o,e,t).forEach(d=>{if($mn(d))u.push(ae.createElement(Bmn,Ct({},n,{key:`ItemRange--${d.from}-${d.to}`,from:d.from,to:d.to,renderChildNodes:iYe})));else{const{key:h,value:f}=d,g=s.indexOf(f)!==-1;u.push(ae.createElement(rYe,Ct({},n,{postprocessValue:l,collectionLimit:o,key:`Node--${h}`,keyPath:[h,...a],value:l(f),circularCache:[...s,f],isCircular:g,hideRoot:!1})))}}),u}function Sbe(n){const{circularCache:e=[],collectionLimit:t,createItemString:i,data:r,expandable:o,getItemString:s,hideRoot:a,isCircular:l,keyPath:c,labelRenderer:u,level:d=0,nodeType:h,nodeTypeIndicator:f,shouldExpandNodeInitially:g,styling:m}=n,[v,_]=w.useState(l?!1:g(c,r,d)),b=w.useCallback(()=>{o&&_(!v)},[o,v]),y=v||a&&d===0?iYe({...n,circularCache:e,level:d+1}):null,C=ae.createElement("span",m("nestedNodeItemType",v),f),x=s(h,r,C,i(r,t),c),E=[c,h,v,o];return a?ae.createElement("li",m("rootNode",...E),ae.createElement("ul",m("rootNodeChildren",...E),y)):ae.createElement("li",m("nestedNode",...E),o&&ae.createElement(nYe,{styling:m,nodeType:h,expanded:v,onClick:b}),ae.createElement("label",Ct({},m(["label","nestedNodeLabel"],...E),{onClick:b}),u(...E)),ae.createElement("span",Ct({},m("nestedNodeItemString",...E),{onClick:b}),x),ae.createElement("ul",m("nestedNodeChildren",...E),y))}function Vmn(n){const e=Object.getOwnPropertyNames(n).length;return`${e} ${e!==1?"keys":"key"}`}function Hmn(n){let{data:e,...t}=n;return ae.createElement(Sbe,Ct({},t,{data:e,nodeType:"Object",nodeTypeIndicator:t.nodeType==="Error"?"Error()":"{}",createItemString:Vmn,expandable:Object.getOwnPropertyNames(e).length>0}))}function Wmn(n){return`${n.length} ${n.length!==1?"items":"item"}`}function zmn(n){let{data:e,...t}=n;return ae.createElement(Sbe,Ct({},t,{data:e,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:Wmn,expandable:e.length>0}))}function Umn(n,e){let t=0,i=!1;if(Number.isSafeInteger(n.size))t=n.size;else for(const r of n){if(e&&t+1>e){i=!0;break}t+=1}return`${i?">":""}${t} ${t!==1?"entries":"entry"}`}function jmn(n){return ae.createElement(Sbe,Ct({},n,{nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:Umn,expandable:!0}))}function Q0(n){let{nodeType:e,styling:t,labelRenderer:i,keyPath:r,valueRenderer:o,value:s,valueGetter:a=l=>l}=n;return ae.createElement("li",t("value",e,r),ae.createElement("label",t(["label","valueLabel"],e,r),i(r,e,!1,!1)),ae.createElement("span",t("valueText",e,r),o(a(s),s,...r)))}function rYe(n){let{getItemString:e,keyPath:t,labelRenderer:i,styling:r,value:o,valueRenderer:s,isCustomNode:a,...l}=n;const c=a(o)?"Custom":Rmn(o),u={getItemString:e,key:t[0],keyPath:t,labelRenderer:i,nodeType:c,styling:r,value:o,valueRenderer:s},d={...l,...u,data:o,isCustomNode:a};switch(c){case"Object":case"Error":case"WeakMap":case"WeakSet":return ae.createElement(Hmn,d);case"Array":return ae.createElement(zmn,d);case"Iterable":case"Map":case"Set":return ae.createElement(jmn,d);case"String":return ae.createElement(Q0,Ct({},u,{valueGetter:h=>`"${h}"`}));case"Number":return ae.createElement(Q0,u);case"Boolean":return ae.createElement(Q0,Ct({},u,{valueGetter:h=>h?"true":"false"}));case"Date":return ae.createElement(Q0,Ct({},u,{valueGetter:h=>h.toISOString()}));case"Null":return ae.createElement(Q0,Ct({},u,{valueGetter:()=>"null"}));case"Undefined":return ae.createElement(Q0,Ct({},u,{valueGetter:()=>"undefined"}));case"Function":case"Symbol":return ae.createElement(Q0,Ct({},u,{valueGetter:h=>h.toString()}));case"Custom":return ae.createElement(Q0,u);default:return ae.createElement(Q0,Ct({},u,{valueGetter:()=>`<${c}>`}))}}const qmn={scheme:"threezerotwofour",author:"jan t. sott (http://github.com/idleberg)",base00:"#090300",base01:"#3a3432",base02:"#4a4543",base03:"#5c5855",base04:"#807d7c",base05:"#a5a2a2",base06:"#d6d5d4",base07:"#f7f7f7",base08:"#db2d20",base09:"#e8bbd0",base0A:"#fded02",base0B:"#01a252",base0C:"#b5e4f4",base0D:"#01a0e4",base0E:"#a16a94",base0F:"#cdab53"},Kmn={scheme:"apathy",author:"jannik siebert (https://github.com/janniks)",base00:"#031A16",base01:"#0B342D",base02:"#184E45",base03:"#2B685E",base04:"#5F9C92",base05:"#81B5AC",base06:"#A7CEC8",base07:"#D2E7E4",base08:"#3E9688",base09:"#3E7996",base0A:"#3E4C96",base0B:"#883E96",base0C:"#963E4C",base0D:"#96883E",base0E:"#4C963E",base0F:"#3E965B"},Gmn={scheme:"ashes",author:"jannik siebert (https://github.com/janniks)",base00:"#1C2023",base01:"#393F45",base02:"#565E65",base03:"#747C84",base04:"#ADB3BA",base05:"#C7CCD1",base06:"#DFE2E5",base07:"#F3F4F5",base08:"#C7AE95",base09:"#C7C795",base0A:"#AEC795",base0B:"#95C7AE",base0C:"#95AEC7",base0D:"#AE95C7",base0E:"#C795AE",base0F:"#C79595"},Ymn={scheme:"atelier dune",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)",base00:"#20201d",base01:"#292824",base02:"#6e6b5e",base03:"#7d7a68",base04:"#999580",base05:"#a6a28c",base06:"#e8e4cf",base07:"#fefbec",base08:"#d73737",base09:"#b65611",base0A:"#cfb017",base0B:"#60ac39",base0C:"#1fad83",base0D:"#6684e1",base0E:"#b854d4",base0F:"#d43552"},Qmn={scheme:"atelier forest",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)",base00:"#1b1918",base01:"#2c2421",base02:"#68615e",base03:"#766e6b",base04:"#9c9491",base05:"#a8a19f",base06:"#e6e2e0",base07:"#f1efee",base08:"#f22c40",base09:"#df5320",base0A:"#d5911a",base0B:"#5ab738",base0C:"#00ad9c",base0D:"#407ee7",base0E:"#6666ea",base0F:"#c33ff3"},Xmn={scheme:"atelier heath",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath)",base00:"#1b181b",base01:"#292329",base02:"#695d69",base03:"#776977",base04:"#9e8f9e",base05:"#ab9bab",base06:"#d8cad8",base07:"#f7f3f7",base08:"#ca402b",base09:"#a65926",base0A:"#bb8a35",base0B:"#379a37",base0C:"#159393",base0D:"#516aec",base0E:"#7b59c0",base0F:"#cc33cc"},Zmn={scheme:"atelier lakeside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/)",base00:"#161b1d",base01:"#1f292e",base02:"#516d7b",base03:"#5a7b8c",base04:"#7195a8",base05:"#7ea2b4",base06:"#c1e4f6",base07:"#ebf8ff",base08:"#d22d72",base09:"#935c25",base0A:"#8a8a0f",base0B:"#568c3b",base0C:"#2d8f6f",base0D:"#257fad",base0E:"#5d5db1",base0F:"#b72dd2"},Jmn={scheme:"atelier seaside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)",base00:"#131513",base01:"#242924",base02:"#5e6e5e",base03:"#687d68",base04:"#809980",base05:"#8ca68c",base06:"#cfe8cf",base07:"#f0fff0",base08:"#e6193c",base09:"#87711d",base0A:"#c3c322",base0B:"#29a329",base0C:"#1999b3",base0D:"#3d62f5",base0E:"#ad2bee",base0F:"#e619c3"},e_n={scheme:"bespin",author:"jan t. sott",base00:"#28211c",base01:"#36312e",base02:"#5e5d5c",base03:"#666666",base04:"#797977",base05:"#8a8986",base06:"#9d9b97",base07:"#baae9e",base08:"#cf6a4c",base09:"#cf7d34",base0A:"#f9ee98",base0B:"#54be0d",base0C:"#afc4db",base0D:"#5ea6ea",base0E:"#9b859d",base0F:"#937121"},t_n={scheme:"brewer",author:"timothée poisot (http://github.com/tpoisot)",base00:"#0c0d0e",base01:"#2e2f30",base02:"#515253",base03:"#737475",base04:"#959697",base05:"#b7b8b9",base06:"#dadbdc",base07:"#fcfdfe",base08:"#e31a1c",base09:"#e6550d",base0A:"#dca060",base0B:"#31a354",base0C:"#80b1d3",base0D:"#3182bd",base0E:"#756bb1",base0F:"#b15928"},n_n={scheme:"bright",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#303030",base02:"#505050",base03:"#b0b0b0",base04:"#d0d0d0",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ffffff",base08:"#fb0120",base09:"#fc6d24",base0A:"#fda331",base0B:"#a1c659",base0C:"#76c7b7",base0D:"#6fb3d2",base0E:"#d381c3",base0F:"#be643c"},i_n={scheme:"chalk",author:"chris kempson (http://chriskempson.com)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#eda987",base0A:"#ddb26f",base0B:"#acc267",base0C:"#12cfc0",base0D:"#6fc2ef",base0E:"#e1a3ee",base0F:"#deaf8f"},r_n={scheme:"codeschool",author:"brettof86",base00:"#232c31",base01:"#1c3657",base02:"#2a343a",base03:"#3f4944",base04:"#84898c",base05:"#9ea7a6",base06:"#a7cfa3",base07:"#b5d8f6",base08:"#2a5491",base09:"#43820d",base0A:"#a03b1e",base0B:"#237986",base0C:"#b02f30",base0D:"#484d79",base0E:"#c59820",base0F:"#c98344"},o_n={scheme:"colors",author:"mrmrs (http://clrs.cc)",base00:"#111111",base01:"#333333",base02:"#555555",base03:"#777777",base04:"#999999",base05:"#bbbbbb",base06:"#dddddd",base07:"#ffffff",base08:"#ff4136",base09:"#ff851b",base0A:"#ffdc00",base0B:"#2ecc40",base0C:"#7fdbff",base0D:"#0074d9",base0E:"#b10dc9",base0F:"#85144b"},oYe={scheme:"default",author:"chris kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"},s_n={scheme:"eighties",author:"chris kempson (http://chriskempson.com)",base00:"#2d2d2d",base01:"#393939",base02:"#515151",base03:"#747369",base04:"#a09f93",base05:"#d3d0c8",base06:"#e8e6df",base07:"#f2f0ec",base08:"#f2777a",base09:"#f99157",base0A:"#ffcc66",base0B:"#99cc99",base0C:"#66cccc",base0D:"#6699cc",base0E:"#cc99cc",base0F:"#d27b53"},a_n={scheme:"embers",author:"jannik siebert (https://github.com/janniks)",base00:"#16130F",base01:"#2C2620",base02:"#433B32",base03:"#5A5047",base04:"#8A8075",base05:"#A39A90",base06:"#BEB6AE",base07:"#DBD6D1",base08:"#826D57",base09:"#828257",base0A:"#6D8257",base0B:"#57826D",base0C:"#576D82",base0D:"#6D5782",base0E:"#82576D",base0F:"#825757"},l_n={scheme:"flat",author:"chris kempson (http://chriskempson.com)",base00:"#2C3E50",base01:"#34495E",base02:"#7F8C8D",base03:"#95A5A6",base04:"#BDC3C7",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ECF0F1",base08:"#E74C3C",base09:"#E67E22",base0A:"#F1C40F",base0B:"#2ECC71",base0C:"#1ABC9C",base0D:"#3498DB",base0E:"#9B59B6",base0F:"#be643c"},c_n={scheme:"google",author:"seth wright (http://sethawright.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#CC342B",base09:"#F96A38",base0A:"#FBA922",base0B:"#198844",base0C:"#3971ED",base0D:"#3971ED",base0E:"#A36AC7",base0F:"#3971ED"},u_n={scheme:"grayscale",author:"alexandre gavioli (https://github.com/alexx2/)",base00:"#101010",base01:"#252525",base02:"#464646",base03:"#525252",base04:"#ababab",base05:"#b9b9b9",base06:"#e3e3e3",base07:"#f7f7f7",base08:"#7c7c7c",base09:"#999999",base0A:"#a0a0a0",base0B:"#8e8e8e",base0C:"#868686",base0D:"#686868",base0E:"#747474",base0F:"#5e5e5e"},d_n={scheme:"green screen",author:"chris kempson (http://chriskempson.com)",base00:"#001100",base01:"#003300",base02:"#005500",base03:"#007700",base04:"#009900",base05:"#00bb00",base06:"#00dd00",base07:"#00ff00",base08:"#007700",base09:"#009900",base0A:"#007700",base0B:"#00bb00",base0C:"#005500",base0D:"#009900",base0E:"#00bb00",base0F:"#005500"},h_n={scheme:"harmonic16",author:"jannik siebert (https://github.com/janniks)",base00:"#0b1c2c",base01:"#223b54",base02:"#405c79",base03:"#627e99",base04:"#aabcce",base05:"#cbd6e2",base06:"#e5ebf1",base07:"#f7f9fb",base08:"#bf8b56",base09:"#bfbf56",base0A:"#8bbf56",base0B:"#56bf8b",base0C:"#568bbf",base0D:"#8b56bf",base0E:"#bf568b",base0F:"#bf5656"},f_n={scheme:"hopscotch",author:"jan t. sott",base00:"#322931",base01:"#433b42",base02:"#5c545b",base03:"#797379",base04:"#989498",base05:"#b9b5b8",base06:"#d5d3d5",base07:"#ffffff",base08:"#dd464c",base09:"#fd8b19",base0A:"#fdcc59",base0B:"#8fc13e",base0C:"#149b93",base0D:"#1290bf",base0E:"#c85e7c",base0F:"#b33508"},p_n={scheme:"isotope",author:"jan t. sott",base00:"#000000",base01:"#404040",base02:"#606060",base03:"#808080",base04:"#c0c0c0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#ff0000",base09:"#ff9900",base0A:"#ff0099",base0B:"#33ff00",base0C:"#00ffff",base0D:"#0066ff",base0E:"#cc00ff",base0F:"#3300ff"},g_n={scheme:"marrakesh",author:"alexandre gavioli (http://github.com/alexx2/)",base00:"#201602",base01:"#302e00",base02:"#5f5b17",base03:"#6c6823",base04:"#86813b",base05:"#948e48",base06:"#ccc37a",base07:"#faf0a5",base08:"#c35359",base09:"#b36144",base0A:"#a88339",base0B:"#18974e",base0C:"#75a738",base0D:"#477ca1",base0E:"#8868b3",base0F:"#b3588e"},m_n={scheme:"mocha",author:"chris kempson (http://chriskempson.com)",base00:"#3B3228",base01:"#534636",base02:"#645240",base03:"#7e705a",base04:"#b8afad",base05:"#d0c8c6",base06:"#e9e1dd",base07:"#f5eeeb",base08:"#cb6077",base09:"#d28b71",base0A:"#f4bc87",base0B:"#beb55b",base0C:"#7bbda4",base0D:"#8ab3b5",base0E:"#a89bb9",base0F:"#bb9584"},__n={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"},v_n={scheme:"ocean",author:"chris kempson (http://chriskempson.com)",base00:"#2b303b",base01:"#343d46",base02:"#4f5b66",base03:"#65737e",base04:"#a7adba",base05:"#c0c5ce",base06:"#dfe1e8",base07:"#eff1f5",base08:"#bf616a",base09:"#d08770",base0A:"#ebcb8b",base0B:"#a3be8c",base0C:"#96b5b4",base0D:"#8fa1b3",base0E:"#b48ead",base0F:"#ab7967"},b_n={scheme:"paraiso",author:"jan t. sott",base00:"#2f1e2e",base01:"#41323f",base02:"#4f424c",base03:"#776e71",base04:"#8d8687",base05:"#a39e9b",base06:"#b9b6b0",base07:"#e7e9db",base08:"#ef6155",base09:"#f99b15",base0A:"#fec418",base0B:"#48b685",base0C:"#5bc4bf",base0D:"#06b6ef",base0E:"#815ba4",base0F:"#e96ba8"},y_n={scheme:"pop",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#eb008a",base09:"#f29333",base0A:"#f8ca12",base0B:"#37b349",base0C:"#00aabb",base0D:"#0e5a94",base0E:"#b31e8d",base0F:"#7a2d00"},C_n={scheme:"railscasts",author:"ryan bates (http://railscasts.com)",base00:"#2b2b2b",base01:"#272935",base02:"#3a4055",base03:"#5a647e",base04:"#d4cfc9",base05:"#e6e1dc",base06:"#f4f1ed",base07:"#f9f7f3",base08:"#da4939",base09:"#cc7833",base0A:"#ffc66d",base0B:"#a5c261",base0C:"#519f50",base0D:"#6d9cbe",base0E:"#b6b3eb",base0F:"#bc9458"},w_n={scheme:"shapeshifter",author:"tyler benziger (http://tybenz.com)",base00:"#000000",base01:"#040404",base02:"#102015",base03:"#343434",base04:"#555555",base05:"#ababab",base06:"#e0e0e0",base07:"#f9f9f9",base08:"#e92f2f",base09:"#e09448",base0A:"#dddd13",base0B:"#0ed839",base0C:"#23edda",base0D:"#3b48e3",base0E:"#f996e2",base0F:"#69542d"},S_n={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},E_n={scheme:"summerfruit",author:"christopher corley (http://cscorley.github.io/)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#B0B0B0",base05:"#D0D0D0",base06:"#E0E0E0",base07:"#FFFFFF",base08:"#FF0086",base09:"#FD8900",base0A:"#ABA800",base0B:"#00C918",base0C:"#1faaaa",base0D:"#3777E6",base0E:"#AD00A1",base0F:"#cc6633"},x_n={scheme:"tomorrow",author:"chris kempson (http://chriskempson.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#cc6666",base09:"#de935f",base0A:"#f0c674",base0B:"#b5bd68",base0C:"#8abeb7",base0D:"#81a2be",base0E:"#b294bb",base0F:"#a3685a"},T_n={scheme:"london tube",author:"jan t. sott",base00:"#231f20",base01:"#1c3f95",base02:"#5a5758",base03:"#737171",base04:"#959ca1",base05:"#d9d8d8",base06:"#e7e7e8",base07:"#ffffff",base08:"#ee2e24",base09:"#f386a1",base0A:"#ffd204",base0B:"#00853e",base0C:"#85cebc",base0D:"#009ddc",base0E:"#98005d",base0F:"#b06110"},k_n={scheme:"twilight",author:"david hart (http://hart-dev.com)",base00:"#1e1e1e",base01:"#323537",base02:"#464b50",base03:"#5f5a60",base04:"#838184",base05:"#a7a7a7",base06:"#c3c3c3",base07:"#ffffff",base08:"#cf6a4c",base09:"#cda869",base0A:"#f9ee98",base0B:"#8f9d6a",base0C:"#afc4db",base0D:"#7587a6",base0E:"#9b859d",base0F:"#9b703f"},I_n=Object.freeze(Object.defineProperty({__proto__:null,apathy:Kmn,ashes:Gmn,atelierDune:Ymn,atelierForest:Qmn,atelierHeath:Xmn,atelierLakeside:Zmn,atelierSeaside:Jmn,bespin:e_n,brewer:t_n,bright:n_n,chalk:i_n,codeschool:r_n,colors:o_n,default:oYe,eighties:s_n,embers:a_n,flat:l_n,google:c_n,grayscale:u_n,greenscreen:d_n,harmonic:h_n,hopscotch:f_n,isotope:p_n,marrakesh:g_n,mocha:m_n,monokai:__n,ocean:v_n,paraiso:b_n,pop:y_n,railscasts:C_n,shapeshifter:w_n,solarized:S_n,summerfruit:E_n,threezerotwofour:qmn,tomorrow:x_n,tube:T_n,twilight:k_n},Symbol.toStringTag,{value:"Module"}));var sYe={exports:{}},aYe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},lYe={exports:{}},L_n=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")},D_n=L_n,A_n=Array.prototype.concat,N_n=Array.prototype.slice,zAe=lYe.exports=function(e){for(var t=[],i=0,r=e.length;i<r;i++){var o=e[i];D_n(o)?t=A_n.call(t,N_n.call(o)):t.push(o)}return t};zAe.wrap=function(n){return function(){return n(zAe(arguments))}};var R_n=lYe.exports,yM=aYe,c6=R_n,cYe=Object.hasOwnProperty,uYe=Object.create(null);for(var mee in yM)cYe.call(yM,mee)&&(uYe[yM[mee]]=mee);var Xp=sYe.exports={to:{},get:{}};Xp.get=function(n){var e=n.substring(0,3).toLowerCase(),t,i;switch(e){case"hsl":t=Xp.get.hsl(n),i="hsl";break;case"hwb":t=Xp.get.hwb(n),i="hwb";break;default:t=Xp.get.rgb(n),i="rgb";break}return t?{model:i,value:t}:null};Xp.get.rgb=function(n){if(!n)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,r=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,s=[0,0,0,1],a,l,c;if(a=n.match(t)){for(c=a[2],a=a[1],l=0;l<3;l++){var u=l*2;s[l]=parseInt(a.slice(u,u+2),16)}c&&(s[3]=parseInt(c,16)/255)}else if(a=n.match(e)){for(a=a[1],c=a[3],l=0;l<3;l++)s[l]=parseInt(a[l]+a[l],16);c&&(s[3]=parseInt(c+c,16)/255)}else if(a=n.match(i)){for(l=0;l<3;l++)s[l]=parseInt(a[l+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=n.match(r)){for(l=0;l<3;l++)s[l]=Math.round(parseFloat(a[l+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=n.match(o))?a[1]==="transparent"?[0,0,0,0]:cYe.call(yM,a[1])?(s=yM[a[1]],s[3]=1,s):null:null;for(l=0;l<3;l++)s[l]=Dw(s[l],0,255);return s[3]=Dw(s[3],0,1),s};Xp.get.hsl=function(n){if(!n)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=n.match(e);if(t){var i=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,o=Dw(parseFloat(t[2]),0,100),s=Dw(parseFloat(t[3]),0,100),a=Dw(isNaN(i)?1:i,0,1);return[r,o,s,a]}return null};Xp.get.hwb=function(n){if(!n)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=n.match(e);if(t){var i=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,o=Dw(parseFloat(t[2]),0,100),s=Dw(parseFloat(t[3]),0,100),a=Dw(isNaN(i)?1:i,0,1);return[r,o,s,a]}return null};Xp.to.hex=function(){var n=c6(arguments);return"#"+f9(n[0])+f9(n[1])+f9(n[2])+(n[3]<1?f9(Math.round(n[3]*255)):"")};Xp.to.rgb=function(){var n=c6(arguments);return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"};Xp.to.rgb.percent=function(){var n=c6(arguments),e=Math.round(n[0]/255*100),t=Math.round(n[1]/255*100),i=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+e+"%, "+t+"%, "+i+"%)":"rgba("+e+"%, "+t+"%, "+i+"%, "+n[3]+")"};Xp.to.hsl=function(){var n=c6(arguments);return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};Xp.to.hwb=function(){var n=c6(arguments),e="";return n.length>=4&&n[3]!==1&&(e=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+e+")"};Xp.to.keyword=function(n){return uYe[n.slice(0,3)]};function Dw(n,e,t){return Math.min(Math.max(e,n),t)}function f9(n){var e=Math.round(n).toString(16).toUpperCase();return e.length<2?"0"+e:e}var O_n=sYe.exports,dYe={exports:{}},dT=aYe,hYe={};for(var _ee in dT)dT.hasOwnProperty(_ee)&&(hYe[dT[_ee]]=_ee);var Hi=dYe.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var hf in Hi)if(Hi.hasOwnProperty(hf)){if(!("channels"in Hi[hf]))throw new Error("missing channels property: "+hf);if(!("labels"in Hi[hf]))throw new Error("missing channel labels property: "+hf);if(Hi[hf].labels.length!==Hi[hf].channels)throw new Error("channel and label counts mismatch: "+hf);var P_n=Hi[hf].channels,M_n=Hi[hf].labels;delete Hi[hf].channels,delete Hi[hf].labels,Object.defineProperty(Hi[hf],"channels",{value:P_n}),Object.defineProperty(Hi[hf],"labels",{value:M_n})}Hi.rgb.hsl=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.min(e,t,i),o=Math.max(e,t,i),s=o-r,a,l,c;return o===r?a=0:e===o?a=(t-i)/s:t===o?a=2+(i-e)/s:i===o&&(a=4+(e-t)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(r+o)/2,o===r?l=0:c<=.5?l=s/(o+r):l=s/(2-o-r),[a,l*100,c*100]};Hi.rgb.hsv=function(n){var e,t,i,r,o,s=n[0]/255,a=n[1]/255,l=n[2]/255,c=Math.max(s,a,l),u=c-Math.min(s,a,l),d=function(h){return(c-h)/6/u+1/2};return u===0?r=o=0:(o=u/c,e=d(s),t=d(a),i=d(l),s===c?r=i-t:a===c?r=1/3+e-i:l===c&&(r=2/3+t-e),r<0?r+=1:r>1&&(r-=1)),[r*360,o*100,c*100]};Hi.rgb.hwb=function(n){var e=n[0],t=n[1],i=n[2],r=Hi.rgb.hsl(n)[0],o=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[r,o*100,i*100]};Hi.rgb.cmyk=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r,o,s,a;return a=Math.min(1-e,1-t,1-i),r=(1-e-a)/(1-a)||0,o=(1-t-a)/(1-a)||0,s=(1-i-a)/(1-a)||0,[r*100,o*100,s*100,a*100]};function F_n(n,e){return Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2)+Math.pow(n[2]-e[2],2)}Hi.rgb.keyword=function(n){var e=hYe[n];if(e)return e;var t=1/0,i;for(var r in dT)if(dT.hasOwnProperty(r)){var o=dT[r],s=F_n(n,o);s<t&&(t=s,i=r)}return i};Hi.keyword.rgb=function(n){return dT[n]};Hi.rgb.xyz=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var r=e*.4124+t*.3576+i*.1805,o=e*.2126+t*.7152+i*.0722,s=e*.0193+t*.1192+i*.9505;return[r*100,o*100,s*100]};Hi.rgb.lab=function(n){var e=Hi.rgb.xyz(n),t=e[0],i=e[1],r=e[2],o,s,a;return t/=95.047,i/=100,r/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=116*i-16,s=500*(t-i),a=200*(i-r),[o,s,a]};Hi.hsl.rgb=function(n){var e=n[0]/360,t=n[1]/100,i=n[2]/100,r,o,s,a,l;if(t===0)return l=i*255,[l,l,l];i<.5?o=i*(1+t):o=i+t-i*t,r=2*i-o,a=[0,0,0];for(var c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?l=r+(o-r)*6*s:2*s<1?l=o:3*s<2?l=r+(o-r)*(2/3-s)*6:l=r,a[c]=l*255;return a};Hi.hsl.hsv=function(n){var e=n[0],t=n[1]/100,i=n[2]/100,r=t,o=Math.max(i,.01),s,a;return i*=2,t*=i<=1?i:2-i,r*=o<=1?o:2-o,a=(i+t)/2,s=i===0?2*r/(o+r):2*t/(i+t),[e,s*100,a*100]};Hi.hsv.rgb=function(n){var e=n[0]/60,t=n[1]/100,i=n[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),s=255*i*(1-t),a=255*i*(1-t*o),l=255*i*(1-t*(1-o));switch(i*=255,r){case 0:return[i,l,s];case 1:return[a,i,s];case 2:return[s,i,l];case 3:return[s,a,i];case 4:return[l,s,i];case 5:return[i,s,a]}};Hi.hsv.hsl=function(n){var e=n[0],t=n[1]/100,i=n[2]/100,r=Math.max(i,.01),o,s,a;return a=(2-t)*i,o=(2-t)*r,s=t*r,s/=o<=1?o:2-o,s=s||0,a/=2,[e,s*100,a*100]};Hi.hwb.rgb=function(n){var e=n[0]/360,t=n[1]/100,i=n[2]/100,r=t+i,o,s,a,l;r>1&&(t/=r,i/=r),o=Math.floor(6*e),s=1-i,a=6*e-o,o&1&&(a=1-a),l=t+a*(s-t);var c,u,d;switch(o){default:case 6:case 0:c=s,u=l,d=t;break;case 1:c=l,u=s,d=t;break;case 2:c=t,u=s,d=l;break;case 3:c=t,u=l,d=s;break;case 4:c=l,u=t,d=s;break;case 5:c=s,u=t,d=l;break}return[c*255,u*255,d*255]};Hi.cmyk.rgb=function(n){var e=n[0]/100,t=n[1]/100,i=n[2]/100,r=n[3]/100,o,s,a;return o=1-Math.min(1,e*(1-r)+r),s=1-Math.min(1,t*(1-r)+r),a=1-Math.min(1,i*(1-r)+r),[o*255,s*255,a*255]};Hi.xyz.rgb=function(n){var e=n[0]/100,t=n[1]/100,i=n[2]/100,r,o,s;return r=e*3.2406+t*-1.5372+i*-.4986,o=e*-.9689+t*1.8758+i*.0415,s=e*.0557+t*-.204+i*1.057,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[r*255,o*255,s*255]};Hi.xyz.lab=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;return e/=95.047,t/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,r=116*t-16,o=500*(e-t),s=200*(t-i),[r,o,s]};Hi.lab.xyz=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;o=(e+16)/116,r=t/500+o,s=o-i/200;var a=Math.pow(o,3),l=Math.pow(r,3),c=Math.pow(s,3);return o=a>.008856?a:(o-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,r*=95.047,o*=100,s*=108.883,[r,o,s]};Hi.lab.lch=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;return r=Math.atan2(i,t),o=r*360/2/Math.PI,o<0&&(o+=360),s=Math.sqrt(t*t+i*i),[e,s,o]};Hi.lch.lab=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;return s=i/360*2*Math.PI,r=t*Math.cos(s),o=t*Math.sin(s),[e,r,o]};Hi.rgb.ansi16=function(n){var e=n[0],t=n[1],i=n[2],r=1 in arguments?arguments[1]:Hi.rgb.hsv(n)[2];if(r=Math.round(r/50),r===0)return 30;var o=30+(Math.round(i/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return r===2&&(o+=60),o};Hi.hsv.ansi16=function(n){return Hi.rgb.ansi16(Hi.hsv.rgb(n),n[2])};Hi.rgb.ansi256=function(n){var e=n[0],t=n[1],i=n[2];if(e===t&&t===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var r=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5);return r};Hi.ansi16.rgb=function(n){var e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(n>50)+1)*.5,i=(e&1)*t*255,r=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[i,r,o]};Hi.ansi256.rgb=function(n){if(n>=232){var e=(n-232)*10+8;return[e,e,e]}n-=16;var t,i=Math.floor(n/36)/5*255,r=Math.floor((t=n%36)/6)/5*255,o=t%6/5*255;return[i,r,o]};Hi.rgb.hex=function(n){var e=((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};Hi.hex.rgb=function(n){var e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(a){return a+a}).join(""));var i=parseInt(t,16),r=i>>16&255,o=i>>8&255,s=i&255;return[r,o,s]};Hi.rgb.hcg=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.max(Math.max(e,t),i),o=Math.min(Math.min(e,t),i),s=r-o,a,l;return s<1?a=o/(1-s):a=0,s<=0?l=0:r===e?l=(t-i)/s%6:r===t?l=2+(i-e)/s:l=4+(e-t)/s+4,l/=6,l%=1,[l*360,s*100,a*100]};Hi.hsl.hcg=function(n){var e=n[1]/100,t=n[2]/100,i=1,r=0;return t<.5?i=2*e*t:i=2*e*(1-t),i<1&&(r=(t-.5*i)/(1-i)),[n[0],i*100,r*100]};Hi.hsv.hcg=function(n){var e=n[1]/100,t=n[2]/100,i=e*t,r=0;return i<1&&(r=(t-i)/(1-i)),[n[0],i*100,r*100]};Hi.hcg.rgb=function(n){var e=n[0]/360,t=n[1]/100,i=n[2]/100;if(t===0)return[i*255,i*255,i*255];var r=[0,0,0],o=e%1*6,s=o%1,a=1-s,l=0;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return l=(1-t)*i,[(t*r[0]+l)*255,(t*r[1]+l)*255,(t*r[2]+l)*255]};Hi.hcg.hsv=function(n){var e=n[1]/100,t=n[2]/100,i=e+t*(1-e),r=0;return i>0&&(r=e/i),[n[0],r*100,i*100]};Hi.hcg.hsl=function(n){var e=n[1]/100,t=n[2]/100,i=t*(1-e)+.5*e,r=0;return i>0&&i<.5?r=e/(2*i):i>=.5&&i<1&&(r=e/(2*(1-i))),[n[0],r*100,i*100]};Hi.hcg.hwb=function(n){var e=n[1]/100,t=n[2]/100,i=e+t*(1-e);return[n[0],(i-e)*100,(1-i)*100]};Hi.hwb.hcg=function(n){var e=n[1]/100,t=n[2]/100,i=1-t,r=i-e,o=0;return r<1&&(o=(i-r)/(1-r)),[n[0],r*100,o*100]};Hi.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};Hi.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};Hi.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};Hi.gray.hsl=Hi.gray.hsv=function(n){return[0,0,n[0]]};Hi.gray.hwb=function(n){return[0,100,n[0]]};Hi.gray.cmyk=function(n){return[0,0,0,n[0]]};Hi.gray.lab=function(n){return[n[0],0,0]};Hi.gray.hex=function(n){var e=Math.round(n[0]/100*255)&255,t=(e<<16)+(e<<8)+e,i=t.toString(16).toUpperCase();return"000000".substring(i.length)+i};Hi.rgb.gray=function(n){var e=(n[0]+n[1]+n[2])/3;return[e/255*100]};var fYe=dYe.exports,IW=fYe;function B_n(){for(var n={},e=Object.keys(IW),t=e.length,i=0;i<t;i++)n[e[i]]={distance:-1,parent:null};return n}function $_n(n){var e=B_n(),t=[n];for(e[n].distance=0;t.length;)for(var i=t.pop(),r=Object.keys(IW[i]),o=r.length,s=0;s<o;s++){var a=r[s],l=e[a];l.distance===-1&&(l.distance=e[i].distance+1,l.parent=i,t.unshift(a))}return e}function V_n(n,e){return function(t){return e(n(t))}}function H_n(n,e){for(var t=[e[n].parent,n],i=IW[e[n].parent][n],r=e[n].parent;e[r].parent;)t.unshift(e[r].parent),i=V_n(IW[e[r].parent][r],i),r=e[r].parent;return i.conversion=t,i}var W_n=function(n){for(var e=$_n(n),t={},i=Object.keys(e),r=i.length,o=0;o<r;o++){var s=i[o],a=e[s];a.parent!==null&&(t[s]=H_n(s,e))}return t},kae=fYe,z_n=W_n,E2={},U_n=Object.keys(kae);function j_n(n){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),n(t))};return"conversion"in n&&(e.conversion=n.conversion),e}function q_n(n){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var i=n(t);if(typeof i=="object")for(var r=i.length,o=0;o<r;o++)i[o]=Math.round(i[o]);return i};return"conversion"in n&&(e.conversion=n.conversion),e}U_n.forEach(function(n){E2[n]={},Object.defineProperty(E2[n],"channels",{value:kae[n].channels}),Object.defineProperty(E2[n],"labels",{value:kae[n].labels});var e=z_n(n),t=Object.keys(e);t.forEach(function(i){var r=e[i];E2[n][i]=q_n(r),E2[n][i].raw=j_n(r)})});var K_n=E2,uP=O_n,$p=K_n,Ebe=[].slice,pYe=["keyword","gray","hex"],Iae={};Object.keys($p).forEach(function(n){Iae[Ebe.call($p[n].labels).sort().join("")]=n});var LW={};function _d(n,e){if(!(this instanceof _d))return new _d(n,e);if(e&&e in pYe&&(e=null),e&&!(e in $p))throw new Error("Unknown model: "+e);var t,i;if(n==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(n instanceof _d)this.model=n.model,this.color=n.color.slice(),this.valpha=n.valpha;else if(typeof n=="string"){var r=uP.get(n);if(r===null)throw new Error("Unable to parse color from string: "+n);this.model=r.model,i=$p[this.model].channels,this.color=r.value.slice(0,i),this.valpha=typeof r.value[i]=="number"?r.value[i]:1}else if(n.length){this.model=e||"rgb",i=$p[this.model].channels;var o=Ebe.call(n,0,i);this.color=Lae(o,i),this.valpha=typeof n[i]=="number"?n[i]:1}else if(typeof n=="number")n&=16777215,this.model="rgb",this.color=[n>>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;var s=Object.keys(n);"alpha"in n&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);var a=s.sort().join("");if(!(a in Iae))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=Iae[a];var l=$p[this.model].labels,c=[];for(t=0;t<l.length;t++)c.push(n[l[t]]);this.color=Lae(c)}if(LW[this.model])for(i=$p[this.model].channels,t=0;t<i;t++){var u=LW[this.model][t];u&&(this.color[t]=u(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}_d.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(n){var e=this.model in uP.to?this:this.rgb();e=e.round(typeof n=="number"?n:1);var t=e.valpha===1?e.color:e.color.concat(this.valpha);return uP.to[e.model](t)},percentString:function(n){var e=this.rgb().round(typeof n=="number"?n:1),t=e.valpha===1?e.color:e.color.concat(this.valpha);return uP.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var n={},e=$p[this.model].channels,t=$p[this.model].labels,i=0;i<e;i++)n[t[i]]=this.color[i];return this.valpha!==1&&(n.alpha=this.valpha),n},unitArray:function(){var n=this.rgb().color;return n[0]/=255,n[1]/=255,n[2]/=255,this.valpha!==1&&n.push(this.valpha),n},unitObject:function(){var n=this.rgb().object();return n.r/=255,n.g/=255,n.b/=255,this.valpha!==1&&(n.alpha=this.valpha),n},round:function(n){return n=Math.max(n||0,0),new _d(this.color.map(Y_n(n)).concat(this.valpha),this.model)},alpha:function(n){return arguments.length?new _d(this.color.concat(Math.max(0,Math.min(1,n))),this.model):this.valpha},red:jl("rgb",0,lu(255)),green:jl("rgb",1,lu(255)),blue:jl("rgb",2,lu(255)),hue:jl(["hsl","hsv","hsl","hwb","hcg"],0,function(n){return(n%360+360)%360}),saturationl:jl("hsl",1,lu(100)),lightness:jl("hsl",2,lu(100)),saturationv:jl("hsv",1,lu(100)),value:jl("hsv",2,lu(100)),chroma:jl("hcg",1,lu(100)),gray:jl("hcg",2,lu(100)),white:jl("hwb",1,lu(100)),wblack:jl("hwb",2,lu(100)),cyan:jl("cmyk",0,lu(100)),magenta:jl("cmyk",1,lu(100)),yellow:jl("cmyk",2,lu(100)),black:jl("cmyk",3,lu(100)),x:jl("xyz",0,lu(100)),y:jl("xyz",1,lu(100)),z:jl("xyz",2,lu(100)),l:jl("lab",0,lu(100)),a:jl("lab",1),b:jl("lab",2),keyword:function(n){return arguments.length?new _d(n):$p[this.model].keyword(this.color)},hex:function(n){return arguments.length?new _d(n):uP.to.hex(this.rgb().round().color)},rgbNumber:function(){var n=this.rgb().color;return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255},luminosity:function(){for(var n=this.rgb().color,e=[],t=0;t<n.length;t++){var i=n[t]/255;e[t]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(n){var e=this.luminosity(),t=n.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(n){var e=this.contrast(n);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var n=this.rgb().color,e=(n[0]*299+n[1]*587+n[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var n=this.rgb(),e=0;e<3;e++)n.color[e]=255-n.color[e];return n},lighten:function(n){var e=this.hsl();return e.color[2]+=e.color[2]*n,e},darken:function(n){var e=this.hsl();return e.color[2]-=e.color[2]*n,e},saturate:function(n){var e=this.hsl();return e.color[1]+=e.color[1]*n,e},desaturate:function(n){var e=this.hsl();return e.color[1]-=e.color[1]*n,e},whiten:function(n){var e=this.hwb();return e.color[1]+=e.color[1]*n,e},blacken:function(n){var e=this.hwb();return e.color[2]+=e.color[2]*n,e},grayscale:function(){var n=this.rgb().color,e=n[0]*.3+n[1]*.59+n[2]*.11;return _d.rgb(e,e,e)},fade:function(n){return this.alpha(this.valpha-this.valpha*n)},opaquer:function(n){return this.alpha(this.valpha+this.valpha*n)},rotate:function(n){var e=this.hsl(),t=e.color[0];return t=(t+n)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(n,e){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);var t=n.rgb(),i=this.rgb(),r=e===void 0?.5:e,o=2*r-1,s=t.alpha()-i.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return _d.rgb(a*t.red()+l*i.red(),a*t.green()+l*i.green(),a*t.blue()+l*i.blue(),t.alpha()*r+i.alpha()*(1-r))}};Object.keys($p).forEach(function(n){if(pYe.indexOf(n)===-1){var e=$p[n].channels;_d.prototype[n]=function(){if(this.model===n)return new _d(this);if(arguments.length)return new _d(arguments,n);var t=typeof arguments[e]=="number"?e:this.valpha;return new _d(Q_n($p[this.model][n].raw(this.color)).concat(t),n)},_d[n]=function(t){return typeof t=="number"&&(t=Lae(Ebe.call(arguments),e)),new _d(t,n)}}});function G_n(n,e){return Number(n.toFixed(e))}function Y_n(n){return function(e){return G_n(e,n)}}function jl(n,e,t){return n=Array.isArray(n)?n:[n],n.forEach(function(i){(LW[i]||(LW[i]=[]))[e]=t}),n=n[0],function(i){var r;return arguments.length?(t&&(i=t(i)),r=this[n](),r.color[e]=i,r):(r=this[n]().color[e],t&&(r=t(r)),r)}}function lu(n){return function(e){return Math.max(0,Math.min(n,e))}}function Q_n(n){return Array.isArray(n)?n:[n]}function Lae(n,e){for(var t=0;t<e;t++)typeof n[t]!="number"&&(n[t]=0);return n}var X_n=_d;const UAe=nl(X_n);var Z_n="Expected a function",jAe="__lodash_placeholder__",UT=1,RK=2,J_n=4,hT=8,CM=16,KL=32,c3=64,gYe=128,evn=256,mYe=512,qAe=1/0,tvn=9007199254740991,nvn=17976931348623157e292,KAe=0/0,ivn=[["ary",gYe],["bind",UT],["bindKey",RK],["curry",hT],["curryRight",CM],["flip",mYe],["partial",KL],["partialRight",c3],["rearg",evn]],rvn="[object Function]",ovn="[object GeneratorFunction]",svn="[object Symbol]",avn=/[\\^$.*+?()[\]{}|]/g,lvn=/^\s+|\s+$/g,cvn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,uvn=/\{\n\/\* \[wrapped with (.+)\] \*/,dvn=/,? & /,hvn=/^[-+]0x[0-9a-f]+$/i,fvn=/^0b[01]+$/i,pvn=/^\[object .+?Constructor\]$/,gvn=/^0o[0-7]+$/i,mvn=/^(?:0|[1-9]\d*)$/,_vn=parseInt,vvn=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,bvn=typeof self=="object"&&self&&self.Object===Object&&self,u6=vvn||bvn||Function("return this")();function _Ye(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function yvn(n,e){for(var t=-1,i=n?n.length:0;++t<i&&e(n[t],t,n)!==!1;);return n}function Cvn(n,e){var t=n?n.length:0;return!!t&&Svn(n,e,0)>-1}function wvn(n,e,t,i){for(var r=n.length,o=t+(i?1:-1);i?o--:++o<r;)if(e(n[o],o,n))return o;return-1}function Svn(n,e,t){if(e!==e)return wvn(n,Evn,t);for(var i=t-1,r=n.length;++i<r;)if(n[i]===e)return i;return-1}function Evn(n){return n!==n}function xvn(n,e){for(var t=n.length,i=0;t--;)n[t]===e&&i++;return i}function Tvn(n,e){return n==null?void 0:n[e]}function kvn(n){var e=!1;if(n!=null&&typeof n.toString!="function")try{e=!!(n+"")}catch{}return e}function vYe(n,e){for(var t=-1,i=n.length,r=0,o=[];++t<i;){var s=n[t];(s===e||s===jAe)&&(n[t]=jAe,o[r++]=t)}return o}var Ivn=Function.prototype,bYe=Object.prototype,vee=u6["__core-js_shared__"],GAe=function(){var n=/[^.]+$/.exec(vee&&vee.keys&&vee.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),yYe=Ivn.toString,Lvn=bYe.hasOwnProperty,CYe=bYe.toString,Dvn=RegExp("^"+yYe.call(Lvn).replace(avn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Avn=Object.create,DW=Math.max,Nvn=Math.min,YAe=function(){var n=QAe(Object,"defineProperty"),e=QAe.name;return e&&e.length>2?n:void 0}();function Rvn(n){return pA(n)?Avn(n):{}}function Ovn(n){if(!pA(n)||jvn(n))return!1;var e=Yvn(n)||kvn(n)?Dvn:pvn;return e.test(Kvn(n))}function Pvn(n,e,t,i){for(var r=-1,o=n.length,s=t.length,a=-1,l=e.length,c=DW(o-s,0),u=Array(l+c),d=!i;++a<l;)u[a]=e[a];for(;++r<s;)(d||r<o)&&(u[t[r]]=n[r]);for(;c--;)u[a++]=n[r++];return u}function Mvn(n,e,t,i){for(var r=-1,o=n.length,s=-1,a=t.length,l=-1,c=e.length,u=DW(o-a,0),d=Array(u+c),h=!i;++r<u;)d[r]=n[r];for(var f=r;++l<c;)d[f+l]=e[l];for(;++s<a;)(h||r<o)&&(d[f+t[s]]=n[r++]);return d}function Fvn(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}function Bvn(n,e,t){var i=e&UT,r=u3(n);function o(){var s=this&&this!==u6&&this instanceof o?r:n;return s.apply(i?t:this,arguments)}return o}function u3(n){return function(){var e=arguments;switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3]);case 5:return new n(e[0],e[1],e[2],e[3],e[4]);case 6:return new n(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new n(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Rvn(n.prototype),i=n.apply(t,e);return pA(i)?i:t}}function $vn(n,e,t){var i=u3(n);function r(){for(var o=arguments.length,s=Array(o),a=o,l=SYe(r);a--;)s[a]=arguments[a];var c=o<3&&s[0]!==l&&s[o-1]!==l?[]:vYe(s,l);if(o-=c.length,o<t)return wYe(n,e,xbe,r.placeholder,void 0,s,c,void 0,void 0,t-o);var u=this&&this!==u6&&this instanceof r?i:n;return _Ye(u,this,s)}return r}function xbe(n,e,t,i,r,o,s,a,l,c){var u=e&gYe,d=e&UT,h=e&RK,f=e&(hT|CM),g=e&mYe,m=h?void 0:u3(n);function v(){for(var _=arguments.length,b=Array(_),y=_;y--;)b[y]=arguments[y];if(f)var C=SYe(v),x=xvn(b,C);if(i&&(b=Pvn(b,i,r,f)),o&&(b=Mvn(b,o,s,f)),_-=x,f&&_<c){var E=vYe(b,C);return wYe(n,e,xbe,v.placeholder,t,b,E,a,l,c-_)}var k=d?t:this,L=h?k[n]:n;return _=b.length,a?b=qvn(b,a):g&&_>1&&b.reverse(),u&&l<_&&(b.length=l),this&&this!==u6&&this instanceof v&&(L=m||u3(L)),L.apply(k,b)}return v}function Vvn(n,e,t,i){var r=e&UT,o=u3(n);function s(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=Array(u+l),h=this&&this!==u6&&this instanceof s?o:n;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return _Ye(h,r?t:this,d)}return s}function wYe(n,e,t,i,r,o,s,a,l,c){var u=e&hT,d=u?s:void 0,h=u?void 0:s,f=u?o:void 0,g=u?void 0:o;e|=u?KL:c3,e&=~(u?c3:KL),e&J_n||(e&=~(UT|RK));var m=t(n,e,r,f,d,g,h,a,l,c);return m.placeholder=i,EYe(m,n,e)}function Hvn(n,e,t,i,r,o,s,a){var l=e&RK;if(!l&&typeof n!="function")throw new TypeError(Z_n);var c=i?i.length:0;if(c||(e&=~(KL|c3),i=r=void 0),s=s===void 0?s:DW(XAe(s),0),a=a===void 0?a:XAe(a),c-=r?r.length:0,e&c3){var u=i,d=r;i=r=void 0}var h=[n,e,t,i,r,u,d,o,s,a];if(n=h[0],e=h[1],t=h[2],i=h[3],r=h[4],a=h[9]=h[9]==null?l?0:n.length:DW(h[9]-c,0),!a&&e&(hT|CM)&&(e&=~(hT|CM)),!e||e==UT)var f=Bvn(n,e,t);else e==hT||e==CM?f=$vn(n,e,a):(e==KL||e==(UT|KL))&&!r.length?f=Vvn(n,e,t,i):f=xbe.apply(void 0,h);return EYe(f,n,e)}function SYe(n){var e=n;return e.placeholder}function QAe(n,e){var t=Tvn(n,e);return Ovn(t)?t:void 0}function Wvn(n){var e=n.match(uvn);return e?e[1].split(dvn):[]}function zvn(n,e){var t=e.length,i=t-1;return e[i]=(t>1?"& ":"")+e[i],e=e.join(t>2?", ":" "),n.replace(cvn,`{ /* [wrapped with `+e+`] */ `)}function Uvn(n,e){return e=e??tvn,!!e&&(typeof n=="number"||mvn.test(n))&&n>-1&&n%1==0&&n<e}function jvn(n){return!!GAe&&GAe in n}function qvn(n,e){for(var t=n.length,i=Nvn(e.length,t),r=Fvn(n);i--;){var o=e[i];n[i]=Uvn(o,t)?r[o]:void 0}return n}var EYe=YAe?function(n,e,t){var i=e+"";return YAe(n,"toString",{configurable:!0,enumerable:!1,value:ebn(zvn(i,Gvn(Wvn(i),t)))})}:tbn;function Kvn(n){if(n!=null){try{return yYe.call(n)}catch{}try{return n+""}catch{}}return""}function Gvn(n,e){return yvn(ivn,function(t){var i="_."+t[0];e&t[1]&&!Cvn(n,i)&&n.push(i)}),n.sort()}function Tbe(n,e,t){e=t?void 0:e;var i=Hvn(n,hT,void 0,void 0,void 0,void 0,void 0,e);return i.placeholder=Tbe.placeholder,i}function Yvn(n){var e=pA(n)?CYe.call(n):"";return e==rvn||e==ovn}function pA(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function Qvn(n){return!!n&&typeof n=="object"}function Xvn(n){return typeof n=="symbol"||Qvn(n)&&CYe.call(n)==svn}function Zvn(n){if(!n)return n===0?n:0;if(n=Jvn(n),n===qAe||n===-qAe){var e=n<0?-1:1;return e*nvn}return n===n?n:0}function XAe(n){var e=Zvn(n),t=e%1;return e===e?t?e-t:e:0}function Jvn(n){if(typeof n=="number")return n;if(Xvn(n))return KAe;if(pA(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=pA(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(lvn,"");var t=fvn.test(n);return t||gvn.test(n)?_vn(n.slice(2),t?2:8):hvn.test(n)?KAe:+n}function ebn(n){return function(){return n}}function tbn(n){return n}Tbe.placeholder={};var nbn=Tbe;const ZAe=nl(nbn);function ibn(n){var e=n[0],t=n[1],i=n[2],r,o,s;return r=e*1+t*0+i*1.13983,o=e*1+t*-.39465+i*-.5806,s=e*1+t*2.02311+i*0,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[r*255,o*255,s*255]}function rbn(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r=e*.299+t*.587+i*.114,o=e*-.14713+t*-.28886+i*.436,s=e*.615+t*-.51499+i*-.10001;return[r,o,s]}function JAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Of(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?JAe(Object(t),!0).forEach(function(i){Ze(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):JAe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var xYe=oYe,eNe=Object.keys(xYe),obn=function(e){return e<.25?1:e<.5?.9-e:1.1-e},sbn=function(e){var t=UAe(e),i=rbn(t.array()),r=ln(i,3),o=r[0],s=r[1],a=r[2],l=[obn(o),s,a],c=ibn(l);return UAe.rgb(c).hex()},GI=function(e){return function(t){return{className:[t.className,e.className].filter(Boolean).join(" "),style:Of(Of({},t.style||{}),e.style||{})}}},abn=function(e,t){if(e===void 0)return t;if(t===void 0)return e;var i=Qr(e),r=Qr(t);switch(i){case"string":switch(r){case"string":return[t,e].filter(Boolean).join(" ");case"object":return GI({className:e,style:t});case"function":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return GI({className:e})(t.apply(void 0,[o].concat(a)))}}break;case"object":switch(r){case"string":return GI({className:t,style:e});case"object":return Of(Of({},t),e);case"function":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return GI({style:e})(t.apply(void 0,[o].concat(a)))}}break;case"function":switch(r){case"string":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return e.apply(void 0,[GI(o)({className:t})].concat(a))};case"object":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return e.apply(void 0,[GI(o)({style:t})].concat(a))};case"function":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return e.apply(void 0,[t.apply(void 0,[o].concat(a))].concat(a))}}}},lbn=function(e,t){var i=Object.keys(t);for(var r in e)i.indexOf(r)===-1&&i.push(r);return i.reduce(function(o,s){return o[s]=abn(e[s],t[s]),o},{})},cbn=function(e,t){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];if(t===null)return e;Array.isArray(t)||(t=[t]);var s=t.map(function(l){return e[l]}).filter(Boolean),a=s.reduce(function(l,c){return typeof c=="string"?l.className=[l.className,c].filter(Boolean).join(" "):Qr(c)==="object"?l.style=Of(Of({},l.style),c):typeof c=="function"&&(l=Of(Of({},l),c.apply(void 0,[l].concat(r)))),l},{className:"",style:{}});return a.className||delete a.className,Object.keys(a.style).length===0&&delete a.style,a},Dae=function(e){return Object.keys(e).reduce(function(t,i){return t[i]=/^base/.test(i)?sbn(e[i]):i==="scheme"?e[i]+":inverted":e[i],t},{})},ubn=ZAe(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=e.defaultBase16,r=i===void 0?xYe:i,o=e.base16Themes,s=o===void 0?null:o,a=dbn(t,s);a&&(t=Of(Of({},a),t));for(var l=eNe.reduce(function(m,v){return m[v]=t[v]||r[v],m},{}),c=Object.keys(t).reduce(function(m,v){return eNe.indexOf(v)===-1&&(m[v]=t[v]),m},{}),u=n(l),d=lbn(c,u),h=arguments.length,f=new Array(h>3?h-3:0),g=3;g<h;g++)f[g-3]=arguments[g];return ZAe(cbn,2).apply(void 0,[d].concat(f))},3),TYe=function(e){return!!e.extend},dbn=function(e,t){if(e&&TYe(e)&&e.extend&&(e=e.extend),typeof e=="string"){var i=e.split(":"),r=ln(i,2),o=r[0],s=r[1];t?e=t[o]:e=I_n[o],s==="inverted"&&(e=Dae(e))}return e&&Object.prototype.hasOwnProperty.call(e,"base00")?e:void 0},hbn=function(e){return typeof e=="string"?"".concat(e,":inverted"):e&&TYe(e)&&e.extend?typeof e.extend=="string"?Of(Of({},e),{},{extend:"".concat(e.extend,":inverted")}):Of(Of({},e),{},{extend:Dae(e.extend)}):e&&Dae(e)};const fbn={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},pbn=n=>({BACKGROUND_COLOR:n.base00,TEXT_COLOR:n.base07,STRING_COLOR:n.base0B,DATE_COLOR:n.base0B,NUMBER_COLOR:n.base09,BOOLEAN_COLOR:n.base09,NULL_COLOR:n.base08,UNDEFINED_COLOR:n.base08,FUNCTION_COLOR:n.base08,SYMBOL_COLOR:n.base08,LABEL_COLOR:n.base0D,ARROW_COLOR:n.base0D,ITEM_STRING_COLOR:n.base0B,ITEM_STRING_EXPANDED_COLOR:n.base03}),gbn=n=>({String:n.STRING_COLOR,Date:n.DATE_COLOR,Number:n.NUMBER_COLOR,Boolean:n.BOOLEAN_COLOR,Null:n.NULL_COLOR,Undefined:n.UNDEFINED_COLOR,Function:n.FUNCTION_COLOR,Symbol:n.SYMBOL_COLOR}),mbn=n=>{const e=pbn(n);return{tree:{border:0,padding:0,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"0.125em",marginRight:0,listStyle:"none",MozUserSelect:"none",WebkitUserSelect:"none",backgroundColor:e.BACKGROUND_COLOR},value:(t,i,r)=>{let{style:o}=t;return{style:{...o,paddingTop:"0.25em",paddingRight:0,marginLeft:"0.875em",WebkitUserSelect:"text",MozUserSelect:"text",wordWrap:"break-word",paddingLeft:r.length>1?"2.125em":"1.25em",textIndent:"-0.5em",wordBreak:"break-all"}}},label:{display:"inline-block",color:e.LABEL_COLOR},valueLabel:{margin:"0 0.5em 0 0"},valueText:(t,i)=>{let{style:r}=t;return{style:{...r,color:gbn(e)[i]}}},itemRange:(t,i)=>({style:{paddingTop:i?0:"0.25em",cursor:"pointer",color:e.LABEL_COLOR}}),arrow:(t,i,r)=>{let{style:o}=t;return{style:{...o,marginLeft:0,transition:"150ms",WebkitTransition:"150ms",MozTransition:"150ms",WebkitTransform:r?"rotateZ(90deg)":"rotateZ(0deg)",MozTransform:r?"rotateZ(90deg)":"rotateZ(0deg)",transform:r?"rotateZ(90deg)":"rotateZ(0deg)",transformOrigin:"45% 50%",WebkitTransformOrigin:"45% 50%",MozTransformOrigin:"45% 50%",position:"relative",lineHeight:"1.1em",fontSize:"0.75em"}}},arrowContainer:(t,i)=>{let{style:r}=t;return{style:{...r,display:"inline-block",paddingRight:"0.5em",paddingLeft:i==="double"?"1em":0,cursor:"pointer"}}},arrowSign:{color:e.ARROW_COLOR},arrowSignInner:{position:"absolute",top:0,left:"-0.4em"},nestedNode:(t,i,r,o,s)=>{let{style:a}=t;return{style:{...a,position:"relative",paddingTop:"0.25em",marginLeft:i.length>1?"0.875em":0,paddingLeft:s?0:"1.125em"}}},rootNode:{padding:0,margin:0},nestedNodeLabel:(t,i,r,o,s)=>{let{style:a}=t;return{style:{...a,margin:0,padding:0,WebkitUserSelect:s?"inherit":"text",MozUserSelect:s?"inherit":"text",cursor:s?"pointer":"default"}}},nestedNodeItemString:(t,i,r,o)=>{let{style:s}=t;return{style:{...s,paddingLeft:"0.5em",cursor:"default",color:o?e.ITEM_STRING_EXPANDED_COLOR:e.ITEM_STRING_COLOR}}},nestedNodeItemType:{marginLeft:"0.3em",marginRight:"0.3em"},nestedNodeChildren:(t,i,r)=>{let{style:o}=t;return{style:{...o,padding:0,margin:0,listStyle:"none",display:r?"block":"none"}}},rootNodeChildren:{padding:0,margin:0,listStyle:"none"}}},_bn=ubn(mbn,{defaultBase16:fbn}),vbn=_bn,tNe=n=>n,bbn=(n,e,t)=>t===0,ybn=(n,e,t,i)=>ae.createElement("span",null,t," ",i),Cbn=n=>{let[e]=n;return ae.createElement("span",null,e,":")},wbn=()=>!1;function Sbn(n){let{data:e,theme:t,invertTheme:i,keyPath:r=["root"],labelRenderer:o=Cbn,valueRenderer:s=tNe,shouldExpandNodeInitially:a=bbn,hideRoot:l=!1,getItemString:c=ybn,postprocessValue:u=tNe,isCustomNode:d=wbn,collectionLimit:h=50,sortObjectKeys:f=!1}=n;const g=w.useMemo(()=>vbn(i?hbn(t):t),[t,i]);return ae.createElement("ul",g("tree"),ae.createElement(rYe,{keyPath:l?[]:r,value:u(e),isCustomNode:d,styling:g,labelRenderer:o,valueRenderer:s,shouldExpandNodeInitially:a,hideRoot:l,getItemString:c,postprocessValue:u,collectionLimit:h,sortObjectKeys:f}))}const Ebn={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"};function xbn(){const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("system_logs"),href:"/settings/system_logs"}],{dateFormat:t}=lc(),{data:i,isLoading:r}=Ti(["/api/v1/system_logs","per_page=200","sort=created_at|DESC"],()=>Ae("GET",Te("/api/v1/system_logs?per_page=200&sort=created_at|DESC")),{staleTime:36e5}),o=[{id:1,name:n("gateway_id")},{id:2,name:n("email")},{id:3,name:n("webhook")},{id:4,name:n("pdf")},{id:5,name:n("security")}],s=[{id:10,name:n("payment_failure")},{id:11,name:n("payment_success")},{id:21,name:n("success")},{id:22,name:n("failure")},{id:23,name:n("error")},{id:30,name:n("email_send")},{id:31,name:n("email_retry_queue")},{id:32,name:n("email_bounced")},{id:33,name:n("email_spam_complaint")},{id:34,name:n("email_delivery")},{id:35,name:n("opened")},{id:40,name:n("webhook_response")},{id:41,name:n("webhook_success")},{id:50,name:n("pdf")},{id:60,name:n("login_failure")},{id:61,name:n("user")}],a=[{id:300,name:n("paypal")},{id:301,name:n("payment_type_stripe")},{id:302,name:n("ledger")},{id:303,name:n("failure")},{id:304,name:n("checkout_com")},{id:305,name:"auth.net"},{id:306,name:n("custom")},{id:307,name:"Braintree"},{id:309,name:n("wepay")},{id:310,name:"PayFast"},{id:311,name:"PayTrace"},{id:312,name:"Mollie"},{id:313,name:"eWay"},{id:320,name:"Square"},{id:321,name:n("gocardless")},{id:322,name:"Razorpay"},{id:323,name:n("paypal")},{id:400,name:"Quota exceeded"},{id:401,name:"Upstream failure"},{id:500,name:"Webhook response"},{id:600,name:"PDF Failure"},{id:601,name:"PDF Sucess"},{id:701,name:"Modified"},{id:702,name:"Deleted"},{id:800,name:"Login Success"},{id:801,name:"Login Failure"}],l=h=>{const f=o.find(g=>g.id===h);return f?f.name:"Undefined Category"},c=h=>{const f=s.find(g=>g.id===h);return f?f.name:"Undefined Event"},u=h=>{const f=a.find(g=>g.id===h);return f?f.name:"Undefined Type"},d=h=>p(Sbn,{data:JSON.parse(h),theme:Ebn})||h;return N(ir,{title:n("system_logs"),breadcrumbs:e,children:[r&&p(Lse,{children:p(ns,{})}),p(Qt,{children:i==null?void 0:i.data.data.map((h,f,{length:g})=>N("div",{children:[p(K,{leftSide:l(h.category_id),leftSideHelp:`${u(h.type_id)} ${go(h.created_at,t)}`,children:N("div",{className:"flex flex-col space-y-2",children:[p("div",{children:p(pr,{children:c(h.event_id)})}),p("div",{children:d(h.log)})]})},f),f+1!==g&&p(_i,{})]},f))})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function OK(n){const e=wi(),t=Qi(),{withoutNavigation:i}=n||{},r=Ar(Kk);return o=>{r(o),t(Go({object:"company",property:"settings",value:o.settings})),t(EF({status:{name:o.name,level:"group"}})),!i&&e("/settings/company_details")}}function kYe(){const[n]=pe(),e=Tl(),t=wi(),i=_o(),r=OK(),{id:o}=il(),s=ufn(),a=e.pathname.includes(o),l=async u=>{const d=await i.fetchQuery(["/api/v1/group_settings",u],()=>Ae("GET",Te("/api/v1/group_settings/:id",{id:u})).then(h=>h.data.data),{staleTime:1/0});r(d)};return[u=>!a&&p(tn,{onClick:()=>l(u.id),icon:p(vt,{className:"h-4 w-4",element:Bge}),children:n("configure_settings")}),u=>Sr(u)===Zi.Active&&p(tn,{onClick:()=>t(bt("/clients/create?group=:groupId",{groupId:u.id})),icon:p(vt,{element:qp}),children:n("new_client")}),()=>a&&p(_i,{withoutPadding:!0}),u=>a&&Sr(u)===Zi.Active&&p(tn,{onClick:()=>s([u.id],"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),u=>a&&(Sr(u)===Zi.Archived||Sr(u)===Zi.Deleted)&&p(tn,{onClick:()=>s([u.id],"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),u=>a&&(Sr(u)===Zi.Active||Sr(u)===Zi.Archived)&&p(tn,{onClick:()=>s([u.id],"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function Tbn(){const{documentTitle:n}=Pi("online_payments"),[e]=pe(),t=kYe(),i=[{name:e("settings"),href:"/settings"},{name:e("group_settings"),href:"/settings/group_settings"}],r=[{id:"status_id",label:e("status"),format:(o,s)=>p(Hm,{entity:s})},{id:"name",label:e("name"),format:(o,s)=>p(Li,{to:bt("/settings/group_settings/:id/edit",{id:s.id}),children:o})}];return p(ir,{title:n,breadcrumbs:i,docsLink:"en/advanced-settings/#group_settings",children:p(Ng,{columns:r,resource:"group",endpoint:"/api/v1/group_settings?sort=id|desc",bulkRoute:"/api/v1/group_settings/bulk",linkToCreate:"/settings/group_settings/create",linkToEdit:"/settings/group_settings/:id/edit",customActions:t,withResourcefulActions:!0,enableSavingFilterPreference:!0})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const IYe={id:"",name:"",settings:{},created_at:0,updated_at:0,archived_at:0,is_deleted:!1,documents:[]};function LYe(n){const{setGroupSettings:e,setErrors:t,isCreatePage:i}=n;return(r,o)=>{t(void 0),e(i?{...IYe,[r]:o}:s=>s&&{...s,[r]:o})}}function DYe(n){const[e]=pe(),{groupSettings:t,handleChange:i,errors:r}=n;return p(K,{leftSide:e("name"),children:p(We,{value:t.name,onValueChange:o=>i("name",o),errorMessage:r==null?void 0:r.errors.name,cypressRef:"groupSettingsNameField"})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function kbn(n){const e=wi(),t=_o(),i=Fi(tu),{groupSettings:r,setErrors:o,setIsFormBusy:s,isFormBusy:a}=n;return()=>{a||(ce.processing(),o(void 0),s(!0),Ae("POST",Te("/api/v1/group_settings"),r).then(l=>{ce.success("created_group"),En(["group_settings"]),i&&t.invalidateQueries([i]),e(bt("/settings/group_settings/:id/edit",{id:l.data.data.id}))}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(ce.dismiss(),o(l.response.data))}).finally(()=>s(!1)))}}function Ibn(){const[n]=pe(),{documentTitle:e}=Pi("new_group"),t=I0(),i=[{name:n("settings"),href:"/settings"},{name:n("group_settings"),href:"/settings/group_settings"},{name:n("new_group"),href:"/settings/group_settings/create"}],[r,o]=w.useState(),[s,a]=w.useState(),[l,c]=w.useState(!1),u=LYe({setGroupSettings:o,setErrors:a,isCreatePage:!0}),d=kbn({groupSettings:r,setErrors:a,isFormBusy:l,setIsFormBusy:c});return w.useEffect(()=>{o(IYe)},[]),N(ir,{title:e,breadcrumbs:i,onSaveClick:d,disableSaveButton:l||!r||t,children:[t&&p(Iv,{}),r&&p(Qt,{title:n("new_group"),children:p(DYe,{groupSettings:r,handleChange:u,errors:s})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function kbe(n){const e=wi(),t=Qi(),i=ci(),r=ji(),{withoutNavigation:o}=n||{},s=Ar(Kk);return a=>{s(a),t(rS(r?{object:"company",data:{...r,settings:{id:a.id,...a.settings},e_invoice:a.e_invoice||{}}}:{object:"company",data:{...i,settings:{id:a.id,...a.settings},e_invoice:a.e_invoice||{}}})),t(EF({status:{name:a.display_name,level:"client"}})),!o&&e("/settings/company_details")}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Lbn(n){const e=wi(),t=_o(),{setIsPurgeOrMergeActionCalled:i,setPasswordConfirmModalOpen:r}=n,o=Lg();return(s,a,l)=>{ce.processing(),i==null||i(!0),Ae("POST",Te("/api/v1/clients/:id/purge",{id:a}),{},{headers:{"X-Api-Password":s}}).then(()=>{ce.success("purged_client"),t.invalidateQueries(),e("/clients")}).catch(c=>{var u;((u=c.response)==null?void 0:u.status)===412&&(o(l),r(!0)),i==null||i(!1)})}}function Dbn(n){const[e]=pe(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,[r,o]=w.useState(!1),s=Lbn({setIsPurgeOrMergeActionCalled:i,setPasswordConfirmModalOpen:o});return N(dt,{children:[p(tn,{onClick:()=>o(!0),icon:p(vt,{element:VEt}),children:e("purge")}),p(ap,{show:r,onClose:o,onSave:(a,l)=>s(a,t.id,l)})]})}function Abn(n){const[e]=pe(),t=Qi(),i=wi(),{isEditOrShowPage:r}=N1({entity:"client"}),{setIsPurgeOrMergeActionCalled:o}=n,s=Lg(),[a,l]=w.useState(""),[c,u]=w.useState(!1),[d,h]=w.useState(!1),f=(g,m)=>{d||(ce.processing(),h(!0),o==null||o(!0),Ae("POST",Te("/api/v1/clients/:mergeIntoClientId/:mergeFromClientId/merge",{mergeIntoClientId:a,mergeFromClientId:n.mergeFromClientId}),{},{headers:{"X-Api-Password":g}}).then(()=>{En(["clients"]),Ae("POST",Te("/api/v1/refresh")).then(v=>{ce.success("merged_clients"),t(w0(v.data.data)),l(""),n.setVisible(!1),r&&i("/clients")}).catch(()=>o==null?void 0:o(!1))}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===412&&(s(m),u(!0)),o==null||o(!1)}).finally(()=>h(!1)))};return N(Ui,{title:e("merge_into"),visible:n.visible,onClose:()=>{l(""),n.setVisible(!1)},overflowVisible:!0,children:[p(xK,{inputLabel:e("client"),onChange:g=>l(g.id),value:a,clearButton:!0,onClearButtonClick:()=>l(""),withoutAction:!0,exclude:[n.mergeFromClientId],dropdownLabelFn:g=>{var m;return N("div",{className:"flex items-center space-x-1",children:[p("span",{children:g.display_name}),((m=g.contacts[0])==null?void 0:m.email)&&N("span",{className:"text-xs",children:["(",g.contacts[0].email,")"]})]})},initiallyVisible:!0}),p("div",{className:"self-end pt-2",children:p(Gt,{disableWithoutIcon:!0,disabled:!a,onClick:()=>u(!0),children:e("merge")})}),p(ap,{show:c,onClose:u,onSave:f})]})}function Nbn(n){const[e]=pe(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,[r,o]=w.useState(!1);return N(dt,{children:[p(tn,{onClick:()=>o(!0),icon:p(vt,{element:qAt}),children:e("merge")}),p(Abn,{visible:r,setVisible:o,mergeFromClientId:t.id,setIsPurgeOrMergeActionCalled:i})]})}function Rbn(n){const[e]=pe(),t=gbe(),{setIsPurgeOrMergeActionCalled:i}=n||{},r=ps(),{isAdmin:o,isOwner:s}=Po(),{isEditOrShowPage:a,isShowPage:l}=N1({entity:"client"}),c=kbe(),{setChangeTemplateVisible:u,setChangeTemplateResources:d,setChangeTemplateEntityContext:h}=QN();return[g=>!g.is_deleted&&p(tn,{to:bt("/clients/:id/statement",{id:g.id}),icon:p(vt,{element:Yj}),children:e("view_statement")}),g=>!g.is_deleted&&!l&&p(tn,{onClick:()=>window.open(bt(`${g.contacts[0].link}?silent=true&client_hash=:clientHash`,{clientHash:g.client_hash}),"__blank"),icon:p(vt,{element:hme}),children:e("client_portal")}),g=>p(AK,{entity:"client",entityId:g.id,label:g.display_name,labelElement:p(tn,{icon:p(vt,{element:Gj}),children:e("add_comment")})}),g=>!g.is_deleted&&(o||s)&&p(tn,{onClick:()=>c(g),icon:p(vt,{element:zEt}),children:e("settings")}),g=>!g.is_deleted&&r("create_invoice")&&p(tn,{to:bt("/invoices/create?client=:id",{id:g.id}),icon:p(vt,{element:qp}),children:e("new_invoice")}),g=>!g.is_deleted&&r("create_payment")&&p(tn,{to:bt("/payments/create?client=:id",{id:g.id}),icon:p(vt,{element:qp}),children:e("new_payment")}),g=>!g.is_deleted&&r("create_quote")&&p(tn,{to:bt("/quotes/create?client=:id",{id:g.id}),icon:p(vt,{element:qp}),children:e("new_quote")}),g=>!g.is_deleted&&r("create_credit")&&p(tn,{to:bt("/credits/create?client=:id",{id:g.id}),icon:p(vt,{element:qp}),children:e("new_credit")}),g=>!g.is_deleted&&(o||s)&&g&&p(Nbn,{client:g,setIsPurgeOrMergeActionCalled:i}),g=>p(tn,{onClick:()=>{u(!0),d([g]),h({endpoint:"/api/v1/clients/bulk",entity:"clients"})},icon:p(vt,{element:EN}),children:e("run_template")}),g=>a&&!g.is_deleted&&p(_i,{withoutPadding:!0}),g=>a&&Sr(g)===Zi.Active&&p(tn,{onClick:()=>t([g.id],"archive"),icon:p(vt,{element:Ac}),children:e("archive")}),g=>a&&(Sr(g)===Zi.Archived||Sr(g)===Zi.Deleted)&&p(tn,{onClick:()=>t([g.id],"restore"),icon:p(vt,{element:Dc}),children:e("restore")}),g=>a&&(Sr(g)===Zi.Active||Sr(g)===Zi.Archived)&&p(tn,{onClick:()=>t([g.id],"delete"),icon:p(vt,{element:gl}),children:e("delete")}),g=>(o||s)&&g&&p(Dbn,{client:g,setIsPurgeOrMergeActionCalled:i},"purge")]}const Obn=["name","contact_email","id_number","balance","paid_to_date","created_at","last_login_at","website"];function Pbn(){const[n,e,t,i]=cp({entity:"client"});return["number","name","balance","paid_to_date","contact_name","contact_email","last_login_at","address2","archived_at","contact_phone","contacts","country","created_at","credit_balance","currency",n,e,t,i,"documents","entity_state","group","id_number","is_deleted","language","phone","private_notes","public_notes","state","address1","task_rate","updated_at","vat_number","website","city"]}function Mbn(){var _;const{t:n}=pe(),{dateFormat:e}=lc(),t=sE(),i=ci(),r=Ha(),o=tf(),s=ZS(),a=JS(),l=x8e(),c=Zk(),u=w.useCallback(b=>{const y=[];return b.contacts.map(C=>y.push(`${C.first_name} ${C.last_name}`)),y.join("<br />")},[]);Pbn();const[d,h,f,g]=cp({entity:"client"}),m=[{column:"number",id:"number",label:n("number")},{column:"name",id:"display_name",label:n("name"),format:(b,y)=>p(Rf,{to:bt("/clients/:id",{id:y.id}),renderSpan:t("client",y),children:b})},{column:"balance",id:"balance",label:n("balance"),format:(b,y)=>o(b,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"paid_to_date",id:"paid_to_date",label:n("paid_to_date"),format:(b,y)=>o(b,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"contact_name",id:"id",label:n("contact_name"),format:(b,y)=>y.contacts.length>0&&N(Rf,{to:bt("/clients/:id",{id:y.id}),renderSpan:t("client",y),children:[y.contacts[0].first_name," ",y.contacts[0].last_name]})},{column:"contact_email",id:"id",label:n("contact_email"),format:(b,y)=>y.contacts.length>0&&p(Fl,{text:y.contacts[0].email})},{column:"last_login_at",id:"last_login",label:n("last_login"),format:b=>go(b,e)},{column:"address2",id:"address2",label:n("address2")},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>go(b,e)},{column:"contact_phone",id:"id",label:n("contact_phone"),format:(b,y)=>y.contacts[0].phone},{column:"contacts",id:"id",label:n("contacts"),format:(b,y)=>p("span",{dangerouslySetInnerHTML:{__html:u(y)}})},{column:"country",id:"country_id",label:n("country"),format:b=>{var y;return b&&((y=s(b))==null?void 0:y.name)}},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>go(b,e)},{column:"credit_balance",id:"credit_balance",label:n("credit_balance"),format:(b,y)=>o(b,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"currency",id:"id",label:n("currency"),format:(b,y)=>{var C,x;return((C=y.settings)==null?void 0:C.currency_id)&&((x=a(y.settings.currency_id))==null?void 0:x.code)}},{column:d,id:"custom_value1",label:d,format:b=>c("client1",b==null?void 0:b.toString())},{column:h,id:"custom_value2",label:h,format:b=>c("client2",b==null?void 0:b.toString())},{column:f,id:"custom_value3",label:f,format:b=>c("client3",b==null?void 0:b.toString())},{column:g,id:"custom_value4",label:g,format:b=>c("client4",b==null?void 0:b.toString())},{column:"documents",id:"documents",label:n("documents"),format:(b,y)=>y.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(b,y)=>p(Hm,{entity:y})},{column:"id_number",id:"id_number",label:n("id_number")},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(b,y)=>y.is_deleted?n("yes"):n("no")},{column:"language",id:"id",label:n("language"),format:(b,y)=>{var C;return(C=l(y.settings.language_id||i.settings.language_id))==null?void 0:C.name}},{column:"phone",id:"phone",label:n("phone")},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:b=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(b)}})}),children:p("span",{children:r0(Xc(b)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:b=>p(wu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:Nt("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(b)}})}),children:p("span",{children:r0(Xc(b)).slice(0,50)})})},{column:"state",id:"state",label:n("state")},{column:"address1",id:"address1",label:n("address1")},{column:"task_rate",id:"id",label:n("task_rate"),format:(b,y)=>o(y.settings.default_task_rate||i.settings.default_task_rate,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:b=>go(b,e)},{column:"vat_number",id:"vat_number",label:n("vat_number")},{column:"website",id:"website",label:n("website"),format:b=>p(Li,{to:b.toString(),external:!0,children:N(iA,{children:[p("span",{children:b}),b.toString().length>0&&p(G8e,{size:14})]})})},{column:"group",id:"group_settings_id",label:n("group"),format:(b,y)=>{var C;return!!b&&p(Li,{to:bt("/settings/group_settings/:id/edit",{id:b}),children:(C=y.group_settings)==null?void 0:C.name})}},{column:"city",id:"city",label:n("city")}],v=((_=r==null?void 0:r.react_table_columns)==null?void 0:_.client)||Obn;return m.filter(b=>v.includes(b.column)).sort((b,y)=>v.indexOf(b.column)-v.indexOf(y.column))}function Fbn(n){var t;const[e]=pe();return p(Fh,{endpoint:Te("/api/v1/group_settings?status=active"),onChange:i=>i.resource&&n.onChange(i.resource),inputOptions:{label:(t=n.inputLabel)==null?void 0:t.toString(),value:n.value||null},entryOptions:{id:"id",label:"name",value:"id"},action:{label:e("new_group"),onClick:()=>{},visible:!1},readonly:n.readonly,onDismiss:n.onClearButtonClick,initiallyVisible:n.initiallyVisible,sortBy:"name|asc",staleTime:n.staleTime,errorMessage:n.errorMessage})}function Bbn(n){const[e]=pe(),{clients:t,setSelected:i}=n,r=gbe(),[o,s]=w.useState(!1),[a,l]=w.useState(""),c=()=>{s(!1),l("")};return N(dt,{children:[p(tn,{onClick:()=>s(!0),icon:p(vt,{element:P9e}),children:e("assign_group")}),N(Ui,{title:e("group"),visible:o,onClose:c,overflowVisible:!0,children:[p(Fbn,{value:a,onChange:u=>l(u.id),onClearButtonClick:()=>l("")}),p(Gt,{behavior:"button",onClick:()=>{r(t.map(({id:u})=>u),"assign_group",{groupSettingsId:a}).then(()=>c()),i([])},disabled:!a,disableWithoutIcon:!0,children:e("add_to_group")})]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $bn(){const{data:n}=ed(),[e,t]=w.useState();return w.useEffect(()=>{n!=null&&n.bulk_updates&&t(n.bulk_updates)},[n]),e}const Vbn=[{key:"private_notes",type:"markdownEditor"},{key:"public_notes",type:"markdownEditor"},{key:"terms",type:"markdownEditor"},{key:"footer",type:"markdownEditor"},{key:"industry_id",type:"industrySelector"},{key:"size_id",type:"sizeSelector"},{key:"country_id",type:"countrySelector"},{key:"custom_value1",type:"customField"},{key:"custom_value2",type:"customField"},{key:"custom_value3",type:"customField"},{key:"custom_value4",type:"customField"},{key:"tax1",type:"taxSelector"},{key:"tax2",type:"taxSelector"},{key:"tax3",type:"taxSelector"},{key:"should_be_invoiced",type:"toggle"},{key:"uses_inclusive_taxes",type:"toggle"}];function Hbn(n){var E;const[e]=pe(),{setSelected:t,resourceIds:i}=n,r=gbe(),o=hGe(),s=NK(),{data:a}=ed(),l=ci(),c=$bn(),[u,d]=w.useState(""),[h,f]=w.useState(""),[g,m]=w.useState(!1),v=()=>{m(!1),d(""),f("")},_=()=>{var k;return n.entity==="expense"&&u.includes("notes")?"textarea":((k=Vbn.find(({key:L})=>L===u))==null?void 0:k.type)||""},b=k=>{if(k.includes("rate"))return!1;if(k.startsWith("custom_value"))return!!l.custom_fields[k.replace("custom_value",n.entity)];if(k.startsWith("tax")){const L=Number(k.split("tax")[1]),D=n.entity==="expense"?l.enabled_expense_tax_rates:l.enabled_tax_rates;return L===1?D>0:L===2?D>1:D>2}return!0},y=k=>k.startsWith("custom_value")?l.custom_fields[k.replace("custom_value",n.entity)].split("|")[0]:e(k),C=()=>u.replace("custom_value",n.entity),x=()=>{n.entity==="client"&&r(i,"bulk_update",{column:u,newValue:h}).then(()=>v()),n.entity==="expense"&&o(i,"bulk_update",{column:u,new_value:h}).then(()=>v()),n.entity==="recurring_invoice"&&s(i,"bulk_update",{column:u,new_value:h}).then(()=>v()),t([])};return N(dt,{children:[p(tn,{onClick:()=>m(!0),icon:p(vt,{element:$Et}),children:e("bulk_update")}),p(Ui,{title:e("bulk_update"),size:"regular",visible:g,onClose:v,overflowVisible:!0,children:N("div",{className:"flex flex-col space-y-5",children:[p(Cn,{label:e("column"),value:u,onValueChange:k=>{d(k),f("")},withBlank:!0,customSelector:!0,children:c==null?void 0:c[n.entity].filter(k=>b(k)).map(k=>p("option",{value:k,children:y(k)},k))}),N("div",{className:"flex flex-col",children:[!!_()&&p(pg,{className:"mb-2",children:e("value")}),_()==="taxSelector"&&p(Yy,{defaultValue:h,onChange:k=>(k==null?void 0:k.resource)&&f(`${k.resource.name}||${k.resource.rate}`),onTaxCreated:k=>f(`${k.name}||${k.rate}`),onClearButtonClick:()=>f("")}),_()==="markdownEditor"&&p(pd,{value:h,onChange:k=>f(k)}),_()==="industrySelector"&&p(Cn,{value:h,onValueChange:k=>f(k),withBlank:!0,children:a==null?void 0:a.industries.map(k=>p("option",{value:k.id,children:k.name},k.id))}),_()==="sizeSelector"&&p(Cn,{value:h,onValueChange:k=>f(k),withBlank:!0,children:a==null?void 0:a.sizes.map((k,L)=>p("option",{value:k.id,children:k.name},L))}),_()==="countrySelector"&&p(FN,{value:h,onChange:k=>f(k),dismissable:!0}),_()==="customField"&&((E=l==null?void 0:l.custom_fields)==null?void 0:E[C()])&&p(ls,{field:C(),defaultValue:h,value:l.custom_fields[C()],onValueChange:k=>f(k),fieldOnly:!0}),_()==="toggle"&&p(ft,{checked:h,onChange:k=>f(k)}),_()==="textarea"&&p(We,{element:"textarea",value:h,onValueChange:k=>f(k)})]}),p("div",{className:"flex self-end",children:p(Gt,{behavior:"button",onClick:x,disabled:!u,disableWithoutIcon:!0,children:e("update")})})]})})]})}const Wbn=()=>{const[n]=pe(),e=KWe(),t=d=>d.flatMap(({documents:h})=>h.map(({id:f})=>f)),i=d=>d.some(({documents:h})=>h.length),r=d=>d.every(({is_deleted:h})=>!h),o=d=>d.every(({is_deleted:h})=>!h),s=(d,h)=>{const f=t(d);e(f,"download"),h([])},{setChangeTemplateVisible:a,setChangeTemplateResources:l,setChangeTemplateEntityContext:c}=QN();return[({selectedResources:d,setSelected:h})=>r(d)&&p(tn,{onClick:()=>i(d)?s(d,h):ce.error("no_documents_to_download"),icon:p(vt,{element:sS}),children:n("documents")}),({selectedResources:d})=>p(tn,{onClick:()=>{a(!0),l(d),c({endpoint:"/api/v1/clients/bulk",entity:"client"})},icon:p(vt,{element:EN}),children:n("run_template")}),({selectedResources:d,setSelected:h})=>o(d)&&p(Bbn,{clients:d,setSelected:h}),({selectedIds:d,setSelected:h})=>p(Hbn,{entity:"client",resourceIds:d,setSelected:h})]};function zbn(){const{id:n}=il(),e=Rbn(),t=Mbn(),i=Wbn();return p("div",{className:"mt-8",children:p(Ng,{resource:"client",endpoint:bt("/api/v1/clients?include=group_settings&group=:groupId&sort=id|desc",{groupId:n}),bulkRoute:"/api/v1/clients/bulk",linkToEdit:"/clients/:id/edit",columns:t,customActions:e,bottomActionsKeys:["purge"],customBulkActions:i,withResourcefulActions:!0,linkToCreate:bt("/clients/create?group=:groupId",{groupId:n})})})}function Ubn(){const[n]=pe(),{id:e}=il(),{documentTitle:t}=Pi("edit_group"),{data:i}=cfn({id:e}),r=kYe(),o=OK(),s=[{name:n("settings"),href:"/settings"},{name:n("group_settings"),href:"/settings/group_settings"},{name:n("edit_group"),href:bt("/settings/group_settings/:id/edit",{id:e})}],[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=w.useState(!1),f=LYe({setGroupSettings:l,setErrors:u}),g=jWe({groupSettings:a,setErrors:u,isFormBusy:d,setIsFormBusy:h});w.useEffect(()=>{i&&l(i)},[i]);const m=()=>{En(["group_settings"])};return p(ir,{title:t,breadcrumbs:s,onSaveClick:g,disableSaveButton:d||!a,navigationTopRight:a&&p(D1,{label:n("more_actions"),resource:a,actions:r}),children:N(kv,{tabs:[n("overview"),n("clients"),n("documents")],formatTabLabel:v=>{if(v===2)return p(P_e,{numberOfDocuments:a==null?void 0:a.documents.length})},children:[p("div",{children:a&&i&&p(Qt,{title:n("edit_group"),topRight:N(Gt,{behavior:"button",onClick:()=>o(i),children:[p(vt,{className:"h-4 w-4",element:Bge,color:"white"}),p("span",{children:n("configure_settings")})]}),children:p("div",{children:p(DYe,{groupSettings:a,handleChange:f,errors:c})})})}),p("div",{children:p(zbn,{})}),N("div",{children:[p(mbe,{endpoint:Te("/api/v1/group_settings/:id/upload",{id:e}),onSuccess:m,widgetOnly:!0}),p(lGe,{documents:(a==null?void 0:a.documents)||[],onDocumentDelete:m})]})]})})}function jbn(){Pi("user_management");const n=pa(),[e]=pe(),[t,i]=w.useState(!1),[r,o]=w.useState(),[s,a]=w.useState([]),l=pfn({setIsPasswordConfirmModalOpen:i}),c=[{name:e("settings"),href:"/settings"},{name:e("user_management"),href:"/settings/users"}],u=[{id:"name",label:"name",format:(d,h)=>N(Li,{to:bt("/settings/users/:id/edit",{id:h.id}),children:[h.first_name," ",h.last_name]})},{id:"email",label:"email"}];return N(dt,{children:[p(ir,{title:e("user_details"),breadcrumbs:c,docsLink:"/docs/advanced-settings/#user_management",children:p(Ng,{resource:"user",columns:u,endpoint:bt("/api/v1/users?hideOwnerUsers=true&without=:userId&sort=id|desc&status=active",{userId:n==null?void 0:n.id}),linkToCreate:"/settings/users/create",bulkRoute:"/api/v1/users/bulk",onBulkActionCall:(d,h)=>{a(d),o(h),i(!0)},enableSavingFilterPreference:!0})}),p(ap,{show:t,onClose:i,onSave:(d,h)=>r&&l(s,r,d,h),tableActions:!0})]})}function qbn(n){const[e]=pe(),[t,i]=w.useState(!1),[r,o]=w.useState(),{user:s}=n,{id:a}=il(),l=wi(),c=()=>{ce.processing(),Ae("POST",Te("/api/v1/users/:id/invite",{id:a})).then(()=>{En(["users"]),ce.success("email_sent_to_confirm_email")})},u=()=>{ce.processing(),Ae("DELETE",Te("/api/v1/users/:id/detach_from_company",{id:a})).then(()=>{ce.success("removed_user"),En(["users"]),l("/settings/users")}).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===412&&ce.error("password_error_incorrect")})};return N(dt,{children:[p(ap,{show:t,onClose:i,onSave:()=>{if(r==="remove")return u();const h={archive:"archived_user",restore:"restored_user",delete:"deleted_user",remove:"removed_user"};ce.processing(),Ae("POST",Te("/api/v1/users/bulk"),{action:r,ids:[a]}).then(()=>{const f=h[r]||`${r}d_user`;ce.success(f),En(["users"])}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===412&&ce.error("password_error_incorrect")})}}),N($m,{label:e("more_actions"),className:"divide-y",children:[N("div",{children:[p(tn,{onClick:()=>c(),icon:p(vt,{element:dme}),children:e("resend_email")}),p(tn,{onClick:()=>{o("remove"),i(!0)},icon:p(vt,{element:YEt}),children:e("remove")})]}),N("div",{children:[s.archived_at===0&&p(tn,{onClick:()=>{o("archive"),i(!0)},icon:p(vt,{element:Ac}),children:e("archive")}),s.archived_at>0&&p(tn,{onClick:()=>{o("restore"),i(!0)},icon:p(vt,{element:Dc}),children:e("restore")}),!s.is_deleted&&p(tn,{onClick:()=>{o("delete"),i(!0)},icon:p(vt,{element:gl}),children:e("delete")})]})]})]})}function AYe(n){var s,a,l,c,u,d,h,f;const[e]=pe(),{user:t,setUser:i}=n,r=(g,m)=>{i(v=>v&&{...v,[g]:m})},o=ci();return N(Qt,{title:e("details"),children:[p(K,{leftSide:e("first_name"),required:!0,children:p(We,{value:t==null?void 0:t.first_name,onValueChange:g=>r("first_name",g),errorMessage:(s=n.errors)==null?void 0:s.errors.first_name})}),p(K,{leftSide:e("last_name"),required:!0,children:p(We,{value:t==null?void 0:t.last_name,onValueChange:g=>r("last_name",g),errorMessage:(a=n.errors)==null?void 0:a.errors.last_name})}),p(K,{leftSide:e("email"),children:p(We,{type:"email",value:t==null?void 0:t.email,onValueChange:g=>r("email",g),errorMessage:(l=n.errors)==null?void 0:l.errors.email})}),p(K,{leftSide:e("phone"),children:p(We,{value:t==null?void 0:t.phone,onValueChange:g=>r("phone",g),errorMessage:(c=n.errors)==null?void 0:c.errors.phone})}),p(K,{leftSide:e("login_notification"),leftSideHelp:e("login_notification_help"),children:p(ft,{checked:t==null?void 0:t.user_logged_in_notification,onChange:g=>r("user_logged_in_notification",g)})}),((u=o==null?void 0:o.custom_fields)==null?void 0:u.user1)&&p(ls,{field:"user1",defaultValue:t.custom_value1,value:o.custom_fields.user1,onValueChange:g=>r("custom_value1",String(g))}),((d=o==null?void 0:o.custom_fields)==null?void 0:d.user2)&&p(ls,{field:"user2",defaultValue:t.custom_value2,value:o.custom_fields.user2,onValueChange:g=>r("custom_value2",String(g))}),((h=o==null?void 0:o.custom_fields)==null?void 0:h.user3)&&p(ls,{field:"user3",defaultValue:t.custom_value3,value:o.custom_fields.user3,onValueChange:g=>r("custom_value3",String(g))}),((f=o==null?void 0:o.custom_fields)==null?void 0:f.user4)&&p(ls,{field:"user4",defaultValue:t.custom_value4,value:o.custom_fields.user4,onValueChange:g=>r("custom_value4",String(g))})]})}function NYe(n){const[e]=pe(),{user:t,setUser:i}=n,r=[{id:"invoice_created",label:"invoice_created"},{id:"invoice_sent",label:"invoice_sent_notification_label"},{id:"invoice_viewed",label:"invoice_viewed"},{id:"invoice_late",label:"invoice_late"},{id:"inventory_threshold",label:"inventory_threshold"},{id:"payment_success",label:"payment_success"},{id:"payment_failure",label:"payment_failure"},{id:"payment_manual",label:"manual_payment"},{id:"purchase_order_created",label:"purchase_order_created"},{id:"purchase_order_sent",label:"purchase_order_sent"},{id:"purchase_order_viewed",label:"purchase_order_viewed"},{id:"purchase_order_accepted",label:"purchase_order_accepted"},{id:"quote_created",label:"quote_created"},{id:"quote_sent",label:"quote_sent"},{id:"quote_viewed",label:"quote_viewed"},{id:"quote_approved",label:"quote_approved"},{id:"quote_expired",label:"quote_expired"},{id:"credit_created",label:"credit_created"},{id:"credit_sent",label:"credit_sent"},{id:"credit_viewed",label:"credit_viewed"}],o=()=>{var u;const c=((u=t==null?void 0:t.company_user)==null?void 0:u.notifications.email)??[];return c.includes("all_notifications")?"all_notifications":c.includes("all_user_notifications")?"all_user_notifications":""},s=(c,u)=>{var h,f;const d=un.cloneDeep(t);if(c==="all_events"&&d.company_user)u.length===0?d.company_user.notifications.email=[]:d.company_user.notifications.email=[u];else if(u.endsWith("none")&&d.company_user){const g=(h=d.company_user)==null?void 0:h.notifications.email.filter(m=>!m.startsWith(c));d.company_user.notifications.email=g}else{const g=((f=d.company_user)==null?void 0:f.notifications.email.filter(m=>!m.startsWith(c)))||[];g==null||g.push(u),d.company_user&&(d.company_user.notifications.email=g)}i({...d})},a=c=>{var d;const u=((d=t==null?void 0:t.company_user)==null?void 0:d.notifications.email)??[];return u.includes("all_notifications")?`${c}_all`:u.includes("all_user_notifications")?`${c}_user`:u.includes(`${c}_all`)?`${c}_all`:u.includes(`${c}_user`)?`${c}_user`:`${c}_none`},l=()=>{var u;const c=((u=t==null?void 0:t.company_user)==null?void 0:u.notifications.email)??[];return!!(c.includes("all_notifications")||c.includes("all_user_notifications"))};return N(Qt,{title:e("notifications"),children:[p(K,{children:e("email")}),p(K,{leftSide:e("all_events"),children:N(Cn,{withBlank:!0,value:o(),onValueChange:c=>s("all_events",c),children:[p("option",{value:"all_notifications",children:e("all_records")}),p("option",{value:"all_user_notifications",children:e("owned_by_user")}),p("option",{value:"",children:e("custom")})]})}),r.map((c,u)=>p(K,{leftSide:e(c.label),children:N(Cn,{value:a(c.id),disabled:l(),onValueChange:d=>s(c.id,d),children:[p("option",{value:`${c.id}_all`,children:e("all_records")}),p("option",{value:`${c.id}_user`,children:e("owned_by_user")}),p("option",{value:`${c.id}_none`,children:e("none")})]})},u))]})}function RYe(n){var l;const[e]=pe(),{user:t,setUser:i}=n,r=["client","product","invoice","payment","recurring_invoice","quote","credit","project","task","vendor","expense","bank_transaction","purchase_order","recurring_expense"],o=c=>{i(u=>u&&{...u,company_user:u.company_user&&{...u.company_user,is_admin:c}})},s=c=>{var h;const u=(h=t==null?void 0:t.company_user)==null?void 0:h.permissions,[d]=c.split("_");return!!(u&&u.includes(`${d}_all`)&&c!=="view_reports"&&c!=="view_dashboard"||u&&u.includes(c))},a=(c,u)=>{var g;let d=un.clone(((g=t==null?void 0:t.company_user)==null?void 0:g.permissions)??"").split(",").filter(m=>m!==c);const[h,f]=c.split("_");if(f==="all")d=d.filter(m=>!m.startsWith(h)||m==="view_reports"||m==="view_dashboard");else if(d.includes(`${h}_all`)&&c!=="view_reports"&&c!=="view_dashboard"){const m=r.map(v=>`${h}_${v}`).filter(v=>v!==c);d=d.filter(v=>v!==`${h}_all`),d=[...d,...m]}u&&d.push(c),d[0]===""&&d.shift(),i(m=>m&&{...m,company_user:m.company_user&&{...m.company_user,permissions:d.join(",")}})};return N(Qt,{title:e("permissions"),children:[p(K,{leftSide:e("administrator"),leftSideHelp:e("administrator_help"),children:p(ft,{checked:(l=t==null?void 0:t.company_user)==null?void 0:l.is_admin,onChange:c=>o(c),cypressRef:"admin"})}),p(K,{leftSide:e("view_dashboard"),children:p(ft,{checked:s("view_dashboard"),onValueChange:c=>a("view_dashboard",c),cypressRef:"viewDashboard"})}),p(K,{leftSide:e("reports"),leftSideHelp:e("view_report_permission"),children:p(ft,{checked:s("view_reports"),onValueChange:c=>a("view_reports",c),cypressRef:"viewReports"})}),p(K,{children:N("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[p("div",{className:"col-1",children:e("create")}),p("div",{className:"col-1",children:e("view")}),p("div",{className:"col-1",children:e("edit")})]})}),p(K,{leftSide:e("all"),children:N("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[p("div",{className:"col-1",children:p(Ph,{checked:s("create_all"),onChange:c=>a("create_all",c.target.checked),cypressRef:"create_all"})}),p("div",{className:"col-1",children:p(Ph,{checked:s("view_all"),onChange:c=>a("view_all",c.target.checked),cypressRef:"view_all"})}),p("div",{className:"col-1",children:p(Ph,{checked:s("edit_all"),onChange:c=>a("edit_all",c.target.checked),cypressRef:"edit_all"})})]})}),r.map((c,u)=>p(K,{leftSide:e(c),children:N("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[p("div",{className:"col-1",children:p(Ph,{checked:s(`create_${c}`),onChange:d=>a(`create_${c}`,d.target.checked),cypressRef:`create_${c}`})}),p("div",{className:"col-1",children:p(Ph,{checked:s(`view_${c}`),onChange:d=>a(`view_${c}`,d.target.checked),cypressRef:`view_${c}`})}),p("div",{className:"col-1",children:p(Ph,{checked:s(`edit_${c}`),onChange:d=>a(`edit_${c}`,d.target.checked),cypressRef:`edit_${c}`})})]})},u))]})}function Kbn(){const[n,e]=w.useState(!1),{id:t}=il(),{data:i}=hfn({id:t,enabled:n}),[r,o]=w.useState(),[s]=pe(),a=[s("details"),s("notifications"),s("permissions")],l=[{name:s("settings"),href:"/settings"},{name:s("user_management"),href:"/settings/users"},{name:s("edit_user"),href:bt("/settings/users/:id/edit",{id:t})}],c=pa(),u=wi(),d=_o(),[h,f]=w.useState(),g=Lg();w.useEffect(()=>{i!=null&&i.data.data&&i.data.data.email===(c==null?void 0:c.email)?u("/settings/user_details"):o(i==null?void 0:i.data.data)},[i==null?void 0:i.data.data]);const m=()=>{ce.processing(),Ae("PUT",Te("/api/v1/users/:id?include=company_user",{id:t}),r).then(()=>{ce.success("updated_user"),En(["users"])}).catch(_=>{var b;((b=_.response)==null?void 0:b.status)===422&&(f(_.response.data),ce.dismiss())})},v=(_,b)=>{ce.processing(),d.fetchQuery(["/api/v1/users",t],()=>Ae("GET",Te("/api/v1/users/:id?include=company_user",{id:t}),{},{headers:{"X-Api-Password":_}}),{staleTime:1/0}).then(()=>{e(!0),ce.dismiss()}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===412&&(g(b),e(!1))})};return N(ir,{breadcrumbs:l,title:s("edit_user"),onSaveClick:m,navigationTopRight:r&&p(qbn,{user:r}),children:[p(ap,{show:!n,onSave:v,onClose:e}),r&&r.email_verified_at===null&&N(Ls,{type:"warning",children:[s("email_sent_to_confirm_email"),"."]}),N(kv,{tabs:a,children:[p("div",{children:r&&p(AYe,{user:r,setUser:o,errors:h})}),p("div",{children:r&&p(NYe,{user:r,setUser:o})}),p("div",{children:r&&p(RYe,{user:r,setUser:o})})]})]})}function Gbn(){Pi("new_user");const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("user_management"),href:"/settings/users"},{name:n("new_user"),href:"/settings/users/create"}],t=[n("details"),n("notifications"),n("permissions")],i=Lg(),{data:r}=ffn(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState(!1),d=wi();w.useEffect(()=>{s({...r==null?void 0:r.data.data,company_user:{permissions:"",notifications:{email:[]},settings:{table_columns:[],report_settings:[],number_years_active:1,include_deleted_clients:!1,accent_color:"#2F7DC3"},is_owner:!1,is_admin:!1,is_locked:!1,updated_at:+new Date,archived_at:+new Date,created_at:+new Date,permissions_updated_at:+new Date,ninja_portal_url:""}})},[r==null?void 0:r.data.data]);const h=(f,g)=>{ce.processing(),u(!1),Ae("POST",Te("/api/v1/users?include=company_user"),o,{headers:{"X-Api-Password":f,...nS()}}).then(m=>{ce.success("created_user"),En(["users"]),d(bt("/settings/users/:id/edit",{id:m.data.data.id}))}).catch(m=>{var v,_;if(((v=m.response)==null?void 0:v.status)===412)i(g),u(!0);else if(((_=m.response)==null?void 0:_.status)===422){const b=m.response.data;b.errors.id?ce.error(b.errors.id):ce.dismiss(),l(b)}})};return N(ir,{title:n("new_user"),breadcrumbs:e,onSaveClick:()=>u(!0),disableSaveButton:!rc()&&Ro(),children:[!rc()&&Ro()&&p(Iv,{message:n("add_users_not_supported")}),p(ap,{show:c,onSave:h,onClose:u}),N(kv,{tabs:t,children:[p("div",{children:o&&p(AYe,{user:o,setUser:s,errors:a})}),p("div",{children:o&&p(NYe,{user:o,setUser:s})}),p("div",{children:o&&p(RYe,{user:o,setUser:s})})]})]})}function OYe(n){return N("div",{className:"flex justify-center",children:[p(Mme,{pages:n.breadcrumbs}),p("div",{className:`container max-w-3xl space-y-6 ${n.className}`,children:n.children})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ybn(n){const{setPaymentTerm:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function Qbn(){const{documentTitle:n}=Pi("create_payment_term"),[e]=pe(),t=wi(),{data:i}=Btn(),r=[{name:e("settings"),href:"/settings"},{name:e("payment_settings"),href:"/settings/online_payments"},{name:e("payment_terms"),href:"/settings/payment_terms"},{name:e("create_payment_term"),href:"/settings/payment_terms/create"}],[o,s]=w.useState(),[a,l]=w.useState(!1),[c,u]=w.useState(),d=Ybn({setErrors:s,setPaymentTerm:u}),h=(g,m)=>{g.preventDefault(),a||(ce.processing(),l(!0),Ae("POST",Te("/api/v1/payment_terms"),c).then(v=>{ce.success("created_payment_term"),En(["payment_terms"]),m==="save"?t(bt("/settings/payment_terms/:id/edit",{id:v.data.data.id})):i&&u(i)}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(ce.dismiss(),s(v.response.data))}).finally(()=>l(!1)))},f=[{onClick:g=>h(g,"create"),text:`${e("save")} / ${e("create")}`,icon:p(vt,{element:qp})}];return w.useEffect(()=>{i&&u(i)},[i]),p(ir,{title:e("payment_terms"),breadcrumbs:r,children:p(OYe,{breadcrumbs:[],children:p(Qt,{title:n,withSaveButton:!0,disableSubmitButton:a,onFormSubmit:g=>h(g,"save"),onSaveClick:g=>h(g,"save"),additionalSaveOptions:f,children:p(x0,{children:p(wo,{precision:0,required:!0,value:(c==null?void 0:c.num_days)||"",label:e("number_of_days"),onValueChange:g=>d("num_days",Number(g)),errorMessage:o==null?void 0:o.errors.num_days,disablePrecision:!0})})})})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Xbn(){return n=>{ce.processing(),Wve([n],"archive").then(()=>ce.success("archived_payment_term")).finally(()=>En(["payment_terms"]))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Zbn(){return n=>{ce.processing(),Wve([n],"delete").then(()=>ce.success("deleted_payment_term")).finally(()=>En(["payment_terms"]))}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Jbn(){return n=>{ce.processing(),Wve([n],"restore").then(()=>ce.success("restored_payment_term")).finally(()=>En(["payment_terms"]))}}function e0n(n){const[e]=pe(),t=Xbn(),i=Jbn(),r=Zbn();return N($m,{label:e("more_actions"),children:[!n.paymentTerm.archived_at&&!n.paymentTerm.is_deleted&&p(tn,{onClick:()=>t(n.paymentTerm.id),icon:p(vt,{element:Ac}),children:e("archive")}),(n.paymentTerm.archived_at||n.paymentTerm.is_deleted)&&p(tn,{onClick:()=>i(n.paymentTerm.id),icon:p(vt,{element:Dc}),children:e("restore")}),!n.paymentTerm.is_deleted&&p(tn,{onClick:()=>r(n.paymentTerm.id),icon:p(vt,{element:gl}),children:e("delete")})]})}function t0n(){Pi("payment_terms");const[n]=pe(),{id:e}=il(),t=[{name:n("settings"),href:"/settings"},{name:n("payment_settings"),href:"/settings/online_payments"},{name:n("payment_terms"),href:"/settings/payment_terms"},{name:n("edit_payment_term"),href:bt("/settings/payment_terms/:id/edit",{id:e})}],{data:i}=Ftn({id:e}),r=()=>{En(["payment_terms"])},o=td({enableReinitialize:!0,initialValues:{num_days:(i==null?void 0:i.data.data.num_days)||0},onSubmit:s=>{ce.processing(),Ae("PUT",Te("/api/v1/payment_terms/:id",{id:i==null?void 0:i.data.data.id}),s).then(()=>ce.success("updated_payment_term")).finally(()=>{o.setSubmitting(!1),r()})}});return N(ir,{title:n("payment_terms"),breadcrumbs:t,navigationTopRight:i&&p(e0n,{paymentTerm:i.data.data}),children:[!i&&p("div",{className:"flex justify-center",children:p(ns,{})}),i&&p(OYe,{breadcrumbs:[],children:N(Qt,{title:i.data.data.name,disableSubmitButton:o.isSubmitting,onFormSubmit:o.handleSubmit,withSaveButton:!0,children:[N(K,{leftSide:"Status",children:[!i.data.data.is_deleted&&!i.data.data.archived_at&&p(pr,{variant:"primary",children:n("active")}),i.data.data.archived_at&&!i.data.data.is_deleted?p(pr,{variant:"yellow",children:n("archived")}):null,i.data.data.is_deleted&&p(pr,{variant:"red",children:n("deleted")})]}),p(x0,{children:p(wo,{precision:0,value:o.values.num_days||"",label:n("number_of_days"),onValueChange:s=>o.setFieldValue("num_days",s),disablePrecision:!0})})]})})]})}function n0n(){const{documentTitle:n}=Pi("payment_terms"),[e]=pe(),t=[{name:e("settings"),href:"/settings"},{name:e("payment_settings"),href:"/settings/online_payments"},{name:e("payment_terms"),href:"/settings/payment_terms"}],i=[{id:"name",label:e("number_of_days"),format:(r,o)=>p(Li,{to:bt("/settings/payment_terms/:id/edit",{id:o.id}),children:r})}];return p(ir,{breadcrumbs:t,title:n,children:p(Ng,{endpoint:"/api/v1/payment_terms?sort=id|desc",bulkRoute:"/api/v1/payment_terms/bulk",resource:"payment_term",columns:i,linkToCreate:"/settings/payment_terms/create",linkToEdit:"/settings/payment_terms/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})})}const i0n=()=>{const[n]=pe();return[{id:"name",label:n("name"),format:(t,i)=>p(Li,{to:bt("/settings/tax_rates/:id/edit",{id:i.id}),children:i==null?void 0:i.name})},{id:"rate",label:n("tax_rate"),format:t=>N("span",{children:[t,"%"]})}]};function r0n(){const n=Qi(),e=i0n(),t=i=>{(i==="archive"||i==="delete")&&Ae("POST",Te("/api/v1/refresh")).then(r=>{n(w0(r.data.data)),n(Ype("company"))})};return p(Ng,{resource:"tax_rate",endpoint:"/api/v1/tax_rates?sort=id|desc&per_page=100",bulkRoute:"/api/v1/tax_rates/bulk",columns:e,linkToCreate:"/settings/tax_rates/create",linkToEdit:"/settings/tax_rates/:id/edit",withResourcefulActions:!0,onBulkActionSuccess:(i,r)=>t(r),enableSavingFilterPreference:!0})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function o0n(n){const{setTaxRate:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function s0n(){const{documentTitle:n}=Pi("create_tax_rate"),[e]=pe(),t=wi(),{data:i}=U$t(),r=[{name:e("settings"),href:"/settings"},{name:e("tax_settings"),href:"/settings/tax_settings"},{name:e("create_tax_rate"),href:"/settings/tax_rates/create"}],[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState(!1),d=o0n({setErrors:s,setTaxRate:l}),h=(g,m)=>{g.preventDefault(),c||(ce.processing(),u(!0),Ae("POST",Te("/api/v1/tax_rates"),a).then(v=>{ce.success("created_tax_rate"),En(["tax_rates"]),m==="save"?t(bt("/settings/tax_rates/:id/edit",{id:v.data.data.id})):i&&l(i)}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(ce.dismiss(),s(v.response.data))}).finally(()=>u(!1)))},f=[{onClick:g=>h(g,"create"),text:`${e("save")} / ${e("create")}`,icon:p(vt,{element:qp})}];return w.useEffect(()=>{i&&l(i)},[i]),p(ir,{title:e("tax_rates"),breadcrumbs:r,children:p("div",{className:"max-w-3xl",children:p(Qt,{title:n,withSaveButton:!0,disableSubmitButton:c,onFormSubmit:g=>h(g,"save"),onSaveClick:g=>h(g,"save"),additionalSaveOptions:f,children:N(x0,{children:[p(We,{required:!0,type:"text",label:e("name"),value:a==null?void 0:a.name,onValueChange:g=>d("name",g),errorMessage:o==null?void 0:o.errors.name}),p(wo,{required:!0,label:e("tax_rate"),value:(a==null?void 0:a.rate)||"",onValueChange:g=>d("rate",Number(g)),errorMessage:o==null?void 0:o.errors.rate})]})})})})}function a0n(){const[n]=pe(),e=j$t();return[i=>i.archived_at===0&&p(tn,{onClick:()=>e(i.id,"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),i=>i.archived_at>0&&p(tn,{onClick:()=>e(i.id,"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),i=>!i.is_deleted&&p(tn,{onClick:()=>e(i.id,"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function l0n(){var u,d;const{setDocumentTitle:n}=Pi("edit_tax_rate"),[e]=pe(),{id:t}=il(),i=[{name:e("settings"),href:"/settings"},{name:e("tax_settings"),href:"/settings/tax_settings"},{name:e("edit_tax_rate"),href:bt("/settings/tax_rates/:id/edit",{id:t})}],{data:r}=z$t({id:t}),[o,s]=w.useState({}),a=a0n();w.useEffect(()=>{n(r==null?void 0:r.data.data.name)},[r]);const l=()=>{En(["tax_rates"])},c=td({enableReinitialize:!0,initialValues:{name:(r==null?void 0:r.data.data.name)||"",rate:(r==null?void 0:r.data.data.rate)||0},onSubmit:h=>{s({}),ce.processing(),Ae("PUT",Te("/api/v1/tax_rates/:id",{id:t}),h).then(()=>ce.success("updated_tax_rate")).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(ce.dismiss(),s(f.response.data))}).finally(()=>{c.setSubmitting(!1),l()})}});return N(ir,{title:e("tax_rates"),navigationTopRight:r&&p(D1,{label:e("more_actions"),resource:r.data.data,actions:a}),breadcrumbs:i,children:[!r&&p("div",{className:"flex justify-center",children:p(ns,{})}),r&&p("div",{className:"max-w-3xl",children:N(Qt,{withSaveButton:!0,onFormSubmit:c.handleSubmit,disableSubmitButton:c.isSubmitting,title:r.data.data.name,children:[N(K,{leftSide:e("status"),children:[!r.data.data.is_deleted&&!r.data.data.archived_at&&p(pr,{variant:"primary",children:e("active")}),r.data.data.archived_at&&!r.data.data.is_deleted?p(pr,{variant:"yellow",children:e("archived")}):null,r.data.data.is_deleted&&p(pr,{variant:"red",children:e("deleted")})]}),N(x0,{children:[p(We,{type:"text",id:"name",label:e("name"),onChange:c.handleChange,errorMessage:(u=o==null?void 0:o.errors)==null?void 0:u.name,value:c.values.name}),p(wo,{value:c.values.rate||"",label:e("tax_rate"),onValueChange:h=>c.setFieldValue("rate",h),errorMessage:(d=o==null?void 0:o.errors)==null?void 0:d.rate})]})]})})]})}function c0n(){const n=()=>{En(["documents"])},e=ci();return N(dt,{children:[e&&p(mbe,{endpoint:Te("/api/v1/companies/:id/upload",{id:e.id}),onSuccess:n}),p(nfn,{})]})}function u0n(){var a,l,c,u,d,h;const[n]=pe(),e=Qi(),t=ma(),i=So(),r=ji(),o=Fi($s),s=f=>e(Go({object:"company",property:f.target.id,value:f.target.value}));return p(dt,{children:(r==null?void 0:r.settings)&&N(Qt,{title:n("address"),children:[p(K,{leftSide:p(Bt,{propertyKey:"address1",labelElement:p($t,{label:n("address1")})}),children:p(We,{value:((a=r==null?void 0:r.settings)==null?void 0:a.address1)||"",onChange:s,id:"settings.address1",disabled:t("address1"),errorMessage:o==null?void 0:o.errors["settings.address1"]})}),p(K,{leftSide:p(Bt,{propertyKey:"address2",labelElement:p($t,{label:n("address2")})}),children:p(We,{value:((l=r==null?void 0:r.settings)==null?void 0:l.address2)||"",onChange:s,id:"settings.address2",disabled:t("address2"),errorMessage:o==null?void 0:o.errors["settings.address2"]})}),p(K,{leftSide:p(Bt,{propertyKey:"city",labelElement:p($t,{label:n("city")})}),children:p(We,{value:((c=r==null?void 0:r.settings)==null?void 0:c.city)||"",onChange:s,id:"settings.city",disabled:t("city"),errorMessage:o==null?void 0:o.errors["settings.city"]})}),p(K,{leftSide:p(Bt,{propertyKey:"state",labelElement:p($t,{label:n("state")})}),children:p(We,{value:((u=r==null?void 0:r.settings)==null?void 0:u.state)||"",onChange:s,id:"settings.state",disabled:t("state"),errorMessage:o==null?void 0:o.errors["settings.state"]})}),p(K,{leftSide:p(Bt,{propertyKey:"postal_code",labelElement:p($t,{label:n("postal_code")})}),children:p(We,{value:((d=r==null?void 0:r.settings)==null?void 0:d.postal_code)||"",onChange:s,id:"settings.postal_code",disabled:t("postal_code"),errorMessage:o==null?void 0:o.errors["settings.postal_code"]})}),p(K,{leftSide:p(Bt,{propertyKey:"country_id",labelElement:p($t,{label:n("country")})}),children:p(FN,{value:((h=r==null?void 0:r.settings)==null?void 0:h.country_id)||"",onChange:f=>i("settings.country_id",f),disabled:t("country_id"),dismissable:!0,errorMessage:o==null?void 0:o.errors["settings.country_id"]})})]})})}function d0n(){var r,o,s,a,l,c,u,d;const[n]=pe(),e=Qi(),t=ma(),i=Oc(h=>h.companyUsers.changes.company);return p(dt,{children:(i==null?void 0:i.settings)&&N(Qt,{title:n("defaults"),children:[p(K,{leftSide:p(Bt,{propertyKey:"invoice_terms",labelElement:p($t,{label:n("invoice_terms")})}),children:p(pd,{value:((r=i==null?void 0:i.settings)==null?void 0:r.invoice_terms)||"",onChange:h=>e(Go({object:"company",property:"settings.invoice_terms",value:h})),disabled:t("invoice_terms")})}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"invoice_footer",labelElement:p($t,{label:n("invoice_footer")})}),children:p(pd,{value:((o=i==null?void 0:i.settings)==null?void 0:o.invoice_footer)||"",onChange:h=>e(Go({object:"company",property:"settings.invoice_footer",value:h})),disabled:t("invoice_footer")})}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"quote_terms",labelElement:p($t,{label:n("quote_terms")})}),children:p(pd,{value:((s=i==null?void 0:i.settings)==null?void 0:s.quote_terms)||"",onChange:h=>e(Go({object:"company",property:"settings.quote_terms",value:h})),disabled:t("quote_terms")})}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"quote_footer",labelElement:p($t,{label:n("quote_footer")})}),children:p(pd,{value:((a=i==null?void 0:i.settings)==null?void 0:a.quote_footer)||"",onChange:h=>e(Go({object:"company",property:"settings.quote_footer",value:h})),disabled:t("quote_footer")})}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"credit_terms",labelElement:p($t,{label:n("credit_terms")})}),children:p(pd,{value:((l=i==null?void 0:i.settings)==null?void 0:l.credit_terms)||"",onChange:h=>e(Go({object:"company",property:"settings.credit_terms",value:h})),disabled:t("credit_terms")})}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"credit_footer",labelElement:p($t,{label:n("credit_footer")})}),children:p(pd,{value:((c=i==null?void 0:i.settings)==null?void 0:c.credit_footer)||"",onChange:h=>e(Go({object:"company",property:"settings.credit_footer",value:h})),disabled:t("credit_footer")})}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"purchase_order_terms",labelElement:p($t,{label:n("purchase_order_terms")})}),children:p(pd,{value:((u=i==null?void 0:i.settings)==null?void 0:u.purchase_order_terms)||"",onChange:h=>e(Go({object:"company",property:"settings.purchase_order_terms",value:h})),disabled:t("purchase_order_terms")})}),p(K,{className:"mt-4",leftSide:p(Bt,{propertyKey:"purchase_order_footer",labelElement:p($t,{label:n("purchase_order_footer")})}),children:p(pd,{value:((d=i==null?void 0:i.settings)==null?void 0:d.purchase_order_footer)||"",onChange:h=>e(Go({object:"company",property:"settings.purchase_order_footer",value:h})),disabled:t("purchase_order_footer")})})]})})}function h0n(){var l,c,u,d,h,f,g,m,v,_,b,y,C;const[n]=pe(),e=Qi(),t=ma(),{isCompanySettingsActive:i}=ea(),{data:r}=ed(),o=Fi($s),s=Oc(x=>x.companyUsers.changes.company),a=(x,E)=>e(Go({object:"company",property:x,value:E}));return p(dt,{children:(s==null?void 0:s.settings)&&N(Qt,{title:n("details"),children:[p(K,{leftSide:p(Bt,{propertyKey:"name",labelElement:p($t,{label:n("company_name")})}),children:p(We,{value:((l=s==null?void 0:s.settings)==null?void 0:l.name)||"",onValueChange:x=>a("settings.name",x.toString()),disabled:t("name"),errorMessage:o==null?void 0:o.errors["settings.name"]})}),p(K,{leftSide:p(Bt,{propertyKey:"id_number",labelElement:p($t,{label:n("id_number")})}),children:p(We,{value:((c=s==null?void 0:s.settings)==null?void 0:c.id_number)||"",onValueChange:x=>a("settings.id_number",x.toString()),disabled:t("id_number")||(s==null?void 0:s.legal_entity_id)!==null,errorMessage:o==null?void 0:o.errors["settings.id_number"]})}),N(K,{leftSide:p(Bt,{propertyKey:"vat_number",labelElement:p($t,{label:n("vat_number")})}),children:[p(We,{value:((u=s==null?void 0:s.settings)==null?void 0:u.vat_number)||"",onValueChange:x=>a("settings.vat_number",x.toString()),disabled:t("vat_number")||(s==null?void 0:s.legal_entity_id)!==null,errorMessage:o==null?void 0:o.errors["settings.vat_number"]}),s!=null&&s.legal_entity_id?p("p",{className:"mt-2",children:n("changing_vat_and_id_number_note")}):null]}),p(K,{leftSide:p(Bt,{propertyKey:"website",labelElement:p($t,{label:n("website")})}),children:p(We,{value:((d=s==null?void 0:s.settings)==null?void 0:d.website)||"",onValueChange:x=>a("settings.website",x.toString()),disabled:t("website"),errorMessage:o==null?void 0:o.errors["settings.website"]})}),p(K,{leftSide:p(Bt,{propertyKey:"email",labelElement:p($t,{label:n("email")})}),children:p(We,{value:((h=s==null?void 0:s.settings)==null?void 0:h.email)||"",onValueChange:x=>a("settings.email",x.toString()),disabled:t("email"),errorMessage:o==null?void 0:o.errors["settings.email"]})}),p(K,{leftSide:p(Bt,{propertyKey:"phone",labelElement:p($t,{label:`${n("company")} ${n("phone")}`})}),children:p(We,{value:((f=s==null?void 0:s.settings)==null?void 0:f.phone)||"",onValueChange:x=>a("settings.phone",x.toString()),disabled:t("phone"),errorMessage:o==null?void 0:o.errors["settings.phone"]})}),(s==null?void 0:s.settings.country_id)=="756"?N(dt,{children:[p(K,{leftSide:p(Bt,{propertyKey:"qr_iban",labelElement:p($t,{label:n("qr_iban")})}),children:p(We,{value:((g=s==null?void 0:s.settings)==null?void 0:g.qr_iban)||"",onValueChange:x=>a("settings.qr_iban",x.toString()),disabled:t("qr_iban"),errorMessage:o==null?void 0:o.errors["settings.qr_iban"]})}),p(K,{leftSide:p(Bt,{propertyKey:"besr_id",labelElement:p($t,{label:n("besr_id")})}),children:p(We,{value:((m=s==null?void 0:s.settings)==null?void 0:m.besr_id)||"",onValueChange:x=>a("settings.besr_id",x.toString()),disabled:t("besr_id"),errorMessage:o==null?void 0:o.errors["settings.besr_id"]})})]}):"",i&&p(K,{leftSide:n("size_id"),children:p(Cn,{value:(s==null?void 0:s.size_id)||"1",onValueChange:x=>a("size_id",x.toString()),errorMessage:o==null?void 0:o.errors.size_id,customSelector:!0,dismissable:!1,children:r==null?void 0:r.sizes.map(x=>p("option",{value:x.id,children:x.name},x.id))})}),i&&p(K,{leftSide:n("industry_id"),children:p(Cn,{value:(s==null?void 0:s.industry_id)||"1",onValueChange:x=>a("industry_id",x.toString()),errorMessage:o==null?void 0:o.errors.industry_id,customSelector:!0,dismissable:!1,children:r==null?void 0:r.industries.map(x=>p("option",{value:x.id,children:x.name},x.id))})}),p(K,{leftSide:p(Bt,{propertyKey:"classification",labelElement:p($t,{label:n("classification")})}),children:N(Cn,{value:((v=s==null?void 0:s.settings)==null?void 0:v.classification)??"",onValueChange:x=>a("settings.classification",x.toString()),disabled:t("classification"),withBlank:!0,customSelector:!0,children:[p("option",{value:"individual",children:n("individual")}),p("option",{value:"business",children:n("business")}),p("option",{value:"company",children:n("company")}),p("option",{value:"partnership",children:n("partnership")}),p("option",{value:"trust",children:n("trust")}),p("option",{value:"charity",children:n("charity")}),p("option",{value:"government",children:n("government")}),p("option",{value:"other",children:n("other")})]})}),((_=s==null?void 0:s.custom_fields)==null?void 0:_.company1)&&p(ls,{field:"company1",defaultValue:s.settings.custom_value1||"",value:s.custom_fields.company1,onValueChange:x=>a("settings.custom_value1",x.toString())}),((b=s==null?void 0:s.custom_fields)==null?void 0:b.company2)&&p(ls,{field:"company2",defaultValue:s.settings.custom_value2||"",value:s.custom_fields.company2,onValueChange:x=>a("settings.custom_value2",x.toString())}),((y=s==null?void 0:s.custom_fields)==null?void 0:y.company3)&&p(ls,{field:"company3",defaultValue:s.settings.custom_value3||"",value:s.custom_fields.company3,onValueChange:x=>a("settings.custom_value3",x.toString())}),((C=s==null?void 0:s.custom_fields)==null?void 0:C.company4)&&p(ls,{field:"company4",defaultValue:s.settings.custom_value4||"",value:s.custom_fields.company4,onValueChange:x=>a("settings.custom_value4",x.toString())})]})})}function nNe({isSettingsPage:n=!0}){const[e]=pe(),t=ji(),i=ci(),r=Qi(),{isGroupSettingsActive:o,isCompanySettingsActive:s,isClientSettingsActive:a}=ea(),l=Fi(Kk),c=OK({withoutNavigation:!0}),u=kbe({withoutNavigation:!0}),d=td({enableReinitialize:!0,initialValues:t,onSubmit:()=>{ce.processing();let f="/api/v1/companies/:id",g=i.id;l&&(o&&(f="/api/v1/group_settings/:id",g=l.id),a&&(f="/api/v1/clients/:id",g=l.id)),Ae("PUT",Te(f,{id:g}),d.values).then(m=>{s&&r(US({object:"company",data:m.data.data})),o&&(En(["group_settings"]),c(m.data.data)),a&&(En(["clients"]),u(m.data.data)),ce.success("removed_logo")})}}),h=()=>{d.setFieldValue("settings.company_logo",""),d.submitForm()};return n?p(K,{children:p(Gt,{behavior:"button",type:"minimal",onClick:()=>h(),children:e("remove_logo")})}):p(Gt,{behavior:"button",type:"minimal",onClick:()=>h(),children:e("remove_logo")})}function PYe({isSettingsPage:n=!0}){const[e]=pe(),t=ci(),i=Qi(),[r,o]=w.useState(new FormData),s=pq(),{isGroupSettingsActive:a,isCompanySettingsActive:l,isClientSettingsActive:c}=ea(),u=Fi(Kk),d=OK({withoutNavigation:!0}),h=kbe({withoutNavigation:!0}),f=td({enableReinitialize:!0,initialValues:r,onSubmit:()=>{ce.processing();let b="/api/v1/companies/:id",y=t.id;u&&(a&&(b="/api/v1/group_settings/:id",y=u.id),c&&(b="/api/v1/clients/:id",y=u.id)),Ae("POST",Te(b,{id:y}),r,{headers:{"Content-Type":"multipart/form-data"}}).then(C=>{l&&i(US({object:"company",data:C.data.data})),a&&(En(["group_settings"]),d(C.data.data)),c&&(En(["clients"]),h(C.data.data)),ce.success("uploaded_logo")}).finally(()=>o(new FormData))}}),g=w.useCallback(b=>{r.append("company_logo",b[0]),r.append("_method","PUT"),o(r),f.submitForm()},[r]),{getRootProps:m,getInputProps:v,isDragActive:_}=YN({onDrop:g,multiple:!1,maxFiles:1,accept:{"image/*":[".jpeg",".png"]}});return n?N(Qt,{title:e("logo"),children:[p(K,{leftSide:e("logo"),children:N("div",{className:"grid grid-cols-12 lg:gap-4 space-y-4 lg:space-y-0",children:[p("div",{className:"bg-gray-200 col-span-12 lg:col-span-5 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})}),p("div",{className:"col-span-12 lg:col-span-5 bg-gray-900 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})})]})}),p(K,{leftSide:e("upload_logo"),children:p("div",{...m(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[p("input",{...v()}),p(NT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium",children:_?"drop_your_logo_here":e("dropzone_default_message")})]})})}),p(nNe,{})]}):N("div",{className:"flex flex-col space-y-5",children:[p("span",{className:"text-lg font-medium",children:e("upload_logo")}),N("div",{className:"grid grid-cols-12 gap-x-4",children:[p("div",{className:"bg-gray-200 col-span-6 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})}),p("div",{className:"col-span-6 bg-gray-900 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})})]}),N("div",{className:"flex flex-col space-y-3",children:[p("div",{...m(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[p("input",{...v()}),p(NT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium",children:_?"drop_your_logo_here":e("dropzone_default_message")})]})}),p("div",{className:"self-start",children:p(nNe,{isSettingsPage:!1})})]})]})}function f0n(){const[n]=pe(),e=ci(),t=Ym();return N(dt,{children:[p(mve,{}),p(Qt,{title:n("custom_fields"),children:p("div",{className:"px-6",children:e&&["company1","company2","company3","company4"].map(i=>p(Jf,{initialValue:e.custom_fields[i]||"",field:i,placeholder:n("company_field"),onChange:r=>t(i,r)},i))})})]})}function p0n(){const[n]=pe(),e=[{id:"name",label:n("name"),format:(t,i)=>p(Li,{to:bt("/settings/task_statuses/:id/edit",{id:i.id}),children:t})},{id:"color",label:n("color"),format:t=>p("div",{className:"w-10 h-4 border border-gray-300 rounded-sm",style:{backgroundColor:t.toString()}})}];return p(Ng,{resource:"task_status",columns:e,endpoint:"/api/v1/task_statuses?sort=id|desc",bulkRoute:"/api/v1/task_statuses/bulk",linkToCreate:"/settings/task_statuses/create",linkToEdit:"/settings/task_statuses/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})}function g0n(){const{documentTitle:n}=Pi("new_task_status"),[e]=pe(),t=wi(),i=vo(),r=[{name:e("settings"),href:"/settings"},{name:e("task_settings"),href:"/settings/task_settings"},{name:e("new_task_status"),href:"/settings/task_statuses/create"}],{data:o}=FGe(),[s,a]=w.useState(),[l,c]=w.useState(!1),[u,d]=w.useState(),h=wbe({setErrors:a,setTaskStatus:d}),f=(m,v)=>{m.preventDefault(),l||(ce.processing(),a(void 0),c(!0),Ae("POST",Te("/api/v1/task_statuses"),u).then(_=>{ce.success("created_task_status"),En(["task_statuses"]),v==="save"?t(bt("/settings/task_statuses/:id/edit",{id:_.data.data.id})):d(o)}).catch(_=>{var b;((b=_.response)==null?void 0:b.status)===422&&(a(_.response.data),ce.dismiss())}).finally(()=>c(!1)))};w.useEffect(()=>{o&&d(o)},[o]);const g=[{onClick:m=>f(m,"create"),text:`${e("save")} / ${e("create")}`,icon:p(vt,{element:qp})}];return p(ir,{title:e("task_statuses"),breadcrumbs:r,children:p("div",{className:"max-w-3xl",children:p(Qt,{title:n,withSaveButton:!0,disableSubmitButton:l,onSaveClick:m=>f(m,"save"),additionalSaveOptions:g,children:N(x0,{children:[p(We,{required:!0,label:e("name"),value:u==null?void 0:u.name,onValueChange:m=>h("name",m),errorMessage:s==null?void 0:s.errors.name}),p(pg,{children:e("color")}),p(Gk,{value:(u==null?void 0:u.color)||i,onValueChange:m=>h("color",m)})]})})})})}function m0n(){var _;const[n]=pe(),{id:e}=il(),t=Rgn(),i=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"},{name:n("edit_task_status"),href:bt("/settings/task_statuses/:id/edit",{id:e})}],{data:r}=Dgn({id:e}),[o,s]=w.useState(),[a,l]=w.useState(!1),{documentTitle:c,setDocumentTitle:u}=Pi(""),[d,h]=w.useState(!1),[f,g]=w.useState(),m=wbe({setErrors:g,setTaskStatus:s}),v=b=>{b.preventDefault(),d||(ce.processing(),g(void 0),h(!0),Ae("PUT",Te("/api/v1/task_statuses/:id",{id:e}),o).then(()=>{ce.success("updated_task_status"),En(["task_statuses"]),l(!1)}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(g(y.response.data),ce.dismiss())}).finally(()=>h(!1)))};return w.useEffect(()=>{r&&s(r.data.data)},[r]),w.useEffect(()=>{o&&!a&&(u(o.name),l(!0))},[o]),N(ir,{title:n("task_statuses"),navigationTopRight:o&&p(D1,{label:n("more_actions"),resource:o,actions:t}),breadcrumbs:i,children:[!o&&p("div",{className:"flex justify-center",children:p(ns,{})}),o&&p("div",{className:"max-w-3xl",children:N(Qt,{title:c,withSaveButton:!0,disableSubmitButton:d,onFormSubmit:v,children:[N(K,{leftSide:n("status"),children:[!o.is_deleted&&!o.archived_at&&p(pr,{variant:"primary",children:n("active")}),o.archived_at&&!o.is_deleted?p(pr,{variant:"yellow",children:n("archived")}):null,o.is_deleted&&p(pr,{variant:"red",children:n("deleted")})]}),N(x0,{children:[p(We,{required:!0,label:n("name"),value:o.name,onValueChange:b=>m("name",b),errorMessage:(_=f==null?void 0:f.errors)==null?void 0:_.name}),p(pg,{children:n("color")}),p(Gk,{value:o.color,onValueChange:b=>m("color",b)})]})]})})]})}function _0n(){const[n]=pe(),{documentTitle:e}=Pi("api_tokens"),{dateFormat:t}=lc(),i=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_tokens"),href:"/settings/integrations/api_tokens"}],r=[{id:"name",label:n("name"),format:(o,s)=>p(Li,{to:bt("/settings/integrations/api_tokens/:id/edit",{id:s==null?void 0:s.id}),children:s==null?void 0:s.name})},{id:"created_at",label:n("created_on"),format:(o,s)=>go(s.created_at,t)}];return p(ir,{title:e,breadcrumbs:i,children:p(Ng,{resource:"token",columns:r,endpoint:"/api/v1/tokens?sort=id|desc&is_system=false",bulkRoute:"/api/v1/tokens/bulk",linkToCreate:"/settings/integrations/api_tokens/create",linkToEdit:"/settings/integrations/api_tokens/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function v0n(n){const{isOwner:e,isAdmin:t}=Po();return Ti(["/api/v1/tokens",n.id],()=>Ae("GET",Te("/api/v1/tokens/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function b0n(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/tokens/bulk"),{action:e,ids:[n]}).then(()=>{ce.success(`${e}d_token`),En(["tokens"])})}}function y0n(){const{isAdmin:n}=Po();return Ti("/api/v1/tokens/create",()=>Ae("GET",Te("/api/v1/tokens/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function MYe(n){const{setApiToken:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function C0n(){const[n]=pe(),{documentTitle:e}=Pi("new_token"),t=wi(),i=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_tokens"),href:"/settings/integrations/api_tokens"},{name:n("new_token"),href:"/settings/integrations/api_tokens/create"}],{data:r}=y0n(),o=Lg(),[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(),[h,f]=w.useState(),g=MYe({setApiToken:d,setErrors:f}),m=(v,_)=>{l||(f(void 0),ce.processing(),c(!0),Ae("POST",Te("/api/v1/tokens"),u,{headers:{"X-Api-Password":v}}).then(b=>{ce.success("created_token"),En(["tokens"]),t(bt("/settings/integrations/api_tokens/:id/edit",{id:b.data.data.id}))}).catch(b=>{var y,C;((y=b.response)==null?void 0:y.status)===422&&(ce.dismiss(),f(b.response.data)),((C=b.response)==null?void 0:C.status)===412&&(o(_),a(!0))}).finally(()=>c(!1)))};return w.useEffect(()=>{r&&d(r)},[r]),N(dt,{children:[p(ap,{show:s,onClose:a,onSave:m}),p(ir,{title:e,breadcrumbs:i,onSaveClick:()=>a(!0),disableSaveButton:!u,children:p(Qt,{title:n("new_token"),children:p(K,{leftSide:n("name"),required:!0,children:p(We,{required:!0,onValueChange:v=>g("name",v),errorMessage:h==null?void 0:h.errors.name})})})})]})}function w0n(){const[n]=pe(),e=b0n();return[i=>i.archived_at===0&&p(tn,{onClick:()=>e(i.id,"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),i=>i.archived_at>0&&p(tn,{onClick:()=>e(i.id,"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),i=>!i.is_deleted&&p(tn,{onClick:()=>e(i.id,"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function S0n(){const[n]=pe(),{id:e}=il(),{data:t}=v0n({id:e}),i=wi(),{documentTitle:r}=Pi("edit_token"),o=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_tokens"),href:"/settings/integrations/api_tokens"},{name:n("edit_token"),href:bt("/settings/integrations/api_tokens/:id/edit",{id:e})}],s=w0n(),{dateFormat:a}=lc(),l=Lg(),[c,u]=w.useState(!1),[d,h]=w.useState(!1),[f,g]=w.useState(),[m,v]=w.useState(),_=MYe({setApiToken:g,setErrors:v}),b=(y,C)=>{d||(v(void 0),ce.processing(),h(!0),Ae("PUT",Te("/api/v1/tokens/:id",{id:e}),f,{headers:{"X-Api-Password":y}}).then(()=>{ce.success("updated_token"),En(["tokens"]),i(bt("/settings/integrations/api_tokens"))}).catch(x=>{var E,k;((E=x.response)==null?void 0:E.status)===422&&(ce.dismiss(),v(x.response.data)),((k=x.response)==null?void 0:k.status)===412&&(l(C),u(!0))}).finally(()=>h(!1)))};return w.useEffect(()=>{t&&g(t)},[t]),N(dt,{children:[p(ap,{show:c,onClose:u,onSave:b}),p(ir,{title:r,breadcrumbs:o,disableSaveButton:!f,onSaveClick:()=>u(!0),navigationTopRight:f&&p(D1,{resource:f,label:n("more_actions"),actions:s}),children:t&&f&&N(Qt,{title:t.name,children:[N(K,{leftSide:"Status",children:[!f.is_deleted&&!f.archived_at&&p(pr,{variant:"primary",children:n("active")}),f.archived_at&&!f.is_deleted?p(pr,{variant:"yellow",children:n("archived")}):null,f.is_deleted&&p(pr,{variant:"red",children:n("deleted")})]}),p(K,{leftSide:n("name"),required:!0,children:p(We,{value:f.name,onValueChange:y=>_("name",y),errorMessage:m==null?void 0:m.errors.name})}),p(K,{leftSide:n("token"),children:p(Fl,{secure:!0,className:"break-all",text:f.token})}),p(K,{leftSide:n("created_on"),children:go(f.created_at,a)})]})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ibe(){const[n]=pe(),e="1",t="2",i="3",r="4",o="5",s="6",a="7",l="8",c="9",u="10",d="11",h="12",f="13",g="14",m="15",v="16",_="17",b="18",y="19",C="20",x="21",E="22",k="23",L="24",D="33",A="37",O="41",P="45",F="60",B="61",M="34",V="42",U="64",W="27",q="62",H="28",ie="35",se="43",Q="29",Ee="31",Fe="32",He="40",ke="48",Me="49",je="39",qe="47",Be="36",_t="44",Wt="25",Tt="26",rn="38",_n="46",wt="30",pt="50",ot="51",we="52",Se="53",re="54",Y="55",Z="63",le="56",te="57",me="58",Oe="59",et="65";return[{event:e,label:n("create_client")},{event:u,label:n("update_client")},{event:A,label:n("archive_client")},{event:P,label:n("restore_client")},{event:d,label:n("delete_client")},{event:t,label:n("create_invoice")},{event:F,label:n("sent_invoice")},{event:l,label:n("update_invoice")},{event:E,label:n("late_invoice")},{event:L,label:n("remind_invoice")},{event:D,label:n("archive_invoice")},{event:O,label:n("restore_invoice")},{event:c,label:n("delete_invoice")},{event:i,label:n("create_quote")},{event:B,label:n("sent_quote")},{event:s,label:n("update_quote")},{event:x,label:n("approve_quote")},{event:k,label:n("expired_quote")},{event:M,label:n("archive_quote")},{event:V,label:n("restore_quote")},{event:a,label:n("delete_quote")},{event:U,label:n("remind_quote")},{event:W,label:n("create_credit")},{event:q,label:n("sent_credit")},{event:H,label:n("update_credit")},{event:ie,label:n("archive_credit")},{event:se,label:n("restore_credit")},{event:Q,label:n("delete_credit")},{event:r,label:n("create_payment")},{event:Ee,label:n("update_payment")},{event:Fe,label:n("archive_payment")},{event:He,label:n("restore_payment")},{event:h,label:n("delete_payment")},{event:o,label:n("create_vendor")},{event:f,label:n("update_vendor")},{event:ke,label:n("archive_vendor")},{event:Me,label:n("restore_vendor")},{event:g,label:n("delete_vendor")},{event:m,label:n("create_expense")},{event:v,label:n("update_expense")},{event:je,label:n("archive_expense")},{event:qe,label:n("restore_expense")},{event:_,label:n("delete_expense")},{event:b,label:n("create_task")},{event:y,label:n("update_task")},{event:Be,label:n("archive_task")},{event:_t,label:n("restore_task")},{event:C,label:n("delete_task")},{event:Wt,label:n("create_project")},{event:Tt,label:n("update_project")},{event:rn,label:n("archive_project")},{event:_n,label:n("restore_project")},{event:wt,label:n("delete_project")},{event:pt,label:n("create_product")},{event:ot,label:n("update_product")},{event:we,label:n("delete_product")},{event:Se,label:n("restore_product")},{event:re,label:n("archive_product")},{event:Y,label:n("create_purchase_order")},{event:Z,label:n("sent_purchase_order")},{event:le,label:n("update_purchase_order")},{event:te,label:n("delete_purchase_order")},{event:me,label:n("restore_purchase_order")},{event:Oe,label:n("archive_purchase_order")},{event:et,label:n("accept_purchase_order")}]}function E0n(){const[n]=pe(),e=Ibe();return[{id:"endpoint",label:n("endpoint"),format:(i,r)=>p(Li,{to:bt("/settings/integrations/api_webhooks/:id/edit",{id:r.id}),children:r.target_url})},{id:"method",label:n("method"),format:(i,r)=>r.rest_method.toUpperCase()},{id:"event_id",label:n("event_type"),format:(i,r)=>{var o;return((o=e.find(({event:s})=>s===r.event_id))==null?void 0:o.label)||""}}]}function x0n(){Pi("api_webhooks");const[n]=pe(),e=E0n(),t=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"}];return p(ir,{title:n("api_webhooks"),breadcrumbs:t,children:p(Ng,{resource:"webhook",columns:e,endpoint:"/api/v1/webhooks?sort=id|desc",bulkRoute:"/api/v1/webhooks/bulk",linkToCreate:"/settings/integrations/api_webhooks/create",linkToEdit:"/settings/integrations/api_webhooks/:id/edit",withResourcefulActions:!0,enableSavingFilterPreference:!0})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function T0n(n){const{isAdmin:e}=Po();return Ti(["/api/v1/webhooks",n.id],()=>Ae("GET",Te("/api/v1/webhooks/:id",{id:n.id})).then(t=>t.data.data),{staleTime:1/0,enabled:e})}function k0n(){const{isAdmin:n}=Po();return Ti("/api/v1/webhooks/create",()=>Ae("GET",Te("/api/v1/webhooks/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function I0n(){return(n,e)=>{ce.processing(),Ae("POST",Te("/api/v1/webhooks/bulk"),{action:e,ids:[n]}).then(()=>{ce.success(`${e}d_webhook`),En(["webhooks"])})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function FYe(n){const{setApiWebHook:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function L0n(){const[n]=pe(),{documentTitle:e}=Pi("new_webhook"),{data:t}=k0n(),i=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"},{name:n("new_webhook"),href:"/settings/integrations/api_webhooks/create"}],r=Ibe(),[o,s]=w.useState({}),[a,l]=w.useState({}),[c,u]=w.useState(),[d,h]=w.useState(),[f,g]=w.useState(!1),m=FYe({setApiWebHook:h,setErrors:u}),v=y=>{if(Object.hasOwn(o,y)){const C={...o};delete C[y],s(C)}},_=wi(),b=()=>{d&&!f&&(ce.processing(),g(!0),u(void 0),d.headers=o,Ae("POST",Te("/api/v1/webhooks"),d).then(y=>{ce.success("created_webhook"),En(["webhooks"]),_(bt("/settings/integrations/api_webhooks/:id/edit",{id:y.data.data.id}))}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(ce.dismiss(),u(y.response.data))}).finally(()=>g(!1)))};return w.useEffect(()=>{t&&h({...t,headers:{}})},[t]),p(ir,{title:n("api_webhooks"),breadcrumbs:i,disableSaveButton:!d,onSaveClick:b,children:N(Qt,{title:e,children:[p(K,{leftSide:n("target_url"),required:!0,children:p(We,{required:!0,value:d==null?void 0:d.target_url,onValueChange:y=>m("target_url",y),errorMessage:c==null?void 0:c.errors.target_url})}),p(K,{leftSide:n("event_type"),children:p(YS,{value:d==null?void 0:d.event_id,onValueChange:y=>m("event_id",y),errorMessage:c==null?void 0:c.errors.event_id,children:r.map(y=>p("option",{value:y.event,children:y.label},y.event))})}),p(K,{leftSide:n("method"),children:N(Cn,{value:d==null?void 0:d.rest_method,onValueChange:y=>m("rest_method",y),errorMessage:c==null?void 0:c.errors.method,children:[p("option",{value:"post",children:"POST"}),p("option",{value:"put",children:"PUT"})]})}),p(K,{leftSide:n("add_header"),children:N("div",{className:"flex flex-col",children:[N("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[p("div",{className:"flex-1",children:p(We,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:a.key||"",onValueChange:y=>l({...a,key:y})})}),p("div",{className:"flex-1",children:p(We,{className:"flex-1",debounceTimeout:0,id:"header_value",value:a.value||"",placeholder:n("header_value"),onValueChange:y=>l({...a,value:y})})}),p(Gt,{behavior:"button",type:"minimal",disableWithoutIcon:!0,disabled:!a.key||!a.value,onClick:()=>{s(y=>({...y,[a.key]:a.value})),l({})},children:p(Yd,{})})]}),N("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(o).map(([y,C],x)=>N("div",{className:"flex justify-between items-center space-x-4",children:[p("span",{className:"flex-1 text-start",children:y}),p("span",{className:"flex-1 text-start",children:C}),p(Gt,{behavior:"button",type:"minimal",onClick:()=>v(y),children:p(kg,{size:18})})]},x)),!Object.entries(o).length&&p("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function D0n(){const[n]=pe(),e=I0n();return[i=>i.archived_at===0&&p(tn,{onClick:()=>e(i.id,"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),i=>i.archived_at>0&&p(tn,{onClick:()=>e(i.id,"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),i=>!i.is_deleted&&p(tn,{onClick:()=>e(i.id,"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function A0n(){const[n]=pe(),{id:e}=il();Pi("edit_webhook");const t=wi(),i=D0n(),r=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"},{name:n("edit_webhook"),href:bt("/settings/integrations/api_webhooks/:id/edit",{id:e})}],o=Ibe(),[s,a]=w.useState({}),[l,c]=w.useState({}),[u,d]=w.useState(),[h,f]=w.useState(!1),[g,m]=w.useState(),v=FYe({setApiWebHook:m,setErrors:d}),{data:_}=T0n({id:e}),b=C=>{if(Object.hasOwn(s,C)){const x={...s};delete x[C],a(x)}},y=()=>{g&&!h&&(ce.processing(),f(!0),d(void 0),g.headers=s,Ae("PUT",Te("/api/v1/webhooks/:id",{id:e}),g).then(()=>{ce.success("created_webhook"),En(["webhooks"]),t("/settings/integrations/api_webhooks")}).catch(C=>{var x;((x=C.response)==null?void 0:x.status)===422&&(ce.dismiss(),d(C.response.data))}).finally(()=>f(!1)))};return w.useEffect(()=>{_&&(m(_),a(_.headers))},[_]),p(ir,{title:n("api_webhooks"),breadcrumbs:r,disableSaveButton:!g,onSaveClick:y,navigationTopRight:g&&p(D1,{label:n("more_actions"),resource:g,actions:i}),children:N(Qt,{title:_==null?void 0:_.target_url,children:[p(K,{leftSide:n("target_url"),required:!0,children:p(We,{required:!0,value:g==null?void 0:g.target_url,onValueChange:C=>v("target_url",C),errorMessage:u==null?void 0:u.errors.target_url})}),p(K,{leftSide:n("event_type"),children:p(YS,{value:g==null?void 0:g.event_id,onValueChange:C=>v("event_id",C),errorMessage:u==null?void 0:u.errors.event_id,children:o.map(C=>p("option",{value:C.event,children:C.label},C.event))})}),p(K,{leftSide:n("method"),children:N(Cn,{value:g==null?void 0:g.rest_method,onValueChange:C=>v("rest_method",C),errorMessage:u==null?void 0:u.errors.rest_method,children:[p("option",{value:"post",children:"POST"}),p("option",{value:"put",children:"PUT"})]})}),p(K,{leftSide:n("add_header"),children:N("div",{className:"flex flex-col",children:[N("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[p("div",{className:"flex-1",children:p(We,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:l.key||"",onValueChange:C=>c({...l,key:C})})}),p("div",{className:"flex-1",children:p(We,{debounceTimeout:0,id:"header_value",value:l.value||"",placeholder:n("header_value"),onValueChange:C=>c({...l,value:C})})}),p(Gt,{behavior:"button",type:"minimal",disableWithoutIcon:!0,disabled:!l.key||!l.value,onClick:()=>{a(C=>({...C,[l.key]:l.value})),c({})},children:p(Yd,{})})]}),N("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(s).map(([C,x],E)=>N("div",{className:"flex justify-between items-center space-x-4",children:[p("span",{className:"flex-1 text-start",children:C}),p("span",{className:"flex-1 text-start",children:x}),p(Gt,{behavior:"button",type:"minimal",onClick:()=>b(C),children:p(kg,{size:18})})]},E)),!Object.entries(s).length&&p("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function N0n(){const[n]=pe(),e=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("analytics"),href:"/settings/integrations/analytics"}];Pi("analytics");const t=Qi(),i=ci(),r=ji(),[o,s]=w.useState(),[a,l]=w.useState(!1);w.useEffect(()=>{t(rS({object:"company",data:i}))},[i]);const c=d=>{s(void 0),t(Go({object:"company",property:d.target.id,value:d.target.value}))},u=()=>{a||(ce.processing(),l(!0),s(void 0),Ae("PUT",Te("/api/v1/companies/:id",{id:r.id}),r).then(d=>{t(US({object:"company",data:d.data.data})),ce.success("updated_settings")}).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(s(d.response.data),ce.dismiss())}).finally(()=>l(!1)))};return p(ir,{title:n("analytics"),breadcrumbs:e,onSaveClick:u,disableSaveButton:a,children:N(Qt,{title:n("analytics"),children:[p(K,{leftSide:N("div",{className:"flex flex-col items-start",children:[n("google_analytics_tracking_id"),p(Li,{to:"https://support.google.com/analytics/answer/1037249?hl=en",external:!0,children:n("learn_more")})]}),children:p(We,{id:"google_analytics_key",value:r==null?void 0:r.google_analytics_key,onChange:c,errorMessage:o==null?void 0:o.errors.google_analytics_key})}),p(K,{leftSide:n("matomo_id"),children:p(We,{id:"matomo_id",value:r==null?void 0:r.matomo_id,onChange:c,errorMessage:o==null?void 0:o.errors.matomo_id})}),p(K,{leftSide:n("matomo_url"),children:p(We,{id:"matomo_url",value:r==null?void 0:r.matomo_url,onChange:c,errorMessage:o==null?void 0:o.errors.matomo_url})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function BYe(){const[n,e]=w.useState([]),{data:t}=ed();return w.useEffect(()=>{t!=null&&t.gateways&&e(()=>t.gateways.filter(i=>i.visible).sort((i,r)=>i.sort_order>r.sort_order?1:-1))},[t]),n}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function $Ye(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/(^\w|\s\w)/g,e=>e.toUpperCase())}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function VYe(n){return(e,t)=>{n(i=>i&&{...i,config:JSON.stringify({...JSON.parse(i.config),[e]:t})})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function PK(n){const e=JSON.parse(n.config);return t=>e[t]||""}function HYe(n,e){const t=PK(n),i=VYe(e),r=vo();return(o,s,a)=>{var l;if(o.toLowerCase().endsWith("color"))return p(Gk,{value:t(o)||r,onValueChange:c=>i(o,c)});if(o==="text")return p(pd,{value:t(o),onChange:c=>i(o,c)});if(o==="appleDomainVerification")return p(We,{element:"textarea",onChange:c=>i(o,c.target.value),value:t(o),errorMessage:a==null?void 0:a.errors.appleDomainVerification});if(typeof s=="string"){const c=o.toLowerCase().includes("key")||o.toLowerCase().includes("password")||o.toLowerCase().includes("secret")||o.toLowerCase().includes("id");return p(We,{type:c?"password":"text",onChange:u=>i(o,u.target.value),value:t(o),errorMessage:a==null?void 0:a.errors[o]})}if(typeof s=="boolean")return p(ft,{checked:t(o),onChange:c=>i(o,c)});if(typeof s=="object")return p(Cn,{value:(l=t(o))==null?void 0:l.toString(),onValueChange:c=>i(o,c),errorMessage:a==null?void 0:a.errors[o],customSelector:!0,children:s.map((c,u)=>p("option",{value:c==null?void 0:c.toString(),children:c},u))})}}function R0n(){const[n]=pe();return p(K,{children:p(Gt,{onClick:()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"stripe_connect"}).then(t=>{var i;return(i=window.open(bt("https://invoicing.co/stripe/signup/:token",{token:t.data.hash}),"_blank"))==null?void 0:i.focus()})},type:"minimal",behavior:"button",children:n("gateway_setup")})})}function O0n(){const[n]=pe();return p(K,{children:p(Gt,{onClick:()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"wepay"}).then(t=>{var i;return(i=window.open(bt("https://invoicing.co/wepay/signup/:token",{token:t.data.hash}),"_blank"))==null?void 0:i.focus()})},type:"minimal",behavior:"button",children:n("gateway_setup")})})}function P0n(n){const[e]=pe(),t=()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(a=>{var l;return(l=window.open(bt("https://invoicing.co/paypal?hash=:hash",{hash:a.data.hash}),"_blank"))==null?void 0:l.focus()})},i=PK(n.companyGateway),r=HYe(n.companyGateway,n.setCompanyGateway),o=()=>{const a=i("status"),l=i("merchantId");return a==="activated"&&l},s=()=>i("merchantId").length>0;return N(dt,{children:[p(K,{leftSide:e("status"),children:N("ul",{className:"list-none",children:[N("li",{children:[p("b",{children:"Merchant id:"})," ",i("merchantId")]}),N("li",{children:[N("b",{children:[e("status"),":"]})," ",i("status")]}),N("li",{children:[N("b",{children:[e("email"),":"]})," ",i("emailVerified")]}),N("li",{children:[N("b",{children:[e("permissions"),":"]})," ",i("permissions")]}),N("li",{children:[N("b",{children:[e("notifications"),":"]})," ",i("returnMessage")]})]})}),n.companyGateway&&!o()&&p(K,{children:p(Gt,{onClick:t,type:"minimal",behavior:"button",children:e("gateway_setup")})}),n.gateway&&s()&&Object.keys(JSON.parse(n.gateway.fields)).map((a,l)=>p(K,{leftSide:$Ye(a),children:r(a,JSON.parse(n.gateway.fields)[a],n.errors)},l))]})}function M0n({companyGateway:n,setCompanyGateway:e}){const{t}=pe(),i=PK(n),r=VYe(e);return N(dt,{children:[p(K,{leftSide:t("OAuth 2.0"),children:p(MD,{size:18})}),p(K,{leftSide:t("test_mode"),children:p(ft,{checked:i("testMode"),onChange:o=>r("testMode",o)})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function WYe(){return()=>Ae("POST",Te("/api/v1/one_time_token"),{context:"gocardless_oauth2"}).then(n=>{var e;return(e=window.open(bt("https://invoicing.co/gocardless/oauth/connect/:token",{token:n.data.hash}),"_blank"))==null?void 0:e.focus()})}function zYe(n){const[e]=pe(),t=Tl(),i=HYe(n.companyGateway,n.setCompanyGateway),r=PK(n.companyGateway),o="d14dd26a47cecc30fdd65700bfb67b34",s="8fdeed552015b3c7b44ed6c8ebd9e992",a="80af24a6a691230bbec33e930ab40666",l="b9886f9257f0c6ee7c302f1c74475f6c",c=[o,s,a],[u,d]=w.useState(!1),[h,f]=w.useState(),[g,m]=w.useState(""),v=()=>{u||(ce.processing(),d(!0),Ae("POST",Te("/api/v1/company_gateways/:id/test",{id:n.companyGateway.id})).then(()=>f(!0)).catch(y=>{var C,x;m((x=(C=y.response)==null?void 0:C.data)==null?void 0:x.message),f(!1)}).finally(()=>{ce.dismiss(),d(!1)}))},_=WYe(),b=vo();return N(dt,{children:[N(Qt,{title:e("credentials"),topRight:N("button",{style:{color:b},type:"button",onClick:()=>wK("gateways",{moveToHeading:"Credentials"}),className:"inline-flex items-center space-x-1 text-sm",children:[p(xge,{size:18}),p("span",{children:e("documentation")})]}),children:[n.gateway.site_url&&n.gateway.site_url.length>=1&&p(K,{leftSide:e("help"),children:p(Li,{external:!0,to:n.gateway.site_url,children:e("learn_more")})}),n.gateway&&n.gateway.key===o&&p(R0n,{}),n.gateway&&n.gateway.key===s&&p(O0n,{}),n.gateway&&n.gateway.key===a&&p(P0n,{gateway:n.gateway,companyGateway:n.companyGateway,setCompanyGateway:n.setCompanyGateway,errors:n.errors}),n.gateway&&n.gateway.key===l&&Ro()&&r("oauth2")===!0&&p(M0n,{companyGateway:n.companyGateway,setCompanyGateway:n.setCompanyGateway}),n.gateway&&!c.includes(n.gateway.key)&&Object.keys(JSON.parse(n.gateway.fields)).map((y,C)=>p(K,{leftSide:$Ye(y),children:i(y,JSON.parse(n.gateway.fields)[y],n.errors)},C)),n.gateway&&n.gateway.key===l&&Ro()&&r("oauth2")!==!0&&p(K,{leftSide:e("OAuth 2.0"),children:p(Gt,{behavior:"button",type:"minimal",onClick:_,children:e("connect")})}),p(_i,{}),!t.pathname.includes("/create")&&N(dt,{children:[p(_i,{}),p("div",{className:"flex justify-end pr-6",children:p(Gt,{behavior:"button",onClick:v,disableWithoutIcon:!0,disabled:u||!n.isGatewaySaved,children:e("health_check")})})]})]}),p(Ui,{title:e("status"),visible:typeof h<"u",onClose:()=>f(void 0),children:typeof h<"u"&&p("span",{className:"text-center font-medium text-base pb-3",children:e(h?"success":g||"status_failed")})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function F0n(n){return(e,t,i)=>{n&&n(r=>r&&{...r,fees_and_limits:{...r.fees_and_limits,[e]:{...r.fees_and_limits[e],[t]:i}}})}}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */var js=(n=>(n.CreditCard="1",n.BankTransfer="2",n.PayPal="3",n.Crypto="4",n.Custom="5",n.Alipay="6",n.Sofort="7",n.ApplePay="8",n.SEPA="9",n.Credit="10",n.KBC="11",n.Bancontact="12",n.IDeal="13",n.Hosted="14",n.Giropay="15",n.Przelewy24="16",n.EPS="17",n.DirectDebit="18",n.ACSS="19",n.BECS="20",n.InstantBankPay="21",n.FPX="22",n.KLARNA="23",n.BACS="24",n.VENMO="25",n.MERCADOPAGO="26",n.MYBANK="27",n.PAYLATER="28",n.PAYPAL_ADVANCED_CARDS="29",n))(js||{});/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const B0n={[js.CreditCard]:"credit_card",[js.BankTransfer]:"bank_transfer",[js.PayPal]:"paypal",[js.Crypto]:"crypto",[js.Custom]:"custom",[js.Alipay]:"alipay",[js.Sofort]:"sofort",[js.ApplePay]:"apple_pay",[js.SEPA]:"sepa",[js.Credit]:"credit",[js.KBC]:"kbc",[js.Bancontact]:"bancontact",[js.IDeal]:"ideal",[js.Hosted]:"hosted",[js.Giropay]:"giropay",[js.Przelewy24]:"przelewy24",[js.DirectDebit]:"direct_debit",[js.EPS]:"eps",[js.ACSS]:"acss",[js.BECS]:"becs",[js.InstantBankPay]:"instant_bank_pay",[js.KLARNA]:"klarna",[js.BACS]:"bacs",[js.FPX]:"fpx",[js.VENMO]:"venmo",[js.MERCADOPAGO]:"mercadopago",[js.MYBANK]:"mybank",[js.PAYLATER]:"paylater",[js.PAYPAL_ADVANCED_CARDS]:"paypal_advanced_cards"};/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function UYe(){return n=>B0n[n]||"other"}const $0n=Oo(void 0);function jYe(n){var d,h,f,g,m,v,_,b,y,C,x,E,k,L,D,A,O,P,F,B,M,V,U,W,q,H,ie,se,Q;const[e]=pe(),t=ci(),[i,r]=Yo($0n),o=UYe(),s=F0n(n.setCompanyGateway);w.useEffect(()=>{const Ee=Object.entries(n.companyGateway.fees_and_limits).filter(([,Fe])=>Fe.is_enabled);typeof i<"u"&&Ee.length>0||(Ee.length>0?r(Ee[0][0]):r(void 0))},[n.companyGateway]);const a=Ee=>{r(Ee)},l=(Ee,Fe)=>{i&&s(i,Ee,Fe)},c=()=>{var Ee,Fe;if(i){const{fee_tax_name1:He,fee_tax_name2:ke,fee_tax_name3:Me}=((Fe=(Ee=n.companyGateway)==null?void 0:Ee.fees_and_limits)==null?void 0:Fe[i])||{};if(t.enabled_item_tax_rates===0&&(He||ke||Me))return!0}return!1},u=vo();return N(Qt,{title:e("limits_and_fees"),topRight:N("button",{style:{color:u},type:"button",onClick:()=>wK("gateways",{moveToHeading:"Limits/Fees"}),className:"inline-flex items-center space-x-1 text-sm",children:[p(xge,{size:18}),p("span",{children:e("documentation")})]}),children:[p(K,{leftSide:e("payment_type"),children:p(Cn,{value:i,onValueChange:Ee=>a(Ee),errorMessage:(d=n.errors)==null?void 0:d.errors.gatewayTypeId,customSelector:!0,dismissable:!1,children:Object.entries(n.companyGateway.fees_and_limits).filter(([,Ee])=>Ee.is_enabled).map(([Ee],Fe)=>p("option",{value:Ee,children:e(o(Ee))},Fe))})}),i&&N(dt,{children:[p(_i,{}),p(K,{leftSide:`${e("min")} ${e("limit")}`,children:N("div",{className:"space-y-4",children:[p(wo,{value:((f=(h=n.companyGateway.fees_and_limits)==null?void 0:h[i])==null?void 0:f.min_limit)||"",onValueChange:Ee=>l("min_limit",parseFloat(Ee)||-1),disabled:((m=(g=n.companyGateway.fees_and_limits)==null?void 0:g[i])==null?void 0:m.min_limit)===-1,errorMessage:(v=n.errors)==null?void 0:v.errors.min_limit}),p(ft,{checked:((b=(_=n.companyGateway.fees_and_limits)==null?void 0:_[i])==null?void 0:b.min_limit)>=0,label:e("enable_min"),onValueChange:Ee=>l("min_limit",Ee?0:-1)})]})}),p(K,{leftSide:`${e("max")} ${e("limit")}`,children:N("div",{className:"space-y-4",children:[p(wo,{value:((C=(y=n.companyGateway.fees_and_limits)==null?void 0:y[i])==null?void 0:C.max_limit)||"",onValueChange:Ee=>l("max_limit",parseFloat(Ee)||-1),disabled:((E=(x=n.companyGateway.fees_and_limits)==null?void 0:x[i])==null?void 0:E.max_limit)===-1,errorMessage:(k=n.errors)==null?void 0:k.errors.max_limit}),p(ft,{checked:((D=(L=n.companyGateway.fees_and_limits)==null?void 0:L[i])==null?void 0:D.max_limit)>=0,label:e("enable_max"),onValueChange:Ee=>l("max_limit",Ee?0:-1)})]})}),p(_i,{}),p(K,{leftSide:e("fee_percent"),children:p(wo,{value:((O=(A=n.companyGateway.fees_and_limits)==null?void 0:A[i])==null?void 0:O.fee_percent)||"",onValueChange:Ee=>l("fee_percent",parseFloat(Ee)),errorMessage:(P=n.errors)==null?void 0:P.errors.fee_percent})}),p(K,{leftSide:e("fee_amount"),children:p(wo,{value:((B=(F=n.companyGateway.fees_and_limits)==null?void 0:F[i])==null?void 0:B.fee_amount)||"",onValueChange:Ee=>l("fee_amount",parseFloat(Ee)),errorMessage:(M=n.errors)==null?void 0:M.errors.fee_amount})}),c()&&N("div",{className:"flex items-center space-x-3 px-6 py-2",children:[p("div",{children:p(vt,{element:Tb,size:20,color:"orange"})}),p("div",{className:"text-sm font-medium",children:SK(e("hidden_taxes_warning"),":link",()=>p(Li,{to:"/settings/tax_settings",children:e("settings")}))})]}),t&&t.enabled_item_tax_rates>0&&p(K,{leftSide:e("tax"),children:p(Yy,{defaultValue:Lw((V=n.companyGateway)==null?void 0:V.fees_and_limits[i],"fee_tax_name1"),onChange:Ee=>{var Fe,He;l("fee_tax_name1",((Fe=Ee.resource)==null?void 0:Fe.name)||""),l("fee_tax_rate1",((He=Ee.resource)==null?void 0:He.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name1",""),l("fee_tax_rate1",0)},onTaxCreated:Ee=>{l("fee_tax_name1",Ee.name),l("fee_tax_rate1",Ee.rate)}})}),t&&t.enabled_item_tax_rates>1&&p(K,{leftSide:e("tax"),children:p(Yy,{defaultValue:Lw((U=n.companyGateway)==null?void 0:U.fees_and_limits[i],"fee_tax_name2"),onChange:Ee=>{var Fe,He;l("fee_tax_name2",((Fe=Ee.resource)==null?void 0:Fe.name)||""),l("fee_tax_rate2",((He=Ee.resource)==null?void 0:He.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name2",""),l("fee_tax_rate2",0)},onTaxCreated:Ee=>{l("fee_tax_name2",Ee.name),l("fee_tax_rate2",Ee.rate)}})}),t&&t.enabled_item_tax_rates>2&&p(K,{leftSide:e("tax"),children:p(Yy,{defaultValue:Lw((W=n.companyGateway)==null?void 0:W.fees_and_limits[i],"fee_tax_name3"),onChange:Ee=>{var Fe,He;l("fee_tax_name3",((Fe=Ee.resource)==null?void 0:Fe.name)||""),l("fee_tax_rate3",((He=Ee.resource)==null?void 0:He.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name3",""),l("fee_tax_rate3",0)},onTaxCreated:Ee=>{l("fee_tax_name3",Ee.name),l("fee_tax_rate3",Ee.rate)}})}),p(K,{leftSide:e("fee_cap"),children:p(wo,{value:((H=(q=n.companyGateway.fees_and_limits)==null?void 0:q[i])==null?void 0:H.fee_cap)||"",onValueChange:Ee=>l("fee_cap",parseFloat(Ee)),errorMessage:(ie=n.errors)==null?void 0:ie.errors.fee_cap})}),p(K,{leftSide:e("adjust_fee_percent"),children:p(ft,{checked:(Q=(se=n.companyGateway.fees_and_limits)==null?void 0:se[i])==null?void 0:Q.adjust_fee_percent,label:e("adjust_fee_percent_help"),onValueChange:Ee=>l("adjust_fee_percent",Ee)})})]})]})}function qYe(n){const[e]=pe(),t=(i,r)=>{n.setCompanyGateway(o=>o&&{...o,[i]:r})};return N(Qt,{title:e("required_fields"),children:[p(K,{leftSide:e("client_name"),children:p(ft,{checked:n.companyGateway.require_client_name,onChange:i=>t("require_client_name",i)})}),p(K,{leftSide:e("client_phone"),children:p(ft,{checked:n.companyGateway.require_client_phone,onChange:i=>t("require_client_phone",i)})}),p(K,{leftSide:e("contact_name"),children:p(ft,{checked:n.companyGateway.require_contact_name,onChange:i=>t("require_contact_name",i)})}),p(K,{leftSide:e("contact_email"),children:p(ft,{checked:n.companyGateway.require_contact_email,onChange:i=>t("require_contact_email",i)})}),p(K,{leftSide:e("postal_code"),children:p(ft,{checked:n.companyGateway.require_postal_code,onChange:i=>t("require_postal_code",i)})}),p(K,{leftSide:e("cvv"),children:p(ft,{checked:n.companyGateway.require_cvv,onChange:i=>t("require_cvv",i)})}),p(K,{leftSide:e("billing_address"),children:p(ft,{checked:n.companyGateway.require_billing_address,onChange:i=>t("require_billing_address",i)})}),p(K,{leftSide:e("shipping_address"),children:p(ft,{checked:n.companyGateway.require_shipping_address,onChange:i=>t("require_shipping_address",i)})}),p(_i,{}),p(K,{leftSide:e("update_address"),children:p(ft,{label:e("update_address_help"),checked:n.companyGateway.update_details,onChange:i=>t("update_details",i)})}),p(K,{leftSide:e("always_show_required_fields"),children:p(ft,{label:e("always_show_required_fields_help"),checked:n.companyGateway.always_show_required_fields??!0,onChange:i=>t("always_show_required_fields",i)})})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const KYe={adjust_fee_percent:!1,fee_amount:0,fee_cap:0,fee_percent:0,fee_tax_name1:"",fee_tax_name2:"",fee_tax_name3:"",fee_tax_rate1:0,fee_tax_rate2:0,fee_tax_rate3:0,is_enabled:!0,max_limit:-1,min_limit:-1};function V0n(n,e){return(t,i)=>{if(Object.hasOwn(n.fees_and_limits,t))return e(r=>r&&{...r,fees_and_limits:{...r.fees_and_limits,[t]:{...r.fees_and_limits[t],is_enabled:i}}});e(r=>r&&{...r,fees_and_limits:{...r.fees_and_limits,[t]:KYe}})}}function GYe(n){var u,d;const[e]=pe(),[t,i]=w.useState(n.gateway),[r,o]=w.useState([]);w.useEffect(()=>i(n.gateway),[n.gateway]),w.useEffect(()=>{const h=[];for(const f in t.options)h.push({gatewayTypeId:f,...t.options[f]});o([...h])},[t]);const s=UYe(),a=(h,f)=>{n.setCompanyGateway(g=>g&&{...g,[h]:f})},l=V0n(n.companyGateway,n.setCompanyGateway),c=h=>{const f=Object.entries(n.companyGateway.fees_and_limits).find(([m])=>h===m);if(!f)return!1;const[,g]=f;return g.is_enabled};return N(Qt,{title:e("settings"),children:[p(K,{leftSide:e("label"),children:p(We,{value:n.companyGateway.label||t.name,onValueChange:h=>a("label",h),errorMessage:(u=n.errors)==null?void 0:u.errors.label})}),r.some(h=>h.token_billing==!0)&&p(K,{leftSide:e("tokenize"),leftSideHelp:e("tokenize_help"),children:N(Cn,{value:n.companyGateway.token_billing||"off",onValueChange:h=>a("token_billing",h),errorMessage:(d=n.errors)==null?void 0:d.errors.token_billing,customSelector:!0,dismissable:!1,children:[p("option",{value:"always",children:e("enabled")}),p("option",{value:"optout",children:e("auto_bill_help_optout")}),p("option",{value:"optin",children:e("auto_bill_help_optin")}),p("option",{value:"off",children:e("off")})]})}),p(_i,{}),r.map((h,f)=>p(K,{leftSide:e(s(h.gatewayTypeId)),...((t==null?void 0:t.key)==="d14dd26a37cecc30fdd65700bfb55b23"||(t==null?void 0:t.key)==="d14dd26a47cecc30fdd65700bfb67b34")&&{leftSideHelp:e(`${s(h.gatewayTypeId)}_stripe_help`)},children:p(ft,{checked:c(h.gatewayTypeId),onChange:g=>l(h.gatewayTypeId,g)})},f))]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function H0n(n,e){const t=wi(),i=_o(),r=Fi(tu);return o=>{ce.processing(),e(void 0),Ae("POST",Te("/api/v1/company_gateways"),n).then(s=>{r&&i.invalidateQueries([r]),En(["company_gateways"]),ce.success("created_company_gateway"),t(bt("/settings/gateways/:id/edit?tab=:defaultTabIndex",{id:s.data.data.id,defaultTabIndex:o}))}).catch(s=>{var a;((a=s==null?void 0:s.response)==null?void 0:a.status)===422&&(ce.dismiss(),e(s.response.data))})}}const W0n="/gateway-card-images/visa.png",z0n="/gateway-card-images/authorize-net.png",U0n="/gateway-card-images/american-express.png",j0n="/gateway-card-images/mastercard.png",bee="/gateway-card-images/paypal.png",q0n="/gateway-card-images/braintree.svg.png",K0n="/gateway-card-images/checkout.jpg",G0n="/gateway-card-images/gocardless.png",Y0n="/gateway-card-images/mollie.png",Q0n="/gateway-card-images/payfast.png",X0n="/gateway-card-images/paytrace.svg",Z0n="/gateway-card-images/razorpay.png",J0n="/gateway-card-images/square.svg.png",eyn="/gateway-card-images/stripe.svg",tyn="/gateway-card-images/eway.png",nyn="/gateway-card-images/forte.png",iyn="/gateway-card-images/wepay.svg",ryn="/gateway-card-images/btcpay.png",oyn=["paypal_ppcp","visa","american_express","mastercard","paypal_platform","authorize","braintree","checkoutcom","gocardless","mollie","payfast","paytrace","razorpay","square","stripe","wepay","eway","forte","paypal_rest","btcpay"];function Aae(n){switch(n.name){case"visa":return p("img",{src:W0n,alt:"Visa",style:n.style||{width:30,height:30}});case"american_express":return p("img",{src:U0n,alt:"American Express",style:n.style||{width:30,height:30}});case"mastercard":return p("img",{src:j0n,alt:"Mastercard",style:n.style||{width:30,height:30}});case"paypal_platform":return p("img",{src:bee,alt:"PayPal",style:n.style||{width:40,height:40}});case"paypal_rest":return p("img",{src:bee,alt:"PayPal Rest",style:n.style||{width:40,height:40}});case"paypal_ppcp":return p("img",{src:bee,alt:"PayPal",style:n.style||{width:40,height:40}});case"authorize":return p("img",{src:z0n,alt:"AuthorizeNet",style:n.style||{width:40,height:40}});case"braintree":return p("img",{src:q0n,alt:"Braintree",style:n.style||{width:40,height:40}});case"checkoutcom":return p("img",{src:K0n,alt:"Checkoutcom",style:n.style||{width:40,height:40}});case"gocardless":return p("img",{src:G0n,alt:"GoCardless",style:n.style||{width:40,height:40}});case"mollie":return p("img",{src:Y0n,alt:"Mollie",style:n.style||{width:40,height:40}});case"payfast":return p("img",{src:Q0n,alt:"Payfast",style:n.style||{width:40,height:40}});case"paytrace":return p("img",{src:X0n,alt:"Paytrace",style:n.style||{width:40,height:40}});case"razorpay":return p("img",{src:Z0n,alt:"Razorpay",style:n.style||{width:40,height:40}});case"square":return p("img",{src:J0n,alt:"Square",style:n.style||{width:40,height:40}});case"stripe":return p("img",{src:eyn,alt:"Stripe",style:n.style||{width:40,height:40}});case"eway":return p("img",{src:tyn,alt:"Eway",style:n.style||{width:40,height:40}});case"forte":return p("img",{src:nyn,alt:"Forte",style:n.style||{width:40,height:40}});case"wepay":return p("img",{src:iyn,alt:"Wepay",style:n.style||{width:30,height:30}});case"btcpay":return p("img",{src:ryn,alt:"BTCPay",style:n.style||{width:30,height:30}});default:return p(dt,{})}}const syn=[{name:"paypal_ppcp",width:110},{name:"paypal_express",width:110},{name:"mollie",width:110},{name:"eway",width:170},{name:"forte",width:190},{name:"square",width:130},{name:"checkoutcom",width:170},{name:"btcpay",width:90}],ayn=[{name:"stripe",key:"d14dd26a37cecc30fdd65700bfb55b23"},{name:"stripe",key:"d14dd26a47cecc30fdd65700bfb67b34"},{name:"paypal_platform",key:"80af24a6a691230bbec33e930ab40666"},{name:"paypal_rest",key:"80af24a6a691230bbec33e930ab40665"},{name:"braintree",key:"f7ec488676d310683fb51802d076d713"},{name:"paypal_ppcp",key:"80af24a6a691230bbec33e930ab40666"},{name:"authorize",key:"3b6621f970ab18887c4f6dca78d3f8bb"},{name:"mollie",key:"1bd651fb213ca0c9d66ae3c336dc77e8"},{name:"gocardless",key:"b9886f9257f0c6ee7c302f1c74475f6c"},{name:"forte",key:"kivcvjexxvdiyqtj3mju5d6yhpeht2xs"},{name:"razorpay",key:"hxd6gwg3ekb9tb3v9lptgx1mqyg69zu9"},{name:"square",key:"65faab2ab6e3223dbe848b1686490baz"},{name:"paytrace",key:"bbd736b3254b0aabed6ad7fda1298c88"},{name:"checkoutcom",key:"3758e7f7c6f4cecf0f4f348b9a00f456"},{name:"payfast",key:"d6814fc83f45d2935e7777071e629ef9"},{name:"eway",key:"944c20175bbe6b9972c05bcfe294c2c7"},{name:"btcpay",key:"vpyfbmdrkqcicpkjqdusgjfluebftuva"}];function lyn(){const[n]=pe(),{documentTitle:e}=Pi("add_gateway"),{data:t}=H$t(),[i,r]=w.useState(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState([]),[d,h]=w.useState(!1),[f,g]=w.useState(0),m=BYe(),v=H0n(i,s),_=(P,F)=>{const B=m.find(M=>M.id===P);if(l(B),(B==null?void 0:B.key)==="80af24a6a691230bbec33e930ab40666")return b();if((B==null?void 0:B.key)==="d14dd26a47cecc30fdd65700bfb67b34")return y();if((B==null?void 0:B.key)==="b9886f9257f0c6ee7c302f1c74475f6c"&&Ro())return C();F&&P&&g(1)},b=()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(P=>{var F;return(F=window.open(bt("https://invoicing.co/paypal?hash=:hash",{hash:P.data.hash}),"_blank"))==null?void 0:F.focus()})},y=()=>{Ae("POST",Te("/api/v1/one_time_token"),{context:"stripe_connect"}).then(P=>{var F;return(F=window.open(bt("https://invoicing.co/stripe/signup/:token",{token:P.data.hash}),"_blank"))==null?void 0:F.focus()})},C=WYe(),x=[n("payment_provider")],E=[n("credentials"),n("settings"),n("required_fields"),n("limits_and_fees")],k=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"},{name:n("add_gateway"),href:"/settings/gateways/create"}],[L,D]=w.useState(x),A=P=>{const F=ayn.find(B=>B.key===P);return(F==null?void 0:F.name)||""},O=P=>{const F=syn.find(B=>B.name===P);return F?F.width:void 0};return w.useEffect(()=>{if(m){const P=m.findIndex(({key:F})=>F==="80af24a6a691230bbec33e930ab40665");if(P>=0){const F=Hve(m,P,1);u(F)}else u(m)}},[m]),w.useEffect(()=>{t!=null&&t.data.data&&i===void 0&&r(t.data.data)},[t,a]),w.useEffect(()=>{r(B=>B&&a&&{...B,gateway_key:a.key,token_billing:"always"}),(a?Object.entries(a.options):[]).find(([B])=>B==="1")&&r(B=>B&&{...B,fees_and_limits:{...B.fees_and_limits,1:KYe}})},[a]),w.useEffect(()=>{D(a?[...x,...E]:[...x])},[a]),w.useEffect(()=>{d&&(v(1),h(!1))},[i]),w.useEffect(()=>{if(!c.length)return;const P=c.findIndex(M=>M.key==="b9886f9257f0c6ee7c302f1c74475f6c");if(P===-1||P===2)return;const F=[...c],[B]=F.splice(P,1);F.splice(2,0,B),u(F)},[c]),N(ir,{title:e,breadcrumbs:k,onSaveClick:()=>v(1),disableSaveButton:!a,children:[p(lbe,{id:"gateways",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/gateways.md"}),N(kv,{tabs:L,defaultTabIndex:f,onTabChange:P=>g(P),children:[p(Qt,{title:n("add_gateway"),children:p(K,{leftSide:n("payment_provider"),children:p(Cn,{value:a==null?void 0:a.id,onValueChange:P=>_(P,!0),errorMessage:o==null?void 0:o.errors.gateway_key,customSelector:!0,withBlank:!0,children:c.map((P,F)=>p("option",{value:P.id,children:P.name},F))})})}),p("div",{children:a&&i&&p(zYe,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})}),p("div",{children:a&&i&&p(GYe,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})}),p("div",{children:a&&i&&p(qYe,{gateway:a,companyGateway:i,setCompanyGateway:r})}),p("div",{children:a&&i&&p(jYe,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})})]}),!f&&p("div",{className:"flex flex-wrap gap-4",children:c.map((P,F)=>oyn.includes(A(P.key))&&p(Qt,{className:"w-52",children:N("div",{className:"flex flex-col items-center justify-between h-52",children:[p("div",{className:"flex justify-center items-center border-b border-b-gray-200 w-full h-28",children:p(Aae,{name:A(P.key),style:{width:O(A(P.key))||150}})}),N("div",{className:Nt("flex flex-col pt-4 flex-1",{"justify-between":P.site_url,"justify-end":!P.site_url}),children:[P.site_url&&p(Li,{external:!0,to:P.site_url,children:n("website")}),p(Gt,{behavior:"button",onClick:()=>{P.key!=="80af24a6a691230bbec33e930ab40666"&&h(!0),_(P.id)},children:n("setup")})]})]})},F))})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function cyn(n,e){return()=>{n&&(e(void 0),ce.processing(),Ae("PUT",Te("/api/v1/company_gateways/:id",{id:n==null?void 0:n.id}),n).then(()=>{ce.success("updated_company_gateway"),En(["company_gateways"])}).catch(t=>{var i;((i=t==null?void 0:t.response)==null?void 0:i.status)===422&&(ce.dismiss(),e(t.response.data))}))}}function uyn(){const[n]=pe(),[e,t]=w.useState(!1),i=Lg(),r=(o,s)=>{ce.processing(),Ae("post",Te("/api/v1/stripe/import_customers"),{},{headers:{"X-Api-Password":o}}).then(()=>ce.success("imported_customers")).catch(a=>{var l;((l=a.response)==null?void 0:l.status)===412&&(i(s),t(!0))})};return N(dt,{children:[p(Qt,{title:n("import_customers"),children:p(wl,{onClick:()=>t(!0),children:n("click_to_continue")})}),p(ap,{onSave:r,show:e,onClose:t})]})}function dyn(n){const[e]=pe(),t=ci();return N(Qt,{title:e("webhooks"),children:[p(K,{leftSide:e("webhook_url"),children:p(Fl,{className:"break-all",text:`${mN()}/payment_webhook/${t.company_key}/${n.companyGateway.id}`})}),p(K,{leftSide:e("supported_events"),children:p("ul",{className:"list-disc",children:el(Object.values(n.gateway.options)).pluck("webhooks").flatten().unique().whereNotNull().all().sort().map((i,r)=>p("li",{children:i},r))})})]})}function hyn(){const[n]=pe(),e=SWe(),t=r=>{ce.processing(),Ae("POST",Te("/api/v1/company_gateways/:id/import_customers",{id:r})).then(o=>ce.success(o.data.message))};return[r=>p(tn,{onClick:()=>t(r.id),icon:p(vt,{element:XEt}),children:n("import_customers")}),()=>p(_i,{withoutPadding:!0}),r=>Sr(r)===Zi.Active&&p(tn,{onClick:()=>e([r.id],"archive"),icon:p(vt,{element:Ac}),children:n("archive")}),r=>(Sr(r)===Zi.Archived||Sr(r)===Zi.Deleted)&&p(tn,{onClick:()=>e([r.id],"restore"),icon:p(vt,{element:Dc}),children:n("restore")}),r=>(Sr(r)===Zi.Active||Sr(r)===Zi.Archived)&&p(tn,{onClick:()=>e([r.id],"delete"),icon:p(vt,{element:gl}),children:n("delete")})]}function fyn(){const{documentTitle:n}=Pi("edit_gateway"),[e]=pe(),[t]=dF(),{id:i}=il(),r=hyn(),o=BYe(),{data:s}=V$t({id:i}),a=[e("payment_provider")],[l,c]=w.useState(),[u,d]=w.useState(),[h,f]=w.useState(a),[g,m]=w.useState(),v=[e("credentials"),e("settings"),e("required_fields"),e("limits_and_fees")],_=[{name:e("settings"),href:"/settings"},{name:e("online_payments"),href:"/settings/online_payments"},{name:(g==null?void 0:g.label)??"",href:bt("/settings/gateways/:id/edit",{id:i})}],b=cyn(g,d);return w.useEffect(()=>{g&&c(o.find(y=>y.key==g.gateway_key))},[g,o]),w.useEffect(()=>{s!=null&&s.data.data&&m(s.data.data)},[s]),w.useEffect(()=>()=>{m(void 0)},[]),w.useEffect(()=>{f(l?[...a,...v]:[...a])},[l]),N(ir,{title:n,breadcrumbs:_,navigationTopRight:g&&p(D1,{resource:g,onSaveClick:b,actions:r}),children:[p(lbe,{id:"gateways",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/gateways.md"}),N(kv,{tabs:h,defaultTabIndex:Number(t.get("tab"))??0,children:[p("div",{children:g&&N("div",{className:"space-y-4",children:[p(Qt,{title:e("edit_gateway"),children:p(K,{leftSide:e("payment_provider"),children:g.label})}),(l==null?void 0:l.key)==="d14dd26a37cecc30fdd65700bfb55b23"?p(uyn,{}):null,l&&el(Object.values(l.options)).pluck("webhooks").flatten().unique().whereNotNull().count()>1&&p(dyn,{companyGateway:g,gateway:l})]})}),p("div",{children:l&&g&&p(zYe,{gateway:l,companyGateway:g,setCompanyGateway:m,errors:u,isGatewaySaved:!!(s&&un.isEqual(g,s.data.data))})}),p("div",{children:l&&g&&p(GYe,{gateway:l,companyGateway:g,setCompanyGateway:m,errors:u})}),p("div",{children:l&&g&&p(qYe,{gateway:l,companyGateway:g,setCompanyGateway:m})}),p("div",{children:l&&g&&p(jYe,{gateway:l,companyGateway:g,setCompanyGateway:m,errors:u})})]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function Ep(){return({settingsLevel:n})=>Promise.resolve(n===iM.Company)}const pyn=w.lazy(()=>ne(()=>import("./InvoiceDesign-a36e6156.js"),["InvoiceDesign-a36e6156.js","atoms-c6d02d14.js","InvoiceViewer-8cc71da3.js"])),gyn=w.lazy(()=>ne(()=>import("./GeneralSettings-6f0a6d46.js"),["GeneralSettings-6f0a6d46.js","designs-25baeda6.js","atoms-c6d02d14.js","hooks-aab10605.js"])),myn=w.lazy(()=>ne(()=>import("./CustomDesigns-f1a1793c.js"),["CustomDesigns-f1a1793c.js","CustomDesignsPlanAlert-1dbe7bff.js"])),_yn=w.lazy(()=>ne(()=>import("./Create-de69bb39.js"),["Create-de69bb39.js","DesignSelector-08028961.js","designs-25baeda6.js","CustomDesignsPlanAlert-1dbe7bff.js"])),vyn=w.lazy(()=>ne(()=>import("./ClientDetails-4793173e.js"),["ClientDetails-4793173e.js","SortableVariableList-c18957a2.js","CustomDesignsPlanAlert-1dbe7bff.js"])),byn=w.lazy(()=>ne(()=>import("./CompanyDetails-de3a6956.js"),["CompanyDetails-de3a6956.js","SortableVariableList-c18957a2.js"])),yyn=w.lazy(()=>ne(()=>import("./CompanyAddress-f949cd75.js"),["CompanyAddress-f949cd75.js","SortableVariableList-c18957a2.js"])),Cyn=w.lazy(()=>ne(()=>import("./InvoiceDetails-e3f6948e.js"),["InvoiceDetails-e3f6948e.js","SortableVariableList-c18957a2.js"])),wyn=w.lazy(()=>ne(()=>import("./QuoteDetails-908f9f4b.js"),["QuoteDetails-908f9f4b.js","SortableVariableList-c18957a2.js"])),Syn=w.lazy(()=>ne(()=>import("./CreditDetails-af64ae26.js"),["CreditDetails-af64ae26.js","SortableVariableList-c18957a2.js"])),Eyn=w.lazy(()=>ne(()=>import("./VendorDetails-1e5a0379.js"),["VendorDetails-1e5a0379.js","SortableVariableList-c18957a2.js"])),xyn=w.lazy(()=>ne(()=>import("./PurchaseOrderDetails-5d7bfd0f.js"),["PurchaseOrderDetails-5d7bfd0f.js","SortableVariableList-c18957a2.js"])),Tyn=w.lazy(()=>ne(()=>import("./ProductColumns-df714d07.js"),["ProductColumns-df714d07.js","SortableVariableList-c18957a2.js","hooks-aab10605.js"])),kyn=w.lazy(()=>ne(()=>import("./ProductQuoteColumns-cf754274.js"),["ProductQuoteColumns-cf754274.js","SortableVariableList-c18957a2.js"])),Iyn=w.lazy(()=>ne(()=>import("./TaskColumns-9aa0d5da.js"),["TaskColumns-9aa0d5da.js","SortableVariableList-c18957a2.js"])),Lyn=w.lazy(()=>ne(()=>import("./TotalFields-91743d98.js"),["TotalFields-91743d98.js","SortableVariableList-c18957a2.js"])),Dyn=w.lazy(()=>ne(()=>import("./CustomDesign-c35e099c.js"),["CustomDesign-c35e099c.js","designs-25baeda6.js","InvoiceViewer-8cc71da3.js","react-responsive-e0860c56.js"])),Ayn=w.lazy(()=>ne(()=>import("./Settings-5177aa61.js"),["Settings-5177aa61.js","DesignSelector-08028961.js","designs-25baeda6.js","hooks-0cd901a9.js","Create-de69bb39.js","CustomDesignsPlanAlert-1dbe7bff.js"])),Nyn=w.lazy(()=>ne(()=>import("./Body-b9d4b6c4.js"),["Body-b9d4b6c4.js","hooks-0cd901a9.js"])),Ryn=w.lazy(()=>ne(()=>import("./Headers-bf115804.js"),["Headers-bf115804.js","hooks-0cd901a9.js"])),Oyn=w.lazy(()=>ne(()=>import("./Footer-a5a26af6.js"),["Footer-a5a26af6.js","hooks-0cd901a9.js"])),Pyn=w.lazy(()=>ne(()=>import("./Includes-29a96bb7.js"),["Includes-29a96bb7.js","hooks-0cd901a9.js"])),Myn=w.lazy(()=>ne(()=>import("./Variables-adbed6b5.js"),[])),Fyn=N(_e,{path:"invoice_design",element:p(pyn,{}),children:[p(_e,{path:"",element:p(gyn,{})}),p(_e,{path:"custom_designs",element:p(myn,{})}),N(_e,{path:"custom_designs/:id/edit",element:p($n,{guards:[Ep()],component:p(Dyn,{}),type:"subPage"}),children:[p(_e,{path:"",element:p(Ayn,{})}),p(_e,{path:"body",element:p(Nyn,{})}),p(_e,{path:"header",element:p(Ryn,{})}),p(_e,{path:"footer",element:p(Oyn,{})}),p(_e,{path:"includes",element:p(Pyn,{})}),p(_e,{path:"variables",element:p(Myn,{})})]}),p(_e,{path:"custom_designs/create",element:p(_yn,{})}),p(_e,{path:"client_details",element:p($n,{guards:[Ep()],component:p(vyn,{}),type:"subPage"})}),p(_e,{path:"company_details",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(byn,{}),type:"subPage"})}),p(_e,{path:"company_address",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(yyn,{}),type:"subPage"})}),p(_e,{path:"invoice_details",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(Cyn,{}),type:"subPage"})}),p(_e,{path:"quote_details",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(wyn,{}),type:"subPage"})}),p(_e,{path:"credit_details",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(Syn,{}),type:"subPage"})}),p(_e,{path:"vendor_details",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(Eyn,{}),type:"subPage"})}),p(_e,{path:"purchase_order_details",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(xyn,{}),type:"subPage"})}),p(_e,{path:"product_columns",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(Tyn,{}),type:"subPage"})}),p(_e,{path:"quote_product_columns",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(kyn,{}),type:"subPage"})}),p(_e,{path:"task_columns",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(Iyn,{}),type:"subPage"})}),p(_e,{path:"total_fields",element:p($n,{guards:[Ep(),Di(la(),la())],component:p(Lyn,{}),type:"subPage"})})]}),Byn=N(_e,{path:"/settings",children:[N(_e,{path:"user_details",element:p(MQt,{}),children:[p(_e,{path:"",element:p(SYt,{})}),p(_e,{path:"password",element:p(TYt,{})}),p(_e,{path:"connect",element:p(uYt,{})}),p(_e,{path:"accent_color",element:p(Kqt,{})}),p(_e,{path:"notifications",element:p(xYt,{})}),p(_e,{path:"enable_two_factor",element:p(tQt,{})}),p(_e,{path:"custom_fields",element:p(nQt,{})}),p(_e,{path:"preferences",element:p(OQt,{})})]}),N(_e,{element:p($n,{guards:[Y2()],component:p(Tg,{})}),children:[p(_e,{path:"",element:p(Cqt,{})}),N(_e,{path:"company_details",element:p(Tqt,{}),children:[p(_e,{path:"",element:p(h0n,{})}),p(_e,{path:"address",element:p(u0n,{})}),p(_e,{path:"logo",element:p(PYe,{})}),p(_e,{path:"defaults",element:p(d0n,{})}),p(_e,{path:"documents",element:p(c0n,{})}),p(_e,{path:"custom_fields",element:p(f0n,{})})]}),N(_e,{path:"localization",element:p(VQt,{}),children:[p(_e,{path:"",element:p(BQt,{})}),p(_e,{path:"custom_labels",element:p(FQt,{})})]}),p(_e,{path:"online_payments",element:p($tn,{})}),p(_e,{path:"tax_settings",element:p(Pcn,{})}),p(_e,{path:"product_settings",element:p(Mcn,{})}),p(_e,{path:"task_settings",element:p(Fcn,{})}),p(_e,{path:"expense_settings",element:p(Xcn,{})}),p(_e,{path:"workflow_settings",element:p(eun,{})}),p(_e,{path:"import_export",element:p(Jun,{})}),N(_e,{path:"account_management",element:p(tdn,{}),children:[p(_e,{path:"",element:p(P$t,{})}),p(_e,{path:"overview",element:p(O$t,{})}),p(_e,{path:"enabled_modules",element:p(y3t,{})}),p(_e,{path:"integrations",element:p(C3t,{})}),p(_e,{path:"security_settings",element:p(M$t,{})}),p(_e,{path:"referral_program",element:p(B$t,{})}),!f1()&&p(_e,{path:"danger_zone",element:p(F$t,{})})]}),N(_e,{path:"backup_restore",element:p(xmn,{}),children:[p(_e,{path:"",element:p(Nmn,{})}),p(_e,{path:"restore",element:p(Amn,{})})]}),N(_e,{path:"custom_fields",element:p(ndn,{}),children:[p(_e,{path:"company",element:p(idn,{})}),p(_e,{path:"clients",element:p(rdn,{})}),p(_e,{path:"products",element:p(odn,{})}),p(_e,{path:"invoices",element:p(ldn,{})}),p(_e,{path:"payments",element:p(cdn,{})}),p(_e,{path:"projects",element:p(udn,{})}),p(_e,{path:"tasks",element:p(ddn,{})}),p(_e,{path:"vendors",element:p(hdn,{})}),p(_e,{path:"expenses",element:p(fdn,{})}),p(_e,{path:"users",element:p(pdn,{})})]}),N(_e,{path:"generated_numbers",element:p(mdn,{}),children:[p(_e,{path:"",element:p(Adn,{})}),p(_e,{path:"clients",element:p(_dn,{})}),p(_e,{path:"invoices",element:p(vdn,{})}),p(_e,{path:"recurring_invoices",element:p(bdn,{})}),p(_e,{path:"payments",element:p(ydn,{})}),p(_e,{path:"quotes",element:p(Cdn,{})}),p(_e,{path:"credits",element:p(wdn,{})}),p(_e,{path:"projects",element:p(Sdn,{})}),p(_e,{path:"tasks",element:p(Edn,{})}),p(_e,{path:"vendors",element:p(xdn,{})}),p(_e,{path:"purchase_orders",element:p(Tdn,{})}),p(_e,{path:"expenses",element:p(kdn,{})}),p(_e,{path:"recurring_expenses",element:p(Idn,{})})]}),N(_e,{path:"client_portal",element:p(ohn,{}),children:[p(_e,{path:"",element:p(Jdn,{})}),p(_e,{path:"authorization",element:p(ehn,{})}),p(_e,{path:"registration",element:p(ihn,{})}),p(_e,{path:"messages",element:p(nhn,{})}),p(_e,{path:"customize",element:p(thn,{})})]}),p(_e,{path:"e_invoice",element:p(Hdn,{})}),p(_e,{path:"email_settings",element:p(Zdn,{})}),p(_e,{path:"templates_and_reminders",element:p(chn,{})}),N(_e,{path:"bank_accounts",children:[p(_e,{path:"",element:p(phn,{})}),p(_e,{path:":id/details",element:p(vhn,{})}),p(_e,{path:"create",element:p(mhn,{})}),p(_e,{path:":id/edit",element:p(ghn,{})})]}),N(_e,{path:"group_settings",children:[p(_e,{path:"",element:p(Tbn,{})}),p(_e,{path:"create",element:p(Ibn,{})}),p(_e,{path:":id/edit",element:p(Ubn,{})})]}),N(_e,{path:"subscriptions",children:[p(_e,{path:"",element:p(Mhn,{})}),p(_e,{path:"create",element:p(Whn,{})}),p(_e,{path:":id/edit",element:p(Uhn,{})})]}),N(_e,{path:"schedules",children:[p(_e,{path:"",element:p(mmn,{})}),p(_e,{path:"create",element:p(Cmn,{})}),p(_e,{path:":id/edit",element:p(Smn,{})})]}),N(_e,{path:"users",children:[p(_e,{path:"",element:p(jbn,{})}),p(_e,{path:"create",element:p(Gbn,{})}),p(_e,{path:":id/edit",element:p($n,{guards:[la()],component:p(Kbn,{})})})]}),p(_e,{path:"/settings/system_logs",children:p(_e,{path:"",element:p(xbn,{})})}),N(_e,{path:"payment_terms",children:[p(_e,{path:"",element:p(n0n,{})}),p(_e,{path:":id/edit",element:p(t0n,{})}),p(_e,{path:"create",element:p(Qbn,{})})]}),N(_e,{path:"tax_rates",children:[p(_e,{path:"create",element:p(s0n,{})}),p(_e,{path:":id/edit",element:p(l0n,{})})]}),N(_e,{path:"task_statuses",children:[p(_e,{path:"create",element:p(g0n,{})}),p(_e,{path:":id/edit",element:p(m0n,{})})]}),N(_e,{path:"expense_categories",children:[p(_e,{path:"create",element:p(Gcn,{})}),p(_e,{path:":id/edit",element:p(Qcn,{})})]}),N(_e,{path:"integrations",children:[N(_e,{path:"api_tokens",children:[p(_e,{path:"",element:p($n,{guards:[Di(la(),la()),Y2()],component:p(_0n,{})})}),p(_e,{path:"create",element:p($n,{guards:[Di(la(),la()),Y2()],component:p(C0n,{})})}),p(_e,{path:":id/edit",element:p($n,{guards:[Di(la(),la()),Y2()],component:p(S0n,{})})})]}),N(_e,{path:"api_webhooks",children:[p(_e,{path:"",element:p(x0n,{})}),p(_e,{path:"create",element:p(L0n,{})}),p(_e,{path:":id/edit",element:p(A0n,{})})]}),p(_e,{path:"analytics",element:p(N0n,{})})]}),N(_e,{path:"gateways",children:[p(_e,{path:"create",element:p(lyn,{})}),p(_e,{path:":id/edit",element:p(fyn,{})})]}),N(_e,{path:"bank_accounts/transaction_rules",children:[p(_e,{path:"",element:p(yhn,{})}),p(_e,{path:"create",element:p(Rhn,{})}),p(_e,{path:":id/edit",element:p(Ohn,{})})]}),Fyn]})]});function $yn(){return p(iS,{to:"/"})}function Vyn(){return Qpe()?p(iS,{to:"/dashboard"}):p(Tg,{})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function YYe(){const n=Qi();return e=>{localStorage.removeItem("X-CURRENT-INDEX");let t=0;const i=e.data.data,r=i[0].account.default_company_id;t=i.findIndex(o=>o.company.id===r),t===-1&&(t=0),n(sF({type:yN.TOKEN,user:e.data.data[t].user,token:e.data.data[t].token.token})),n(w0(e.data.data)),n(Hj(t))}}const Hyn="",Wyn="";function zyn(){const n=wi(),e=YYe();return w.useEffect(()=>{if(!f1())return n("/login");Ae("POST",Te("/api/v1/login"),{email:Hyn,password:Wyn}).then(t=>e(t)).catch(()=>n("/login"))},[]),p("div",{})}const yee=rl.a` &:hover { background-color: ${n=>n.theme.hoverColor}; } `;function Uyn(){const n=ni();return N("div",{className:"grid grid-cols-3 text-sm border rounded",style:{backgroundColor:n.$1,borderColor:n.$5,color:n.$3},children:[p("div",{className:"col-span-3 md:col-span-1",children:N(yee,{theme:{hoverColor:n.$2},href:"https://status.invoiceninja.com/",target:"_blank",className:"py-3 w-full px-2 inline-flex justify-center items-center rounded-l",rel:"noreferrer",children:[p(MCt,{size:15}),p("span",{className:"m-1",children:"Check status"})]})}),p("div",{className:"col-span-3 md:col-span-1",children:N(yee,{theme:{hoverColor:n.$2},href:"https://www.invoiceninja.com/mobile/",target:"_blank",className:"py-3 w-full px-2 inline-flex justify-center items-center",rel:"noreferrer",children:[p(swt,{size:15}),p("span",{className:"m-1",children:"Applications"})]})}),p("div",{className:"col-span-3 md:col-span-1",children:N(yee,{theme:{hoverColor:n.$2},href:"https://invoiceninja.github.io",target:"_blank",className:"py-3 w-full hover:bg-gray-100 px-2 inline-flex justify-center items-center rounded-r",rel:"noreferrer",children:[p(L1t,{size:15}),p("span",{className:"m-1",children:"Documentation"})]})})]})}const jyn="/invoiceninja-logo@dark-365f6449.png";function Lbe(){const e={backgroundColor:vo()};return N(dt,{children:[p("div",{className:"py-1",style:e}),p("div",{className:"flex justify-center py-8",children:p(Li,{to:"/",children:p("img",{src:jyn,alt:"Invoice Ninja Logo",className:"h-12"})})})]})}function qyn(n){const[e]=pe(),{visible:t,setVisible:i}=n,[r,o]=w.useState(""),[s,a]=w.useState(""),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,f]=w.useState(),[g,m]=w.useState(!1),v=()=>{ce.processing(),c(!0),Ae("POST",Te("/api/v1/sms_reset"),{email:r}).then(b=>{ce.success(b.data.message),i(!1),m(!0)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(f(b.response.data),ce.dismiss())}).finally(()=>c(!1))},_=()=>{ce.processing(),d(!0),Ae("POST",Te("/api/v1/sms_reset/confirm"),{email:r,code:s}).then(b=>{ce.success(b.data.message),a(""),o(""),m(!1)}).finally(()=>d(!1))};return N(dt,{children:[p(Ui,{title:e("disable_2fa"),visible:t,onClose:()=>{i(!1),o("")},children:N("div",{className:"flex flex-col space-y-6",children:[p(We,{label:e("email"),value:r,onValueChange:b=>{o(b),h&&f(void 0)},errorMessage:h==null?void 0:h.errors.email}),p(Gt,{className:"self-end",onClick:v,disableWithoutIcon:!0,disabled:!r||l,children:e("send_code")})]})}),p(Ui,{title:e("disable_two_factor"),visible:g,onClose:()=>{m(!1),a(""),o("")},children:N("div",{className:"flex flex-col space-y-7 items-center",children:[p(DWe,{onComplete:a}),N("div",{className:"flex self-end space-x-5",children:[p(Gt,{type:"minimal",onClick:v,disableWithoutIcon:!0,disabled:l||u,children:e("resend_code")}),p(Gt,{onClick:_,disableWithoutIcon:!0,disabled:l||u||s.length!==6,children:e("verify")})]})]})})]})}const Kyn=" Latest Build - 2025-01-16";/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Gyn=`v${Kyn}`;function Yyn(){Pi("login");const n=vo(),[e,t]=w.useState(void 0),[i,r]=w.useState(void 0),[o,s]=w.useState(!1),[a]=pe(),[l,c]=w.useState(!1),u=YYe();function d(f){const g=new FormData(f);t(void 0),r(void 0),s(!0);const m=g.get("secret");Ae("POST",Te("/api/v1/login"),Object.fromEntries(g),{...m&&{headers:{"X-API-SECRET":m}}}).then(v=>u(v)).catch(v=>{var _,b,y;((_=v.response)==null?void 0:_.status)===422?r(v.response.data.errors):((b=v.response)==null?void 0:b.status)===503?ce.error("app_maintenance"):t(((y=v.response)==null?void 0:y.data.message)??a("invalid_credentials"))}).finally(()=>s(!1))}const h=ni();return N("div",{className:"h-screen",children:[p(Lbe,{}),N("div",{className:"flex flex-col items-center",children:[N("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:h.$1,borderColor:h.$5},children:[p("h2",{className:"text-2xl",style:{color:h.$3},children:a("login")}),N("form",{onSubmit:f=>{f.preventDefault(),d(f.currentTarget)},className:"my-6 space-y-4",children:[p(We,{type:"email",autoComplete:"on",label:a("email_address"),errorMessage:i==null?void 0:i.email,name:"email"}),p(We,{type:"password",autoComplete:"on",label:a("password"),id:"password",errorMessage:i==null?void 0:i.password,name:"password"}),p("div",{className:"space-y-2",children:N("div",{className:"flex flex-col lg:flex-row items-center justify-between",children:[p(pg,{children:`2FA - ${a("one_time_password")}`}),p(Li,{to:"/recover_password",children:a("forgot_password")})]})}),p(We,{type:"text",autoComplete:"on",id:"one_time_password",placeholder:a("plaid_optional"),errorMessage:i==null?void 0:i.one_time_password,name:"one_time_password"}),p("div",{className:"space-y-2",children:N("div",{className:Nt("flex flex-col lg:flex-row items-center",{"justify-between":Rk(),"justify-end":Ro()}),children:[p(pg,{children:a("secret")}),p("div",{className:"text-sm hover:underline cursor-pointer",onClick:()=>c(!0),style:{color:n},children:a("disable_2fa")})]})}),p(We,{type:"password",autoComplete:"on",placeholder:a("plaid_optional"),name:"secret"}),e&&p(Ls,{className:"mt-4",type:"danger",children:e}),p(Gt,{disabled:o,className:"mt-4",variant:"block",children:a("login")})]}),p("div",{className:"flex justify-center",children:Ro()})]}),Ro(),p("p",{className:"mt-4 text-xs",children:Gyn})]}),p(qyn,{visible:l,setVisible:c})]})}function Qyn(){const n=_o();return w.useEffect(()=>{Upe(),sessionStorage.clear(),n.invalidateQueries(),n.removeQueries(),window.location.href="/"},[]),p(dt,{})}function Xyn(){var c,u;Pi("recover_password");const[n]=pe(),[e,t]=w.useState(!1),[i,r]=w.useState(void 0),[o,s]=w.useState(void 0),a=td({initialValues:{email:""},onSubmit:d=>{t(!0),s(void 0),r(void 0),Ae("POST",Te("/api/v1/reset_password"),d).then(h=>r(h.data)).catch(h=>{var f,g,m;return((f=h.response)==null?void 0:f.status)===422?s((g=h.response)==null?void 0:g.data.errors):r((m=h.response)==null?void 0:m.data)}).finally(()=>t(!1))}}),l=ni();return N("div",{className:"h-screen",children:[p(Lbe,{}),N("div",{className:"flex flex-col items-center",children:[N("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:l.$1,borderColor:l.$5},children:[p("h2",{className:"text-2xl",style:{color:l.$3},children:n("recover_password")}),N("form",{onSubmit:a.handleSubmit,className:"my-6",children:[p(We,{type:"email",label:n("email_address"),id:"email",onChange:a.handleChange}),((c=o==null?void 0:o.errors)==null?void 0:c.email)&&p(Ls,{className:"mt-2",type:"danger",children:(u=o.errors)==null?void 0:u.email}),i&&p(Ls,{className:"mt-4",type:i.status?"success":"danger",children:i.message}),p(Gt,{disabled:e,className:"mt-4",variant:"block",children:n("send_email")})]}),p("div",{className:"flex justify-center",children:Ro()})]}),Ro()]})]})}var MK={},Zyn=Bo&&Bo.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Jyn=Bo&&Bo.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),e1n=Bo&&Bo.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&Zyn(e,n,t);return Jyn(e,n),e};Object.defineProperty(MK,"__esModule",{value:!0});var QYe=MK.useTurnstile=void 0;const yx=e1n(w),wM=typeof globalThis<"u"?globalThis:window;let Aw=typeof wM.turnstile<"u"?"ready":"unloaded",XYe,Nae;const ZYe=new Promise((n,e)=>{Nae={resolve:n,reject:e},Aw==="ready"&&n(void 0)});{const n="cf__reactTurnstileOnLoad",e="https://challenges.cloudflare.com/turnstile/v0/api.js";XYe=()=>{if(Aw==="unloaded"){Aw="loading",wM[n]=()=>{Nae.resolve(),Aw="ready",delete wM[n]};const t=`${e}?onload=${n}&render=explicit`,i=document.createElement("script");i.src=t,i.async=!0,i.addEventListener("error",()=>{Nae.reject("Failed to load Turnstile."),delete wM[n]}),document.head.appendChild(i)}return ZYe}}function t1n({id:n,className:e,style:t,sitekey:i,action:r,cData:o,theme:s,language:a,tabIndex:l,responseField:c,responseFieldName:u,size:d,fixedSize:h,retry:f,retryInterval:g,refreshExpired:m,appearance:v,execution:_,userRef:b,onVerify:y,onLoad:C,onError:x,onExpire:E,onTimeout:k,onAfterInteractive:L,onBeforeInteractive:D,onUnsupported:A}){const O=(0,yx.useRef)(null),P=(0,yx.useState)({onVerify:y,onLoad:C,onError:x,onExpire:E,onTimeout:k,onAfterInteractive:L,onBeforeInteractive:D,onUnsupported:A})[0],F=b??O;return(0,yx.useEffect)(()=>{if(!F.current)return;let B=!1,M="";return(async()=>{var V,U;if(Aw!=="ready")try{await XYe()}catch(H){(V=P.onError)===null||V===void 0||V.call(P,H);return}if(B||!F.current)return;let W;const q={sitekey:i,action:r,cData:o,theme:s,language:a,tabindex:l,"response-field":c,"response-field-name":u,size:d,retry:f,"retry-interval":g,"refresh-expired":m,appearance:v,execution:_,callback:H=>{var ie;return(ie=P.onVerify)===null||ie===void 0?void 0:ie.call(P,H,W)},"error-callback":H=>{var ie;return(ie=P.onError)===null||ie===void 0?void 0:ie.call(P,H,W)},"expired-callback":H=>{var ie;return(ie=P.onExpire)===null||ie===void 0?void 0:ie.call(P,H,W)},"timeout-callback":()=>{var H;return(H=P.onTimeout)===null||H===void 0?void 0:H.call(P,W)},"after-interactive-callback":()=>{var H;return(H=P.onAfterInteractive)===null||H===void 0?void 0:H.call(P,W)},"before-interactive-callback":()=>{var H;return(H=P.onBeforeInteractive)===null||H===void 0?void 0:H.call(P,W)},"unsupported-callback":()=>{var H;return(H=P.onUnsupported)===null||H===void 0?void 0:H.call(P,W)}};M=window.turnstile.render(F.current,q),W=i1n(M),(U=P.onLoad)===null||U===void 0||U.call(P,M,W)})(),()=>{B=!0,M&&window.turnstile.remove(M)}},[i,r,o,s,a,l,c,u,d,f,g,m,v,_]),(0,yx.useEffect)(()=>{P.onVerify=y,P.onLoad=C,P.onError=x,P.onExpire=E,P.onTimeout=k,P.onAfterInteractive=L,P.onBeforeInteractive=D,P.onUnsupported=A},[y,C,x,E,k,L,D,A]),yx.default.createElement("div",{ref:F,id:n,className:e,style:h?{...t??{},width:d==="compact"?"130px":"300px",height:d==="compact"?"120px":"65px"}:t})}var n1n=MK.default=t1n;function i1n(n){return{execute:e=>window.turnstile.execute(n,e),reset:()=>window.turnstile.reset(n),getResponse:()=>window.turnstile.getResponse(n),isExpired:()=>window.turnstile.isExpired(n)}}function r1n(){const[n,e]=(0,yx.useState)(Aw);return(0,yx.useEffect)(()=>{Aw!=="ready"&&ZYe.then(()=>e(Aw))},[]),wM.turnstile}QYe=MK.useTurnstile=r1n;function o1n(n){const{onVerified:e}=n;return p(n1n,{appearance:"interaction-only",sitekey:"",onVerify:i=>e(i)})}function s1n(){Pi("register");const[n]=pe(),e=QYe(),[t,i]=w.useState(void 0),[r,o]=w.useState(""),[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(""),h=Qi(),[f]=dF(),g=td({initialValues:{email:"",password:"",password_confirmation:"",terms_of_service:!1,privacy_policy:!1},onSubmit(v){if(d(""),i(void 0),c(!0),v.password!==v.password_confirmation){c(!1),i({password_confirmation:["Password confirmation does not match."]});return}const _=new URL("/api/v1/signup?include=token,user.company_user,company,account",mN());["utm_source","utm_medium","utm_campaign","utm_content","utm_term"].forEach(y=>{f.has(y)&&_.searchParams.append(y,f.get(y))});const b=f.get("rc");b&&_.searchParams.append("rc",b),Ae("POST",_.href,{...v,"cf-turnstile":r}).then(y=>{h(fbt({token:y.data.data[0].token.token,user:y.data.data[0].user})),h(w0(y.data.data)),h(Hj(0))}).catch(y=>{var C,x;((C=y.response)==null?void 0:C.status)===422&&i(y.response.data.errors),d((x=y.response)==null?void 0:x.data.message),c(!1)}).finally(()=>{e.reset(),a(!1),o("")})}}),m=ni();return w.useEffect(()=>{r&&g.handleSubmit()},[r]),p(dt,{children:N("div",{className:"h-screen",children:[p(Lbe,{}),N("div",{className:"flex flex-col items-center",children:[N("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:m.$1,borderColor:m.$5},children:[p("h2",{className:"text-2xl",style:{color:m.$3},children:n("register_label")}),N("div",{className:"space-y-5 my-6",children:[p(We,{type:"email",autoComplete:"on",label:n("email_address"),id:"email",onChange:g.handleChange,errorMessage:t==null?void 0:t.email}),p(We,{type:"password",autoComplete:"on",label:n("password"),id:"password",onChange:g.handleChange,errorMessage:t==null?void 0:t.password}),p(We,{type:"password",autoComplete:"on",label:n("password_confirmation"),id:"password_confirmation",onChange:g.handleChange,errorMessage:t==null?void 0:t.password_confirmation}),u&&p(Ls,{className:"mt-4",type:"danger",children:u}),s&&p("div",{className:"flex justify-center",children:p(o1n,{onVerified:v=>o(v)})}),p(Gt,{disabled:l,className:"mt-4",variant:"block",onClick:()=>a(!0),children:n("register")})]}),p("div",{className:"flex justify-center",children:Ro()})]}),N(dt,{children:[p(lYt,{}),p("div",{className:"mx-4 max-w-md w-full rounded md:shadow-lg mt-4",children:p(Uyn,{})})]})]})]})})}const a1n=N(dt,{children:[N(_e,{element:p(Vyn,{}),children:[p(_e,{path:"/login",element:p(Yyn,{})}),p(_e,{path:"/recover_password",element:p(Xyn,{})}),p(_e,{element:p($yn,{}),children:p(_e,{path:"/register",element:p(s1n,{})})}),p(_e,{path:"/demo",element:p(zyn,{})})]}),p(_e,{element:p(WWe,{}),children:p(_e,{path:"/logout",element:p(Qyn,{})})})]}),l1n=w.lazy(()=>ne(()=>import("./Quotes-2f8d3045.js"),["Quotes-2f8d3045.js","DataTableColumnsPicker-72027136.js","ImportButton-83a39628.js","useFooterColumns-351ff362.js","useDownloadPdfs-4d13e7c1.js","useSumTableColumn-8f701cc1.js","QuoteSlider-2a281377.js","EmailRecord-9930c242.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","queries-7063068e.js","DataTableFooterColumnsPicker-4117910d.js"])),c1n=w.lazy(()=>ne(()=>import("./Import-a225bfdd.js"),[])),u1n=w.lazy(()=>ne(()=>import("./Quote-f2d165e4.js"),["Quote-f2d165e4.js","queries-7063068e.js","CommonActions-323e4db3.js","Actions-d2496d38.js","invoice-status-756326ba.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","PreviousNextNavigation-f6f14b66.js"])),d1n=w.lazy(()=>ne(()=>import("./Edit-c0abd9a6.js"),["Edit-c0abd9a6.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","QuoteFooter-9c1de3ec.js","useTaskColumns-e922e1b4.js"])),h1n=w.lazy(()=>ne(()=>import("./Create-a8fea34a.js"),["Create-a8fea34a.js","blank-invitation-ca06b7b6.js","queries-7063068e.js"])),f1n=w.lazy(()=>ne(()=>import("./CreatePage-78a3666f.js"),["CreatePage-78a3666f.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","useTaskColumns-e922e1b4.js","QuoteFooter-9c1de3ec.js"])),iNe=w.lazy(()=>ne(()=>import("./Documents-a977bd53.js"),[])),rNe=w.lazy(()=>ne(()=>import("./Settings-af0c822b.js"),["Settings-af0c822b.js","ProjectSelector-720c414a.js","DesignSelector-08028961.js","designs-25baeda6.js"])),p1n=w.lazy(()=>ne(()=>import("./Pdf-27a5474c.js"),["Pdf-27a5474c.js","InvoiceViewer-8cc71da3.js","queries-7063068e.js"])),g1n=w.lazy(()=>ne(()=>import("./Email-4551843d.js"),["Email-4551843d.js","Mailer-bea14c11.js","InvoiceViewer-8cc71da3.js","queries-7063068e.js"])),m1n=w.lazy(()=>ne(()=>import("./Activities-680a4611.js"),["Activities-680a4611.js","QuoteSlider-2a281377.js","EmailRecord-9930c242.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js"])),_1n=w.lazy(()=>ne(()=>import("./History-b74fc9a5.js"),[])),v1n=w.lazy(()=>ne(()=>import("./EmailHistory-47007c9c.js"),["EmailHistory-47007c9c.js","EmailRecord-9930c242.js"])),b1n=N(_e,{path:"/quotes",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.Quotes),Di(Zt("view_quote"),Zt("create_quote"),Zt("edit_quote"))],component:p(l1n,{})})}),p(_e,{path:"import",element:p($n,{guards:[xr(Ci.Quotes),Di(Zt("create_quote"),Zt("edit_quote"))],component:p(c1n,{})})}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.Quotes),Di(Zt("view_quote"),Zt("edit_quote"),ka("/api/v1/quotes/:id"))],component:p(u1n,{})}),children:[p(_e,{path:"edit",element:p(d1n,{})}),p(_e,{path:"documents",element:p(iNe,{})}),p(_e,{path:"settings",element:p(rNe,{})}),p(_e,{path:"activity",element:p(m1n,{})}),p(_e,{path:"history",element:p(_1n,{})}),p(_e,{path:"email_history",element:p(v1n,{})})]}),N(_e,{path:"create",element:p($n,{guards:[xr(Ci.Quotes),Zt("create_quote")],component:p(h1n,{})}),children:[p(_e,{path:"",element:p(f1n,{})}),p(_e,{path:"documents",element:p(iNe,{})}),p(_e,{path:"settings",element:p(rNe,{})})]}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.Quotes),Di(Zt("edit_quote"),ka("/api/v1/quotes/:id"))],component:p(Tg,{})}),children:[p(_e,{path:"pdf",element:p(p1n,{})}),p(_e,{path:"email",element:p(g1n,{})})]})]}),y1n=w.lazy(()=>ne(()=>import("./Credits-eea058b7.js"),["Credits-eea058b7.js","DataTableColumnsPicker-72027136.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","useCustomBulkActions-ba75d32d.js","useDownloadPdfs-4d13e7c1.js","payments-0a3eee62.js","atoms-f5ce5583.js"])),C1n=w.lazy(()=>ne(()=>import("./Create-bb2217f5.js"),["Create-bb2217f5.js","blank-invitation-ca06b7b6.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","queries-beff1213.js"])),w1n=w.lazy(()=>ne(()=>import("./CreatePage-2a9d353f.js"),["CreatePage-2a9d353f.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","CreditFooter-5459a26f.js"])),S1n=w.lazy(()=>ne(()=>import("./Credit-1f864930.js"),["Credit-1f864930.js","queries-beff1213.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","CommonActions-323e4db3.js","Actions-d2496d38.js","PreviousNextNavigation-f6f14b66.js"])),E1n=w.lazy(()=>ne(()=>import("./Edit-dc245d7b.js"),["Edit-dc245d7b.js","ClientSelector-e427e3b8.js","ClientActionButtons-a4f20d96.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","CreditFooter-5459a26f.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js"])),x1n=w.lazy(()=>ne(()=>import("./Pdf-d328e116.js"),["Pdf-d328e116.js","InvoiceViewer-8cc71da3.js","queries-beff1213.js"])),T1n=w.lazy(()=>ne(()=>import("./Email-6d345a2e.js"),["Email-6d345a2e.js","Mailer-bea14c11.js","InvoiceViewer-8cc71da3.js","queries-beff1213.js"])),oNe=w.lazy(()=>ne(()=>import("./Documents-31560b2c.js"),[])),sNe=w.lazy(()=>ne(()=>import("./Settings-7b9206ca.js"),["Settings-7b9206ca.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","invoice-status-756326ba.js","DesignSelector-08028961.js","designs-25baeda6.js","ProjectSelector-720c414a.js"])),k1n=w.lazy(()=>ne(()=>import("./Activities-01ca315d.js"),[])),I1n=w.lazy(()=>ne(()=>import("./History-1e5fdb7d.js"),[])),L1n=N(_e,{path:"/credits",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.Credits),Di(Zt("view_credit"),Zt("create_credit"),Zt("edit_credit"))],component:p(y1n,{})})}),N(_e,{path:"create",element:p($n,{guards:[xr(Ci.Credits),Zt("create_credit")],component:p(C1n,{})}),children:[p(_e,{path:"",element:p(w1n,{})}),p(_e,{path:"documents",element:p(oNe,{})}),p(_e,{path:"settings",element:p(sNe,{})})]}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.Credits),Di(Zt("edit_credit"),Zt("view_credit"),ka("/api/v1/credits/:id"))],component:p(S1n,{})}),children:[p(_e,{path:"edit",element:p(E1n,{})}),p(_e,{path:"documents",element:p(oNe,{})}),p(_e,{path:"settings",element:p(sNe,{})}),p(_e,{path:"activity",element:p(k1n,{})}),p(_e,{path:"history",element:p(I1n,{})})]}),p(_e,{path:":id/pdf",element:p($n,{guards:[xr(Ci.Credits),Di(Zt("edit_credit"),ka("/api/v1/credits/:id"))],component:p(x1n,{})})}),p(_e,{path:":id/email",element:p($n,{guards:[xr(Ci.Credits),Di(Zt("edit_credit"),ka("/api/v1/credits/:id"))],component:p(T1n,{})})})]}),D1n=w.lazy(()=>ne(()=>import("./Projects-b2bf0506.js"),["Projects-b2bf0506.js","hooks-344a2ac4.js","atoms-d3dbf501.js","DataTableColumnsPicker-72027136.js"])),A1n=w.lazy(()=>ne(()=>import("./Create-8de743ea.js"),["Create-8de743ea.js","atoms-d3dbf501.js"])),aNe=w.lazy(()=>ne(()=>import("./Project-b462ac0e.js"),["Project-b462ac0e.js","hooks-344a2ac4.js","atoms-d3dbf501.js","PreviousNextNavigation-f6f14b66.js"])),N1n=w.lazy(()=>ne(()=>import("./Edit-fd4d668b.js"),["Edit-fd4d668b.js","ClientActionButtons-a4f20d96.js"])),R1n=w.lazy(()=>ne(()=>import("./Show-9ae14f3c.js"),["Show-9ae14f3c.js","InfoCard-3b3f3798.js","hooks-344a2ac4.js","atoms-d3dbf501.js","DataTableColumnsPicker-72027136.js","useShowEditOption-6f2fb612.js","ClientActionButtons-a4f20d96.js","PreviousNextNavigation-f6f14b66.js"])),O1n=w.lazy(()=>ne(()=>import("./Documents-5dc7febe.js"),[])),P1n=N(_e,{children:[p(_e,{path:"/projects",element:p($n,{guards:[xr(Ci.Projects),Di(Zt("view_project"),Zt("create_project"),Zt("edit_project"))],component:p(D1n,{})})}),p(_e,{path:"/projects/create",element:p($n,{guards:[xr(Ci.Projects),Zt("create_project")],component:p(A1n,{})})}),p(_e,{path:"/projects/:id",element:p($n,{guards:[xr(Ci.Projects),Di(Zt("view_project"),Zt("edit_project"),ka("/api/v1/projects/:id"))],component:p(R1n,{})})}),p(_e,{path:"/projects/:id",element:p($n,{guards:[xr(Ci.Projects),Di(Zt("view_project"),Zt("edit_project"),ka("/api/v1/projects/:id"))],component:p(aNe,{})}),children:p(_e,{path:"documents",element:p(O1n,{})})}),p(_e,{path:"/projects/:id/edit",element:p($n,{guards:[xr(Ci.Projects),Di(Zt("edit_project"),ka("/api/v1/projects/:id"))],component:p(aNe,{})}),children:p(_e,{path:"",element:p(N1n,{})})})]});function M1n(){const{t:n}=pe(),{documentTitle:e}=Pi("import"),t=[{name:n("tasks"),href:"/tasks"},{name:n("import"),href:"/tasks/import"}];return p(BN,{title:e,breadcrumbs:t,children:p("div",{className:"grid grid-cols-12",children:p("div",{className:"col-span-12 xl:col-span-8",children:p(tYe,{entity:"task",onSuccess:!1,type:"csv"})})})})}const F1n=w.lazy(()=>ne(()=>import("./Tasks-8fb2d59c.js"),["Tasks-8fb2d59c.js","DataTableColumnsPicker-72027136.js","useShowEditOption-6f2fb612.js","ImportButton-83a39628.js","hooks-9926da03.js","TaskClock-3e7e241b.js"])),B1n=w.lazy(()=>ne(()=>import("./Kanban-9e165408.js"),["Kanban-9e165408.js","hooks-9926da03.js","TaskClock-3e7e241b.js","ProjectSelector-720c414a.js","TaskDetails-d7b36d24.js","ClientActionButtons-a4f20d96.js"])),$1n=w.lazy(()=>ne(()=>import("./Create-99c05f06.js"),["Create-99c05f06.js","TaskDetails-d7b36d24.js","ProjectSelector-720c414a.js","TaskClock-3e7e241b.js","ClientActionButtons-a4f20d96.js"])),V1n=w.lazy(()=>ne(()=>import("./Task-88d15c48.js"),["Task-88d15c48.js","PreviousNextNavigation-f6f14b66.js"])),H1n=w.lazy(()=>ne(()=>import("./Edit-97f69b1f.js"),["Edit-97f69b1f.js","TaskDetails-d7b36d24.js","ProjectSelector-720c414a.js","TaskClock-3e7e241b.js","ClientActionButtons-a4f20d96.js"])),W1n=w.lazy(()=>ne(()=>import("./Documents-0147f127.js"),[])),z1n=N(_e,{path:"/tasks",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.Tasks),Di(Zt("view_task"),Zt("create_task"),Zt("edit_task"))],component:p(F1n,{})})}),p(_e,{path:"kanban",element:p($n,{guards:[xr(Ci.Tasks),Di(Zt("view_task"),Zt("edit_task"))],component:p(B1n,{})})}),p(_e,{path:"create",element:p($n,{guards:[xr(Ci.Tasks),Zt("create_task")],component:p($1n,{})})}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.Tasks),Di(Zt("view_task"),Zt("edit_task"),ka("/api/v1/tasks/:id"))],component:p(V1n,{})}),children:[p(_e,{path:"edit",element:p(H1n,{})}),p(_e,{path:"documents",element:p(W1n,{})})]}),p(_e,{path:"import",element:p($n,{guards:[xr(Ci.Tasks),Di(Zt("create_task"),Zt("edit_task"))],component:p(M1n,{})})})]}),U1n=w.lazy(()=>ne(()=>import("./Vendors-7548b14c.js"),["Vendors-7548b14c.js","DataTableColumnsPicker-72027136.js","ImportButton-83a39628.js","useActions-6dbdf27d.js"])),j1n=w.lazy(()=>ne(()=>import("./Import-26bd5098.js"),[])),q1n=w.lazy(()=>ne(()=>import("./Vendor-90be3c94.js"),["Vendor-90be3c94.js","InfoCard-3b3f3798.js","useActions-6dbdf27d.js","PreviousNextNavigation-f6f14b66.js"])),lNe=w.lazy(()=>ne(()=>import("./PurchaseOrders-77edcb52.js"),["PurchaseOrders-77edcb52.js","useCustomBulkActions-b6ff588f.js","useDownloadPdfs-4d13e7c1.js"])),K1n=w.lazy(()=>ne(()=>import("./Expenses-12a99cee.js"),[])),G1n=w.lazy(()=>ne(()=>import("./RecurringExpenses-9f59147f.js"),["RecurringExpenses-9f59147f.js","hooks-2f667abc.js"])),Y1n=w.lazy(()=>ne(()=>import("./Documents-9dfda922.js"),[])),Q1n=w.lazy(()=>ne(()=>import("./Edit-dafcb373.js"),["Edit-dafcb373.js","useActions-6dbdf27d.js","PreviousNextNavigation-f6f14b66.js"])),X1n=w.lazy(()=>ne(()=>import("./Create-e02db13b.js"),[])),Z1n=w.lazy(()=>ne(()=>import("./Activities-d21cc2a6.js"),[])),J1n=N(_e,{path:"vendors",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.Vendors),Di(Zt("view_vendor"),Zt("create_vendor"),Zt("edit_vendor"))],component:p(U1n,{})})}),p(_e,{path:"import",element:p($n,{guards:[xr(Ci.Vendors),Di(Zt("create_vendor"),Zt("edit_vendor"))],component:p(j1n,{})})}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.Vendors),Di(Zt("view_vendor"),Zt("edit_vendor"),ka("/api/v1/vendors/:id"))],component:p(q1n,{})}),children:[p(_e,{path:"",element:p(lNe,{})}),p(_e,{path:"purchase_orders",element:p(lNe,{})}),p(_e,{path:"expenses",element:p(K1n,{})}),p(_e,{path:"recurring_expenses",element:p(G1n,{})}),p(_e,{path:"activities",element:p(Z1n,{})}),p(_e,{path:"documents",element:p(Y1n,{})})]}),p(_e,{path:":id/edit",element:p($n,{guards:[xr(Ci.Vendors),Di(Zt("edit_vendor"),ka("/api/v1/vendors/:id"))],component:p(Q1n,{})})}),p(_e,{path:"create",element:p($n,{guards:[xr(Ci.Vendors),Zt("create_vendor")],component:p(X1n,{})})})]}),eCn=w.lazy(()=>ne(()=>import("./Expenses-a493d66b.js"),["Expenses-a493d66b.js","DataTableColumnsPicker-72027136.js","ImportButton-83a39628.js"])),tCn=w.lazy(()=>ne(()=>import("./Import-87258d49.js"),[])),nCn=w.lazy(()=>ne(()=>import("./Create-3cfc89ea.js"),["Create-3cfc89ea.js","Taxes-1231f52c.js","ProjectSelector-720c414a.js","ClientActionButtons-a4f20d96.js","PaymentTypeSelector-511a774a.js","useResolveCurrencySeparator-a8afdb2f.js"])),iCn=w.lazy(()=>ne(()=>import("./Expense-b3a1c6db.js"),["Expense-b3a1c6db.js","react-responsive-e0860c56.js","InvoiceViewer-8cc71da3.js","PreviousNextNavigation-f6f14b66.js"])),rCn=w.lazy(()=>ne(()=>import("./Edit-3c6cff5b.js"),["Edit-3c6cff5b.js","Taxes-1231f52c.js","ProjectSelector-720c414a.js","ClientActionButtons-a4f20d96.js","PaymentTypeSelector-511a774a.js","useResolveCurrencySeparator-a8afdb2f.js"])),oCn=w.lazy(()=>ne(()=>import("./Documents-def8eb1b.js"),[])),sCn=N(_e,{path:"expenses",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.Expenses),Di(Zt("view_expense"),Zt("create_expense"),Zt("edit_expense"))],component:p(eCn,{})})}),p(_e,{path:"import",element:p($n,{guards:[xr(Ci.Expenses),Di(Zt("create_expense"),Zt("edit_expense"))],component:p(tCn,{})})}),p(_e,{path:"create",element:p($n,{guards:[xr(Ci.Expenses),Zt("create_expense")],component:p(nCn,{})})}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.Expenses),Di(Zt("view_expense"),Zt("edit_expense"),ka("/api/v1/expenses/:id"))],component:p(iCn,{})}),children:[p(_e,{path:"edit",element:p(rCn,{})}),p(_e,{path:"documents",element:p(oCn,{})})]})]}),aCn=w.lazy(()=>ne(()=>import("./PurchaseOrders-85337a13.js"),["PurchaseOrders-85337a13.js","DataTableColumnsPicker-72027136.js","useCustomBulkActions-b6ff588f.js","useDownloadPdfs-4d13e7c1.js"])),lCn=w.lazy(()=>ne(()=>import("./Edit-e3761b9b.js"),["Edit-e3761b9b.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","useHandleProductChange-279c5b26.js"])),cCn=w.lazy(()=>ne(()=>import("./Email-e2056d82.js"),["Email-e2056d82.js","Mailer-bea14c11.js","InvoiceViewer-8cc71da3.js"])),uCn=w.lazy(()=>ne(()=>import("./Pdf-634d48e6.js"),["Pdf-634d48e6.js","InvoiceViewer-8cc71da3.js"])),dCn=w.lazy(()=>ne(()=>import("./Create-557a3fa5.js"),["Create-557a3fa5.js","blank-invitation-ca06b7b6.js","useCalculateInvoiceSum-102b940a.js"])),hCn=w.lazy(()=>ne(()=>import("./PurchaseOrder-75a42c3f.js"),["PurchaseOrder-75a42c3f.js","useCalculateInvoiceSum-102b940a.js","CommonActions-323e4db3.js","Actions-d2496d38.js","invoice-status-756326ba.js","hooks-10493af2.js","CreditStatus-ef9aafcc.js","useInvoiceColumns-4c12a1a8.js","InvoiceStatus-e46861b3.js","PreviousNextNavigation-f6f14b66.js"])),fCn=w.lazy(()=>ne(()=>import("./CreatePage-285dc0c8.js"),["CreatePage-285dc0c8.js","useProductColumns-d8c41450.js","InvoiceViewer-8cc71da3.js","useHandleProductChange-279c5b26.js"])),cNe=w.lazy(()=>ne(()=>import("./Documents-62864c9e.js"),[])),uNe=w.lazy(()=>ne(()=>import("./Settings-7fb11edb.js"),["Settings-7fb11edb.js","DesignSelector-08028961.js","designs-25baeda6.js","ProjectSelector-720c414a.js"])),pCn=w.lazy(()=>ne(()=>import("./Activities-cde86fab.js"),[])),gCn=w.lazy(()=>ne(()=>import("./History-11bfe4c6.js"),[])),mCn=w.lazy(()=>ne(()=>import("./EmailHistory-cf4939c4.js"),["EmailHistory-cf4939c4.js","EmailRecord-9930c242.js"])),_Cn=N(_e,{path:"/purchase_orders",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.PurchaseOrders),Di(Zt("view_purchase_order"),Zt("create_purchase_order"),Zt("edit_purchase_order"))],component:p(aCn,{})})}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.PurchaseOrders),Di(Zt("view_purchase_order"),Zt("edit_purchase_order"),ka("/api/v1/purchase_orders/:id"))],component:p(hCn,{})}),children:[p(_e,{path:"edit",element:p(lCn,{})}),p(_e,{path:"documents",element:p(cNe,{})}),p(_e,{path:"settings",element:p(uNe,{})}),p(_e,{path:"activity",element:p(pCn,{})}),p(_e,{path:"history",element:p(gCn,{})}),p(_e,{path:"email_history",element:p(mCn,{})})]}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.PurchaseOrders),Di(Zt("edit_purchase_order"),ka("/api/v1/purchase_orders/:id"))],component:p(Tg,{})}),children:[p(_e,{path:"email",element:p(cCn,{})}),p(_e,{path:"pdf",element:p(uCn,{})})]}),N(_e,{path:"create",element:p($n,{guards:[xr(Ci.PurchaseOrders),Zt("create_purchase_order")],component:p(dCn,{})}),children:[p(_e,{path:"",element:p(fCn,{})}),p(_e,{path:"documents",element:p(cNe,{})}),p(_e,{path:"settings",element:p(uNe,{})})]})]}),vCn=w.lazy(()=>ne(()=>Promise.resolve().then(()=>fmn),void 0)),bCn=p(_e,{path:"/reports",element:p($n,{guards:[Zt("view_reports")],component:p(vCn,{})})}),yCn=w.lazy(()=>ne(()=>import("./Transactions-9ba0fd54.js"),["Transactions-9ba0fd54.js","transactions-cc5537db.js","useActions-7d783617.js","ImportButton-83a39628.js","payments-0a3eee62.js","invoice-status-756326ba.js","payment-status-51e1486d.js"])),CCn=w.lazy(()=>ne(()=>import("./Create-fda12256.js"),["Create-fda12256.js","transactions-cc5537db.js","useResolveCurrencySeparator-a8afdb2f.js","useHandleChange-c519ade2.js"])),wCn=w.lazy(()=>ne(()=>import("./Import-85b6a749.js"),[])),SCn=w.lazy(()=>ne(()=>import("./Edit-ac0ca528.js"),["Edit-ac0ca528.js","useResolveCurrencySeparator-a8afdb2f.js","useHandleChange-c519ade2.js","transactions-cc5537db.js","useActions-7d783617.js","PreviousNextNavigation-f6f14b66.js"])),ECn=N(dt,{children:[p(_e,{path:"bank_transactions",element:p(iS,{to:"/transactions"})}),N(_e,{path:"transactions",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.Transactions),Di(Zt("view_bank_transaction"),Zt("create_bank_transaction"),Zt("edit_bank_transaction"))],component:p(yCn,{})})}),p(_e,{path:"create",element:p($n,{guards:[xr(Ci.Transactions),Di(Zt("create_bank_transaction"))],component:p(CCn,{})})}),p(_e,{path:"import",element:p($n,{guards:[xr(Ci.Transactions),Di(Zt("create_bank_transaction"),Zt("edit_bank_transaction"))],component:p(wCn,{})})}),p(_e,{path:":id/edit",element:p($n,{guards:[xr(Ci.Transactions),Di(Zt("view_bank_transaction"),Zt("edit_bank_transaction"),ka("/api/v1/bank_transactions/:id"))],component:p(SCn,{})})})]})]}),xCn=w.lazy(()=>ne(()=>import("./RecurringExpense-ee9b987e.js"),["RecurringExpense-ee9b987e.js","hooks-2f667abc.js","PreviousNextNavigation-f6f14b66.js"])),TCn=w.lazy(()=>ne(()=>import("./RecurringExpenses-3ff6649d.js"),["RecurringExpenses-3ff6649d.js","DataTableColumnsPicker-72027136.js","hooks-2f667abc.js"])),kCn=w.lazy(()=>ne(()=>import("./Create-00058ea2.js"),["Create-00058ea2.js","Taxes-8cb698e6.js","ProjectSelector-720c414a.js","hooks-2f667abc.js","ClientActionButtons-a4f20d96.js","PaymentTypeSelector-511a774a.js","useResolveCurrencySeparator-a8afdb2f.js"])),ICn=w.lazy(()=>ne(()=>import("./Edit-7df21704.js"),["Edit-7df21704.js","hooks-2f667abc.js","Taxes-8cb698e6.js","ProjectSelector-720c414a.js","ClientActionButtons-a4f20d96.js","PaymentTypeSelector-511a774a.js","useResolveCurrencySeparator-a8afdb2f.js"])),LCn=w.lazy(()=>ne(()=>import("./Documents-38c90b19.js"),[])),DCn=N(_e,{path:"/recurring_expenses",children:[p(_e,{path:"",element:p($n,{guards:[xr(Ci.RecurringExpenses),Di(Zt("view_recurring_expense"),Zt("create_recurring_expense"),Zt("edit_recurring_expense"))],component:p(TCn,{})})}),p(_e,{path:"create",element:p($n,{guards:[xr(Ci.RecurringExpenses),Zt("create_recurring_expense")],component:p(kCn,{})})}),N(_e,{path:":id",element:p($n,{guards:[xr(Ci.RecurringExpenses),Di(Zt("view_recurring_expense"),Zt("edit_recurring_expense"),ka("/api/v1/recurring_expenses/:id"))],component:p(xCn,{})}),children:[p(_e,{path:"edit",element:p(ICn,{})}),p(_e,{path:"documents",element:p(LCn,{})})]})]});function ACn(){return Qpe()?p(iS,{to:"/dashboard"}):p(iS,{to:"/login"})}function NCn(){return p(iS,{to:"/logout"})}function RCn(){const[n]=pe(),[e,t]=w.useState(!1),[i,r]=w.useState("");return p("div",{className:"flex items-center w-full h-full justify-center",children:N("div",{className:"mt-96",children:[p(uGe,{isModalOpen:e,setIsModalOpen:t,onClientCreated:o=>r(o.id)}),p(Fh,{inputOptions:{value:i??null},endpoint:Te("/api/v1/clients?status=active"),entryOptions:{id:"id",label:"name",value:"id"},onChange:o=>o.resource&&r(o.resource.id),onDismiss:()=>r(""),action:{label:n("new_client"),onClick:()=>t(!0),visible:!0}})]})})}const OCn=w.lazy(()=>ne(()=>import("./Activity-40cebc89.js"),["Activity-40cebc89.js","InvoiceViewer-8cc71da3.js"])),PCn=p(_e,{children:p(_e,{path:"/activities/:id",element:p(OCn,{})})}),MCn=w.lazy(()=>ne(()=>import("./Dashboard-7e67e802.js"),[])),FCn=w.lazy(()=>ne(()=>import("./NotFound-e7590a12.js"),[])),BCn=N(qyt,{children:[p(_e,{path:"/",element:p(ACn,{})}),a1n,N(_e,{element:p(WWe,{}),children:[p(_e,{path:"/dashboard",element:p($n,{guards:[Zt("view_dashboard")],component:p(MCn,{})})}),Ljt,Kjt,tqt,hqt,yqt,b1n,L1n,P1n,z1n,J1n,_Cn,sCn,DCn,bCn,ECn,Byn,PCn,p(_e,{element:p(NCn,{}),children:p(_e,{path:"/testing",element:p(RCn,{})})})]}),p(_e,{path:"*",element:p(FCn,{})})]});function $Cn(){return n=>{switch(n.replace("_","-").toLowerCase()){case"af":return ne(()=>import("./af-726e9084.js").then(t=>t.a),[]);case"am":return ne(()=>import("./am-178b7a1c.js").then(t=>t.a),[]);case"ar-dz":return ne(()=>import("./ar-dz-8bda4d47.js").then(t=>t.a),[]);case"ar-iq":return ne(()=>import("./ar-iq-bb2d0a5d.js").then(t=>t.a),[]);case"ar-kw":return ne(()=>import("./ar-kw-5f9112d5.js").then(t=>t.a),[]);case"ar-ly":return ne(()=>import("./ar-ly-ac7a36f4.js").then(t=>t.a),[]);case"ar-ma":return ne(()=>import("./ar-ma-e8d6df1b.js").then(t=>t.a),[]);case"ar-sa":return ne(()=>import("./ar-sa-edd74586.js").then(t=>t.a),[]);case"ar-tn":return ne(()=>import("./ar-tn-a6d89e8a.js").then(t=>t.a),[]);case"ar":return ne(()=>import("./ar-a0962ac6.js").then(t=>t.a),[]);case"az":return ne(()=>import("./az-08992b87.js").then(t=>t.a),[]);case"be":return ne(()=>import("./be-1d18397a.js").then(t=>t.b),[]);case"bg":return ne(()=>import("./bg-1b1355e9.js").then(t=>t.b),[]);case"bi":return ne(()=>import("./bi-9b6c2dbd.js").then(t=>t.b),[]);case"bm":return ne(()=>import("./bm-4a02e1cb.js").then(t=>t.b),[]);case"bn-bd":return ne(()=>import("./bn-bd-e757882e.js").then(t=>t.b),[]);case"bn":return ne(()=>import("./bn-2410fc23.js").then(t=>t.b),[]);case"bo":return ne(()=>import("./bo-1d64c427.js").then(t=>t.b),[]);case"br":return ne(()=>import("./br-34370a2c.js").then(t=>t.b),[]);case"bs":return ne(()=>import("./bs-60637492.js").then(t=>t.b),[]);case"ca":return ne(()=>import("./ca-d1fa1bc2.js").then(t=>t.c),[]);case"cs":return ne(()=>import("./cs-8baa93da.js").then(t=>t.c),[]);case"cv":return ne(()=>import("./cv-1797d51a.js").then(t=>t.c),[]);case"cy":return ne(()=>import("./cy-cb3f4141.js").then(t=>t.c),[]);case"da":return ne(()=>import("./da-8433ac85.js").then(t=>t.d),[]);case"de-at":return ne(()=>import("./de-at-966d0e58.js").then(t=>t.d),[]);case"de-ch":return ne(()=>import("./de-ch-8b8d6c10.js").then(t=>t.d),[]);case"de":return ne(()=>import("./de-927eef85.js").then(t=>t.d),[]);case"dv":return ne(()=>import("./dv-d79ab051.js").then(t=>t.d),[]);case"el":return ne(()=>import("./el-ea92f8bf.js").then(t=>t.e),[]);case"en-au":return ne(()=>import("./en-au-c1bfef62.js").then(t=>t.e),[]);case"en-ca":return ne(()=>import("./en-ca-e6091a57.js").then(t=>t.e),[]);case"en-gb":return ne(()=>import("./en-gb-511cab59.js").then(t=>t.e),[]);case"en-ie":return ne(()=>import("./en-ie-a48fe3be.js").then(t=>t.e),[]);case"en-il":return ne(()=>import("./en-il-39a15459.js").then(t=>t.e),[]);case"en-in":return ne(()=>import("./en-in-9c42b0aa.js").then(t=>t.e),[]);case"en-nz":return ne(()=>import("./en-nz-5208b0a1.js").then(t=>t.e),[]);case"en-sg":return ne(()=>import("./en-sg-5f2d85c3.js").then(t=>t.e),[]);case"en-tt":return ne(()=>import("./en-tt-a368fcf9.js").then(t=>t.e),[]);case"en":return ne(()=>import("./en-d51f626b.js").then(t=>t.e),[]);case"eo":return ne(()=>import("./eo-05535914.js").then(t=>t.e),[]);case"es-do":return ne(()=>import("./es-do-bd7ef0b5.js").then(t=>t.e),[]);case"es-mx":return ne(()=>import("./es-mx-c788ce6f.js").then(t=>t.e),[]);case"es-pr":return ne(()=>import("./es-pr-b45522f4.js").then(t=>t.e),[]);case"es-us":return ne(()=>import("./es-us-4eb14230.js").then(t=>t.e),[]);case"es":return ne(()=>import("./es-02757174.js").then(t=>t.e),[]);case"et":return ne(()=>import("./et-e690a27a.js").then(t=>t.e),[]);case"eu":return ne(()=>import("./eu-5b8703f6.js").then(t=>t.e),[]);case"fa":return ne(()=>import("./fa-e40fd571.js").then(t=>t.f),[]);case"fi":return ne(()=>import("./fi-65caa6f1.js").then(t=>t.f),[]);case"fo":return ne(()=>import("./fo-9b25dec1.js").then(t=>t.f),[]);case"fr-ca":return ne(()=>import("./fr-ca-28019df5.js").then(t=>t.f),[]);case"fr-ch":return ne(()=>import("./fr-ch-06be830b.js").then(t=>t.f),[]);case"fr":return ne(()=>import("./fr-b60ad2a3.js").then(t=>t.f),[]);case"fy":return ne(()=>import("./fy-88e949d6.js").then(t=>t.f),[]);case"ga":return ne(()=>import("./ga-f4dfffb7.js").then(t=>t.g),[]);case"gd":return ne(()=>import("./gd-40731b8a.js").then(t=>t.g),[]);case"gl":return ne(()=>import("./gl-f26f038d.js").then(t=>t.g),[]);case"gom-latn":return ne(()=>import("./gom-latn-df79abba.js").then(t=>t.g),[]);case"gu":return ne(()=>import("./gu-f40a5cef.js").then(t=>t.g),[]);case"he":return ne(()=>import("./he-e043745c.js").then(t=>t.h),[]);case"hi":return ne(()=>import("./hi-e00d63fa.js").then(t=>t.h),[]);case"hr":return ne(()=>import("./hr-348ed1b0.js").then(t=>t.h),[]);case"hu":return ne(()=>import("./hu-fb900964.js").then(t=>t.h),[]);case"hy-am":return ne(()=>import("./hy-am-5dc7e756.js").then(t=>t.h),[]);case"id":return ne(()=>import("./id-2792541a.js").then(t=>t.i),[]);case"is":return ne(()=>import("./is-511e774f.js").then(t=>t.i),[]);case"it":return ne(()=>import("./it-66c14de7.js").then(t=>t.i),[]);case"ja":return ne(()=>import("./ja-f0952813.js").then(t=>t.j),[]);case"jv":return ne(()=>import("./jv-f493ab7e.js").then(t=>t.j),[]);case"ka":return ne(()=>import("./ka-c4a5b8b1.js").then(t=>t.k),[]);case"kk":return ne(()=>import("./kk-89b65490.js").then(t=>t.k),[]);case"km":return ne(()=>import("./km-44151346.js").then(t=>t.k),[]);case"kn":return ne(()=>import("./kn-7a18b63c.js").then(t=>t.k),[]);case"ko":return ne(()=>import("./ko-3872f259.js").then(t=>t.k),[]);case"ku":return ne(()=>import("./ku-9994d7c6.js").then(t=>t.k),[]);case"ky":return ne(()=>import("./ky-6648ee63.js").then(t=>t.k),[]);case"lb":return ne(()=>import("./lb-67a4a0fb.js").then(t=>t.l),[]);case"lo":return ne(()=>import("./lo-f4daf3b1.js").then(t=>t.l),[]);case"lt":return ne(()=>import("./lt-e2eb4d97.js").then(t=>t.l),[]);case"lv":return ne(()=>import("./lv-4f92e204.js").then(t=>t.l),[]);case"me":return ne(()=>import("./me-18802b48.js").then(t=>t.m),[]);case"mi":return ne(()=>import("./mi-33e96ef6.js").then(t=>t.m),[]);case"mk":return ne(()=>import("./mk-cf97a04b.js").then(t=>t.m),[]);case"ml":return ne(()=>import("./ml-c5cd51cd.js").then(t=>t.m),[]);case"mn":return ne(()=>import("./mn-85a9d59a.js").then(t=>t.m),[]);case"mr":return ne(()=>import("./mr-cffede1c.js").then(t=>t.m),[]);case"ms-my":return ne(()=>import("./ms-my-0d9e4273.js").then(t=>t.m),[]);case"ms":return ne(()=>import("./ms-c2da4f42.js").then(t=>t.m),[]);case"mt":return ne(()=>import("./mt-fd3240fd.js").then(t=>t.m),[]);case"my":return ne(()=>import("./my-adc7c0f5.js").then(t=>t.m),[]);case"nb":return ne(()=>import("./nb-d5a1aef4.js").then(t=>t.n),[]);case"ne":return ne(()=>import("./ne-d8949b57.js").then(t=>t.n),[]);case"nl-be":return ne(()=>import("./nl-be-921a9500.js").then(t=>t.n),[]);case"nl":return ne(()=>import("./nl-90569a74.js").then(t=>t.n),[]);case"nn":return ne(()=>import("./nn-3efea2fb.js").then(t=>t.n),[]);case"oc-lnc":return ne(()=>import("./oc-lnc-ba429ba6.js").then(t=>t.o),[]);case"pa-in":return ne(()=>import("./pa-in-7cbfdde8.js").then(t=>t.p),[]);case"pl":return ne(()=>import("./pl-eb77ea97.js").then(t=>t.p),[]);case"pt-br":return ne(()=>import("./pt-br-002294ab.js").then(t=>t.p),[]);case"pt":return ne(()=>import("./pt-111f6953.js").then(t=>t.p),[]);case"rn":return ne(()=>import("./rn-6c04ad05.js").then(t=>t.r),[]);case"ro":return ne(()=>import("./ro-9c8fd7d6.js").then(t=>t.r),[]);case"ru":return ne(()=>import("./ru-596ff91f.js").then(t=>t.r),[]);case"rw":return ne(()=>import("./rw-e7a0d6c8.js").then(t=>t.r),[]);case"sd":return ne(()=>import("./sd-a402ed8e.js").then(t=>t.s),[]);case"se":return ne(()=>import("./se-2b5ea728.js").then(t=>t.s),[]);case"si":return ne(()=>import("./si-8864324a.js").then(t=>t.s),[]);case"sk":return ne(()=>import("./sk-04020c2e.js").then(t=>t.s),[]);case"sl":return ne(()=>import("./sl-abfa2870.js").then(t=>t.s),[]);case"sq":return ne(()=>import("./sq-15f18d85.js").then(t=>t.s),[]);case"sr-cyrl":return ne(()=>import("./sr-cyrl-093b56f0.js").then(t=>t.s),[]);case"sr":return ne(()=>import("./sr-ba766b52.js").then(t=>t.s),[]);case"ss":return ne(()=>import("./ss-4ff4f01c.js").then(t=>t.s),[]);case"sv-fi":return ne(()=>import("./sv-fi-487155c8.js").then(t=>t.s),[]);case"sv":return ne(()=>import("./sv-55f031d4.js").then(t=>t.s),[]);case"sw":return ne(()=>import("./sw-70cefa00.js").then(t=>t.s),[]);case"ta":return ne(()=>import("./ta-1c6ea1bf.js").then(t=>t.t),[]);case"te":return ne(()=>import("./te-5d3ea1fc.js").then(t=>t.t),[]);case"tet":return ne(()=>import("./tet-bd7d7e36.js").then(t=>t.t),[]);case"tg":return ne(()=>import("./tg-03cf1bf9.js").then(t=>t.t),[]);case"th":return ne(()=>import("./th-77156f83.js").then(t=>t.t),[]);case"tk":return ne(()=>import("./tk-f319a7b6.js").then(t=>t.t),[]);case"tl-ph":return ne(()=>import("./tl-ph-a42760f5.js").then(t=>t.t),[]);case"tlh":return ne(()=>import("./tlh-505194f5.js").then(t=>t.t),[]);case"tr":return ne(()=>import("./tr-917a9930.js").then(t=>t.t),[]);case"tzl":return ne(()=>import("./tzl-2a648fb1.js").then(t=>t.t),[]);case"tzm-latn":return ne(()=>import("./tzm-latn-2935b1d6.js").then(t=>t.t),[]);case"tzm":return ne(()=>import("./tzm-724d8c1f.js").then(t=>t.t),[]);case"ug-cn":return ne(()=>import("./ug-cn-182fdfb5.js").then(t=>t.u),[]);case"uk":return ne(()=>import("./uk-1622c9fc.js").then(t=>t.u),[]);case"ur":return ne(()=>import("./ur-380f6f76.js").then(t=>t.u),[]);case"uz-latn":return ne(()=>import("./uz-latn-661fe926.js").then(t=>t.u),[]);case"uz":return ne(()=>import("./uz-7bc6347a.js").then(t=>t.u),[]);case"vi":return ne(()=>import("./vi-4f2d074b.js").then(t=>t.v),[]);case"x-pseudo":return ne(()=>import("./x-pseudo-9e291b2b.js").then(t=>t.x),[]);case"yo":return ne(()=>import("./yo-466cf563.js").then(t=>t.y),[]);case"zh-cn":return ne(()=>import("./zh-cn-6889869f.js").then(t=>t.z),[]);case"zh-hk":return ne(()=>import("./zh-hk-848e8602.js").then(t=>t.z),[]);case"zh-tw":return ne(()=>import("./zh-tw-9f5eabd8.js").then(t=>t.z),[]);case"zh":return ne(()=>import("./zh-60e40d96.js").then(t=>t.z),[]);default:return ne(()=>import("./en-d51f626b.js").then(t=>t.e),[])}}}function VCn(){return n=>{switch(n){case"en":return ne(()=>import("./en_US-582991c1.js").then(e=>e.e),["en_US-582991c1.js","interopRequireDefault-01ffd8a5.js"]);case"it":return ne(()=>import("./it_IT-a73276f8.js").then(e=>e.i),["it_IT-a73276f8.js","interopRequireDefault-01ffd8a5.js"]);case"de":return ne(()=>import("./de_DE-dcec3684.js").then(e=>e.d),["de_DE-dcec3684.js","interopRequireDefault-01ffd8a5.js"]);case"fr":return ne(()=>import("./fr_FR-28f39595.js").then(e=>e.f),["fr_FR-28f39595.js","interopRequireDefault-01ffd8a5.js"]);case"pt_BR":return ne(()=>import("./pt_BR-8163ad30.js").then(e=>e.p),["pt_BR-8163ad30.js","interopRequireDefault-01ffd8a5.js"]);case"nl":return ne(()=>import("./nl_NL-0bfe8590.js").then(e=>e.n),["nl_NL-0bfe8590.js","interopRequireDefault-01ffd8a5.js"]);case"es":return ne(()=>import("./es_ES-c23408ba.js").then(e=>e.e),["es_ES-c23408ba.js","interopRequireDefault-01ffd8a5.js"]);case"nb_NO":return ne(()=>import("./nb_NO-691161b4.js").then(e=>e.n),["nb_NO-691161b4.js","interopRequireDefault-01ffd8a5.js"]);case"da":return ne(()=>import("./da_DK-ce1446ba.js").then(e=>e.d),["da_DK-ce1446ba.js","interopRequireDefault-01ffd8a5.js"]);case"ja":return ne(()=>import("./ja_JP-1d62b9c5.js").then(e=>e.j),["ja_JP-1d62b9c5.js","interopRequireDefault-01ffd8a5.js"]);case"sv":return ne(()=>import("./sv_SE-b6d1f6ea.js").then(e=>e.s),["sv_SE-b6d1f6ea.js","interopRequireDefault-01ffd8a5.js"]);case"es_ES":return ne(()=>import("./es_ES-c23408ba.js").then(e=>e.e),["es_ES-c23408ba.js","interopRequireDefault-01ffd8a5.js"]);case"fr_CA":return ne(()=>import("./fr_CA-f76b7ab0.js").then(e=>e.f),["fr_CA-f76b7ab0.js","interopRequireDefault-01ffd8a5.js"]);case"lt":return ne(()=>import("./lt_LT-7f2de48d.js").then(e=>e.l),["lt_LT-7f2de48d.js","interopRequireDefault-01ffd8a5.js"]);case"pl":return ne(()=>import("./pl_PL-8844b782.js").then(e=>e.p),["pl_PL-8844b782.js","interopRequireDefault-01ffd8a5.js"]);case"cs":return ne(()=>import("./cs_CZ-ac5e370b.js").then(e=>e.c),["cs_CZ-ac5e370b.js","interopRequireDefault-01ffd8a5.js"]);case"hr":return ne(()=>import("./hr_HR-af1dcb36.js").then(e=>e.h),["hr_HR-af1dcb36.js","interopRequireDefault-01ffd8a5.js"]);case"sq":return ne(()=>import("./en_US-582991c1.js").then(e=>e.e),["en_US-582991c1.js","interopRequireDefault-01ffd8a5.js"]);case"el":return ne(()=>import("./el_GR-52c0362c.js").then(e=>e.e),["el_GR-52c0362c.js","interopRequireDefault-01ffd8a5.js"]);case"en_GB":return ne(()=>import("./en_GB-954c8bd2.js").then(e=>e.e),["en_GB-954c8bd2.js","interopRequireDefault-01ffd8a5.js"]);case"pt_PT":return ne(()=>import("./pt_PT-eb8d1ebb.js").then(e=>e.p),["pt_PT-eb8d1ebb.js","interopRequireDefault-01ffd8a5.js"]);case"sl":return ne(()=>import("./sl_SI-4af0b12e.js").then(e=>e.s),["sl_SI-4af0b12e.js","interopRequireDefault-01ffd8a5.js"]);case"fi":return ne(()=>import("./fi_FI-4d0d4eb8.js").then(e=>e.f),["fi_FI-4d0d4eb8.js","interopRequireDefault-01ffd8a5.js"]);case"ro":return ne(()=>import("./ro_RO-cbc13832.js").then(e=>e.r),["ro_RO-cbc13832.js","interopRequireDefault-01ffd8a5.js"]);case"tr_TR":return ne(()=>import("./tr_TR-19ba7c78.js").then(e=>e.t),["tr_TR-19ba7c78.js","interopRequireDefault-01ffd8a5.js"]);case"th":return ne(()=>import("./th_TH-065e99fd.js").then(e=>e.t),["th_TH-065e99fd.js","interopRequireDefault-01ffd8a5.js"]);case"mk_MK":return ne(()=>import("./mk_MK-d61380a0.js").then(e=>e.m),["mk_MK-d61380a0.js","interopRequireDefault-01ffd8a5.js"]);case"zh_TW":return ne(()=>import("./zh_TW-9759e3fd.js").then(e=>e.z),["zh_TW-9759e3fd.js","interopRequireDefault-01ffd8a5.js"]);case"ru_RU":return ne(()=>import("./ru_RU-1219c39c.js").then(e=>e.r),["ru_RU-1219c39c.js","interopRequireDefault-01ffd8a5.js"]);case"ar":return ne(()=>import("./ar_EG-4ae708c6.js").then(e=>e.a),["ar_EG-4ae708c6.js","interopRequireDefault-01ffd8a5.js"]);case"fa":return ne(()=>import("./fa_IR-0a55c100.js").then(e=>e.f),["fa_IR-0a55c100.js","interopRequireDefault-01ffd8a5.js"]);case"lv_LV":return ne(()=>import("./lv_LV-e2b909dd.js").then(e=>e.l),["lv_LV-e2b909dd.js","interopRequireDefault-01ffd8a5.js"]);case"sr":return ne(()=>import("./sr_RS-ebf7ecbd.js").then(e=>e.s),["sr_RS-ebf7ecbd.js","interopRequireDefault-01ffd8a5.js"]);case"sk":return ne(()=>import("./sk_SK-09148c5d.js").then(e=>e.s),["sk_SK-09148c5d.js","interopRequireDefault-01ffd8a5.js"]);case"et":return ne(()=>import("./et_EE-10d43871.js").then(e=>e.e),["et_EE-10d43871.js","interopRequireDefault-01ffd8a5.js"]);case"bg":return ne(()=>import("./bg_BG-4ff1a3ac.js").then(e=>e.b),["bg_BG-4ff1a3ac.js","interopRequireDefault-01ffd8a5.js"]);case"he":return ne(()=>import("./he_IL-42bf9a08.js").then(e=>e.h),["he_IL-42bf9a08.js","interopRequireDefault-01ffd8a5.js"]);case"km_KH":return ne(()=>import("./km_KH-426dce0e.js").then(e=>e.k),["km_KH-426dce0e.js","interopRequireDefault-01ffd8a5.js"]);case"hu":return ne(()=>import("./hu_HU-60d39eba.js").then(e=>e.h),["hu_HU-60d39eba.js","interopRequireDefault-01ffd8a5.js"]);case"fr_CH":return ne(()=>import("./fr_FR-28f39595.js").then(e=>e.f),["fr_FR-28f39595.js","interopRequireDefault-01ffd8a5.js"]);default:return ne(()=>import("./en_US-582991c1.js").then(e=>e.e),["en_US-582991c1.js","interopRequireDefault-01ffd8a5.js"])}}}const dNe=rl.div` &:hover { background-color: ${n=>n.theme.hoverColor}; }: `;function HCn(n){var b,y,C,x,E;const[e]=pe(),t=wi(),i=Qi(),r=ni(),o=ci(),s=Pc(),[a,l]=w.useState(),[c,u]=w.useState(!1),[d,h]=w.useState(0),f=So(),g=k=>{f("settings.name",k);const L=k.split("").filter(D=>/[a-zA-Z]/.test(D)).join("").toLowerCase();f("subdomain",L)},m=k=>{Ae("PUT",Te("/api/v1/companies/:id",{id:s==null?void 0:s.id}),s).then(L=>{ce.success("updated_company"),k?h(D=>D+1):n.setIsModalOpen(!1),i(US({object:"company",data:L.data.data}))}).catch(L=>{var D;((D=L.response)==null?void 0:D.status)===422&&(l(L.response.data),ce.dismiss())}).finally(()=>u(!1))},v=k=>{ce.processing(),Ae("POST",Te("/api/v1/one_time_token"),{context:k}).then(L=>{var A;let D="stripe/signup/:token";k==="paypal_ppcp"&&(D="paypal?hash=:token"),(A=window.open(bt(`https://invoicing.co/${D}`,{token:L.data.hash}),"_blank"))==null||A.focus(),ce.dismiss()})},_=async k=>{if(!c){if(un.isEqual(o,s)){k?h(L=>L+1):n.setIsModalOpen(!1);return}ce.processing(),l(void 0),u(!0),s!=null&&s.subdomain&&Ro()?Ae("POST",Te("/api/v1/check_subdomain"),{subdomain:s.subdomain}).then(()=>m(k)).finally(()=>u(!1)):m(k)}};return p(Ui,{title:d!==1?e(d===0?"welcome_to_invoice_ninja":"accept_payments_online"):"",visible:n.isModalOpen,onClose:()=>{n.setIsModalOpen(!1),l(void 0)},backgroundColor:"white",overflowVisible:!0,children:N("div",{className:"flex flex-col space-y-6",children:[d===0&&N("div",{className:"flex flex-col space-y-4",children:[p(We,{label:e("company_name"),value:(b=s==null?void 0:s.settings)==null?void 0:b.name,onValueChange:k=>g(k),errorMessage:(y=a==null?void 0:a.errors)==null?void 0:y.name,changeOverride:!0}),Ro(),p(QF,{label:e("language"),value:((C=s==null?void 0:s.settings)==null?void 0:C.language_id)||"",onChange:k=>f("settings.language_id",k),errorMessage:(x=a==null?void 0:a.errors)==null?void 0:x.language_id}),p(lA,{label:e("currency"),value:((E=s==null?void 0:s.settings)==null?void 0:E.currency_id)||"",onChange:k=>f("settings.currency_id",k)})]}),d===1&&p(PYe,{isSettingsPage:!1}),d===2&&N("div",{className:"flex flex-col items-center",children:[p(dNe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>v("stripe_connect"),children:p(Aae,{name:"stripe",style:{width:"64%"}})}),p(dNe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>v("paypal_ppcp"),children:p(Aae,{name:"paypal_ppcp",style:{width:"38%",transform:"scale(1.7)",pointerEvents:"none"}})}),p(Gt,{behavior:"button",className:"w-full mt-4",onClick:()=>{n.setIsModalOpen(!1),t("/settings/gateways/create")},children:e("all_payment_gateways")})]}),p("div",{className:"flex justify-end",children:(d!==2||Rk())&&p(Gt,{behavior:"button",onClick:()=>{d===0&&_(Ro()),d!==0&&h(k=>k+1)},children:e("save")})})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const JYe=Oo(null),WCn=["public_notes","private_notes","terms","footer"];function ZLr(n){const{id:e}=il();Ar(JYe);const[t,i]=Yo(n),[r,o]=Yo(TN),[s,a]=w.useState(),l=!0,c=(d,h="")=>un.flatMapDeep(un.keys(d),f=>{const g=d[f],m=h?`${h}.${f}`:f;return un.isObject(g)?c(g,m):m}),u=(d,h="")=>c(d,h);return w.useEffect(()=>{if(t&&s&&t.id===s.id&&!l){const h=u(t).filter(v=>WCn.some(_=>v.includes(_))),f=un.cloneDeep(t);h.forEach(v=>{v.includes(".")||(delete f[v],delete s[v])});const g=un.isEqual(f,s);r.prevent!==!g&&o(v=>v&&{...v,prevent:!g})}},[t]),QD(()=>{t&&t.id===e&&s&&(a(un.cloneDeep(t)),o(d=>d&&{...d,prevent:!1}))},50,[t==null?void 0:t.updated_at]),QD(()=>{t&&(!e||t.id===e)&&!s&&a(un.cloneDeep(t))},50,[t,s]),w.useEffect(()=>()=>{a(void 0),o(d=>d&&{...d,prevent:!1})},[]),[t,i]}function zCn(){const[n]=pe(),e=wi(),t=Tl(),i=!1,r=Fi(JYe),[o,s]=Yo(k7e),a=Fi(I7e),[l,c]=Yo(TN),[u,d]=Yo(tq),[h,f]=w.useState(!1),{nonPreventedLocations:g}=o,m=()=>{const _=l.actionKey==="browserBack",{url:b,externalLink:y,fn:C}=a||{};y||(s(k=>({...k,lastLocation:""})),c({prevent:!1,actionKey:void 0}));const x=g.length;let E=g[x-1];E=E!==t.pathname?E:g[x-2],_&&E&&e(E),a&&(b&&(y?window.open(b,"_blank"):e(b)),C==null||C()),d(!1)},v=()=>{const _=l.actionKey==="browserBack";c(b=>b&&{...b,actionKey:b.actionKey!=="browserBack"?void 0:"browserBack"}),d(!1),_&&history.pushState(null,document.title,window.location.href)};return w.useEffect(()=>{f(u)},[u]),p(Ui,{visible:h,onClose:()=>{},disableClosing:!0,children:N("div",{className:"flex flex-col space-y-8",children:[p("span",{className:"font-medium text-lg text-center",children:n("error_unsaved_changes")}),r&&i&&p("span",{className:"break-words",children:JSON.stringify(r)}),N("div",{className:"flex justify-between",children:[p(Gt,{type:"secondary",onClick:v,children:n("continue_editing")}),p(Gt,{onClick:m,children:n("discard_changes")})]})]})})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */const Cee=["mousedown","mousemove","wheel","keydown","touchstart","scroll"];function UCn(){const n=ci(),e=w.useRef(null),t=()=>{Upe()},i=()=>{e.current&&clearTimeout(e.current),e.current=setTimeout(t,n==null?void 0:n.session_timeout)},r=()=>{i()};return w.useEffect(()=>(n!=null&&n.session_timeout?(Cee.forEach(o=>{window.addEventListener(o,r,{passive:!0})}),i()):(e.current&&clearTimeout(e.current),Cee.forEach(o=>window.removeEventListener(o,r))),()=>{e.current&&clearTimeout(e.current),Cee.forEach(o=>window.removeEventListener(o,r))}),[n==null?void 0:n.session_timeout]),null}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function jCn(){const{preferences:n}=L1();return w.useEffect(()=>{if(n.use_system_fonts){hNe("system-ui");return}hNe("Inter var")},[n.use_system_fonts]),null}function hNe(n){const e=window.getComputedStyle(document.body).fontFamily.split(",").map(i=>i.trim()),t=[n,...e].join(", ");document.body.style.fontFamily=t}function qCn(){const[n]=pe(),{isOwner:e}=Po(),{i18n:t}=pe(),i=Oc(A=>A.settings.darkMode),r=wi(),{id:o}=il(),s=pa(),a=Tl(),l=ci();UCn(),r2t();const c=S8e(),u=ps(),d=x8e(),h=VCn(),f=$Cn(),g=zWe(),m=Fi(H8e),v=Ar(Yme),_=Ar(cbe),b=Ar(xIt),{isCompanySettingsActive:y,isGroupSettingsActive:C}=ea(),[x,E]=w.useState(!1),k=l?d(s!=null&&s.language_id&&s.language_id.length>0?s.language_id:l.settings.language_id):void 0,L=A=>{var O,P;if(!o&&!a.pathname.startsWith("/settings")){const{error:F}=A.detail;if(F.response.data.errors){const B=F.response.data.errors||{},M=(O=Object.keys(B))==null?void 0:O[0],V=(P=B==null?void 0:B[M])==null?void 0:P[0];V&&ce.error(V)}}};w.useEffect(()=>{document.body.style.backgroundColor=m.$2,document.body.style.colorScheme=m.$0},[m]),w.useEffect(()=>{k!=null&&k.locale&&(f(k.locale).then(A=>{b(A),Un.locale(A)}),h(k.locale).then(A=>{_(A)}),t.hasResourceBundle(k.locale,"translation")?t.changeLanguage(k.locale):fetch(new URL(Object.assign({"/src/resources/lang/ar/ar.json":Jdt,"/src/resources/lang/bg/bg.json":eht,"/src/resources/lang/ca/ca.json":tht,"/src/resources/lang/cs/cs.json":nht,"/src/resources/lang/da/da.json":iht,"/src/resources/lang/de/de.json":rht,"/src/resources/lang/el/el.json":oht,"/src/resources/lang/en/en.json":sht,"/src/resources/lang/en_GB/en_GB.json":aht,"/src/resources/lang/es/es.json":lht,"/src/resources/lang/es_ES/es_ES.json":cht,"/src/resources/lang/et/et.json":uht,"/src/resources/lang/fa/fa.json":dht,"/src/resources/lang/fi/fi.json":hht,"/src/resources/lang/fr/fr.json":fht,"/src/resources/lang/fr_CA/fr_CA.json":pht,"/src/resources/lang/fr_CH/fr_CH.json":ght,"/src/resources/lang/he/he.json":mht,"/src/resources/lang/hr/hr.json":_ht,"/src/resources/lang/hu/hu.json":vht,"/src/resources/lang/it/it.json":bht,"/src/resources/lang/ja/ja.json":yht,"/src/resources/lang/km_KH/km_KH.json":Cht,"/src/resources/lang/lo_LA/lo_LA.json":wht,"/src/resources/lang/lt/lt.json":Sht,"/src/resources/lang/lv_LV/lv_LV.json":Eht,"/src/resources/lang/mk_MK/mk_MK.json":xht,"/src/resources/lang/nb_NO/nb_NO.json":Tht,"/src/resources/lang/nl/nl.json":kht,"/src/resources/lang/pl/pl.json":Iht,"/src/resources/lang/pt_BR/pt_BR.json":Lht,"/src/resources/lang/pt_PT/pt_PT.json":Dht,"/src/resources/lang/ro/ro.json":Aht,"/src/resources/lang/ru_RU/ru_RU.json":Nht,"/src/resources/lang/sk/sk.json":Rht,"/src/resources/lang/sl/sl.json":Oht,"/src/resources/lang/sq/sq.json":Pht,"/src/resources/lang/sr/sr.json":Mht,"/src/resources/lang/sv/sv.json":Fht,"/src/resources/lang/th/th.json":Bht,"/src/resources/lang/tr_TR/tr_TR.json":$ht,"/src/resources/lang/vi/vi.json":Vht,"/src/resources/lang/zh_TW/zh_TW.json":Hht})[`/src/resources/lang/${k.locale}/${k.locale}.json`],self.location).href).then(A=>A.json()).then(A=>{t.addResources(k.locale,"translation",A),t.changeLanguage(k.locale)}))},[i,k]),w.useEffect(()=>{window.addEventListener("navigate.invalid.page",()=>r("/not_found")),window.addEventListener("reset.password.required",()=>{v(!1)}),window.addEventListener("refetch",A=>{const{property:O}=A.detail;c(O)})},[]),w.useEffect(()=>(window.removeEventListener("display.error.toaster",L),window.addEventListener("display.error.toaster",L),()=>{window.removeEventListener("display.error.toaster",L)}),[o,a]),w.useEffect(()=>{var O;const A=(O=l==null?void 0:l.settings)==null?void 0:O.name;l&&(!A||A===n("untitled_company"))&&localStorage.getItem("COMPANY-EDIT-OPENED")!=="true"&&(localStorage.setItem("COMPANY-EDIT-OPENED","true"),E(!0))},[l]),w.useEffect(()=>{!a.pathname.startsWith("/settings")&&!y&&g(),a.pathname.startsWith("/settings/group_settings")&&C&&r("/settings/company_details")},[a]),w.useEffect(()=>{s&&Object.keys(s).length&&a.pathname.endsWith("/dashboard")&&!u("view_dashboard")&&r("/settings/user_details")},[a,s]);const D=Hpe();return mbt(),w.useEffect(()=>(l&&D&&(D.connection.bind("disconnected",()=>{console.log("Disconnected from Pusher")}),D.connection.bind("error",()=>{console.error("Error from Pusher")}),D.connect()),()=>{D&&l&&D.disconnect()}),[l==null?void 0:l.company_key]),jCn(),N(dt,{children:[N("div",{className:"App",children:[p(s0t,{position:"top-center"}),BCn]}),p(HCn,{isModalOpen:x&&e,setIsModalOpen:E}),p(zCn,{})]})}const eQe=Object.prototype.toString;function tQe(n){switch(eQe.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return v1(n,Error)}}function XN(n,e){return eQe.call(n)===`[object ${e}]`}function Dbe(n){return XN(n,"ErrorEvent")}function fNe(n){return XN(n,"DOMError")}function KCn(n){return XN(n,"DOMException")}function hS(n){return XN(n,"String")}function nQe(n){return n===null||typeof n!="object"&&typeof n!="function"}function gA(n){return XN(n,"Object")}function FK(n){return typeof Event<"u"&&v1(n,Event)}function GCn(n){return typeof Element<"u"&&v1(n,Element)}function YCn(n){return XN(n,"RegExp")}function Abe(n){return!!(n&&n.then&&typeof n.then=="function")}function QCn(n){return gA(n)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n}function iQe(n){return typeof n=="number"&&n!==n}function v1(n,e){try{return n instanceof e}catch{return!1}}function rQe(n){return!!(typeof n=="object"&&n!==null&&(n.__isVue||n._isVue))}function GL(n,e=0){return typeof n!="string"||e===0||n.length<=e?n:`${n.slice(0,e)}...`}function pNe(n,e){if(!Array.isArray(n))return"";const t=[];for(let i=0;i<n.length;i++){const r=n[i];try{rQe(r)?t.push("[VueViewModel]"):t.push(String(r))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function XCn(n,e,t=!1){return hS(n)?YCn(e)?e.test(n):hS(e)?t?n===e:n.includes(e):!1:!1}function d6(n,e=[],t=!1){return e.some(i=>XCn(n,i,t))}function ZCn(n,e,t=250,i,r,o,s){if(!o.exception||!o.exception.values||!s||!v1(s.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=JCn(Rae(n,e,r,s.originalException,i,o.exception.values,a,0),t))}function Rae(n,e,t,i,r,o,s,a){if(o.length>=t+1)return o;let l=[...o];if(v1(i[r],Error)){gNe(s,a);const c=n(e,i[r]),u=l.length;mNe(c,r,u,a),l=Rae(n,e,t,i[r],r,[c,...l],c,u)}return Array.isArray(i.errors)&&i.errors.forEach((c,u)=>{if(v1(c,Error)){gNe(s,a);const d=n(e,c),h=l.length;mNe(d,`errors[${u}]`,h,a),l=Rae(n,e,t,c,r,[d,...l],d,h)}}),l}function gNe(n,e){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,is_exception_group:!0,exception_id:e}}function mNe(n,e,t,i){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,type:"chained",source:e,exception_id:t,parent_id:i}}function JCn(n,e){return n.map(t=>(t.value&&(t.value=GL(t.value,e)),t))}function p9(n){return n&&n.Math==Math?n:void 0}const vu=typeof globalThis=="object"&&p9(globalThis)||typeof window=="object"&&p9(window)||typeof self=="object"&&p9(self)||typeof global=="object"&&p9(global)||function(){return this}()||{};function h6(){return vu}function oQe(n,e,t){const i=t||vu,r=i.__SENTRY__=i.__SENTRY__||{};return r[n]||(r[n]=e())}const O$=h6(),ewn=80;function mA(n,e={}){if(!n)return"<unknown>";try{let t=n;const i=5,r=[];let o=0,s=0;const a=" > ",l=a.length;let c;const u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||ewn;for(;t&&o++<i&&(c=twn(t,u),!(c==="html"||o>1&&s+r.length*l+c.length>=d));)r.push(c),s+=c.length,t=t.parentNode;return r.reverse().join(a)}catch{return"<unknown>"}}function twn(n,e){const t=n,i=[];let r,o,s,a,l;if(!t||!t.tagName)return"";i.push(t.tagName.toLowerCase());const c=e&&e.length?e.filter(d=>t.getAttribute(d)).map(d=>[d,t.getAttribute(d)]):null;if(c&&c.length)c.forEach(d=>{i.push(`[${d[0]}="${d[1]}"]`)});else if(t.id&&i.push(`#${t.id}`),r=t.className,r&&hS(r))for(o=r.split(/\s+/),l=0;l<o.length;l++)i.push(`.${o[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)s=u[l],a=t.getAttribute(s),a&&i.push(`[${s}="${a}"]`);return i.join("")}function nwn(){try{return O$.document.location.href}catch{return""}}function iwn(n){return O$.document&&O$.document.querySelector?O$.document.querySelector(n):null}const rwn="Sentry Logger ",Oae=["debug","info","warn","error","log","assert","trace"],AW={};function sQe(n){if(!("console"in vu))return n();const e=vu.console,t={},i=Object.keys(AW);i.forEach(r=>{const o=AW[r];t[r]=e[r],e[r]=o});try{return n()}finally{i.forEach(r=>{e[r]=t[r]})}}function own(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Oae.forEach(t=>{e[t]=(...i)=>{n&&sQe(()=>{vu.console[t](`${rwn}[${t}]:`,...i)})}}):Oae.forEach(t=>{e[t]=()=>{}}),e}const On=own(),swn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function awn(n){return n==="http"||n==="https"}function BK(n,e=!1){const{host:t,path:i,pass:r,port:o,projectId:s,protocol:a,publicKey:l}=n;return`${a}://${l}${e&&r?`:${r}`:""}@${t}${o?`:${o}`:""}/${i&&`${i}/`}${s}`}function lwn(n){const e=swn.exec(n);if(!e){console.error(`Invalid Sentry Dsn: ${n}`);return}const[t,i,r="",o,s="",a]=e.slice(1);let l="",c=a;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const d=c.match(/^\d+/);d&&(c=d[0])}return aQe({host:o,pass:r,path:l,projectId:c,port:s,protocol:t,publicKey:i})}function aQe(n){return{protocol:n.protocol,publicKey:n.publicKey||"",pass:n.pass||"",host:n.host,port:n.port||"",path:n.path||"",projectId:n.projectId}}function cwn(n){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;const{port:e,projectId:t,protocol:i}=n;return["protocol","publicKey","host","projectId"].find(s=>n[s]?!1:(On.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:t.match(/^\d+$/)?awn(i)?e&&isNaN(parseInt(e,10))?(On.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(On.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(On.error(`Invalid Sentry Dsn: Invalid projectId ${t}`),!1)}function uwn(n){const e=typeof n=="string"?lwn(n):aQe(n);if(!(!e||!cwn(e)))return e}class gb extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function Td(n,e,t){if(!(e in n))return;const i=n[e],r=t(i);typeof r=="function"&&lQe(r,i),n[e]=r}function d3(n,e,t){try{Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`Failed to add non-enumerable property "${e}" to object`,n)}}function lQe(n,e){try{const t=e.prototype||{};n.prototype=e.prototype=t,d3(n,"__sentry_original__",e)}catch{}}function Nbe(n){return n.__sentry_original__}function dwn(n){return Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&")}function cQe(n){if(tQe(n))return{message:n.message,name:n.name,stack:n.stack,...vNe(n)};if(FK(n)){const e={type:n.type,target:_Ne(n.target),currentTarget:_Ne(n.currentTarget),...vNe(n)};return typeof CustomEvent<"u"&&v1(n,CustomEvent)&&(e.detail=n.detail),e}else return n}function _Ne(n){try{return GCn(n)?mA(n):Object.prototype.toString.call(n)}catch{return"<unknown>"}}function vNe(n){if(typeof n=="object"&&n!==null){const e={};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e}else return{}}function hwn(n,e=40){const t=Object.keys(cQe(n));if(t.sort(),!t.length)return"[object has no keys]";if(t[0].length>=e)return GL(t[0],e);for(let i=t.length;i>0;i--){const r=t.slice(0,i).join(", ");if(!(r.length>e))return i===t.length?r:GL(r,e)}return""}function Nw(n){return Pae(n,new Map)}function Pae(n,e){if(gA(n)){const t=e.get(n);if(t!==void 0)return t;const i={};e.set(n,i);for(const r of Object.keys(n))typeof n[r]<"u"&&(i[r]=Pae(n[r],e));return i}if(Array.isArray(n)){const t=e.get(n);if(t!==void 0)return t;const i=[];return e.set(n,i),n.forEach(r=>{i.push(Pae(r,e))}),i}return n}function zh(){const n=vu,e=n.crypto||n.msCrypto;let t=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(t=()=>e.getRandomValues(new Uint8Array(1))[0])}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,i=>(i^(t()&15)>>i/4).toString(16))}function uQe(n){return n.exception&&n.exception.values?n.exception.values[0]:void 0}function FC(n){const{message:e,event_id:t}=n;if(e)return e;const i=uQe(n);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||t||"<unknown>":t||"<unknown>"}function Mae(n,e,t){const i=n.exception=n.exception||{},r=i.values=i.values||[],o=r[0]=r[0]||{};o.value||(o.value=e||""),o.type||(o.type=t||"Error")}function h3(n,e){const t=uQe(n);if(!t)return;const i={type:"generic",handled:!0},r=t.mechanism;if(t.mechanism={...i,...r,...e},e&&"data"in e){const o={...r&&r.data,...e.data};t.mechanism.data=o}}function bNe(n){if(n&&n.__sentry_captured__)return!0;try{d3(n,"__sentry_captured__",!0)}catch{}return!1}function dQe(n){return Array.isArray(n)?n:[n]}const hQe=50,yNe=/\(error: (.*)\)/,CNe=/captureMessage|captureException/;function fQe(...n){const e=n.sort((t,i)=>t[0]-i[0]).map(t=>t[1]);return(t,i=0)=>{const r=[],o=t.split(` `);for(let s=i;s<o.length;s++){const a=o[s];if(a.length>1024)continue;const l=yNe.test(a)?a.replace(yNe,"$1"):a;if(!l.match(/\S*Error: /)){for(const c of e){const u=c(l);if(u){r.push(u);break}}if(r.length>=hQe)break}}return pwn(r)}}function fwn(n){return Array.isArray(n)?fQe(...n):n}function pwn(n){if(!n.length)return[];const e=Array.from(n);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),CNe.test(e[e.length-1].function||"")&&(e.pop(),CNe.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,hQe).map(t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"}))}const wee="<anonymous>";function b1(n){try{return!n||typeof n!="function"?wee:n.name||wee}catch{return wee}}const Fae=h6();function pQe(){if(!("fetch"in Fae))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Bae(n){return n&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(n.toString())}function gwn(){if(!pQe())return!1;if(Bae(Fae.fetch))return!0;let n=!1;const e=Fae.document;if(e&&typeof e.createElement=="function")try{const t=e.createElement("iframe");t.hidden=!0,e.head.appendChild(t),t.contentWindow&&t.contentWindow.fetch&&(n=Bae(t.contentWindow.fetch)),e.head.removeChild(t)}catch(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return n}const g9=h6();function mwn(){const n=g9.chrome,e=n&&n.app&&n.app.runtime,t="history"in g9&&!!g9.history.pushState&&!!g9.history.replaceState;return!e&&t}const qu=h6(),eL="__sentry_xhr_v2__",SM={},wNe={};function _wn(n){if(!wNe[n])switch(wNe[n]=!0,n){case"console":vwn();break;case"dom":kwn();break;case"xhr":Cwn();break;case"fetch":bwn();break;case"history":wwn();break;case"error":Iwn();break;case"unhandledrejection":Lwn();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("unknown instrumentation type:",n);return}}function Vp(n,e){SM[n]=SM[n]||[],SM[n].push(e),_wn(n)}function lv(n,e){if(!(!n||!SM[n]))for(const t of SM[n]||[])try{t(e)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.error(`Error while triggering instrumentation handler. Type: ${n} Name: ${b1(t)} Error:`,i)}}function vwn(){"console"in vu&&Oae.forEach(function(n){n in vu.console&&Td(vu.console,n,function(e){return AW[n]=e,function(...t){lv("console",{args:t,level:n});const i=AW[n];i&&i.apply(vu.console,t)}})})}function bwn(){gwn()&&Td(vu,"fetch",function(n){return function(...e){const{method:t,url:i}=ywn(e),r={args:e,fetchData:{method:t,url:i},startTimestamp:Date.now()};return lv("fetch",{...r}),n.apply(vu,e).then(o=>(lv("fetch",{...r,endTimestamp:Date.now(),response:o}),o),o=>{throw lv("fetch",{...r,endTimestamp:Date.now(),error:o}),o})}})}function $ae(n,e){return!!n&&typeof n=="object"&&!!n[e]}function SNe(n){return typeof n=="string"?n:n?$ae(n,"url")?n.url:n.toString?n.toString():"":""}function ywn(n){if(n.length===0)return{method:"GET",url:""};if(n.length===2){const[t,i]=n;return{url:SNe(t),method:$ae(i,"method")?String(i.method).toUpperCase():"GET"}}const e=n[0];return{url:SNe(e),method:$ae(e,"method")?String(e.method).toUpperCase():"GET"}}function Cwn(){if(!qu.XMLHttpRequest)return;const n=XMLHttpRequest.prototype;Td(n,"open",function(e){return function(...t){const i=Date.now(),r=t[1],o=this[eL]={method:hS(t[0])?t[0].toUpperCase():t[0],url:t[1],request_headers:{}};hS(r)&&o.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const s=()=>{const a=this[eL];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}lv("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:i,xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Td(this,"onreadystatechange",function(a){return function(...l){return s(),a.apply(this,l)}}):this.addEventListener("readystatechange",s),Td(this,"setRequestHeader",function(a){return function(...l){const[c,u]=l,d=this[eL];return d&&(d.request_headers[c.toLowerCase()]=u),a.apply(this,l)}}),e.apply(this,t)}}),Td(n,"send",function(e){return function(...t){const i=this[eL];return i&&t[0]!==void 0&&(i.body=t[0]),lv("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}let m9;function wwn(){if(!mwn())return;const n=qu.onpopstate;qu.onpopstate=function(...t){const i=qu.location.href,r=m9;if(m9=i,lv("history",{from:r,to:i}),n)try{return n.apply(this,t)}catch{}};function e(t){return function(...i){const r=i.length>2?i[2]:void 0;if(r){const o=m9,s=String(r);m9=s,lv("history",{from:o,to:s})}return t.apply(this,i)}}Td(qu.history,"pushState",e),Td(qu.history,"replaceState",e)}const Swn=1e3;let ENe,Vae,Hae;function Ewn(n){if(n.type!==Vae)return!1;try{if(!n.target||n.target._sentryId!==Hae)return!1}catch{}return!0}function xwn(n,e){return n!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function Twn(n){try{return n.target}catch{return null}}function xNe(n,e=!1){return t=>{if(!t||t._sentryCaptured)return;const i=Twn(t);if(xwn(t.type,i))return;d3(t,"_sentryCaptured",!0),i&&!i._sentryId&&d3(i,"_sentryId",zh());const r=t.type==="keypress"?"input":t.type;Ewn(t)||(n({event:t,name:r,global:e}),Vae=t.type,Hae=i?i._sentryId:void 0),clearTimeout(ENe),ENe=qu.setTimeout(()=>{Hae=void 0,Vae=void 0},Swn)}}function kwn(){if(!qu.document)return;const n=lv.bind(null,"dom"),e=xNe(n,!0);qu.document.addEventListener("click",e,!1),qu.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(t=>{const i=qu[t]&&qu[t].prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(Td(i,"addEventListener",function(r){return function(o,s,a){if(o==="click"||o=="keypress")try{const l=this,c=l.__sentry_instrumentation_handlers__=l.__sentry_instrumentation_handlers__||{},u=c[o]=c[o]||{refCount:0};if(!u.handler){const d=xNe(n);u.handler=d,r.call(this,o,d,a)}u.refCount++}catch{}return r.call(this,o,s,a)}}),Td(i,"removeEventListener",function(r){return function(o,s,a){if(o==="click"||o=="keypress")try{const l=this,c=l.__sentry_instrumentation_handlers__||{},u=c[o];u&&(u.refCount--,u.refCount<=0&&(r.call(this,o,u.handler,a),u.handler=void 0,delete c[o]),Object.keys(c).length===0&&delete l.__sentry_instrumentation_handlers__)}catch{}return r.call(this,o,s,a)}}))})}let _9=null;function Iwn(){_9=qu.onerror,qu.onerror=function(n,e,t,i,r){return lv("error",{column:i,error:r,line:t,msg:n,url:e}),_9&&!_9.__SENTRY_LOADER__?_9.apply(this,arguments):!1},qu.onerror.__SENTRY_INSTRUMENTED__=!0}let v9=null;function Lwn(){v9=qu.onunhandledrejection,qu.onunhandledrejection=function(n){return lv("unhandledrejection",n),v9&&!v9.__SENTRY_LOADER__?v9.apply(this,arguments):!0},qu.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Dwn(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Awn(){return"npm"}function Nwn(){return!Dwn()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Rwn(n,e){return n.require(e)}function Own(){const n=typeof WeakSet=="function",e=n?new WeakSet:[];function t(r){if(n)return e.has(r)?!0:(e.add(r),!1);for(let o=0;o<e.length;o++)if(e[o]===r)return!0;return e.push(r),!1}function i(r){if(n)e.delete(r);else for(let o=0;o<e.length;o++)if(e[o]===r){e.splice(o,1);break}}return[t,i]}function IC(n,e=100,t=1/0){try{return Wae("",n,e,t)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function gQe(n,e=3,t=100*1024){const i=IC(n,e);return Bwn(i)>t?gQe(n,e-1,t):i}function Wae(n,e,t=1/0,i=1/0,r=Own()){const[o,s]=r;if(e==null||["number","boolean","string"].includes(typeof e)&&!iQe(e))return e;const a=Pwn(n,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:t;if(l===0)return a.replace("object ","");if(o(e))return"[Circular ~]";const c=e;if(c&&typeof c.toJSON=="function")try{const f=c.toJSON();return Wae("",f,l-1,i,r)}catch{}const u=Array.isArray(e)?[]:{};let d=0;const h=cQe(e);for(const f in h){if(!Object.prototype.hasOwnProperty.call(h,f))continue;if(d>=i){u[f]="[MaxProperties ~]";break}const g=h[f];u[f]=Wae(f,g,l-1,i,r),d++}return s(e),u}function Pwn(n,e){try{if(n==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(n==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(rQe(e))return"[VueViewModel]";if(QCn(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${b1(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const t=Mwn(e);return/^HTML(\w*)Element$/.test(t)?`[HTMLElement: ${t}]`:`[object ${t}]`}catch(t){return`**non-serializable** (${t})`}}function Mwn(n){const e=Object.getPrototypeOf(n);return e?e.constructor.name:"null prototype"}function Fwn(n){return~-encodeURI(n).split(/%..|./).length}function Bwn(n){return Fwn(JSON.stringify(n))}var dy;(function(n){n[n.PENDING=0]="PENDING";const t=1;n[n.RESOLVED=t]="RESOLVED";const i=2;n[n.REJECTED=i]="REJECTED"})(dy||(dy={}));function jT(n){return new Mp(e=>{e(n)})}function Rbe(n){return new Mp((e,t)=>{t(n)})}class Mp{constructor(e){Mp.prototype.__init.call(this),Mp.prototype.__init2.call(this),Mp.prototype.__init3.call(this),Mp.prototype.__init4.call(this),this._state=dy.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new Mp((i,r)=>{this._handlers.push([!1,o=>{if(!e)i(o);else try{i(e(o))}catch(s){r(s)}},o=>{if(!t)r(o);else try{i(t(o))}catch(s){r(s)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new Mp((t,i)=>{let r,o;return this.then(s=>{o=!1,r=s,e&&e()},s=>{o=!0,r=s,e&&e()}).then(()=>{if(o){i(r);return}t(r)})})}__init(){this._resolve=e=>{this._setResult(dy.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(dy.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===dy.PENDING){if(Abe(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===dy.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===dy.RESOLVED&&t[1](this._value),this._state===dy.REJECTED&&t[2](this._value),t[0]=!0)})}}}function $wn(n){const e=[];function t(){return n===void 0||e.length<n}function i(s){return e.splice(e.indexOf(s),1)[0]}function r(s){if(!t())return Rbe(new gb("Not adding Promise because buffer limit was reached."));const a=s();return e.indexOf(a)===-1&&e.push(a),a.then(()=>i(a)).then(null,()=>i(a).then(null,()=>{})),a}function o(s){return new Mp((a,l)=>{let c=e.length;if(!c)return a(!0);const u=setTimeout(()=>{s&&s>0&&a(!1)},s);e.forEach(d=>{jT(d).then(()=>{--c||(clearTimeout(u),a(!0))},l)})})}return{$:e,add:r,drain:o}}function See(n){if(!n)return{};const e=n.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const t=e[6]||"",i=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:t,hash:i,relative:e[5]+t+i}}const Vwn=["fatal","error","warning","log","info","debug"];function Hwn(n){return n==="warn"?"warning":Vwn.includes(n)?n:"log"}const mQe=h6(),zae={nowSeconds:()=>Date.now()/1e3};function Wwn(){const{performance:n}=mQe;if(!n||!n.now)return;const e=Date.now()-n.now();return{now:()=>n.now(),timeOrigin:e}}function zwn(){try{return Rwn(module,"perf_hooks").performance}catch{return}}const Eee=Nwn()?zwn():Wwn(),TNe=Eee===void 0?zae:{nowSeconds:()=>(Eee.timeOrigin+Eee.now())/1e3},$K=zae.nowSeconds.bind(zae),qT=TNe.nowSeconds.bind(TNe),o0=(()=>{const{performance:n}=mQe;if(!n||!n.now)return;const e=3600*1e3,t=n.now(),i=Date.now(),r=n.timeOrigin?Math.abs(n.timeOrigin+t-i):e,o=r<e,s=n.timing&&n.timing.navigationStart,l=typeof s=="number"?Math.abs(s+t-i):e,c=l<e;return o||c?r<=l?n.timeOrigin:s:i})(),Uae="baggage",_Qe="sentry-",Uwn=/^sentry-/,jwn=8192;function qwn(n){if(!hS(n)&&!Array.isArray(n))return;let e={};if(Array.isArray(n))e=n.reduce((i,r)=>{const o=kNe(r);return{...i,...o}},{});else{if(!n)return;e=kNe(n)}const t=Object.entries(e).reduce((i,[r,o])=>{if(r.match(Uwn)){const s=r.slice(_Qe.length);i[s]=o}return i},{});if(Object.keys(t).length>0)return t}function jae(n){if(!n)return;const e=Object.entries(n).reduce((t,[i,r])=>(r&&(t[`${_Qe}${i}`]=r),t),{});return Kwn(e)}function kNe(n){return n.split(",").map(e=>e.split("=").map(t=>decodeURIComponent(t.trim()))).reduce((e,[t,i])=>(e[t]=i,e),{})}function Kwn(n){if(Object.keys(n).length!==0)return Object.entries(n).reduce((e,[t,i],r)=>{const o=`${encodeURIComponent(t)}=${encodeURIComponent(i)}`,s=r===0?o:`${e},${o}`;return s.length>jwn?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Not adding key: ${t} with val: ${i} to baggage header due to exceeding baggage size limits.`),e):s},"")}const Gwn=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ywn(n){if(!n)return;const e=n.match(Gwn);if(!e)return;let t;return e[3]==="1"?t=!0:e[3]==="0"&&(t=!1),{traceId:e[1],parentSampled:t,parentSpanId:e[2]}}function Qwn(n,e){const t=Ywn(n),i=qwn(e),{traceId:r,parentSpanId:o,parentSampled:s}=t||{},a={traceId:r||zh(),spanId:zh().substring(16),sampled:s};return o&&(a.parentSpanId=o),i&&(a.dsc=i),{traceparentData:t,dynamicSamplingContext:i,propagationContext:a}}function Obe(n=zh(),e=zh().substring(16),t){let i="";return t!==void 0&&(i=t?"-1":"-0"),`${n}-${e}${i}`}function f6(n,e=[]){return[n,e]}function Xwn(n,e){const[t,i]=n;return[t,[...i,e]]}function INe(n,e){const t=n[1];for(const i of t){const r=i[0].type;if(e(i,r))return!0}return!1}function qae(n,e){return(e||new TextEncoder).encode(n)}function Zwn(n,e){const[t,i]=n;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[qae(r,e),s]:r.push(typeof s=="string"?qae(s,e):s)}for(const s of i){const[a,l]=s;if(o(` ${JSON.stringify(a)} `),typeof l=="string"||l instanceof Uint8Array)o(l);else{let c;try{c=JSON.stringify(l)}catch{c=JSON.stringify(IC(l))}o(c)}}return typeof r=="string"?r:Jwn(r)}function Jwn(n){const e=n.reduce((r,o)=>r+o.length,0),t=new Uint8Array(e);let i=0;for(const r of n)t.set(r,i),i+=r.length;return t}function eSn(n,e){const t=typeof n.data=="string"?qae(n.data,e):n.data;return[Nw({type:"attachment",length:t.length,filename:n.filename,content_type:n.contentType,attachment_type:n.attachmentType}),t]}const tSn={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",statsd:"unknown"};function LNe(n){return tSn[n]}function vQe(n){if(!n||!n.sdk)return;const{name:e,version:t}=n.sdk;return{name:e,version:t}}function nSn(n,e,t,i){const r=n.sdkProcessingMetadata&&n.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:n.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!t&&i&&{dsn:BK(i)},...r&&{trace:Nw({...r})}}}function iSn(n,e,t){const i=[{type:"client_report"},{timestamp:t||$K(),discarded_events:n}];return f6(e?{dsn:e}:{},[i])}const rSn=60*1e3;function oSn(n,e=Date.now()){const t=parseInt(`${n}`,10);if(!isNaN(t))return t*1e3;const i=Date.parse(`${n}`);return isNaN(i)?rSn:i-e}function sSn(n,e){return n[e]||n.all||0}function aSn(n,e,t=Date.now()){return sSn(n,e)>t}function lSn(n,{statusCode:e,headers:t},i=Date.now()){const r={...n},o=t&&t["x-sentry-rate-limits"],s=t&&t["retry-after"];if(o)for(const a of o.trim().split(",")){const[l,c]=a.split(":",2),u=parseInt(l,10),d=(isNaN(u)?60:u)*1e3;if(!c)r.all=i+d;else for(const h of c.split(";"))r[h]=i+d}else s?r.all=i+oSn(s,i):e===429&&(r.all=i+60*1e3);return r}const Pbe="production";function Mbe(){return oQe("globalEventProcessors",()=>[])}function cSn(n){Mbe().push(n)}function NW(n,e,t,i=0){return new Mp((r,o)=>{const s=n[i];if(e===null||typeof s!="function")r(e);else{const a=s({...e},t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&s.id&&a===null&&On.log(`Event processor "${s.id}" dropped event`),Abe(a)?a.then(l=>NW(n,l,t,i+1).then(r)).then(null,o):NW(n,a,t,i+1).then(r).then(null,o)}})}function uSn(n){const e=qT(),t={sid:zh(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>hSn(t)};return n&&_A(t,n),t}function _A(n,e={}){if(e.user&&(!n.ipAddress&&e.user.ip_address&&(n.ipAddress=e.user.ip_address),!n.did&&!e.did&&(n.did=e.user.id||e.user.email||e.user.username)),n.timestamp=e.timestamp||qT(),e.abnormal_mechanism&&(n.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(n.ignoreDuration=e.ignoreDuration),e.sid&&(n.sid=e.sid.length===32?e.sid:zh()),e.init!==void 0&&(n.init=e.init),!n.did&&e.did&&(n.did=`${e.did}`),typeof e.started=="number"&&(n.started=e.started),n.ignoreDuration)n.duration=void 0;else if(typeof e.duration=="number")n.duration=e.duration;else{const t=n.timestamp-n.started;n.duration=t>=0?t:0}e.release&&(n.release=e.release),e.environment&&(n.environment=e.environment),!n.ipAddress&&e.ipAddress&&(n.ipAddress=e.ipAddress),!n.userAgent&&e.userAgent&&(n.userAgent=e.userAgent),typeof e.errors=="number"&&(n.errors=e.errors),e.status&&(n.status=e.status)}function dSn(n,e){let t={};e?t={status:e}:n.status==="ok"&&(t={status:"exited"}),_A(n,t)}function hSn(n){return Nw({sid:`${n.sid}`,init:n.init,started:new Date(n.started*1e3).toISOString(),timestamp:new Date(n.timestamp*1e3).toISOString(),status:n.status,errors:n.errors,did:typeof n.did=="number"||typeof n.did=="string"?`${n.did}`:void 0,duration:n.duration,abnormal_mechanism:n.abnormal_mechanism,attrs:{release:n.release,environment:n.environment,ip_address:n.ipAddress,user_agent:n.userAgent}})}const fSn=100;class fT{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=DNe()}static clone(e){const t=new fT;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata={...e._sdkProcessingMetadata},t._propagationContext={...e._propagationContext}),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&_A(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){const t=e(this);return t instanceof fT?t:this}return e instanceof fT?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):gA(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=DNe(),this}addBreadcrumb(e,t){const i=typeof t=="number"?t:fSn;if(i<=0)return this;const r={timestamp:$K(),...e},o=this._breadcrumbs;return o.push(r),this._breadcrumbs=o.length>i?o.slice(-i):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},i){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const s=this._span.transaction;if(s){e.sdkProcessingMetadata={dynamicSamplingContext:s.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const a=s.name;a&&(e.tags={transaction:a,...e.tags})}}this._applyFingerprint(e);const r=this._getBreadcrumbs(),o=[...e.breadcrumbs||[],...r];return e.breadcrumbs=o.length>0?o:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},NW([...i||[],...Mbe(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?dQe(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function DNe(){return{traceId:zh(),spanId:zh().substring(16)}}const bQe=4,pSn=100;class yQe{constructor(e,t=new fT,i=bQe){this._version=i,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=fT.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const i=this._lastEventId=t&&t.event_id?t.event_id:zh(),r=new Error("Sentry syntheticException");return this._withClient((o,s)=>{o.captureException(e,{originalException:e,syntheticException:r,...t,event_id:i},s)}),i}captureMessage(e,t,i){const r=this._lastEventId=i&&i.event_id?i.event_id:zh(),o=new Error(e);return this._withClient((s,a)=>{s.captureMessage(e,t,{originalException:e,syntheticException:o,...i,event_id:r},a)}),r}captureEvent(e,t){const i=t&&t.event_id?t.event_id:zh();return e.type||(this._lastEventId=i),this._withClient((r,o)=>{r.captureEvent(e,{...t,event_id:i},o)}),i}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:i,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=pSn}=r.getOptions&&r.getOptions()||{};if(s<=0)return;const l={timestamp:$K(),...e},c=o?sQe(()=>o(l,t)):l;c!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),i.addBreadcrumb(c,s))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:i}=this.getStackTop();i&&e(t)}run(e){const t=ANe(this);try{e(this)}finally{ANe(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const i=this._callExtensionMethod("startTransaction",e,t);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!i){const r=this.getClient();console.warn(r?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': Sentry.addTracingExtensions(); Sentry.init({...}); `:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return i}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,i=t.getSession();i&&dSn(i),this._sendSessionUpdate(),t.setSession()}startSession(e){const{scope:t,client:i}=this.getStackTop(),{release:r,environment:o=Pbe}=i&&i.getOptions()||{},{userAgent:s}=vu.navigator||{},a=uSn({release:r,environment:o,user:t.getUser(),...s&&{userAgent:s},...e}),l=t.getSession&&t.getSession();return l&&l.status==="ok"&&_A(l,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),i=e.getSession();i&&t&&t.captureSession&&t.captureSession(i)}_withClient(e){const{scope:t,client:i}=this.getStackTop();i&&e(i,t)}_callExtensionMethod(e,...t){const r=p6().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function p6(){return vu.__SENTRY__=vu.__SENTRY__||{extensions:{},hub:void 0},vu}function ANe(n){const e=p6(),t=Kae(e);return CQe(e,n),t}function sc(){const n=p6();if(n.__SENTRY__&&n.__SENTRY__.acs){const e=n.__SENTRY__.acs.getCurrentHub();if(e)return e}return gSn(n)}function gSn(n=p6()){return(!mSn(n)||Kae(n).isOlderThan(bQe))&&CQe(n,new yQe),Kae(n)}function mSn(n){return!!(n&&n.__SENTRY__&&n.__SENTRY__.hub)}function Kae(n){return oQe("hub",()=>new yQe,n)}function CQe(n,e){if(!n)return!1;const t=n.__SENTRY__=n.__SENTRY__||{};return t.hub=e,!0}function g6(n){return(n||sc()).getScope().getTransaction()}let NNe=!1;function _Sn(){NNe||(NNe=!0,Vp("error",Gae),Vp("unhandledrejection",Gae))}function Gae(){const n=g6();if(n){const e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Transaction: ${e} -> Global error occured`),n.setStatus(e)}}Gae.tag="sentry_tracingErrorCallback";class wQe{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class Fbe{constructor(e={}){this.traceId=e.traceId||zh(),this.spanId=e.spanId||zh().substring(16),this.startTimestamp=e.startTimestamp||qT(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){const t=new Fbe({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.transaction){const i=e&&e.op||"< unknown op >",r=t.transaction.name||"< unknown name >",o=t.transaction.spanId,s=`[Tracing] Starting '${i}' span on transaction '${r}' (${o}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:s},On.log(s)}return t}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);const t=vSn(e);return t!=="unknown_error"&&this.setStatus(t),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&On.log(t.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:qT()}toTraceparent(){return Obe(this.traceId,this.spanId,this.sampled)}toContext(){return Nw({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return Nw({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return Nw({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}}function vSn(n){if(n<400&&n>=100)return"ok";if(n>=400&&n<500)switch(n){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(n>=500&&n<600)switch(n){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function VK(n,e,t){const i=e.getOptions(),{publicKey:r}=e.getDsn()||{},{segment:o}=t&&t.getUser()||{},s=Nw({environment:i.environment||Pbe,release:i.release,user_segment:o,public_key:r,trace_id:n});return e.emit&&e.emit("createDsc",s),s}class SQe extends Fbe{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||sc(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;const i=this.metadata.dynamicSamplingContext;i&&(this._frozenDynamicSamplingContext={...i})}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new wQe(e)),this.spanRecorder.add(this)}setContext(e,t){t===null?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,i=""){this._measurements[e]={value:t,unit:i}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){const t=this._finishTransaction(e);if(t)return this._hub.captureEvent(t)}toContext(){const e=super.toContext();return Nw({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const e=this._hub||sc(),t=e.getClient();if(!t)return{};const i=e.getScope(),r=VK(this.traceId,t,i),o=this.metadata.sampleRate;o!==void 0&&(r.sample_rate=`${o}`);const s=this.metadata.source;return s&&s!=="url"&&(r.transaction=this.name),this.sampled!==void 0&&(r.sampled=String(this.sampled)),r}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);const t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","transaction");return}const i=this.spanRecorder?this.spanRecorder.spans.filter(a=>a!==this&&a.endTimestamp):[];this._trimEnd&&i.length>0&&(this.endTimestamp=i.reduce((a,l)=>a.endTimestamp&&l.endTimestamp?a.endTimestamp>l.endTimestamp?a:l:a).endTimestamp);const r=this.metadata,o={contexts:{...this._contexts,trace:this.getTraceContext()},spans:i,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),o.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),o}}const P$={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},bSn="finishReason",YI=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class ySn extends wQe{constructor(e,t,i,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=i}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp=typeof t=="number"?t:qT(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}}class CSn extends SQe{constructor(e,t,i=P$.idleTimeout,r=P$.finalTimeout,o=P$.heartbeatInterval,s=!1){super(e,t),this._idleHub=t,this._idleTimeout=i,this._finalTimeout=r,this._heartbeatInterval=o,this._onScope=s,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=YI[4],s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=YI[3],this.finish())},this._finalTimeout)}finish(e=qT()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(bSn,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(const t of this._beforeFinishCallbacks)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(t=>{if(t.spanId===this.spanId)return!0;t.endTimestamp||(t.endTimestamp=e,t.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));const i=t.startTimestamp<e,r=(this._finalTimeout+this._idleTimeout)/1e3,o=t.endTimestamp-this.startTimestamp<r;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=JSON.stringify(t,void 0,2);i?o||On.log("[Tracing] discarding Span since it finished after Transaction final timeout",s):On.log("[Tracing] discarding Span since it happened after Transaction was finished",s)}return i&&o}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] No active IdleTransaction");if(this._onScope){const t=this._idleHub.getScope();t.getTransaction()===this&&t.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const t=r=>{this._finished||this._pushActivity(r)},i=r=>{this._finished||this._popActivity(r)};this.spanRecorder=new ySn(t,i,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=t===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=YI[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=YI[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const t=qT();this._idleTimeoutCanceledPermanently?(this._finishReason=YI[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=YI[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function Bbe(n){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=sc().getClient(),t=n||e&&e.getOptions();return!!t&&(t.enableTracing||"tracesSampleRate"in t||"tracesSampler"in t)}function EQe(n,e,t){if(!Bbe(e))return n.sampled=!1,n;if(n.sampled!==void 0)return n.setMetadata({sampleRate:Number(n.sampled)}),n;let i;return typeof e.tracesSampler=="function"?(i=e.tracesSampler(t),n.setMetadata({sampleRate:Number(i)})):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"?(i=e.tracesSampleRate,n.setMetadata({sampleRate:Number(i)})):(i=1,n.setMetadata({sampleRate:i})),wSn(i)?i?(n.sampled=Math.random()<i,n.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] starting ${n.op} transaction - ${n.name}`),n):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),n)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),n.sampled=!1,n):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("[Tracing] Discarding transaction because of invalid sample rate."),n.sampled=!1,n)}function wSn(n){return iQe(n)||!(typeof n=="number"||typeof n=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(n)} of type ${JSON.stringify(typeof n)}.`),!1):n<0||n>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${n}.`),!1):!0}function SSn(){const e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function ESn(n,e){const t=this.getClient(),i=t&&t.getOptions()||{},r=i.instrumenter||"sentry",o=n.instrumenter||"sentry";r!==o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.error(`A transaction was started with instrumenter=\`${o}\`, but the SDK is configured with the \`${r}\` instrumenter. The transaction will not be sampled. Please use the ${r} instrumentation to start transactions.`),n.sampled=!1);let s=new SQe(n,this);return s=EQe(s,i,{parentSampled:n.parentSampled,transactionContext:n,...e}),s.sampled&&s.initSpanRecorder(i._experiments&&i._experiments.maxSpans),t&&t.emit&&t.emit("startTransaction",s),s}function RNe(n,e,t,i,r,o,s){const a=n.getClient(),l=a&&a.getOptions()||{};let c=new CSn(e,n,t,i,s,r);return c=EQe(c,l,{parentSampled:e.parentSampled,transactionContext:e,...o}),c.sampled&&c.initSpanRecorder(l._experiments&&l._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",c),c}function xSn(){const n=p6();n.__SENTRY__&&(n.__SENTRY__.extensions=n.__SENTRY__.extensions||{},n.__SENTRY__.extensions.startTransaction||(n.__SENTRY__.extensions.startTransaction=ESn),n.__SENTRY__.extensions.traceHeaders||(n.__SENTRY__.extensions.traceHeaders=SSn),_Sn())}function TSn(n,e){return sc().captureException(n,{captureContext:e})}function kSn(n){sc().withScope(n)}const ISn="7";function LSn(n){const e=n.protocol?`${n.protocol}:`:"",t=n.port?`:${n.port}`:"";return`${e}//${n.host}${t}${n.path?`/${n.path}`:""}/api/`}function DSn(n){return`${LSn(n)}${n.projectId}/envelope/`}function ASn(n,e){return dwn({sentry_key:n.publicKey,sentry_version:ISn,...e&&{sentry_client:`${e.name}/${e.version}`}})}function NSn(n,e={}){const t=typeof e=="string"?e:e.tunnel,i=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return t||`${DSn(n)}?${ASn(n,i)}`}function RSn(n,e){return e&&(n.sdk=n.sdk||{},n.sdk.name=n.sdk.name||e.name,n.sdk.version=n.sdk.version||e.version,n.sdk.integrations=[...n.sdk.integrations||[],...e.integrations||[]],n.sdk.packages=[...n.sdk.packages||[],...e.packages||[]]),n}function OSn(n,e,t,i){const r=vQe(t),o={sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&e&&{dsn:BK(e)}},s="aggregates"in n?[{type:"sessions"},n]:[{type:"session"},n.toJSON()];return f6(o,[s])}function PSn(n,e,t,i){const r=vQe(t),o=n.type&&n.type!=="replay_event"?n.type:"event";RSn(n,t&&t.sdk);const s=nSn(n,r,i,e);return delete n.sdkProcessingMetadata,f6(s,[[{type:o},n]])}const ONe=[];function MSn(n){const e={};return n.forEach(t=>{const{name:i}=t,r=e[i];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[i]=t)}),Object.keys(e).map(t=>e[t])}function FSn(n){const e=n.defaultIntegrations||[],t=n.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let i;Array.isArray(t)?i=[...e,...t]:typeof t=="function"?i=dQe(t(e)):i=e;const r=MSn(i),o=$Sn(r,s=>s.name==="Debug");if(o!==-1){const[s]=r.splice(o,1);r.push(s)}return r}function BSn(n,e){const t={};return e.forEach(i=>{i&&xQe(n,i,t)}),t}function xQe(n,e,t){if(t[e.name]=e,ONe.indexOf(e.name)===-1&&(e.setupOnce(cSn,sc),ONe.push(e.name)),n.on&&typeof e.preprocessEvent=="function"){const i=e.preprocessEvent.bind(e);n.on("preprocessEvent",(r,o)=>i(r,o,n))}if(n.addEventProcessor&&typeof e.processEvent=="function"){const i=e.processEvent.bind(e),r=Object.assign((o,s)=>i(o,s,n),{id:e.name});n.addEventProcessor(r)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`Integration installed: ${e.name}`)}function $Sn(n,e){for(let t=0;t<n.length;t++)if(e(n[t])===!0)return t;return-1}function VSn(n,e,t,i,r){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=n,a={...e,event_id:e.event_id||t.event_id||zh(),timestamp:e.timestamp||$K()},l=t.integrations||n.integrations.map(h=>h.name);HSn(a,n),USn(a,l),e.type===void 0&&WSn(a,n.stackParser);let c=i;t.captureContext&&(c=fT.clone(c).update(t.captureContext));let u=jT(a);const d=r&&r.getEventProcessors?r.getEventProcessors():[];if(c){if(c.getAttachments){const h=[...t.attachments||[],...c.getAttachments()];h.length&&(t.attachments=h)}u=c.applyToEvent(a,t,d)}else u=NW([...d,...Mbe()],a,t);return u.then(h=>(h&&zSn(h),typeof o=="number"&&o>0?jSn(h,o,s):h))}function HSn(n,e){const{environment:t,release:i,dist:r,maxValueLength:o=250}=e;"environment"in n||(n.environment="environment"in e?t:Pbe),n.release===void 0&&i!==void 0&&(n.release=i),n.dist===void 0&&r!==void 0&&(n.dist=r),n.message&&(n.message=GL(n.message,o));const s=n.exception&&n.exception.values&&n.exception.values[0];s&&s.value&&(s.value=GL(s.value,o));const a=n.request;a&&a.url&&(a.url=GL(a.url,o))}const PNe=new WeakMap;function WSn(n,e){const t=vu._sentryDebugIds;if(!t)return;let i;const r=PNe.get(e);r?i=r:(i=new Map,PNe.set(e,i));const o=Object.keys(t).reduce((s,a)=>{let l;const c=i.get(a);c?l=c:(l=e(a),i.set(a,l));for(let u=l.length-1;u>=0;u--){const d=l[u];if(d.filename){s[d.filename]=t[a];break}}return s},{});try{n.exception.values.forEach(s=>{s.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=o[a.filename])})})}catch{}}function zSn(n){const e={};try{n.exception.values.forEach(i=>{i.stacktrace.frames.forEach(r=>{r.debug_id&&(r.abs_path?e[r.abs_path]=r.debug_id:r.filename&&(e[r.filename]=r.debug_id),delete r.debug_id)})})}catch{}if(Object.keys(e).length===0)return;n.debug_meta=n.debug_meta||{},n.debug_meta.images=n.debug_meta.images||[];const t=n.debug_meta.images;Object.keys(e).forEach(i=>{t.push({type:"sourcemap",code_file:i,debug_id:e[i]})})}function USn(n,e){e.length>0&&(n.sdk=n.sdk||{},n.sdk.integrations=[...n.sdk.integrations||[],...e])}function jSn(n,e,t){if(!n)return null;const i={...n,...n.breadcrumbs&&{breadcrumbs:n.breadcrumbs.map(r=>({...r,...r.data&&{data:IC(r.data,e,t)}}))},...n.user&&{user:IC(n.user,e,t)},...n.contexts&&{contexts:IC(n.contexts,e,t)},...n.extra&&{extra:IC(n.extra,e,t)}};return n.contexts&&n.contexts.trace&&i.contexts&&(i.contexts.trace=n.contexts.trace,n.contexts.trace.data&&(i.contexts.trace.data=IC(n.contexts.trace.data,e,t))),n.spans&&(i.spans=n.spans.map(r=>(r.data&&(r.data=IC(r.data,e,t)),r))),i}const MNe="Not capturing exception because it's already been captured.";class qSn{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=uwn(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("No DSN provided, client will not send events."),this._dsn){const t=NSn(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,i){if(bNe(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(MNe);return}let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(o=>this._captureEvent(o,t,i)).then(o=>{r=o})),r}captureMessage(e,t,i,r){let o=i&&i.event_id;const s=nQe(e)?this.eventFromMessage(String(e),t,i):this.eventFromException(e,i);return this._process(s.then(a=>this._captureEvent(a,i,r)).then(a=>{o=a})),o}captureEvent(e,t,i){if(t&&t.originalException&&bNe(t.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(MNe);return}let r=t&&t.event_id;return this._process(this._captureEvent(e,t,i).then(o=>{r=o})),r}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),_A(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then(i=>t.flush(e).then(r=>i&&r)):jT(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=BSn(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){xQe(this,e,this._integrations)}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let i=PSn(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of t.attachments||[])i=Xwn(i,eSn(o,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(i);r&&r.then(o=>this.emit("afterSendEvent",e,o),null)}sendSession(e){const t=OSn(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,i){if(this._options.sendClientReports){const r=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(i=>i(...t))}_updateSessionFromEvent(e,t){let i=!1,r=!1;const o=t.exception&&t.exception.values;if(o){r=!0;for(const l of o){const c=l.mechanism;if(c&&c.handled===!1){i=!0;break}}}const s=e.status==="ok";(s&&e.errors===0||s&&i)&&(_A(e,{...i&&{status:"crashed"},errors:e.errors||Number(r||i)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Mp(t=>{let i=0;const r=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),t(!0)):(i+=r,e&&i>=e&&(clearInterval(o),t(!1)))},r)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,i){const r=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),VSn(r,e,t,i,this).then(s=>{if(s===null)return s;const{propagationContext:a}=s.sdkProcessingMetadata||{};if(!(s.contexts&&s.contexts.trace)&&a){const{traceId:c,spanId:u,parentSpanId:d,dsc:h}=a;s.contexts={trace:{trace_id:c,span_id:u,parent_span_id:d},...s.contexts};const f=h||VK(c,this,i);s.sdkProcessingMetadata={dynamicSamplingContext:f,...s.sdkProcessingMetadata}}return s})}_captureEvent(e,t={},i){return this._processEvent(e,t,i).then(r=>r.event_id,r=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const o=r;o.logLevel==="log"?On.log(o.message):On.warn(o)}})}_processEvent(e,t,i){const r=this.getOptions(),{sampleRate:o}=r,s=kQe(e),a=TQe(e),l=e.type||"error",c=`before send for type \`${l}\``;if(a&&typeof o=="number"&&Math.random()>o)return this.recordDroppedEvent("sample_rate","error",e),Rbe(new gb(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const u=l==="replay_event"?"replay":l;return this._prepareEvent(e,t,i).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",u,e),new gb("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return d;const f=GSn(r,d,t);return KSn(f,c)}).then(d=>{if(d===null)throw this.recordDroppedEvent("before_send",u,e),new gb(`${c} returned \`null\`, will not send event.`,"log");const h=i&&i.getSession();!s&&h&&this._updateSessionFromEvent(h,d);const f=d.transaction_info;if(s&&f&&d.transaction!==e.transaction){const g="custom";d.transaction_info={...f,source:g}}return this.sendEvent(d,t),d}).then(null,d=>{throw d instanceof gb?d:(this.captureException(d,{data:{__sentry__:!0},originalException:d}),new gb(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${d}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,t=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.error("Error while sending event:",t)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[i,r]=t.split(":");return{reason:i,category:r,quantity:e[t]}})}}function KSn(n,e){const t=`${e} must return \`null\` or a valid event.`;if(Abe(n))return n.then(i=>{if(!gA(i)&&i!==null)throw new gb(t);return i},i=>{throw new gb(`${e} rejected with ${i}`)});if(!gA(n)&&n!==null)throw new gb(t);return n}function GSn(n,e,t){const{beforeSend:i,beforeSendTransaction:r}=n;return TQe(e)&&i?i(e,t):kQe(e)&&r?r(e,t):e}function TQe(n){return n.type===void 0}function kQe(n){return n.type==="transaction"}function YSn(n,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?On.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const t=sc();t.getScope().update(e.initialScope);const r=new n(e);t.bindClient(r)}const QSn=30;function IQe(n,e,t=$wn(n.bufferSize||QSn)){let i={};const r=s=>t.drain(s);function o(s){const a=[];if(INe(s,(d,h)=>{const f=LNe(h);if(aSn(i,f)){const g=FNe(d,h);n.recordDroppedEvent("ratelimit_backoff",f,g)}else a.push(d)}),a.length===0)return jT();const l=f6(s[0],a),c=d=>{INe(l,(h,f)=>{const g=FNe(h,f);n.recordDroppedEvent(d,LNe(f),g)})},u=()=>e({body:Zwn(l,n.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),i=lSn(i,d),d),d=>{throw c("network_error"),d});return t.add(u).then(d=>d,d=>{if(d instanceof gb)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.error("Skipped sending event because buffer is full."),c("queue_overflow"),jT();throw d})}return o.__sentry__baseTransport__=!0,{send:o,flush:r}}function FNe(n,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(n)?n[1]:void 0}const RW="7.77.0";let BNe;class HK{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=HK.id}setupOnce(){BNe=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Nbe(this)||this;return BNe.apply(t,e)}}catch{}}}HK.__initStatic();const XSn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ZSn=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/];class WK{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=WK.id,this._options=e}setupOnce(e,t){}processEvent(e,t,i){const r=i.getOptions(),o=JSn(this._options,r);return eEn(e,o)?null:e}}WK.__initStatic();function JSn(n={},e={}){return{allowUrls:[...n.allowUrls||[],...e.allowUrls||[]],denyUrls:[...n.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...n.ignoreErrors||[],...e.ignoreErrors||[],...n.disableErrorDefaults?[]:XSn],ignoreTransactions:[...n.ignoreTransactions||[],...e.ignoreTransactions||[],...n.disableTransactionDefaults?[]:ZSn],ignoreInternal:n.ignoreInternal!==void 0?n.ignoreInternal:!0}}function eEn(n,e){return e.ignoreInternal&&sEn(n)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Event dropped due to being internal Sentry Error. Event: ${FC(n)}`),!0):tEn(n,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${FC(n)}`),!0):nEn(n,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${FC(n)}`),!0):iEn(n,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${FC(n)}. Url: ${OW(n)}`),!0):rEn(n,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${FC(n)}. Url: ${OW(n)}`),!0)}function tEn(n,e){return n.type||!e||!e.length?!1:oEn(n).some(t=>d6(t,e))}function nEn(n,e){if(n.type!=="transaction"||!e||!e.length)return!1;const t=n.transaction;return t?d6(t,e):!1}function iEn(n,e){if(!e||!e.length)return!1;const t=OW(n);return t?d6(t,e):!1}function rEn(n,e){if(!e||!e.length)return!0;const t=OW(n);return t?d6(t,e):!0}function oEn(n){const e=[];n.message&&e.push(n.message);let t;try{t=n.exception.values[n.exception.values.length-1]}catch{}return t&&t.value&&(e.push(t.value),t.type&&e.push(`${t.type}: ${t.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.length===0&&On.error(`Could not extract message for event ${FC(n)}`),e}function sEn(n){try{return n.exception.values[0].type==="SentryError"}catch{}return!1}function aEn(n=[]){for(let e=n.length-1;e>=0;e--){const t=n[e];if(t&&t.filename!=="<anonymous>"&&t.filename!=="[native code]")return t.filename||null}return null}function OW(n){try{let e;try{e=n.exception.values[0].stacktrace.frames}catch{}return e?aEn(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.error(`Cannot extract url for event ${FC(n)}`),null}}const Oa=vu;let Yae=0;function LQe(){return Yae>0}function lEn(){Yae++,setTimeout(()=>{Yae--})}function vA(n,e={},t){if(typeof n!="function")return n;try{const r=n.__sentry_wrapped__;if(r)return r;if(Nbe(n))return n}catch{return n}const i=function(){const r=Array.prototype.slice.call(arguments);try{t&&typeof t=="function"&&t.apply(this,arguments);const o=r.map(s=>vA(s,e));return n.apply(this,o)}catch(o){throw lEn(),kSn(s=>{s.addEventProcessor(a=>(e.mechanism&&(Mae(a,void 0,void 0),h3(a,e.mechanism)),a.extra={...a.extra,arguments:r},a)),TSn(o)}),o}};try{for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}catch{}lQe(i,n),d3(n,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get(){return n.name}})}catch{}return i}function DQe(n,e){const t=$be(n,e),i={type:e&&e.name,value:hEn(e)};return t.length&&(i.stacktrace={frames:t}),i.type===void 0&&i.value===""&&(i.value="Unrecoverable error caught"),i}function cEn(n,e,t,i){const o=sc().getClient(),s=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:FK(e)?e.constructor.name:i?"UnhandledRejection":"Error",value:gEn(e,{isUnhandledRejection:i})}]},extra:{__serialized__:gQe(e,s)}};if(t){const l=$be(n,t);l.length&&(a.exception.values[0].stacktrace={frames:l})}return a}function xee(n,e){return{exception:{values:[DQe(n,e)]}}}function $be(n,e){const t=e.stacktrace||e.stack||"",i=dEn(e);try{return n(t,i)}catch{}return[]}const uEn=/Minified React error #\d+;/i;function dEn(n){if(n){if(typeof n.framesToPop=="number")return n.framesToPop;if(uEn.test(n.message))return 1}return 0}function hEn(n){const e=n&&n.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function fEn(n,e,t,i){const r=t&&t.syntheticException||void 0,o=Vbe(n,e,r,i);return h3(o),o.level="error",t&&t.event_id&&(o.event_id=t.event_id),jT(o)}function pEn(n,e,t="info",i,r){const o=i&&i.syntheticException||void 0,s=Qae(n,e,o,r);return s.level=t,i&&i.event_id&&(s.event_id=i.event_id),jT(s)}function Vbe(n,e,t,i,r){let o;if(Dbe(e)&&e.error)return xee(n,e.error);if(fNe(e)||KCn(e)){const s=e;if("stack"in e)o=xee(n,e);else{const a=s.name||(fNe(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;o=Qae(n,l,t,i),Mae(o,l)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}return tQe(e)?xee(n,e):gA(e)||FK(e)?(o=cEn(n,e,t,r),h3(o,{synthetic:!0}),o):(o=Qae(n,e,t,i),Mae(o,`${e}`,void 0),h3(o,{synthetic:!0}),o)}function Qae(n,e,t,i){const r={message:e};if(i&&t){const o=$be(n,t);o.length&&(r.exception={values:[{value:e,stacktrace:{frames:o}}]})}return r}function gEn(n,{isUnhandledRejection:e}){const t=hwn(n),i=e?"promise rejection":"exception";return Dbe(n)?`Event \`ErrorEvent\` captured as ${i} with message \`${n.message}\``:FK(n)?`Event \`${mEn(n)}\` (type=${n.type}) captured as ${i}`:`Object captured as ${i} with keys: ${t}`}function mEn(n){try{const e=Object.getPrototypeOf(n);return e?e.constructor.name:void 0}catch{}}function _En(n,{metadata:e,tunnel:t,dsn:i}){const r={event_id:n.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!t&&!!i&&{dsn:BK(i)}},o=vEn(n);return f6(r,[o])}function vEn(n){return[{type:"user_report"},n]}class bEn extends qSn{constructor(e){const t=Oa.SENTRY_SDK_SOURCE||Awn();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:RW}],version:RW},super(e),e.sendClientReports&&Oa.document&&Oa.document.addEventListener("visibilitychange",()=>{Oa.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return fEn(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",i){return pEn(this._options.stackParser,e,t,i,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("SDK not enabled, will not capture user feedback.");return}const t=_En(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,i){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,i)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("Sending outcomes:",e);const t=iSn(e,this._options.tunnel&&BK(this._dsn));this._sendEnvelope(t)}}let dP;function yEn(){if(dP)return dP;if(Bae(Oa.fetch))return dP=Oa.fetch.bind(Oa);const n=Oa.document;let e=Oa.fetch;if(n&&typeof n.createElement=="function")try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const i=t.contentWindow;i&&i.fetch&&(e=i.fetch),n.head.removeChild(t)}catch(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return dP=e.bind(Oa)}function CEn(){dP=void 0}function wEn(n,e=yEn()){let t=0,i=0;function r(o){const s=o.body.length;t+=s,i++;const a={body:o.body,method:"POST",referrerPolicy:"origin",headers:n.headers,keepalive:t<=6e4&&i<15,...n.fetchOptions};try{return e(n.url,a).then(l=>(t-=s,i--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return CEn(),t-=s,i--,Rbe(l)}}return IQe(n,r)}const SEn=4;function EEn(n){function e(t){return new Mp((i,r)=>{const o=new XMLHttpRequest;o.onerror=r,o.onreadystatechange=()=>{o.readyState===SEn&&i({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",n.url);for(const s in n.headers)Object.prototype.hasOwnProperty.call(n.headers,s)&&o.setRequestHeader(s,n.headers[s]);o.send(t.body)})}return IQe(n,e)}const zK="?",xEn=30,TEn=40,kEn=50;function Hbe(n,e,t,i){const r={filename:n,function:e,in_app:!0};return t!==void 0&&(r.lineno=t),i!==void 0&&(r.colno=i),r}const IEn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,LEn=/\((\S*)(?::(\d+))(?::(\d+))\)/,DEn=n=>{const e=IEn.exec(n);if(e){if(e[2]&&e[2].indexOf("eval")===0){const o=LEn.exec(e[2]);o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3])}const[i,r]=AQe(e[1]||zK,e[2]);return Hbe(r,i,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},AEn=[xEn,DEn],NEn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,REn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,OEn=n=>{const e=NEn.exec(n);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=REn.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let i=e[3],r=e[1]||zK;return[r,i]=AQe(r,i),Hbe(i,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},PEn=[kEn,OEn],MEn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,FEn=n=>{const e=MEn.exec(n);return e?Hbe(e[2],e[1]||zK,+e[3],e[4]?+e[4]:void 0):void 0},BEn=[TEn,FEn],$En=[AEn,PEn,BEn],VEn=fQe(...$En),AQe=(n,e)=>{const t=n.indexOf("safari-extension")!==-1,i=n.indexOf("safari-web-extension")!==-1;return t||i?[n.indexOf("@")!==-1?n.split("@")[0]:zK,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[n,e]};class ZN{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=ZN.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:HEn,onunhandledrejection:WEn}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const t in e){const i=this._installFunc[t];i&&e[t]&&(jEn(t),i(),this._installFunc[t]=void 0)}}}ZN.__initStatic();function HEn(){Vp("error",n=>{const[e,t,i]=OQe();if(!e.getIntegration(ZN))return;const{msg:r,url:o,line:s,column:a,error:l}=n;if(LQe()||l&&l.__sentry_own_request__)return;const c=l===void 0&&hS(r)?UEn(r,o,s,a):NQe(Vbe(t,l||r,void 0,i,!1),o,s,a);c.level="error",RQe(e,l,c,"onerror")})}function WEn(){Vp("unhandledrejection",n=>{const[e,t,i]=OQe();if(!e.getIntegration(ZN))return;let r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch{}if(LQe()||r&&r.__sentry_own_request__)return!0;const o=nQe(r)?zEn(r):Vbe(t,r,void 0,i,!0);o.level="error",RQe(e,r,o,"onunhandledrejection")})}function zEn(n){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`}]}}}function UEn(n,e,t,i){const r=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Dbe(n)?n.message:n,s="Error";const a=o.match(r);return a&&(s=a[1],o=a[2]),NQe({exception:{values:[{type:s,value:o}]}},e,t,i)}function NQe(n,e,t,i){const r=n.exception=n.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[],c=isNaN(parseInt(i,10))?void 0:i,u=isNaN(parseInt(t,10))?void 0:t,d=hS(e)&&e.length>0?e:nwn();return l.length===0&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),n}function jEn(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`Global Handler attached: ${n}`)}function RQe(n,e,t,i){h3(t,{handled:!1,type:i}),n.captureEvent(t,{originalException:e})}function OQe(){const n=sc(),e=n.getClient(),t=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[n,t.stackParser,t.attachStacktrace]}const qEn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class UK{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=UK.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&Td(Oa,"setTimeout",$Ne),this._options.setInterval&&Td(Oa,"setInterval",$Ne),this._options.requestAnimationFrame&&Td(Oa,"requestAnimationFrame",KEn),this._options.XMLHttpRequest&&"XMLHttpRequest"in Oa&&Td(XMLHttpRequest.prototype,"send",GEn);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:qEn).forEach(YEn)}}UK.__initStatic();function $Ne(n){return function(...e){const t=e[0];return e[0]=vA(t,{mechanism:{data:{function:b1(n)},handled:!1,type:"instrument"}}),n.apply(this,e)}}function KEn(n){return function(e){return n.apply(this,[vA(e,{mechanism:{data:{function:"requestAnimationFrame",handler:b1(n)},handled:!1,type:"instrument"}})])}}function GEn(n){return function(...e){const t=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in t&&typeof t[r]=="function"&&Td(t,r,function(o){const s={mechanism:{data:{function:r,handler:b1(o)},handled:!1,type:"instrument"}},a=Nbe(o);return a&&(s.mechanism.data.handler=b1(a)),vA(o,s)})}),n.apply(this,e)}}function YEn(n){const e=Oa,t=e[n]&&e[n].prototype;!t||!t.hasOwnProperty||!t.hasOwnProperty("addEventListener")||(Td(t,"addEventListener",function(i){return function(r,o,s){try{typeof o.handleEvent=="function"&&(o.handleEvent=vA(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:b1(o),target:n},handled:!1,type:"instrument"}}))}catch{}return i.apply(this,[r,vA(o,{mechanism:{data:{function:"addEventListener",handler:b1(o),target:n},handled:!1,type:"instrument"}}),s])}}),Td(t,"removeEventListener",function(i){return function(r,o,s){const a=o;try{const l=a&&a.__sentry_wrapped__;l&&i.call(this,r,l,s)}catch{}return i.call(this,r,a,s)}}))}const b9=1024;class jK{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=jK.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&Vp("console",ZEn),this.options.dom&&Vp("dom",XEn(this.options.dom)),this.options.xhr&&Vp("xhr",JEn),this.options.fetch&&Vp("fetch",exn),this.options.history&&Vp("history",txn),this.options.sentry){const e=sc().getClient();e&&e.on&&e.on("beforeSendEvent",QEn)}}}jK.__initStatic();function QEn(n){sc().addBreadcrumb({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:FC(n)},{event:n})}function XEn(n){function e(t){let i,r=typeof n=="object"?n.serializeAttribute:void 0,o=typeof n=="object"&&typeof n.maxStringLength=="number"?n.maxStringLength:void 0;o&&o>b9&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`\`dom.maxStringLength\` cannot exceed ${b9}, but a value of ${o} was configured. Sentry will use ${b9} instead.`),o=b9),typeof r=="string"&&(r=[r]);try{const s=t.event;i=nxn(s)?mA(s.target,{keyAttrs:r,maxStringLength:o}):mA(s,{keyAttrs:r,maxStringLength:o})}catch{i="<unknown>"}i.length!==0&&sc().addBreadcrumb({category:`ui.${t.name}`,message:i},{event:t.event,name:t.name,global:t.global})}return e}function ZEn(n){const e={category:"console",data:{arguments:n.args,logger:"console"},level:Hwn(n.level),message:pNe(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)e.message=`Assertion failed: ${pNe(n.args.slice(1)," ")||"console.assert"}`,e.data.arguments=n.args.slice(1);else return;sc().addBreadcrumb(e,{input:n.args,level:n.level})}function JEn(n){const{startTimestamp:e,endTimestamp:t}=n,i=n.xhr[eL];if(!e||!t||!i)return;const{method:r,url:o,status_code:s,body:a}=i,l={method:r,url:o,status_code:s},c={xhr:n.xhr,input:a,startTimestamp:e,endTimestamp:t};sc().addBreadcrumb({category:"xhr",data:l,type:"http"},c)}function exn(n){const{startTimestamp:e,endTimestamp:t}=n;if(t&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,r={data:n.error,input:n.args,startTimestamp:e,endTimestamp:t};sc().addBreadcrumb({category:"fetch",data:i,level:"error",type:"http"},r)}else{const i={...n.fetchData,status_code:n.response&&n.response.status},r={input:n.args,response:n.response,startTimestamp:e,endTimestamp:t};sc().addBreadcrumb({category:"fetch",data:i,type:"http"},r)}}function txn(n){let e=n.from,t=n.to;const i=See(Oa.location.href);let r=See(e);const o=See(t);r.path||(r=i),i.protocol===o.protocol&&i.host===o.host&&(t=o.relative),i.protocol===r.protocol&&i.host===r.host&&(e=r.relative),sc().addBreadcrumb({category:"navigation",data:{from:e,to:t}})}function nxn(n){return!!n&&!!n.target}const ixn="cause",rxn=5;class qK{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=qK.id,this._key=e.key||ixn,this._limit=e.limit||rxn}setupOnce(){}preprocessEvent(e,t,i){const r=i.getOptions();ZCn(DQe,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}}qK.__initStatic();class KK{static __initStatic(){this.id="HttpContext"}constructor(){this.name=KK.id}setupOnce(){}preprocessEvent(e){if(!Oa.navigator&&!Oa.location&&!Oa.document)return;const t=e.request&&e.request.url||Oa.location&&Oa.location.href,{referrer:i}=Oa.document||{},{userAgent:r}=Oa.navigator||{},o={...e.request&&e.request.headers,...i&&{Referer:i},...r&&{"User-Agent":r}},s={...e.request,...t&&{url:t},headers:o};e.request=s}}KK.__initStatic();class GK{static __initStatic(){this.id="Dedupe"}constructor(){this.name=GK.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(oxn(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}}GK.__initStatic();function oxn(n,e){return e?!!(sxn(n,e)||axn(n,e)):!1}function sxn(n,e){const t=n.message,i=e.message;return!(!t&&!i||t&&!i||!t&&i||t!==i||!MQe(n,e)||!PQe(n,e))}function axn(n,e){const t=VNe(e),i=VNe(n);return!(!t||!i||t.type!==i.type||t.value!==i.value||!MQe(n,e)||!PQe(n,e))}function PQe(n,e){let t=HNe(n),i=HNe(e);if(!t&&!i)return!0;if(t&&!i||!t&&i||(t=t,i=i,i.length!==t.length))return!1;for(let r=0;r<i.length;r++){const o=i[r],s=t[r];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function MQe(n,e){let t=n.fingerprint,i=e.fingerprint;if(!t&&!i)return!0;if(t&&!i||!t&&i)return!1;t=t,i=i;try{return t.join("")===i.join("")}catch{return!1}}function VNe(n){return n.exception&&n.exception.values&&n.exception.values[0]}function HNe(n){const e=n.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const lxn=[new WK,new HK,new UK,new jK,new ZN,new qK,new GK,new KK];function cxn(n={}){n.defaultIntegrations===void 0&&(n.defaultIntegrations=lxn),n.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(n.release=__SENTRY_RELEASE__),Oa.SENTRY_RELEASE&&Oa.SENTRY_RELEASE.id&&(n.release=Oa.SENTRY_RELEASE.id)),n.autoSessionTracking===void 0&&(n.autoSessionTracking=!0),n.sendClientReports===void 0&&(n.sendClientReports=!0);const e={...n,stackParser:fwn(n.stackParser||VEn),integrations:FSn(n),transport:n.transport||(pQe()?wEn:EEn)};YSn(bEn,e),n.autoSessionTracking&&uxn()}function WNe(n){n.startSession({ignoreDuration:!0}),n.captureSession()}function uxn(){if(typeof Oa.document>"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const n=sc();n.captureSession&&(WNe(n),Vp("history",({from:e,to:t})=>{e===void 0||e===t||WNe(sc())}))}const Ba=vu;function dxn(){Ba&&Ba.document?Ba.document.addEventListener("visibilitychange",()=>{const n=g6();if(Ba.document.hidden&&n){const e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n.op}`),n.status||n.setStatus(e),n.setTag("visibilitychange","document.hidden"),n.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Wbe=(n,e,t)=>{let i,r;return o=>{e.value>=0&&(o||t)&&(r=e.value-(i||0),(r||i===void 0)&&(i=e.value,e.delta=r,n(e)))}},hxn=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,fxn=()=>{const n=Ba.performance.timing,e=Ba.performance.navigation.type,t={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const i in n)i!=="navigationStart"&&i!=="toJSON"&&(t[i]=Math.max(n[i]-n.navigationStart,0));return t},FQe=()=>Ba.__WEB_VITALS_POLYFILL__?Ba.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||fxn()):Ba.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],BQe=()=>{const n=FQe();return n&&n.activationStart||0},zbe=(n,e)=>{const t=FQe();let i="navigate";return t&&(Ba.document.prerendering||BQe()>0?i="prerender":i=t.type.replace(/_/g,"-")),{name:n,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:hxn(),navigationType:i}},YK=(n,e,t)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(n)){const i=new PerformanceObserver(r=>{e(r.getEntries())});return i.observe(Object.assign({type:n,buffered:!0},t||{})),i}}catch{}},QK=(n,e)=>{const t=i=>{(i.type==="pagehide"||Ba.document.visibilityState==="hidden")&&(n(i),e&&(removeEventListener("visibilitychange",t,!0),removeEventListener("pagehide",t,!0)))};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},pxn=n=>{const e=zbe("CLS",0);let t,i=0,r=[];const o=a=>{a.forEach(l=>{if(!l.hadRecentInput){const c=r[0],u=r[r.length-1];i&&r.length!==0&&l.startTime-u.startTime<1e3&&l.startTime-c.startTime<5e3?(i+=l.value,r.push(l)):(i=l.value,r=[l]),i>e.value&&(e.value=i,e.entries=r,t&&t())}})},s=YK("layout-shift",o);if(s){t=Wbe(n,e);const a=()=>{o(s.takeRecords()),t(!0)};return QK(a),a}};let M$=-1;const gxn=()=>Ba.document.visibilityState==="hidden"&&!Ba.document.prerendering?0:1/0,mxn=()=>{QK(({timeStamp:n})=>{M$=n},!0)},Ube=()=>(M$<0&&(M$=gxn(),mxn()),{get firstHiddenTime(){return M$}}),_xn=n=>{const e=Ube(),t=zbe("FID");let i;const r=a=>{a.startTime<e.firstHiddenTime&&(t.value=a.processingStart-a.startTime,t.entries.push(a),i(!0))},o=a=>{a.forEach(r)},s=YK("first-input",o);i=Wbe(n,t),s&&QK(()=>{o(s.takeRecords()),s.disconnect()},!0)},zNe={},vxn=n=>{const e=Ube(),t=zbe("LCP");let i;const r=s=>{const a=s[s.length-1];if(a){const l=Math.max(a.startTime-BQe(),0);l<e.firstHiddenTime&&(t.value=l,t.entries=[a],i())}},o=YK("largest-contentful-paint",r);if(o){i=Wbe(n,t);const s=()=>{zNe[t.id]||(r(o.takeRecords()),o.disconnect(),zNe[t.id]=!0,i(!0))};return["keydown","click"].forEach(a=>{addEventListener(a,s,{once:!0,capture:!0})}),QK(s,!0),s}},EM={},PW={};let $Qe,VQe,HQe;function bxn(n){return qbe("cls",n,wxn,$Qe)}function yxn(n){return qbe("lcp",n,Exn,HQe)}function Cxn(n){return qbe("fid",n,Sxn,VQe)}function jbe(n,e){return WQe(n,e),PW[n]||(xxn(n),PW[n]=!0),zQe(n,e)}function XK(n,e){const t=EM[n];if(!(!t||!t.length))for(const i of t)try{i(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.error(`Error while triggering instrumentation handler. Type: ${n} Name: ${b1(i)} Error:`,r)}}function wxn(){pxn(n=>{XK("cls",{metric:n}),$Qe=n})}function Sxn(){_xn(n=>{XK("fid",{metric:n}),VQe=n})}function Exn(){vxn(n=>{XK("lcp",{metric:n}),HQe=n})}function qbe(n,e,t,i){return WQe(n,e),PW[n]||(t(),PW[n]=!0),i&&e({metric:i}),zQe(n,e)}function xxn(n){const e={};n==="event"&&(e.durationThreshold=0),YK(n,t=>{XK(n,{entries:t})},e)}function WQe(n,e){EM[n]=EM[n]||[],EM[n].push(e)}function zQe(n,e){return()=>{const t=EM[n];if(!t)return;const i=t.indexOf(e);i!==-1&&t.splice(i,1)}}function Tee(n){return typeof n=="number"&&isFinite(n)}function bA(n,{startTimestamp:e,...t}){return e&&n.startTimestamp>e&&(n.startTimestamp=e),n.startChild({startTimestamp:e,...t})}function hu(n){return n/1e3}function UQe(){return Ba&&Ba.addEventListener&&Ba.performance}let UNe=0,ql={},Qv,xM;function Txn(){const n=UQe();if(n&&o0){n.mark&&Ba.performance.mark("sentry-tracing-init");const e=Axn(),t=Lxn(),i=Dxn();return()=>{e(),t(),i()}}return()=>{}}function kxn(){jbe("longtask",({entries:n})=>{for(const e of n){const t=g6();if(!t)return;const i=hu(o0+e.startTime),r=hu(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r})}})}function Ixn(){jbe("event",({entries:n})=>{for(const e of n){const t=g6();if(!t)return;if(e.name==="click"){const i=hu(o0+e.startTime),r=hu(e.duration);t.startChild({description:mA(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r})}}})}function Lxn(){return bxn(({metric:n})=>{const e=n.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding CLS"),ql.cls={value:n.value,unit:""},xM=e)})}function Dxn(){return yxn(({metric:n})=>{const e=n.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding LCP"),ql.lcp={value:n.value,unit:"millisecond"},Qv=e)})}function Axn(){return Cxn(({metric:n})=>{const e=n.entries.pop();if(!e)return;const t=hu(o0),i=hu(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding FID"),ql.fid={value:n.value,unit:"millisecond"},ql["mark.fid"]={value:t+i,unit:"second"}})}function Nxn(n){const e=UQe();if(!e||!Ba.performance.getEntries||!o0)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Tracing] Adding & adjusting spans using Performance API");const t=hu(o0),i=e.getEntries();let r,o;if(i.slice(UNe).forEach(s=>{const a=hu(s.startTime),l=hu(s.duration);if(!(n.op==="navigation"&&t+a<n.startTimestamp))switch(s.entryType){case"navigation":{Oxn(n,s,t),r=t+hu(s.responseStart),o=t+hu(s.requestStart);break}case"mark":case"paint":case"measure":{Rxn(n,s,a,l,t);const c=Ube(),u=s.startTime<c.firstHiddenTime;s.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding FP"),ql.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding FCP"),ql.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{const c=s.name.replace(Ba.location.origin,"");Mxn(n,s,c,a,l,t);break}}}),UNe=Math.max(i.length-1,0),Fxn(n),n.op==="pageload"){typeof r=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding TTFB"),ql.ttfb={value:(r-n.startTimestamp)*1e3,unit:"millisecond"},typeof o=="number"&&o<=r&&(ql["ttfb.requestTime"]={value:(r-o)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!ql[a]||t>=n.startTimestamp)return;const l=ql[a].value,c=t+hu(l),u=Math.abs((c-n.startTimestamp)*1e3),d=u-l;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Measurements] Normalized ${a} from ${l} to ${u} (${d})`),ql[a].value=u});const s=ql["mark.fid"];s&&ql.fid&&(bA(n,{description:"first input delay",endTimestamp:s.value+hu(ql.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:s.value}),delete ql["mark.fid"]),"fcp"in ql||delete ql.cls,Object.keys(ql).forEach(a=>{n.setMeasurement(a,ql[a].value,ql[a].unit)}),Bxn(n)}Qv=void 0,xM=void 0,ql={}}function Rxn(n,e,t,i,r){const o=r+t,s=o+i;return bA(n,{description:e.name,endTimestamp:s,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:o}),o}function Oxn(n,e,t){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(i=>{y9(n,e,i,t)}),y9(n,e,"secureConnection",t,"TLS/SSL","connectEnd"),y9(n,e,"fetch",t,"cache","domainLookupStart"),y9(n,e,"domainLookup",t,"DNS"),Pxn(n,e,t)}function y9(n,e,t,i,r,o){const s=o?e[o]:e[`${t}End`],a=e[`${t}Start`];!a||!s||bA(n,{op:"browser",origin:"auto.browser.browser.metrics",description:r||t,startTimestamp:i+hu(a),endTimestamp:i+hu(s)})}function Pxn(n,e,t){bA(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:t+hu(e.requestStart),endTimestamp:t+hu(e.responseEnd)}),bA(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:t+hu(e.responseStart),endTimestamp:t+hu(e.responseEnd)})}function Mxn(n,e,t,i,r,o){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const s={};"transferSize"in e&&(s["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(s["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(s["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(s["resource.render_blocking_status"]=e.renderBlockingStatus);const a=o+i,l=a+r;bA(n,{description:t,endTimestamp:l,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:s})}function Fxn(n){const e=Ba.navigator;if(!e)return;const t=e.connection;t&&(t.effectiveType&&n.setTag("effectiveConnectionType",t.effectiveType),t.type&&n.setTag("connectionType",t.type),Tee(t.rtt)&&(ql["connection.rtt"]={value:t.rtt,unit:"millisecond"})),Tee(e.deviceMemory)&&n.setTag("deviceMemory",`${e.deviceMemory} GB`),Tee(e.hardwareConcurrency)&&n.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function Bxn(n){Qv&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding LCP Data"),Qv.element&&n.setTag("lcp.element",mA(Qv.element)),Qv.id&&n.setTag("lcp.id",Qv.id),Qv.url&&n.setTag("lcp.url",Qv.url.trim().slice(0,200)),n.setTag("lcp.size",Qv.size)),xM&&xM.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log("[Measurements] Adding CLS Data"),xM.sources.forEach((e,t)=>n.setTag(`cls.source.${t+1}`,mA(e.node))))}const Xae=["localhost",/^\/(?!\/)/],Zae={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Xae,tracePropagationTargets:Xae};function $xn(n){const{traceFetch:e,traceXHR:t,tracePropagationTargets:i,tracingOrigins:r,shouldCreateSpanForRequest:o,enableHTTPTimings:s}={traceFetch:Zae.traceFetch,traceXHR:Zae.traceXHR,...n},a=typeof o=="function"?o:u=>!0,l=u=>zxn(u,i||r),c={};e&&Vp("fetch",u=>{const d=Uxn(u,a,l,c);s&&d&&jNe(d)}),t&&Vp("xhr",u=>{const d=qxn(u,a,l,c);s&&d&&jNe(d)})}function Vxn(n){return n.entryType==="resource"&&"initiatorType"in n&&typeof n.nextHopProtocol=="string"&&(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest")}function jNe(n){const e=n.data.url;if(!e)return;const t=jbe("resource",({entries:i})=>{i.forEach(r=>{Vxn(r)&&r.name.endsWith(e)&&(Wxn(r).forEach(s=>n.setData(...s)),setTimeout(t))})})}function Hxn(n){let e="unknown",t="unknown",i="";for(const r of n){if(r==="/"){[e,t]=n.split("/");break}if(!isNaN(Number(r))){e=i==="h"?"http":i,t=n.split(i)[1];break}i+=r}return i===n&&(e=i),{name:e,version:t}}function Hv(n=0){return((o0||performance.timeOrigin)+n)/1e3}function Wxn(n){const{name:e,version:t}=Hxn(n.nextHopProtocol),i=[];return i.push(["network.protocol.version",t],["network.protocol.name",e]),o0?[...i,["http.request.redirect_start",Hv(n.redirectStart)],["http.request.fetch_start",Hv(n.fetchStart)],["http.request.domain_lookup_start",Hv(n.domainLookupStart)],["http.request.domain_lookup_end",Hv(n.domainLookupEnd)],["http.request.connect_start",Hv(n.connectStart)],["http.request.secure_connection_start",Hv(n.secureConnectionStart)],["http.request.connection_end",Hv(n.connectEnd)],["http.request.request_start",Hv(n.requestStart)],["http.request.response_start",Hv(n.responseStart)],["http.request.response_end",Hv(n.responseEnd)]]:i}function zxn(n,e){return d6(n,e||Xae)}function Uxn(n,e,t,i){if(!Bbe()||!n.fetchData)return;const r=e(n.fetchData.url);if(n.endTimestamp&&r){const h=n.fetchData.__span;if(!h)return;const f=i[h];if(f){if(n.response){f.setHttpStatus(n.response.status);const g=n.response&&n.response.headers&&n.response.headers.get("content-length"),m=parseInt(g);m>0&&f.setData("http.response_content_length",m)}else n.error&&f.setStatus("internal_error");f.finish(),delete i[h]}return}const o=sc(),s=o.getScope(),a=o.getClient(),l=s.getSpan(),{method:c,url:u}=n.fetchData,d=r&&l?l.startChild({data:{url:u,type:"fetch","http.method":c},description:`${c} ${u}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(n.fetchData.__span=d.spanId,i[d.spanId]=d),t(n.fetchData.url)&&a){const h=n.args[0];n.args[1]=n.args[1]||{};const f=n.args[1];f.headers=jxn(h,a,s,f,d)}return d}function jxn(n,e,t,i,r){const o=r||t.getSpan(),s=o&&o.transaction,{traceId:a,sampled:l,dsc:c}=t.getPropagationContext(),u=o?o.toTraceparent():Obe(a,void 0,l),d=s?s.getDynamicSamplingContext():c||VK(a,e,t),h=jae(d),f=typeof Request<"u"&&v1(n,Request)?n.headers:i.headers;if(f)if(typeof Headers<"u"&&v1(f,Headers)){const g=new Headers(f);return g.append("sentry-trace",u),h&&g.append(Uae,h),g}else if(Array.isArray(f)){const g=[...f,["sentry-trace",u]];return h&&g.push([Uae,h]),g}else{const g="baggage"in f?f.baggage:void 0,m=[];return Array.isArray(g)?m.push(...g):g&&m.push(g),h&&m.push(h),{...f,"sentry-trace":u,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":u,baggage:h}}function qxn(n,e,t,i){const r=n.xhr,o=r&&r[eL];if(!Bbe()||r&&r.__sentry_own_request__||!r||!o)return;const s=e(o.url);if(n.endTimestamp&&s){const d=r.__sentry_xhr_span_id__;if(!d)return;const h=i[d];h&&(h.setHttpStatus(o.status_code),h.finish(),delete i[d]);return}const a=sc(),l=a.getScope(),c=l.getSpan(),u=s&&c?c.startChild({data:{...o.data,type:"xhr","http.method":o.method,url:o.url},description:`${o.method} ${o.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(u&&(r.__sentry_xhr_span_id__=u.spanId,i[r.__sentry_xhr_span_id__]=u),r.setRequestHeader&&t(o.url))if(u){const d=u&&u.transaction,h=d&&d.getDynamicSamplingContext(),f=jae(h);qNe(r,u.toTraceparent(),f)}else{const d=a.getClient(),{traceId:h,sampled:f,dsc:g}=l.getPropagationContext(),m=Obe(h,void 0,f),v=g||(d?VK(h,d,l):void 0),_=jae(v);qNe(r,m,_)}return u}function qNe(n,e,t){try{n.setRequestHeader("sentry-trace",e),t&&n.setRequestHeader(Uae,t)}catch{}}function Kxn(n,e=!0,t=!0){if(!Ba||!Ba.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn("Could not initialize routing instrumentation due to invalid location");return}let i=Ba.location.href,r;e&&(r=n({name:Ba.location.pathname,startTimestamp:o0?o0/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),t&&Vp("history",({to:o,from:s})=>{if(s===void 0&&i&&i.indexOf(o)!==-1){i=void 0;return}s!==o&&(i=void 0,r&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=n({name:Ba.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const Gxn="BrowserTracing",Yxn={...P$,markBackgroundTransactions:!0,routingInstrumentation:Kxn,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...Zae};class Qxn{constructor(e){this.name=Gxn,this._hasSetTracePropagationTargets=!1,xSn(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...Yxn,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=Txn(),this.options.enableLongTask&&kxn(),this.options._experiments.enableInteractions&&Ixn()}setupOnce(e,t){this._getCurrentHub=t;const r=t().getClient(),o=r&&r.getOptions(),{routingInstrumentation:s,startTransactionOnLocationChange:a,startTransactionOnPageLoad:l,markBackgroundTransactions:c,traceFetch:u,traceXHR:d,shouldCreateSpanForRequest:h,enableHTTPTimings:f,_experiments:g}=this.options,m=o&&o.tracePropagationTargets,v=m||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&m&&On.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),s(_=>{const b=this._createRouteTransaction(_);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(b,_,t),b},l,a),c&&dxn(),g.enableInteractions&&this._registerInteractionListener(),$xn({traceFetch:u,traceXHR:d,tracePropagationTargets:v,shouldCreateSpanForRequest:h,enableHTTPTimings:f})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const t=this._getCurrentHub(),{beforeNavigate:i,idleTimeout:r,finalTimeout:o,heartbeatInterval:s}=this.options,a=e.op==="pageload",l=a?KNe("sentry-trace"):"",c=a?KNe("baggage"):"",{traceparentData:u,dynamicSamplingContext:d,propagationContext:h}=Qwn(l,c),f={...e,...u,metadata:{...e.metadata,dynamicSamplingContext:u&&!d?{}:d},trimEnd:!0},g=typeof i=="function"?i(f):f,m=g===void 0?{...f,sampled:!1}:g;m.metadata=m.name!==f.name?{...m.metadata,source:"custom"}:m.metadata,this._latestRouteName=m.name,this._latestRouteSource=m.metadata&&m.metadata.source,m.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.log(`[Tracing] Starting ${m.op} transaction on scope`);const{location:v}=Ba,_=RNe(t,m,r,o,!0,{location:v},s),b=t.getScope();return a&&u?b.setPropagationContext(h):b.setPropagationContext({traceId:_.traceId,spanId:_.spanId,parentSpanId:_.parentSpanId,sampled:_.sampled}),_.registerBeforeFinishCallback(y=>{this._collectWebVitals(),Nxn(y)}),_}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:i,finalTimeout:r,heartbeatInterval:o}=this.options,s="ui.action.click",a=g6();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&On.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`);return}const l=this._getCurrentHub(),{location:c}=Ba,u={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=RNe(l,u,i,r,!0,{location:c},o)};["click"].forEach(i=>{addEventListener(i,t,{once:!1,capture:!0})})}}function KNe(n){const e=iwn(`meta[name=${n}]`);return e?e.getAttribute("content"):void 0}function Xxn(n){const e={_metadata:{},...n};e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:RW}],version:RW},cxn(e)}function Zxn(n){const e=Tl();return w.useEffect(()=>{window.scrollTo(0,0)},[e]),p(dt,{children:n.children})}var jQe,GNe=sp;jQe=GNe.createRoot,GNe.hydrateRoot;const Jxn="Organization",eTn="Name",tTn="Website",nTn="Phone",iTn="Address",rTn="Street",oTn="Apt/Suite",sTn="City",aTn="State/Province",lTn="Postal Code",cTn="Country",uTn="Contacts",dTn="First Name",hTn="Last Name",fTn="Phone",pTn="Email",gTn="Additional Info",mTn="Payment Terms",_Tn="Currency",vTn="Company Size",bTn="Industry",yTn="Private Notes",CTn="Invoice Date",wTn="Due Date",STn="Invoice",ETn="Client",xTn="Invoice Number",TTn="Invoice #",kTn="PO Number",ITn="PO #",LTn="How Often",DTn="Discount",ATn="Taxes",NTn="Tax",RTn="Item",OTn="Description",PTn="Unit Cost",MTn="Quantity",FTn="Line Total",BTn="Subtotal",$Tn="Net",VTn="Paid to Date",HTn="Balance Due",WTn="Design",zTn="Terms",UTn="Your Invoice",jTn="Remove contact",qTn="Add contact",KTn="Create new client",GTn="Edit client details",YTn="Enable",QTn="Learn more",XTn="Manage rates",ZTn="Note to Client",JTn="Invoice Terms",ekn="Save as default terms",tkn="Download PDF",nkn="Pay Now",ikn="Save Invoice",rkn="Clone To Invoice",okn="Archive Invoice",skn="Delete Invoice",akn="Email Invoice",lkn="Enter Payment",ckn="Tax Rates",ukn="Rate",dkn="Settings",hkn="Enable specifying an <b>invoice tax</b>",fkn="Enable specifying <b>line item taxes</b>",pkn="Dashboard",gkn='Note: add a :link named ":name" to show the totals using a single base currency.',mkn="Clients",_kn="Invoices",vkn="Payments",bkn="Credits",ykn="History",Ckn="Search",wkn="Sign Up",Skn="Guest",Ekn="Company Details",xkn="Online Payments",Tkn="Notifications",kkn="Import | Export",Ikn="Done",Lkn="Save",Dkn="Create",Akn="Upload",Nkn="Download",Rkn="Cancel",Okn="Close",Pkn="Please provide a valid email address",Mkn="Powered by",Fkn="No items",Bkn="Recurring Invoices",$kn=`<p>Automatically send clients the same invoices weekly, bi-monthly, monthly, quarterly or annually. </p> <p>Use :MONTH, :QUARTER or :YEAR for dynamic dates. Basic math works as well, for example :MONTH-1.</p> <p>Examples of dynamic invoice variables:</p> <ul> <li>"Gym membership for the month of :MONTH" >> "Gym membership for the month of July"</li> <li>":YEAR+1 yearly subscription" >> "2015 Yearly Subscription"</li> <li>"Retainer payment for :QUARTER+1" >> "Retainer payment for Q2"</li> </ul>`,Vkn="Recurring Quotes",Hkn="in total revenue",Wkn="billed client",zkn="billed clients",Ukn="active client",jkn="active clients",qkn="Invoices Past Due",Kkn="Upcoming Invoices",Gkn="Average Invoice",Ykn="Archive",Qkn="Archive Client",Xkn="Delete Client",Zkn="Archive Payment",Jkn="Delete Payment",eIn="Archive Credit",tIn="Delete Credit",nIn="Show archived/deleted",iIn="Filter",rIn="New Client",oIn="New Invoice",sIn="Enter Payment",aIn="Enter Credit",lIn="Contact",cIn="Date Created",uIn="Last Login",dIn="Balance",hIn="Action",fIn="Status",pIn="Invoice Total",gIn="Frequency",mIn="Range",_In="Start Date",vIn="End Date",bIn="Transaction Reference",yIn="Method",CIn="Payment Amount",wIn="Payment Date",SIn="Credit Amount",EIn="Credit Balance",xIn="Credit Date",TIn="No data available in table",kIn="Select",IIn="Edit Client",LIn="Edit Invoice",DIn="Create Invoice",AIn="Enter Credit",NIn="Last logged in",RIn="Details",OIn="Standing",PIn="Credit",MIn="Activity",FIn="Date",BIn="Message",$In="Adjustment",VIn="Are you sure?",HIn="Payment Type",WIn="Amount",zIn="Email",UIn="Language",jIn="Timezone",qIn="Date Format",KIn="Date/Time Format",GIn="Users",YIn="Localization",QIn="Remove logo",XIn="Supported: JPEG, GIF and PNG",ZIn="Payment Gateway",JIn="Gateway",e2n="Email Notifications",t2n="Email me when an invoice is <b>viewed</b>",n2n="Email me when an invoice is <b>paid</b>",i2n="Site Updates",r2n="Custom Messages",o2n="Set default <b>email signature</b>",s2n="Please select a file",a2n="Use first row as headers",l2n="Column",c2n="Sample",u2n="Import to",d2n="client will be created",h2n="clients will be created",f2n="Email Settings",p2n="Client View Styling",g2n="Attach PDF",m2n="Custom CSS",_2n="Import Client Data",v2n="CSV file",b2n="Export Client Data",y2n="Successfully created client",C2n="Successfully created :count client(s)",w2n="Successfully updated settings",S2n="Successfully removed logo",E2n="Successfully sent message",x2n="Please make sure to select a client and correct any errors",T2n="You've hit the :count client limit on Free accounts. Congrats on your success!",k2n="There was an error processing your payment. Please try again later.",I2n="Registration Required",L2n="Please confirm your email address, :link to resend the confirmation email.",D2n="Successfully updated client",A2n="Successfully archived client",N2n="Successfully archived :count clients",R2n="Successfully deleted client",O2n="Successfully deleted :count clients",P2n="Successfully updated invoice",M2n="Successfully created invoice",F2n="Successfully cloned invoice",B2n="Successfully emailed invoice",$2n="and created client",V2n="Successfully archived invoice",H2n="Successfully archived :count invoices",W2n="Successfully deleted invoice",z2n="Successfully deleted :count invoices",U2n="Successfully created payment",j2n="Successfully created :count payment(s)",q2n="Successfully archived payment",K2n="Successfully archived :count payments",G2n="Successfully deleted payment",Y2n="Successfully deleted :count payments",Q2n="Successfully applied payment",X2n="Successfully created credit",Z2n="Successfully archived credit",J2n="Successfully archived :count credits",eLn="Successfully deleted credit",tLn="Successfully deleted :count credits",nLn="Successfully imported file",iLn="Successfully updated vendor",rLn="Successfully created vendor",oLn="Successfully archived vendor",sLn="Successfully archived :count vendors",aLn="Successfully deleted vendor",lLn="Successfully deleted :count vendors",cLn="Account Confirmation",uLn="Account Confirmation",dLn="Please access the link below to confirm your account.",hLn="New invoice :number from :account",fLn="To view your invoice for :amount, click the link below.",pLn="Payment Received",gLn="Thank you for your payment of :amount.",mLn="Dear :name,",_Ln="Regards,",vLn="The Invoice Ninja Team",bLn="To view the invoice click the link below:",yLn="Invoice :invoice was paid by :client",CLn="Invoice :invoice was sent to :client",wLn="Invoice :invoice was viewed by :client",SLn="A payment of :amount was made by client :client towards Invoice :invoice.",ELn="The following client :client was emailed Invoice :invoice for :amount.",xLn="The following client :client viewed Invoice :invoice for :amount.",TLn="Invoice :invoicenumber for :amount for client :client",kLn="Payment with no invoice for amount :amount for client :client",ILn="You can reset your account password by clicking the following button:",LLn="Secure Payment",DLn="Card Number",ALn="Expiration Month",NLn="Expiration Year",RLn="CVV",OLn="Log Out",PLn="Sign up to save your work",MLn="I agree to the :terms",FLn="Terms of Service",BLn="The email address is already registered",$Ln="Working",VLn="Success",HLn="You have successfully registered! Please visit the link in the account confirmation email to verify your email address.",WLn="Your account is not registered, this will permanently erase your data.",zLn="Password",ULn="Pro Plan",jLn="You have unsaved changes",qLn="Custom Fields",KLn="Company Fields",GLn="Client Fields",YLn="Field Label",QLn="Field Value",XLn="Edit",ZLn="Set your company name",JLn="View as recipient",eDn="Product Library",tDn="Product",nDn="Products",iDn="Auto-fill products",rDn="Selecting a product will automatically <b>fill in the description and cost</b>",oDn="Auto-update products",sDn="Updating an invoice will automatically <b>update the product library</b>",aDn="Add Product",lDn="Edit Product",cDn="Archive Product",uDn="Successfully updated product",dDn="Successfully created product",hDn="Successfully archived product",fDn=":link to enable custom fields by joining the Pro Plan",pDn="Advanced Settings",gDn=":link to enable the advanced settings by joining the Pro Plan",mDn="Invoice Design",_Dn="Specify colors",vDn="Select the colors used in the invoice",bDn="Chart Builder",yDn="Created by :site | Create. Send. Get Paid.",CDn="Go Pro",wDn="Quote",SDn="Quotes",EDn="Quote Number",xDn="Quote #",TDn="Quote Date",kDn="Quote Total",IDn="Your Quote",LDn="Total",DDn="Clone",ADn="New Quote",NDn="Create Quote",RDn="Edit Quote",ODn="Archive Quote",PDn="Delete Quote",MDn="Save Quote",FDn="Email Quote",BDn="Clone To Quote",$Dn="Convert to Invoice",VDn="View Invoice",HDn="View Client",WDn="View Quote",zDn="Successfully updated quote",UDn="Successfully created quote",jDn="Successfully cloned quote",qDn="Successfully emailed quote",KDn="Successfully archived quote",GDn="Successfully archived :count quotes",YDn="Successfully deleted quote",QDn="Successfully deleted :count quotes",XDn="Successfully converted quote to invoice",ZDn="New quote :number from :account",JDn="To view your quote for :amount, click the link below.",eAn="To view your client quote click the link below:",tAn="Quote :invoice was sent to :client",nAn="Quote :invoice was viewed by :client",iAn="The following client :client was emailed Quote :invoice for :amount.",rAn="The following client :client viewed Quote :invoice for :amount.",oAn="Your session has expired.",sAn="Invoice Fields",aAn="Invoice Options",lAn="Hide Paid to Date",cAn='Only display the "Paid to Date" area on your invoices once a payment has been received.',uAn="Charge taxes",dAn="User Management",hAn="Add User",fAn="Send Invitation",pAn="Successfully sent invitation",gAn="Successfully updated user",mAn="You've been invited by :invitor. ",_An="Please sign up to add a user",vAn="State",bAn="Edit User",yAn="Delete User",CAn="Active",wAn="Pending",SAn="Successfully deleted user",EAn="Are you sure you want to email this invoice?",xAn="Are you sure you want to email this quote?",TAn="Are you sure you want this invoice emailed?",kAn="Are you sure you want to start the recurrence?",IAn="Delete Account",LAn="Warning: This will permanently delete your account, there is no undo.",DAn="Go Back",AAn="Data Visualizations",NAn="Sample data shown",RAn="Hide",OAn="A new version of :releases_link is available. You're running v:user_version, the latest is v:latest_version",PAn="Invoice Settings",MAn="Invoice Number Prefix",FAn="Invoice Number Counter",BAn="Quote Number Prefix",$An="Quote Number Counter",VAn="Share invoice counter",HAn="Invoice issued to",WAn="To prevent a possible conflict please set either an invoice or quote number prefix",zAn="Mark Sent",UAn="More designs",jAn="Additional Invoice Designs",qAn="Go Pro for more invoice designs",KAn="",GAn="",YAn="Buy",QAn="Successfully added additional invoice designs",XAn="Sent",ZAn="VAT Number",JAn="Enter Your Billing Address and Credit Card information",eNn="*This is the 3-4 digit number on the back of your card",tNn="*Billing address must match address associated with credit card.",nNn='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',iNn="ID Number",rNn="White label",oNn="White Label",sNn="Successfully enabled white label license",aNn="White labeled",lNn="Restore",cNn="Restore Invoice",uNn="Restore Quote",dNn="Restore Client",hNn="Restore Credit",fNn="Restore Payment",pNn="Successfully restored invoice",gNn="Successfully restored quote",mNn="Successfully restored client",_Nn="Successfully restored payment",vNn="Successfully restored credit",bNn="Help us improve our site by telling us why you're leaving.",yNn="Percent",CNn="Amount",wNn="Invoice History",SNn="Quote History",ENn="Current version",xNn="Select version",TNn="View History",kNn="Edit Payment",INn="Successfully updated payment",LNn="Deleted",DNn="Restore User",ANn="Successfully restored user",NNn="Show deleted users",RNn="Email Templates",ONn="Invoice Email",PNn="Payment Email",MNn="Quote Email",FNn="Reset All",BNn="Approve",$Nn="Token Billing",VNn="Disabled",HNn="Opt-in - checkbox is shown but not selected",WNn="Opt-out - checkbox is shown and selected",zNn="Always",UNn="Store credit card details",jNn="View in :gateway",qNn="Use Card on File",KNn="Edit payment details",GNn="Save card details",YNn="The data is stored securely by :link",QNn="Support",XNn="Contact Information",ZNn="Amount due",JNn="Billing Address",eRn="Billing Method",tRn="Order overview",nRn="*Address must match address associated with credit card.",iRn='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',rRn="Invoice Footer",oRn="Save as default footer",sRn="Token Management",aRn="Tokens",lRn="Add Token",cRn="Show deleted tokens",uRn="Successfully deleted token",dRn="Successfully created token",hRn="Successfully updated token",fRn="Edit Token",pRn="Delete Token",gRn="Token",mRn="Add Payment Gateway",_Rn="Delete Payment Gateway",vRn="Edit Payment Gateway",bRn="Successfully updated gateway",yRn="Successfully created gateway",CRn="Successfully deleted gateway",wRn="PayPal",SRn="Credit Card",ERn="Change password",xRn="Current password",TRn="New password",kRn="Confirm password",IRn="The current password is incorrect.",LRn="The new password is invalid.",DRn="Successfully updated password",ARn="API Tokens",NRn="Users & Tokens",RRn="Account Login",ORn="Recover your password",PRn="Forgot your password?",MRn="Email address",FRn="Let's go",BRn="Password Recovery",$Rn="Send Email",VRn="Set Password",HRn="Converted",WRn="Email me when a quote is <b>approved</b>",zRn="Quote :invoice was approved by :client",URn="The following client :client approved Quote :invoice for :amount.",jRn="Resend confirmation email",qRn="The confirmation email was resent",KRn="Credit Card",GRn="PayPal",YRn="Bitcoin",QRn="GoCardless",XRn="Knowledge Base",ZRn="Partial/Deposit",JRn=":partial of :balance",eOn="More Fields",tOn="Less Fields",nOn="Client Name",iOn="PDF Settings",rOn="Product Settings",oOn="Auto Line Wrap",sOn="Warning: the previous page was submitted twice. The second submission had been ignored.",aOn="View Documentation",lOn="Free Online Invoicing",cOn="Invoice Ninja is a free, open-code solution for invoicing and billing customers. With Invoice Ninja, you can easily build and send beautiful invoices from any device that has access to the web. Your clients can print your invoices, download them as pdf files, and even pay you online from within the system.",uOn="rows",dOn="www",hOn="Logo",fOn="Subdomain",pOn="Please provide a name or email",gOn="Charts & Reports",mOn="Chart",_On="Report",vOn="Group by",bOn="Paid",yOn="Report",COn="Chart",wOn="Totals",SOn="Run",EOn="Documentation",xOn="Zapier",TOn="Recurring",kOn="Last invoice sent :date",IOn="Successfully completed update",LOn="Tasks",DOn="New Task",AOn="Start Time",NOn="Successfully created task",ROn="Successfully updated task",OOn="Edit Task",POn="Clone Task",MOn="Archive Task",FOn="Restore Task",BOn="Delete Task",$On="Stop Task",VOn="Time",HOn="Start",WOn="Stop",zOn="Now",UOn="Timer",jOn="Manual",qOn="Date & Time",KOn="Second",GOn="Seconds",YOn="Minute",QOn="Minutes",XOn="Hour",ZOn="Hours",JOn="Task Details",ePn="Duration",tPn="Time Log",nPn="End Time",iPn="End",rPn="Invoiced",oPn="Logged",sPn="Running",aPn="The tasks can't belong to different clients",lPn="Please stop running tasks first",cPn="Tasks have already been invoiced",uPn="Successfully restored task",dPn="Successfully archived task",hPn="Successfully archived :count tasks",fPn="Successfully deleted task",pPn="Successfully deleted :count tasks",gPn="Create Task",mPn="Successfully stopped task",_Pn="Invoice Task",vPn="Invoice Labels",bPn="Prefix",yPn="Counter",CPn="Dwolla",wPn="Must be greater than zero and less than the total",SPn="More Actions",EPn="NINJA PRO",xPn="Upgrade Now!",TPn="Create Unlimited Clients",kPn="Access to 10 Beautiful Invoice Designs",IPn='Custom URLs - "YourBrand.InvoiceNinja.com"',LPn='Remove "Created by Invoice Ninja"',DPn="Multi-user Access & Activity Tracking",APn="Create Quotes & Pro-forma Invoices",NPn="Customize Invoice Field Titles & Numbering",RPn="Option to attach PDFs to Client Emails",OPn="Resume",PPn="Break",MPn="Edit Details",FPn="Work",BPn="Please :link to set your timezone",$Pn="click here",VPn="Email payment receipt to the client",HPn="Successfully created payment and emailed client",WPn="Add Company",zPn="Untitled",UPn="New Company",jPn="Successfully linked accounts",qPn="Successfully unlinked accounts",KPn="Login",GPn="or",YPn="There was a problem sending the email",QPn="Note: emails are sent at the start of the hour.",XPn="Note: invoices are created at the start of the hour.",ZPn="Unlink Account",JPn="Unlink",eMn="Show Address",tMn="Require client to provide their billing address",nMn="Update Address",iMn="Update client's address with provided details",rMn="Times",oMn="Set to now",sMn="Dark Mode",aMn="Use a dark background for the sidebars",lMn="Add to invoice :invoice",cMn="Create new invoice",uMn="Please correct any overlapping times",dMn="From",hMn="To",fMn="Font Size",pMn="Primary Color",gMn="Secondary Color",mMn="Customize Design",_Mn="Content",vMn="Styles",bMn="Defaults",yMn="Margins",CMn="Header",wMn="Footer",SMn="Custom",EMn="Invoice to",xMn="Invoice No.",TMn="Quote No.",kMn="Recent Payments",IMn="Outstanding",LMn="Manage Companies",DMn="Total Revenue",AMn="Current User",NMn="New Recurring Invoice",RMn="Recurring Invoice",OMn="New Recurring Quote",PMn="Recurring Quote",MMn="Created by :invoice",FMn="Primary User",BMn="Help",$Mn="playground",VMn="Support Forums",HMn="Due Date",WMn="Valid Until",zMn="Valid Until",UMn="Reset terms",jMn="Reset footer",qMn=":count invoice sent",KMn=":count invoices sent",GMn="Draft",YMn="Sent",QMn="Viewed",XMn="Partial",ZMn="Paid",JMn="Unpaid",e4n="All",t4n="Display <b>line item taxes inline</b>",n4n="Auto Bill",i4n="24 Hour Time",r4n="Last Sent",o4n="Reminder Emails",s4n="Quote Reminder Emails",a4n="Templates & Reminders",l4n="Subject",c4n="Body",u4n="First Reminder",d4n="Second Reminder",h4n="Third Reminder",f4n="Days after due date",p4n="Reminder: Invoice :invoice from :account",g4n="Reset",m4n="The requested invoice is not available",_4n="Referral Program",v4n="Referral URL",b4n="Sent Last: :date",y4n="This page will expire soon, :click_here to keep working",C4n="Upcoming Quotes",w4n="Expired Quotes",S4n="Sign up using",E4n="These credentials do not match our records",x4n="Show all options",T4n="User Details",k4n="Connected Account",I4n="Disable",L4n="Invoice and Quote Numbers",D4n="Invoice Surcharges",A4n="We were unable to deliver Invoice :invoice to :contact. <br><br> :error",N4n="Unable to deliver Invoice :invoice",R4n="We were unable to deliver Quote :invoice to :contact. <br><br> :error",O4n="Unable to deliver Quote :invoice",P4n="Custom Invoice Link",M4n="Total Invoiced",F4n="Open Balance",B4n="Please visit the link in the account confirmation email to verify your email address.",$4n="Basic Settings",V4n="Pro",H4n="Payment Gateways",W4n="Send Next: :date",z4n="This invoice is not scheduled to run",U4n="General Settings",j4n="Customize",q4n="Connect an account to login without a password",K4n="Earn money by sharing our app online",G4n="Enable | Requires Stripe",Y4n="Tax Settings",Q4n="Add Tax Rate",X4n="Successfully updated tax rate",Z4n="Successfully created tax rate",J4n="Edit tax rate",e3n="Archive Tax Rate",t3n="Successfully archived the tax rate",n3n="Default Tax Rate",i3n="Tax Rate",r3n="Recurring Hour",o3n="Pattern",s3n="Pattern Help",a3n="Create custom numbers by specifying a pattern",l3n="Available variables:",c3n="For example, :example would be converted to :value",u3n="See options",d3n="Invoice Counter",h3n="Quote Counter",f3n="Type",p3n=":user created client :client",g3n=":user archived client :client",m3n=":user deleted client :client",_3n=":user created invoice :invoice",v3n=":user updated invoice :invoice",b3n=":user emailed invoice :invoice for :client to :contact",y3n=":contact viewed invoice :invoice for :client",C3n=":user archived invoice :invoice",w3n=":user deleted invoice :invoice",S3n=":user entered payment :payment for :payment_amount on invoice :invoice for :client",E3n=":user updated payment :payment",x3n=":user archived payment :payment",T3n=":user deleted payment :payment",k3n=":user entered :credit credit",I3n=":user updated :credit credit",L3n=":user archived :credit credit",D3n=":user deleted :credit credit",A3n=":user created quote :quote",N3n=":user updated quote :quote",R3n=":user emailed quote :quote for :client to :contact",O3n=":contact viewed quote :quote",P3n=":user archived quote :quote",M3n=":user deleted quote :quote",F3n=":user restored quote :quote",B3n=":user restored invoice :invoice",$3n=":user restored client :client",V3n=":user restored payment :payment",H3n=":user restored :credit credit",W3n=":contact approved quote :quote for :client",z3n=":user created vendor :vendor",U3n=":user archived vendor :vendor",j3n=":user deleted vendor :vendor",q3n=":user restored vendor :vendor",K3n=":user created expense :expense",G3n=":user archived expense :expense",Y3n=":user deleted expense :expense",Q3n=":user restored expense :expense",X3n=":user created task :task",Z3n=":user updated task :task",J3n=":user archived task :task",e5n=":user deleted task :task",t5n=":user restored task :task",n5n=":user updated expense :expense",i5n=":user created user :user",r5n=":user updated user :user",o5n=":user archived user :user",s5n=":user deleted user :user",a5n=":user restored user :user",l5n=":user marked sent :invoice",c5n=":user paid invoice :invoice",u5n=":contact replied ticket :ticket",d5n=":user viewed ticket :ticket",h5n="Payment",f5n="System",p5n="Email Signature",g5n="Default Messages",m5n="Quote Terms",_5n="Default Quote Terms",v5n="Default Invoice Terms",b5n="Default Invoice Footer",y5n="Quote Footer",C5n="Free",w5n="Successfully approved",S5n="Apply Credit",E5n="System Settings",x5n="Archive Token",T5n="Successfully archived token",k5n="Archive User",I5n="Successfully archived user",L5n="Delete Gateway",D5n="Successfully archived gateway",A5n="Archive Recurring Invoice",N5n="Successfully archived recurring invoice",R5n="Delete Recurring Invoice",O5n="Successfully deleted recurring invoice",P5n="Restore Recurring Invoice",M5n="Successfully restored recurring invoice",F5n="Archive Recurring Quote",B5n="Successfully archived recurring quote",$5n="Delete Recurring Quote",V5n="Successfully deleted recurring quote",H5n="Restore Recurring Quote",W5n="Successfully restored recurring quote",z5n="Archived",U5n="Untitled Company",j5n="Before",q5n="After",K5n="Reset to the default account terms",G5n="Reset to the default account footer",Y5n="Export Data",Q5n="User",X5n="Country",Z5n="Include",J5n="Your logo is :size, for better PDF performance we suggest uploading an image file less than 200KB",eFn="Import From FreshBooks",tFn="Import Data",nFn="Source",iFn="CSV",rFn="Client File",oFn="Invoice File",sFn="Task File",aFn="No valid mapping for file",lFn="Invalid CSV Header",cFn="Client Portal",uFn="Admin",dFn="Disabled",hFn="Show archived users",fFn="Notes",pFn="invoice will be created",gFn="invoices will be created",mFn="The following records failed to import, they either already exist or are missing required fields.",_Fn="Publishable Key",vFn="Secret Key",bFn="Set your Stripe publishable key for an improved checkout process",yFn="Email Design",CFn="Due by :date",wFn="Enable Markup",SFn="Make it easier for your clients to pay you by adding schema.org markup to your emails.",EFn="Templates Help",xFn="Available variables:",TFn="Email Style",kFn="Make your emails look more professional with HTML layouts.",IFn="Plain",LFn="Light",DFn="Dark",AFn="Used to provide comparisons against the averages of companies of similar size and industry.",NFn="Set the subdomain or display the invoice on your own website.",RFn="Display the invoice in an iFrame on your own website",OFn="Specify a prefix or use a custom pattern to dynamically set the invoice number.",PFn="Specify a prefix or use a custom pattern to dynamically set the quote number.",MFn="Add a field when creating a client and optionally display the label and value on the PDF.",FFn="Add a label and value to the company details section of the PDF.",BFn="Add a field when creating an invoice and optionally display the label and value on the PDF.",$Fn="Add a field when creating an invoice and include the charge in the invoice subtotals.",VFn="Validation token was expired. Please try again.",HFn="Invoice Link",WFn="Confirm your email.",zFn="Confirm",UFn="Email Preferences",jFn="Successfully created :count invoice(s)",qFn="The next invoice number is :number.",KFn="The next quote number is :number.",GFn="days before the",YFn="days after the",QFn="due date",XFn="invoice date",ZFn="Schedule",JFn="Email Designs",e6n="Assigned when sent",t6n="Purchase a white label license",n6n="Expense",i6n="Expenses",r6n="Enter Expense",o6n="New Vendor",s6n="Net",a6n="Vendor",l6n="Edit Vendor",c6n="Archive Vendor",u6n="Delete Vendor",d6n="View Vendor",h6n="Successfully deleted expense",f6n="Successfully archived expense",p6n="Successfully deleted expenses",g6n="Successfully archived expenses",m6n="Expense Amount",_6n="Expense Balance",v6n="Expense Date",b6n="Should this expense be invoiced?",y6n="Public Notes",C6n="Invoice Amount",w6n="Exchange Rate",S6n="Yes",E6n="No",x6n="Should be invoiced",T6n="View expense # :expense",k6n="Edit Expense",I6n="Archive Expense",L6n="Delete Expense",D6n="Expense # :expense",A6n="Successfully updated expense",N6n="Successfully created expense",R6n="Enter Expense",O6n="View",P6n="Restore Expense",M6n="Invoice Expense",F6n="The expenses can't belong to different clients",B6n="Expense has already been invoiced",$6n="Convert currency",V6n="Number of Days",H6n="Create Payment Term",W6n="Edit Payment Term",z6n="Edit Payment Term",U6n="Archive Payment Term",j6n="Recurring Invoice Due Dates",q6n=`<p>Automatically sets a due date for the invoice.</p> <p>Invoices on a monthly or yearly cycle set to be due on or before the day they are created will be due the next month. Invoices set to be due on the 29th or 30th in months that don't have that day will be due the last day of the month.</p> <p>Invoices on a weekly cycle set to be due on the day of the week they are created will be due the next week.</p> <p>For example:</p> <ul> <li>Today is the 15th, due date is 1st of the month. The due date should likely be the 1st of the next month.</li> <li>Today is the 15th, due date is the last day of the month. The due date will be the last day of the this month. </li> <li>Today is the 15th, due date is the 15th day of the month. The due date will be the 15th day of <strong>next</strong> month. </li> <li>Today is the Friday, due date is the 1st Friday after. The due date will be next Friday, not today. </li> </ul>`,K6n="Due",G6n="Due Next: :date",Y6n="Use client terms",Q6n=":ordinal day of month",X6n="Last day of month",Z6n=":ordinal :day after",J6n="Sunday",eBn="Monday",tBn="Tuesday",nBn="Wednesday",iBn="Thursday",rBn="Friday",oBn="Saturday",sBn="Header Font",aBn="Body Font",lBn="Note: the primary color and fonts are also used in the client portal and custom email designs.",cBn="Live Preview",uBn="Unable to send email, please check that the mail settings are correct.",dBn="To view your invoice for :amount, click the button below.",hBn="To view your quote for :amount, click the button below.",fBn="Thank you for your payment of :amount.",pBn="Direct Debit",gBn="Credit Cards & Banks",mBn="Add Bank Account",_Bn="Setup Account",vBn="Import Expenses",bBn="Bank",yBn="Integration Type",CBn="Successfully updated bank account",wBn="Edit Bank Account",SBn="Archive Bank Account",EBn="Successfully archived bank account",xBn="Successfully created bank account",TBn="Validate Bank Account",kBn="Note: your password is transmitted securely and never stored on our servers.",IBn="Warning: your password may be transmitted in plain text, consider enabling HTTPS.",LBn="Username",DBn="Account Number",ABn="Account Name",NBn="Failed to retrieve account details, please check your credentials.",RBn="Approved",OBn="Quote Settings",PBn="Auto Convert",MBn="Automatically convert a quote to an invoice when approved.",FBn="Validate",BBn="Info",$Bn="Successfully created :count_vendors vendor(s) and :count_expenses expense(s)",VBn="Note: if you plan on accepting credit cards details we strongly recommend enabling HTTPS on your site.",HBn="The expenses can't have different currencies.",WBn="The client's currency does not match the expense currency.",zBn="Trello Roadmap",UBn="Header/Footer",jBn="First page",qBn="All pages",KBn="Last page",GBn="Show Header on",YBn="Show Footer on",QBn="Invoice Currency",XBn="We strongly recommend using HTTPS to accept credit card details online.",ZBn="Quote issued to",JBn="Currency Code",e8n="Your account has been upgraded to the pro plan for one year at no cost.",t8n="Your account will receive a free two week trial of our pro plan.",n8n="Your free pro plan trial lasts :count more days, :link to upgrade now.",i8n="This is the last day of your free pro plan trial, :link to upgrade now.",r8n="Start Free Trial",o8n="Successfully enabled two week free pro plan trial",s8n="Overdue",a8n="Purchase a ONE YEAR white label license for $:price to remove the Invoice Ninja branding from the invoice and client portal.",l8n="To adjust your email notification settings please visit :link",c8n="If you did not request this password reset please email our support: :email",u8n="Sorry, this will exceed the limit of :limit users",d8n="Get 6 more invoice designs for just $:price",h8n="Please use a :link",f8n="newer browser",p8n=":link for $:price to enable custom styling and help support our project.",g8n=":link to remove the Invoice Ninja logo by joining the Pro Plan",m8n="Click here",_8n="Sent",v8n="Opened",b8n="Viewed",y8n="Emails can not be sent to inactive clients",C8n="Emails can not be sent to inactive contacts",w8n="Emails can not be sent to inactive invoices",S8n="Emails can not be sent to inactive proposals",E8n="Please register your account to send emails",x8n="Please confirm your account to send emails",T8n="Invalid contact email",k8n="Navigation",I8n="List Invoices",L8n="List Clients",D8n="List Quotes",A8n="List Tasks",N8n="List Expenses",R8n="List Recurring Invoices",O8n="List Payments",P8n="List Credits",M8n="Tax Name",F8n="Report Settings",B8n="New User",$8n="New Product",V8n="New Tax Rate",H8n="Invoiced Amount",W8n="Invoice Item Fields",z8n="Add a field when creating an invoice item and display the label and value on the PDF.",U8n="Recurring Number",j8n="Specify a prefix to be added to the invoice number for recurring invoices.",q8n="Password Protect Invoices",K8n="Allows you to set a password for each contact. If a password is set, the contact will be required to enter a password before viewing invoices.",G8n="Generate Automatically",Y8n="If no password is set, one will be generated and sent with the first invoice.",Q8n="Expired",X8n="The credit card number is not valid.",Z8n="The expiration date is not valid.",J8n="The CVV is not valid.",e9n="Cost",t9n="Note: create your first invoice to see a preview here.",n9n="Owner",i9n="Administrator",r9n="Allow user to manage users, change settings and modify all records",o9n="Create clients, invoices, etc.",s9n="View all clients, invoices, etc.",a9n="Edit all clients, invoices, etc.",l9n="Partial Due",c9n="Restore Vendor",u9n="Successfully restored vendor",d9n="Successfully restored expense",h9n="Permissions",f9n="Allow user to create and modify records",p9n="Allow user to view records they didn't create",g9n="Allow user to modify records they didn't create",m9n="View Payment",_9n="January",v9n="February",b9n="March",y9n="April",C9n="May",w9n="June",S9n="July",E9n="August",x9n="September",T9n="October",k9n="November",I9n="December",L9n="Documents:",D9n="Documents:",A9n="Widgets Receipt.pdf",N9n="Final Deliverable.zip",R9n="Quote Documents",O9n="Invoice Documents",P9n="Expense Documents",M9n="Embed Documents",F9n="Include attached images in the invoice.",B9n="Attach Documents",$9n="Attach UBL",V9n="Download Documents (:size)",H9n="From Expenses:",W9n="Drop files or click to upload",z9n="Uploads disabled",U9n="Your browser does not support drag'n'drop file uploads.",j9n="Please use the fallback form below to upload your files like in the olden days.",q9n="File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",K9n="You can't upload files of this type.",G9n="Server responded with {{statusCode}} code.",Y9n="Cancel upload",Q9n="Are you sure you want to cancel this upload?",X9n="Remove file",Z9n="Documents",J9n="Document Date",e7n="Size",t7n="Client Portal",n7n="Show/hide the client portal.",i7n="Dashboard",r7n="Show/hide the dashboard page in the client portal.",o7n="Account Management",s7n="Plan Status",a7n="Upgrade",l7n="Manage Plan",c7n="Changes To",u7n=":plan on :date",d7n=":plan (:term) on :date",h7n="Cancel Change",f7n="Plan",p7n="Expires",g7n="Renews",m7n=":plan Plan Expired",_7n=":plan Plan Trial Ended",v7n="Never",b7n="Free",y7n="Pro",C7n="Enterprise",w7n="Self Hosted (White labeled)",S7n="Self Hosted (Free)",E7n="Trial",x7n="Term",T7n="Monthly",k7n="Yearly",I7n="Month",L7n="Year",D7n="$:price/Month",A7n="$:price/Year",N7n="Updated plan settings",R7n="Term Started",O7n="Plan Started",P7n="Plan Expires",M7n="Purchase White Label",F7n="One year enrollment in the Invoice Ninja Pro Plan.",B7n="One month enrollment in the Invoice Ninja Pro Plan.",$7n="Enterprise Plan",V7n="One year enrollment in the Invoice Ninja Enterprise Plan.",H7n="One month enrollment in the Invoice Ninja Enterprise Plan.",W7n="Credit",z7n="Credit for unused time",U7n="Will switch to monthly on :date",j7n="A refund has been issued.",q7n="Page Size",K7n="Live preview has been disabled to support selected font",G7n="Padding",Y7n="Preview",Q7n="List Vendors",X7n="Upgrade to the Enterprise Plan to add additional users to your account.",Z7n="The Enterprise Plan adds support for multiple users and file attachments, :link to see the full list of features.",J7n="Return To App",e$n="Refund Payment",t$n="Max:",n$n="Refund",i$n="Refund selected payments?",r$n="Pending",o$n="Completed",s$n="Failed",a$n="Partially Refunded",l$n=":amount Refunded",c$n="Refunded",u$n="Cancelled",d$n="Refunded Payment",h$n=":user cancelled a :payment_amount payment :payment",f$n=":user refunded :adjustment of a :payment_amount payment :payment",p$n="Exp: :expires",g$n="Unknown",m$n="American Express",_$n="Carte Blanche",v$n="UnionPay",b$n="Diners Club",y$n="Discover",C$n="JCB",w$n="Laser",S$n="Maestro",E$n="MasterCard",x$n="Solo",T$n="Switch",k$n="Visa",I$n="ACH",L$n="Stripe",D$n="ACH",A$n="Accept US bank transfers",N$n="ACH support must also be enabled in :link.",R$n="Another gateway is already configured for direct debit.",O$n="Plaid",P$n="Client Id",M$n="Secret",F$n="Public Key",B$n="(optional)",$$n="When a Stripe test key is given, Plaid's development environment (tartan) will be used.",V$n="Other Providers",H$n="That country is not supported.",W$n="The routing number is not valid.",z$n="The account number is not valid.",U$n="The account numbers do not match.",j$n="Please select an individual or company account.",q$n="Please enter the account holder's name.",K$n="Routing Number",G$n="Confirm Account Number",Y$n="Individual Account",Q$n="Company Account",X$n="Account Holder Name",Z$n="Add Account",J$n="Payment Methods",eVn="Complete Verification",tVn="Amount 1",nVn="Amount 2",iVn="Verification completed successfully",rVn="Verification Failed",oVn="Remove Payment Method",sVn="Are you sure you want to remove this payment method?",aVn="Remove",lVn="Removed payment method.",cVn='We have made two deposits into your account with the description "VERIFICATION". These deposits will take 1-2 business days to appear on your statement. Please enter the amounts below.',uVn=`We have made two deposits into your account with the description "VERIFICATION". These deposits will take 1-2 business days to appear on your statement. Once you have the amounts, come back to this payment methods page and click "Complete Verification" next to the account.`,dVn="Unknown Bank",hVn="You will be able to use the account after completing verification. Verification usually takes 1-2 business days.",fVn="Add Credit Card",pVn="Added payment method.",gVn="Use For Autobill",mVn="Autobill Payment Method",_Vn="Set Autobill payment method.",vVn=":payment_amount payment (:payment) failed",bVn="Webhook URL",yVn="You must :link.",CVn="add this URL as an endpoint at Stripe",wVn="add this URL as an endpoint in GoCardless",SVn="There was an error adding your payment methd. Please try again later.",EVn="Payment failed for Invoice :invoice",xVn="A payment made by client :client towards Invoice :invoice failed. The payment has been marked as failed and :amount has been added to the client's balance.",TVn="Link Account Instantly with Plaid",kVn="Link Manually",IVn="Secured by Plaid",LVn="Your bank account at :bank",DVn="Add Payment Method",AVn="Account Holder Type",NVn="I authorize :company to use my bank account for future payments and, if necessary, electronically credit my account to correct erroneous debits. I understand that I may cancel this authorization at any time by removing the payment method or by contacting :email.",RVn="You must consent to ACH transactions.",OVn="Off",PVn="Opt-in",MVn="Opt-out",FVn="Always",BVn="Opted out",$Vn="Opted in",VVn="Manage Auto-bill",HVn="Enabled",WVn="PayPal",zVn="Enable PayPal payments through BrainTree",UVn="The PayPal gateway is processing PayPal payments",jVn="You must also :link.",qVn="link PayPal to your BrainTree account",KVn="Save payment details",GVn="Add PayPal Account",YVn="No payment method specified",QVn="Chart Type",XVn="Format",ZVn="Import OFX",JVn="OFX File",eHn="Failed to parse OFX file",tHn="WePay",nHn="Sign up with WePay",iHn="Use another provider",rHn="Company Name",oHn="This will appear on client's credit card statements.",sHn="The purpose of this account.",aHn="I agree to the :link.",lHn="WePay Terms of Service",cHn="Resend Confirmation Email",uHn="Manage Account",dHn="Action Required",hHn="Finish Setup",fHn="Please check your email and confirm your email address with WePay.",pHn="Switch to WePay",gHn="Restore Gateway",mHn="Successfully restored gateway",_Hn="United States",vHn="Canada",bHn="Accept Debit Cards",yHn="Debit Cards",CHn="The next invoice will be sent on the new start date.",wHn="The next invoice will be created on the new start date.",SHn="Original start date",EHn="New start date",xHn="Security",THn="See what's new in v:version",kHn="Please wait for the document upload to complete.",IHn="Upgrade to our Enterprise Plan to enable permissions.",LHn="Enable specifying a <b>second tax rate</b>",DHn="Payment File",AHn="Expense File",NHn="Product File",RHn="Import Products",OHn="products will be created",PHn="Product",MHn="Successfully created/updated :count product(s)",FHn="Use JSON if you plan to import the data into Invoice Ninja.<br/>The file includes clients, products, invoices, quotes and payments.",BHn="<br/>We recommend using mysqldump to create a full backup.",$Hn="JSON File",VHn="View Dashboard",HHn="Session Expired",WHn="Your session has expired. Please click the link in your email again.",zHn="This invoice will automatically be billed to your :payment_method on file on :due_date.",UHn="bank account",jHn="credit card",qHn="PayPal account",KHn="This invoice will automatically be billed to your credit card on file on the due date.",GHn="Payment Settings",YHn="On send date",QHn="On due date",XHn="ACH will always auto bill on the due date.",ZHn="Due to NACHA rules, changes to this invoice may prevent ACH auto bill.",JHn="Bank Account",eWn="ACH payments will be processed using WePay.",tWn="Privacy Policy",nWn="Please enter your email address:",iWn="Verification Pending",rWn="Please force refresh the page to update the font cache.",oWn="More options",sWn="Credit Card",aWn="Bank Transfer",lWn="We did not receive a payment transaction reference from the gateway.",cWn="Use Bank on File",uWn="This invoice will automatically be billed to the payment method on file on the due date.",dWn="Bitcoin",hWn="GoCardless",fWn="Added :date",pWn="Failed to remove the payment method",gWn="This gateway already exists",mWn="Manual entry",_Wn="First Day of the Week",vWn="Inactive",bWn="Daily",yWn="Weekly",CWn="Biweekly",wWn="Two weeks",SWn="Four weeks",EWn="Monthly",xWn="Three months",TWn="Four months",kWn="Six months",IWn="Annually",LWn="Two years",DWn="Cash",AWn="Debit",NWn="ACH",RWn="MasterCard",OWn="EuroCard",PWn="Nova",MWn="PayPal",FWn="Check",BWn="UnionPay",$Wn="JCB",VWn="Laser",HWn="Maestro",WWn="Solo",zWn="Switch",UWn="iZettle",jWn="Swish",qWn="Alipay",KWn="Sofort",GWn="SEPA Direct Debit",YWn="Bitcoin",QWn="GoCardless",XWn="Zelle",ZWn="Afghanistan",JWn="Albania",ezn="Antarctica",tzn="Algeria",nzn="Andorra",izn="Angola",rzn="Azerbaijan",ozn="Argentina",szn="Australia",azn="Austria",lzn="Bahamas",czn="Bahrain",uzn="Bangladesh",dzn="Armenia",hzn="Barbados",fzn="Belgium",pzn="Bermuda",gzn="Bhutan",mzn="Botswana",_zn="Brazil",vzn="Belize",bzn="Bulgaria",yzn="Myanmar",Czn="Burundi",wzn="Belarus",Szn="Cambodia",Ezn="Cameroon",xzn="Canada",Tzn="Chad",kzn="Chile",Izn="China",Lzn="Colombia",Dzn="Comoros",Azn="Mayotte",Nzn="Congo",Rzn="Croatia",Ozn="Cuba",Pzn="Cyprus",Mzn="Benin",Fzn="Denmark",Bzn="Dominica",$zn="Ecuador",Vzn="Ethiopia",Hzn="Eritrea",Wzn="Estonia",zzn="Fiji",Uzn="Finland",jzn="France",qzn="Djibouti",Kzn="Gabon",Gzn="Georgia",Yzn="Gambia",Qzn="Germany",Xzn="Ghana",Zzn="Gibraltar",Jzn="Kiribati",eUn="Greece",tUn="Greenland",nUn="Grenada",iUn="Guadeloupe",rUn="Guam",oUn="Guatemala",sUn="Guinea",aUn="Guyana",lUn="Haiti",cUn="Honduras",uUn="Hungary",dUn="Iceland",hUn="India",fUn="Indonesia",pUn="Iraq",gUn="Ireland",mUn="Israel",_Un="Italy",vUn="Jamaica",bUn="Japan",yUn="Kazakhstan",CUn="Jordan",wUn="Kenya",SUn="Kuwait",EUn="Kyrgyzstan",xUn="Lebanon",TUn="Lesotho",kUn="Latvia",IUn="Liberia",LUn="Libya",DUn="Liechtenstein",AUn="Lithuania",NUn="Luxembourg",RUn="Macao",OUn="Madagascar",PUn="Malawi",MUn="Malaysia",FUn="Maldives",BUn="Mali",$Un="Malta",VUn="Martinique",HUn="Mauritania",WUn="Mauritius",zUn="Mexico",UUn="Monaco",jUn="Mongolia",qUn="Montenegro",KUn="Montserrat",GUn="Morocco",YUn="Mozambique",QUn="Oman",XUn="Namibia",ZUn="Nauru",JUn="Nepal",ejn="Netherlands",tjn="Aruba",njn="Vanuatu",ijn="Nicaragua",rjn="Niger",ojn="Nigeria",sjn="Niue",ajn="Norway",ljn="Palau",cjn="Pakistan",ujn="Panama",djn="Paraguay",hjn="Peru",fjn="Philippines",pjn="Pitcairn",gjn="Poland",mjn="Portugal",_jn="Qatar",vjn="Romania",bjn="Rwanda",yjn="Anguilla",Cjn="Senegal",wjn="Serbia",Sjn="Seychelles",Ejn="Singapore",xjn="Slovakia",Tjn="Slovenia",kjn="Somalia",Ijn="Zimbabwe",Ljn="Spain",Djn="Sudan",Ajn="Suriname",Njn="Swaziland",Rjn="Sweden",Ojn="Switzerland",Pjn="Tajikistan",Mjn="Thailand",Fjn="Togo",Bjn="Tokelau",$jn="Tonga",Vjn="Tunisia",Hjn="Turkey",Wjn="Turkmenistan",zjn="Tuvalu",Ujn="Uganda",jjn="Ukraine",qjn="Egypt",Kjn="Guernsey",Gjn="Jersey",Yjn="Uruguay",Qjn="Uzbekistan",Xjn="Samoa",Zjn="Yemen",Jjn="Zambia",eqn="Croatian",tqn="Czech",nqn="Danish",iqn="Dutch",rqn="English",oqn="French",sqn="German",aqn="Italian",lqn="Japanese",cqn="Lithuanian",uqn="Norwegian",dqn="Polish",hqn="Spanish",fqn="Swedish",pqn="Albanian",gqn="Greek",mqn="Slovenian",_qn="Finnish",vqn="Romanian",bqn="Thai",yqn="Macedonian",Cqn="Serbian",wqn="Bulgarian",Sqn="Advertising",Eqn="Aerospace",xqn="Agriculture",Tqn="Automotive",kqn="Biotechnology",Iqn="Broadcasting",Lqn="Communications",Dqn="Defense",Aqn="Energy",Nqn="Entertainment",Rqn="Government",Oqn="Insurance",Pqn="Manufacturing",Mqn="Marketing",Fqn="Media",Bqn="Pharmaceuticals",$qn="Sports",Vqn="Transportation",Hqn="Other",Wqn="Photography",zqn="View client portal",Uqn="View Portal",jqn="Vendor Contacts",qqn="All",Kqn="Selected",Gqn="Category",Yqn="Categories",Qqn="New Expense Category",Xqn="Edit Category",Zqn="Archive Category",Jqn="Expense Categories",eKn="List Expense Categories",tKn="Successfully updated expense category",nKn="Successfully created expense category",iKn="Successfully archived expense category",rKn="Successfully archived :count expense category",oKn="Restore expense category",sKn="Successfully restored expense category",aKn="Apply taxes",lKn=":min to :max users",cKn="The maximum number of users has been reached.",uKn="Buy Now Buttons",dKn="Landing Page",hKn="Payment Type",fKn="Form",pKn="Link",gKn="Fields",mKn="Dwolla",_Kn="Note: the client and invoice are created even if the transaction isn't completed.",vKn="This feature requires that a product is created and a payment gateway is configured.",bKn="Enable support for buy now buttons",yKn="Note: changes take effect immediately",CKn="Payment gateway for Invoice Ninja",wKn="There was an error processing your payment [:code]. Please try again later.",SKn="Fee: 2.9%/1.2% [Credit Card/Bank Transfer] + $0.30 per successful charge.",EKn="Data needs to be imported in batches of :count rows or less",xKn="Something went wrong",TKn="If you'd like help please email us at :mailaddress",kKn="Warning: this can't be undone.",IKn="Please select a contact",LKn="Please select a client",DKn="It may help to set new passwords or generate new API keys.",AKn=":type on file",NKn="Invoice :invoice for :client",RKn="Sorry, I'm not sure what you're asking.",OKn="Sorry, I'm not able to do that.",PKn="I wasn't able to find the client",MKn="Sorry, you don't have the needed permissions",FKn="Your invoice has been sent.",BKn="I'll email you when it's viewed.",$Kn="I'll email you when it's paid.",VKn="Add 1 :product",HKn="You are not authorized",WKn="I wasn't able to find an available account for :email",zKn="The code is not correct",UKn="List Products",jKn="Include <b>line item taxes in line total</b>",qKn="Successfully created :count quotes(s)",KKn="Warning",GKn="Update Invoice Ninja",YKn="Before start upgrading Invoice Ninja create a backup of your database and files!",QKn="A new version of Invoice Ninja is available.",XKn="No new version of Invoice Ninja available.",ZKn="Update now",JKn="Download :version",eGn="Create New",tGn="Toggle Navigation",nGn="Toggle History",iGn="Unassigned",rGn="Task",oGn="Contact Name",sGn="City/State/Postal",aGn="Postal/City",lGn="Custom Field",cGn="Company Fields",uGn="Facebook and Twitter",dGn="Follow our feeds to help support our project",hGn="Note: the white-label license is intended for personal use, please email us at :email if you'd like to resell the app.",fGn="Unnamed Client",pGn="Day",gGn="Week",mGn="Month",_Gn="You have been logged out due to inactivity",vGn="Reports",bGn="Total Profit",yGn="Total Expenses",CGn="Quote to",wGn="Limit",SGn="Min: :min",EGn="Max: :max",xGn="No Limits",TGn="Set :gateway_type Limits",kGn="Enable min",IGn="Enable max",LGn="Min",DGn="Max",AGn="This invoice does not meet the limits for that payment type.",NGn="Date Range",RGn="Raw",OGn="Raw HTML",PGn="Update",MGn="Drag and drop fields to change their order and location",FGn="New Category",BGn="Restore Product",$Gn="Blank",VGn="There was an error saving your invoice",HGn="Enable Recurring",WGn="Disable Recurring",zGn="Text",UGn="expense will be created",jGn="expenses will be created",qGn="Successfully created :count expense(s)",KGn="Help improve our translations with :link",GGn="Expense Category",YGn="Go Ninja Pro!",QGn="Go Enterprise!",XGn="Upgrade For More Features",ZGn="Pay annually for 10 months + 2 free!",JGn="Ninja Pro",eYn="YourBrand.InvoiceNinja.com",tYn="Customize every aspect of your invoice!",nYn="Set permissions for multiple-users",iYn="Attach 3rd party files to invoices & expenses",rYn="Much More!",oYn="Plus all pro features!",sYn="Symbol",aYn="Code",lYn="Buy License",cYn="Apply License",uYn="Submit",dYn="License Key",hYn="The white label license is not valid",fYn="Created by :name",pYn="Modules",gYn="First Month of the Year",mYn="Authentication",_Yn="Checkbox",vYn="Signature",bYn="Invoice Terms Checkbox",yYn="Require client to confirm that they accept the invoice terms.",CYn="Quote Terms Checkbox",wYn="Require client to confirm that they accept the quote terms.",SYn="Invoice Signature",EYn="Require client to provide their signature.",xYn="Quote Signature",TYn="Require client to provide their signature.",kYn="I Agree To The Terms",IYn="Please sign here:",LYn="Use the mouse or your touchpad to trace your signature.",DYn="Authorization",AYn="Signed",NYn="Vendor",RYn="State",OYn="Date Created",PYn="There was a problem sending the email through Postmark: :link",MYn="Project",FYn="Projects",BYn="New Project",$Yn="Edit Project",VYn="Archive Project",HYn="List Projects",WYn="Successfully updated project",zYn="Successfully created project",UYn="Successfully archived project",jYn="Successfully archived :count projects",qYn="Restore Project",KYn="Successfully restored project",GYn="Delete Project",YYn="Successfully deleted project",QYn="Successfully deleted :count projects",XYn="Delete category",ZYn="Successfully deleted category",JYn="Delete Product",eQn="Successfully deleted product",tQn="Successfully deleted :count products",nQn="Successfully restored product",iQn="Update Credit",rQn="Successfully updated credit",oQn="Edit Credit",sQn="Realtime Preview",aQn="Realtime refresh PDF preview on the invoice page when editing invoice.<br/>Disable this to improve performance when editing invoices.",lQn="Display a live PDF preview on the invoice page.",cQn="Replace the built-in PDF viewer in :chrome_link and :firefox_link.<br/>Enable this if your browser is automatically downloading the PDF.",uQn="Prevent Download",dQn="Redirect URL",hQn="Optionally specify a URL to redirect to after a payment is entered.",fQn="Save Draft",pQn="Refunded credit payment",gQn="Keyboard Shortcuts",mQn="Toggle Menu",_Qn="Date Created",vQn="Contact Us",bQn="User Guide",yQn="Upgrade before :expires and get :amount OFF your first year of our Pro or Enterprise packages.",CQn=":amount off expires :expires",wQn="Mark Paid",SQn="Successfully marked invoice sent",EQn="Successfully marked invoices sent",xQn="Invoice",TQn="product will be created",kQn="Thank you for your message! We'll try to respond as soon as possible.",IQn="Last 7 Days",LQn="Last 30 Days",DQn="This Month",AQn="Last Month",NQn="Current Quarter",RQn="Last Quarter",OQn="Last Year",PQn="All Time",MQn="Custom Range",FQn="URL",BQn="Debug",$Qn="HTTPS",VQn="Require",HQn="Note: Your license will expire in :count days, :link to renew it.",WQn="Your email address has been confirmed.",zQn="Your white label license has expired, please consider renewing it to help support our project.",UQn="Renew License",jQn="Consider downloading our :link",qQn="iPhone app",KQn="Android app",GQn="Logged In",YQn="Switch to your primary company (:name) to manage your plan.",QQn="Inclusive",XQn="Exclusive",ZQn="Postal/City/State",JQn="In certain cases the app uses :link_phantom to generate the PDF, install :link_docs to generate it locally.",eXn="Using local PhantomJS",tXn="Client Number",nXn="Specify a prefix or use a custom pattern to dynamically set the client number.",iXn="The next client number is :number.",rXn="Generated Numbers",oXn="First Reminder",sXn="Second Reminder",aXn="Third Reminder",lXn="Reminder",cXn="BCC Email",uXn="Tax Quote",dXn="Tax Invoice",hXn="Successfully emailed invoices",fXn="Successfully emailed quotes",pXn="Website URL",gXn="Domain",mXn="Used in the client portal and when sending emails.",_Xn="Used when sending emails.",vXn="Import Invoices",bXn="New Report",yXn="Edit Report",CXn="Columns",wXn="Filters",SXn="Sort By",EXn="Draft",xXn="Unpaid",TXn="Aging",kXn="Age",IXn="Days",LXn="0 - 30 Days",DXn="30 - 60 Days",AXn="60 - 90 Days",NXn="90 - 120 Days",RXn="120+ Days",OXn="Invoice Details",PXn="Quantity",MXn="Profit and Loss",FXn="Revenue",BXn="Profit",$Xn="Group Sort",VXn="Group Dates By",HXn="Year",WXn="View Statement",zXn="Statement",UXn="Statement Date",jXn="Mark Active",qXn="Send Automatically",KXn="Initial Email",GXn="This invoice hasn't been emailed.",YXn="This quote hasn't been emailed.",QXn="Sent by :user",XXn="Recipients",ZXn="Save as default",JXn="Used by <b>date</b> selectors",eZn="Used by <b>date range</b> selectors",tZn="Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.",nZn="This Year",iZn="Create. Send. Get Paid.",rZn="Or login with a connected account.",oZn="Sign Up Now",sZn="Not a member yet?",aZn="Create an Account!",lZn="Invoices From:",cZn="Full Name",uZn="MONTH/YEAR",dZn="Valid\\nthru",hZn="Product Fields",fZn="Add a field when creating a product or invoice and display the label and value on the PDF.",pZn="Two months",gZn="Annually",mZn="Profile",_Zn="Construction",vZn="Your Statement",bZn="Statement issued to",yZn="Statement to",CZn="Customize options",wZn="Successfully created payment term",SZn="Successfully updated payment term",EZn="Successfully archived payment term",xZn="Resend Invitation",TZn="Credit created by payment :transaction_reference",kZn="Successfully created payment and credit",IZn="Successfully created payment and credit, and emailed client",LZn="Create project",DZn="Create vendor",AZn="Create category",NZn=":link to enable reports by joining the Pro Plan",RZn="Mark Ready",OZn="Limits",PZn="Fees",MZn="Fee",FZn="Set :gateway_type Limits/Fees",BZn="Enable line item taxes to set the fee tax rates.",$Zn="The fee for a :amount invoice would be :total.",VZn="The discount for a :amount invoice would be :total.",HZn="No Fees",WZn="Warning: not all states/payment gateways allow adding fees, please review local laws/terms of service.",zZn="Percent",UZn="Location",jZn="Line Item",qZn="Surcharge",KZn="Enabled - First surcharge",GZn="Enabled - Second surcharge",YZn="Enabled - Line item",QZn="Online Payment Surcharge",XZn="Gateway Fees",ZZn="Fees are disabled",JZn="Automatically add an online payment surcharge/discount.",eJn="Gateway",tJn="If there are unpaid invoices with fees they need to be updated manually.",nJn="Customize surcharge :link.",iJn="label and taxes",rJn="Billable",oJn="The image file is too large.",sJn="Warning: To support gifs the fileinfo PHP extension needs to be enabled.",aJn="There was a problem reading the image file, please try a different format.",lJn="An error occurred, please refresh the page and try again.",cJn="Data",uJn="Successfully imported settings",dJn="Reset Counter",hJn="Next Reset",fJn="Automatically reset the invoice and quote counters.",pJn="Auto-billing for invoice :invoice_number failed",gJn="Online Payment Discount",mJn="Successfully created new company",_Jn="Fees are disabled for this gateway.",vJn="Log Out/Delete Account",bJn="Inclusive tax rates adjust the line item cost when selected.<br/>Only exclusive tax rates can be used as a default.",yJn="Credit Note",CJn="Credit issued to",wJn="Credit to",SJn="Your Credit",EJn="Credit Number",xJn="Create Credit Note",TJn="Menu",kJn="Error: The gateways table has incorrect ids.",IJn="Purge Data",LJn="Delete Data",DJn="Permanently delete all data but keep the account and settings.",AJn="Permanently delete the account along with all data and setting.",NJn="Successfully purged company data",RJn="Forbidden",OJn="Warning: This will permanently erase your data, there is no undo.",PJn="Contact Phone",MJn="Contact Email",FJn="Reply-To Email",BJn="Specify the reply-to address for client emails.",$Jn="Privately include this address with client emails.",VJn="Your import has successfully completed.",HJn="Please confirm your account to import data.",WJn="Your import has started, we'll send you an email once it completes.",zJn="Venmo",UJn="Successfully archived :count products",jJn="We recommend <b>enabling</b> this setting.",qJn="We recommend <b>disabling</b> this setting.",KJn="Auto-billed",GJn="Surcharge Label",YJn="Contact Fields",QJn="Add a field when creating a contact and optionally display the label and value on the PDF.",XJn="Showing :start to :end of :total entries",ZJn="Credit Total",JJn="Mark billable",eei="Billed",tei="Company Variables",nei="Client Variables",iei="Invoice Variables",rei="Navigation Variables",oei="Custom Variables",sei="Invalid file type",aei="Add Documents to Invoice",lei="Mark paid",cei="Failed to validate the license, either expired or excessive activations. Email contact@invoiceninja.com for more information.",uei="Plan Price",dei="Incorrect confirmation code",hei="The account is already registered",fei="Successfully emailed payment",pei="Email Payment",gei="Use :link to migrate your data from InvoicePlane.",mei="Warning: This :link may be a duplicate",_ei="expense",vei="Resume Task",bei="Successfully resumed task",yei="Quote Design",Cei="Standard Design",wei="Custom Design 1",Sei="Custom Design 2",Eei="Custom Design 3",xei="Empty",Tei="Load Design",kei="Accepted Card Logos",Iei="Google Analytics",Lei="Analytics Key",Dei="Track payments using :link",Aei="The start date is required",Nei="Application Settings",Rei="Database Connection",Oei="Driver",Pei="Host",Mei="Database",Fei="Test connection",Bei="From Name",$ei="From Address",Vei="Port",Hei="Encryption",Wei="Mailgun Domain",zei="Mailgun Private Key",Uei="Brevo Domain",jei="Brevo Private Key",qei="Send Test Email",Kei="Select Label",Gei="Label",Yei="Service",Qei="Update payment details",Xei="Successfully updated payment details",Zei="Update Credit Card",Jei="Recurring Expenses",eti="Recurring Expense",tti="New Recurring Expense",nti="Edit Recurring Expense",iti="Archive Recurring Expense",rti="List Recurring Expenses",oti="Successfully updated recurring expense",sti="Successfully created recurring expense",ati="Successfully archived recurring expense",lti="Restore Recurring Expense",cti="Successfully restored recurring expense",uti="Delete Recurring Expense",dti="Successfully deleted recurring expense",hti="View Recurring Expense",fti="Taxes and fees",pti="Import Failed",gti="Recurring Prefix",mti="Options",_ti="Specify a prefix or use a custom pattern to dynamically set the credit number for negative invoices.",vti="The next credit number is :number.",bti="The number of zero's to pad the number.",yti="Warning: The date format appears to be invalid.",Cti="Product Notes",wti="App Version",Sti="OFX Version",Eti="Charge Late Fee",xti="Late Fee Amount",Tti="Late Fee Percent",kti="Late fee added on :date",Iti="Download Invoice",Lti="Download Quote",Dti="Your invoice PDFs are attached.",Ati="An email will be sent with the invoice PDF",Nti="An email will be sent with the quote PDF",Rti="An email will be sent with the invoice PDFs",Oti="An email will be sent with the quote PDFs",Pti="Clone Expense",Mti="Default Documents",Fti="Send email to the client",Bti="Refund Processed",$ti="You have been processed a refund of :amount for invoice :invoice_number.",Vti="US Dollar",Hti="British Pound",Wti="Euro",zti="South African Rand",Uti="Danish Krone",jti="Israeli Shekel",qti="Swedish Krona",Kti="Kenyan Shilling",Gti="Canadian Dollar",Yti="Philippine Peso",Qti="Indian Rupee",Xti="Australian Dollar",Zti="Singapore Dollar",Jti="Norske Kroner",eni="New Zealand Dollar",tni="Vietnamese Dong",nni="Swiss Franc",ini="Guatemalan Quetzal",rni="Malaysian Ringgit",oni="Brazilian Real",sni="Thai Baht",ani="Nigerian Naira",lni="Argentine Peso",cni="Bangladeshi Taka",uni="United Arab Emirates Dirham",dni="Hong Kong Dollar",hni="Indonesian Rupiah",fni="Mexican Peso",pni="Egyptian Pound",gni="Colombian Peso",mni="West African Franc",_ni="Chinese Renminbi",vni="Rwandan Franc",bni="Tanzanian Shilling",yni="Netherlands Antillean Guilder",Cni="Trinidad and Tobago Dollar",wni="East Caribbean Dollar",Sni="Ghanaian Cedi",Eni="Bulgarian Lev",xni="Aruban Florin",Tni="Turkish Lira",kni="Romanian New Leu",Ini="Croatian Kuna",Lni="Saudi Riyal",Dni="Japanese Yen",Ani="Maldivian Rufiyaa",Nni="Costa Rican Colón",Rni="Pakistani Rupee",Oni="Polish Zloty",Pni="Sri Lankan Rupee",Mni="Czech Koruna",Fni="Uruguayan Peso",Bni="Namibian Dollar",$ni="Tunisian Dinar",Vni="Russian Ruble",Hni="Mozambican Metical",Wni="Omani Rial",zni="Ukrainian Hryvnia",Uni="Macanese Pataca",jni="Taiwan New Dollar",qni="Dominican Peso",Kni="Chilean Peso",Gni="Icelandic Króna",Yni="Papua New Guinean Kina",Qni="Jordanian Dinar",Xni="Myanmar Kyat",Zni="Peruvian Sol",Jni="Botswana Pula",eii="Hungarian Forint",tii="Ugandan Shilling",nii="Barbadian Dollar",iii="Brunei Dollar",rii="Georgian Lari",oii="Qatari Riyal",sii="Honduran Lempira",aii="Surinamese Dollar",lii="Bahraini Dinar",cii="Venezuelan Bolivars",uii="South Korean Won",dii="Moroccan Dirham",hii="Jamaican Dollar",fii="Angolan Kwanza",pii="Haitian Gourde",gii="Zambian Kwacha",mii="Nepalese Rupee",_ii="CFP Franc",vii="Mauritian Rupee",bii="Cape Verdean Escudo",yii="Kuwaiti Dinar",Cii="Algerian Dinar",wii="Macedonian Denar",Sii="Fijian Dollar",Eii="Bolivian Boliviano",xii="Albanian Lek",Tii="Serbian Dinar",kii="Lebanese Pound",Iii="Armenian Dram",Lii="Azerbaijan Manat",Dii="Bosnia and Herzegovina Convertible Mark",Aii="Belarusian Ruble",Nii="Moldovan Leu",Rii="Kazakhstani Tenge",Oii="Gibraltar Pound",Pii="Gambia Dalasi",Mii="Paraguayan Guarani",Fii="Malawi Kwacha",Bii="Zimbabwean Dollar",$ii="Cambodian Riel",Vii="Vanuatu Vatu",Hii="Cuban Peso",Wii="BZ Dollar",zii="Libyan Dinar",Uii="Silver Troy Ounce",jii="Gold Troy Ounce",qii="Malagasy ariary",Kii="Tongan Pa'anga",Gii="We hope you're enjoying using the app.<br/>If you'd consider :link we'd greatly appreciate it!",Yii="writing a review",Qii="First Tax",Xii="Second Tax",Zii="Gateway fees are the costs charged for access to the financial networks that handle the processing of online payments.",Jii="Exporting format",eri="First Custom",tri="Second Custom",nri="Contact First Name",iri="Contact Last Name",rri="Contact First Custom",ori="Contact Second Custom",sri="Currency",ari="To troubleshoot check for comments on :ofxhome_link and test with :ofxget_link.",lri="comments",cri="Item Product",uri="Item Notes",dri="Item Cost",hri="Item Quantity",fri="Item Tax Rate",pri="Item Tax Name",gri="Item Tax1",mri="Item Tax2",_ri="Delete Company",vri="Permanently delete the company along with all data and setting.",bri="Warning: This will permanently delete your company, there is no undo.",yri="The coupon has been applied, the plan price has been reduced by :discount%.",Cri="The coupon has been applied, your account has been upgraded to pro for one year.",wri="If you're reporting an error please include any relevant logs from storage/logs/laravel-error.log",Sri="Include Errors",Eri="Include :link from storage/logs/laravel-error.log",xri="recent errors",Tri="Customer",kri="Customers",Iri="Successfully created customer",Lri="Successfully created :count customers",Dri="The data in your company (:account) has been successfully purged.",Ari="Successfully deleted company",Nri="Successfully canceled account",Rri="Your company (:account) has been successfully deleted.",Ori="Your account (:account) has been successfully deleted.",Pri="Alipay",Mri="Sofort",Fri="SEPA Direct Debit",Bri="Please enter a name with only the letters a-z and whitespaces",$ri="Accept Alipay",Vri="Accept EU bank transfers",Hri="These gateways also need to be activated in :link.",Wri="Calendar",zri=":link to enable the calendar by joining the Pro Plan",Uri="What are you working on?",jri="Time Tracker",qri="Refresh",Kri="Filter/Sort",Gri="No Description",Yri="Time Tracker Login",Qri="Save or discard your changes",Xri="Discard Changes",Zri="Tasks are not enabled.",Jri="Successfully started task",eoi="Create Client",toi="Download the desktop app",noi="Download the iPhone app",ioi="Download the Android app",roi="Double tap a task to select it",ooi="Stopped",soi="Ascending",aoi="Descending",loi="Sort By",coi="Direction",uoi="Discard",doi="AM",hoi="PM",foi="mins",poi="hr",goi="hrs",moi="Clear",_oi="Note: accepting online payments requires a payment gateway, :link to add one.",voi="Task Rate",boi="Set the default rate for invoiced tasks.",yoi="Past Due",Coi="Document",woi="Invoice/Expense",Soi="Invoice PDFs",Eoi="Accept SEPA",xoi="Accept Bitcoin",Toi="IBAN",koi="By providing your IBAN and confirming this payment, you are authorizing :company and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.",Ioi="Recover License",Loi="Purchase",Doi="Recover",Aoi="Apply",Noi="Recover White Label License",Roi="Apply White Label License",Ooi="Videos",Poi="Video",Moi="Return to Invoice",Foi="Partial Due Date",Boi="Task Fields",$oi="Drag and drop fields to change their order",Voi="Custom Value 1",Hoi="Custom Value 2",Woi="Two-Factor Authentication",zoi="Use your phone to confirm your identity when logging in",Uoi="Two-Factor Setup",joi="Scan the bar code with a :link compatible app.",qoi="One Time Password",Koi="Set your mobile phone number as a backup to enable.",Goi="Successfully enabled Two-Factor Authentication",Yoi="Add Product",Qoi="Note: the email will be sent on :date.",Xoi="Invoice Product",Zoi="Self-Host Login",Joi="Self-Host URL",esi="Error: local storage is not available.",tsi="Your Password Reset Link",nsi="The subdomain is already in use",isi="The inbound mailbox is already in use",rsi="The inbound mailbox does not match the required schema",osi="Client Login",ssi="Converted Amount",asi="Shipping Address",lsi="Billing Address",csi="Billing Street",usi="Billing Apt/Suite",dsi="Billing City",hsi="Billing State/Province",fsi="Billing Postal Code",psi="Billing Country",gsi="Shipping Street",msi="Shipping Apt/Suite",_si="Shipping City",vsi="Shipping State/Province",bsi="Shipping Postal Code",ysi="Shipping Country",Csi="Classify",wsi="Require client to provide their shipping address",Ssi="Ship to billing address",Esi="Delivery Note",xsi="Show tasks in the client portal",Tsi="Cancel Schedule",ksi="Scheduled Report",Isi="Email the :report report as :format to :email",Lsi="Successfully scheduled report",Dsi="Successfully canceled scheduled report",Asi="Your scheduled :type report is attached.",Nsi="Failed to create schedule report",Rsi="Invalid one time password",Osi="Apple/Google Pay",Psi="Accept Apple Pay and Pay with Google",Msi="This payment type requires that a :link.",Fsi="subdomain is set",Bsi="Verification File",$si="The verification file is needed to accept payments.",Vsi="Use <code>:domain</code> as the domain in :link.",Hsi="Sorry, Apple/Google Pay isn't supported by your browser",Wsi="Optional Payment Methods",zsi="Add Subscription",Usi="Target",jsi="When the selected event occurs the app will post the entity to the target URL.",qsi="Event",Ksi="Created Client",Gsi="Created Invoice",Ysi="Created Quote",Qsi="Created Payment",Xsi="Created Vendor",Zsi="Updated Quote",Jsi="Deleted Quote",eai="Updated Invoice",tai="Deleted Invoice",nai="Updated Client",iai="Deleted Client",rai="Deleted Payment",oai="Updated Vendor",sai="Deleted Vendor",aai="Created Expense",lai="Updated Expense",cai="Deleted Expense",uai="Created Task",dai="Updated Task",hai="Deleted Task",fai="Approved Quote",pai="Subscriptions",gai="Successfully updated subscription",mai="Successfully created subscription",_ai="Edit Subscription",vai="Archive Subscription",bai="Successfully archived subscription",yai="The projects can't belong to different clients",Cai="Invoice Project",wai="Recurring Invoices",Sai="Credits",Eai="Quotes & Proposals",xai="Tasks & Projects",Tai="Expenses & Vendors",kai="Tickets",Iai="Reminders",Lai="Send email reminders",Dai="Tasks are visible in the portal",Aai="Reminders are not sent",Nai="Your promotion will expire soon, :link to upgrade now.",Rai="Note: to delete this company first delete all linked companies.",Oai="Please register your account",Pai="Processing request",Mai="Warning: Mcrypt is deprecated, run :command to update your cipher.",Fai="Edit Times",Bai="Include <b>taxes in the cost</b>",$ai="This setting can not be changed once an invoice has been created.",Vai="Warning: existing invoices will need to be resaved",Hai="Copy Shipping",Wai="Copy Billing",zai="The quote has expired, please contact the merchant.",Uai="Showing 0 to 0 of 0 entries",jai="Do not remember this device",qai="Trust for 30 days",Kai="Trust forever",Gai="Kanban",Yai="Backlog",Qai="Ready to do",Xai="In progress",Zai="Add status",Jai="Archive Status",eli="New Status",tli="Convert Products",nli="Automatically convert product prices to the client's currency",ili="Set a subdomain to shorten the client portal link.",rli="Budgeted Hours",oli="Progress",sli="View Project",ali="Summary",lli="Endless Reminder",cli="Add the following code to show your client's signature on the PDF.",uli="Show on PDF",dli="Show the client signature on the invoice/quote PDF.",hli="The white label license has expired",fli="Return to Login",pli='Note: add a :link named ":name" to see the exchange rate.',gli="The amount is greater than the invoice balance, a credit will be created with the remaining amount.",mli="Use <code>Label|Option1,Option2</code> to show a select box.",_li="Client Information",vli="Successfully updated client details",bli="Auto",yli="Tax Amount",Cli="Tax Paid",wli="None",Sli="To view your proposal for :amount, click the button below.",Eli="Proposal",xli="Proposals",Tli="List Proposals",kli="New Proposal",Ili="Edit Proposal",Lli="Archive Proposal",Dli="Delete Proposal",Ali="Successfully created proposal",Nli="Successfully updated proposal",Rli="Successfully archived proposal",Oli="Successfully archived proposal",Pli="Successfully archived :count proposals",Mli="Successfully archived :count proposals",Fli="Successfully restored proposal",Bli="Restore Proposal",$li="Snippet",Vli="Snippets",Hli="Snippet",Wli="Snippets",zli="New Snippet",Uli="Edit Snippet",jli="Archive Snippet",qli="Delete Snippet",Kli="Successfully created snippet",Gli="Successfully updated snippet",Yli="Successfully archived snippet",Qli="Successfully archived snippet",Xli="Successfully archived :count snippets",Zli="Successfully archived :count snippets",Jli="Successfully restored snippet",eci="Restore Snippet",tci="Template",nci="Templates",ici="Template",rci="Templates",oci="New Template",sci="Edit Template",aci="Archive Template",lci="Delete Template",cci="Successfully created template",uci="Successfully updated template",dci="Successfully archived template",hci="Successfully archived template",fci="Successfully archived :count templates",pci="Successfully archived :count templates",gci="Successfully restored template",mci="Restore Template",_ci="Category",vci="Categories",bci="New Category",yci="Edit Category",Cci="Archive Category",wci="Delete Category",Sci="Successfully created category",Eci="Successfully updated category",xci="Successfully archived category",Tci="Successfully archived category",kci="Successfully archived :count categories",Ici="Successfully archived :count categories",Lci="Successfully restored category",Dci="Restore Category",Aci="Delete Status",Nci="Standard",Rci="Icon",Oci="The requested proposal is not available",Pci="Create category",Mci="Clone Template",Fci="Proposal Email",Bci="New proposal :number from :account",$ci="To view your proposal for :amount, click the link below.",Vci="Successfully emailed proposal",Hci="Load Template",Wci="No images, drag to upload",zci="Add Image",Uci="Select Image",jci="Upgrade to the Enterprise Plan to upload files & images",qci="Delete Image",Kci="Warning: deleting the image will remove it from all proposals.",Gci="Note: the invoice $amount field will use the partial/deposit field if set otherwise it will use the invoice balance.",Yci="Note: Inclusive taxes have been enabled.",Qci="Note: Inclusive taxes are not enabled.",Xci="Changing this setting requires :link the account data.",Zci="purging",Jci="The refund will be recorded in the app but will NOT be processed by the payment gateway.",eui="Email address has been changed",tui="The email address for your account has been changed from :old_email to :new_email.",nui="Test",iui="Beta",rui="Email History",oui="Loading",sui="No messages found",aui="Processing",lui="Reactivate",cui="The email address has been reactivated",uui="Emails",dui="Opened",hui="Bounced",fui="Total Sent",pui="Total Opened",gui="Total Bounced",mui="Total Spam",_ui="Platforms",vui="Email Clients",bui="Mobile",yui="Desktop",Cui="Webmail",wui="Group",Sui="Subgroup",Eui="Unset",xui="You've received a new payment!",Tui="Receive payment notifications using :link.",kui="Slack incoming webhooks",Iui="Accept",Lui="Successfully accepted the latest terms of service",Dui="Invalid URL",Aui="Workflow Settings",Nui="Auto Email",Rui="Automatically email recurring invoices when created.",Oui="Auto Archive",Pui="Automatically archive invoices when paid.",Mui="Auto Archive",Fui="Automatically archive quotes when converted to invoice.",Bui="Require approve quote",$ui="Require clients to approve quotes.",Vui="Allow approve expired quote",Hui="Allow clients to approve expired quotes.",Wui="Invoice Workflow",zui="Quote Workflow",Uui="Error: the client must be active",jui="Purge Client",qui="Successfully purged client",Kui="All related records (invoices, tasks, expenses, documents, etc) will also be deleted.",Gui="Clone Product",Yui="Item Details",Qui="Send line item details to the payment gateway.",Xui="View Proposal",Zui="View in Portal",Jui="This website uses cookies to ensure you get the best experience on our website.",edi="Got it!",tdi="vendor will be created",ndi="vendors will be created",idi="Successfully created :count vendor(s)",rdi="Import Vendors",odi="Company",sdi="Client Field",adi="Contact Field",ldi="Product Field",cdi="Task Field",udi="Project Field",ddi="Expense Field",hdi="Vendor Field",fdi="Company Field",pdi="Invoice Field",gdi="Invoice Surcharge",mdi="Add a field when creating a task.",_di="Add a field when creating a project.",vdi="Add a field when creating an expense.",bdi="Add a field when creating a vendor.",ydi="Messages",Cdi="Unpaid Invoice",wdi="Paid Invoice",Sdi="Unapproved Quote",Edi="Unapproved Proposal",xdi="Auto-fills city/state",Tdi="No match found",kdi="Password Strength",Idi="Weak",Ldi="Good",Ddi="Strong",Adi="Mark",Ndi="Successfully update task status",Rdi="Background Image",Odi="Use the :link to manage your images, we recommend using a small file.",Pdi="proposal editor",Mdi="Background",Fdi="Guide",Bdi="Gateway Fee Item",$di="Gateway Fee Surcharge",Vdi="Gateway Fee Discount",Hdi="Show Payments",Wdi="Show Aging",zdi="Reference",Udi="Amount Paid",jdi="Send Notifications For",qdi="All Invoices",Kdi="My Invoices",Gdi="Payment Reference",Ydi="Maximum",Qdi="Sort",Xdi="Refresh Complete",Zdi="Please enter your email",Jdi="Please enter your password",ehi="Please enter your URL",thi="Please enter a product key",nhi="An error occurred",ihi="Overview",rhi="Copied :value to the clipboard",ohi="Error",shi="Could not launch",ahi="Additional",lhi="Ok",chi="Email is invalid",uhi="Items",dhi="Partial/Deposit",hhi="Add Item",fhi="Total Amount",phi="PDF",ghi="Invoice Status",mhi="Click + to add an item",_hi=":count selected",vhi="Dismiss",bhi="Please select a date",yhi="Please select a client",Chi="Language",whi="Updated",Shi="Please enter an invoice number",Ehi="Please enter a quote number",xhi=":client's invoices",Thi="Viewed",khi="Approved",Ihi="Draft",Lhi="Sent",Dhi="Viewed",Ahi="Approved",Nhi="Partial",Rhi="Paid",Ohi="Successfully marked invoice as sent",Phi="Please enter a client or contact name",Mhi="Restart the app to apply the change",Fhi="Refresh Data",Bhi="Blank Contact",$hi="No records found",Vhi="Industry",Hhi="Size",Whi="Net",zhi="Show tasks",Uhi="Email Reminders",jhi="First Reminder",qhi="Second Reminder",Khi="Third Reminder",Ghi="Send",Yhi="Auto billing",Qhi="Button",Xhi="More",Zhi="Edit Recurring Invoice",Jhi="Edit Recurring Quote",efi="Quote Status",tfi="Please select an invoice",nfi="Filtered by",ifi="Payment Status",rfi="Pending",ofi="Voided",sfi="Failed",afi="Completed",lfi="Partially Refunded",cfi="Refunded",ufi="Send receipt to the client",dfi="Refunded",hfi="Successfully marked quote as sent",ffi="Custom Module Settings",pfi="Open",gfi="Closed",mfi="Reopened",_fi="Priority",vfi="Last Updated",bfi="Comments",yfi="Tags",Cfi="Linked Objects",wfi="Low",Sfi="Medium",Efi="High",xfi="No due date set",Tfi="Assigned to",kfi="Reply",Ifi="Awaiting reply",Lfi="Mark as Spam",Dfi="Local Part",Afi="Name taken",Nfi="Name available",Rfi="Invalid name (alpha numeric only, no spaces",Ofi="Customize the local part of your inbound support email, ie. YOUR_NAME@support.invoiceninja.com",Pfi="From name is the recognizable sender which is displayed instead of the email address, ie Support Center",Mfi="YOUR_NAME",Ffi="Support Center",Bfi="Attachments",$fi="Client uploads",Vfi="Allow clients to upload documents/attachments",Hfi="Maximum file size (KB) is limited by your post_max_size and upload_max_filesize variables as set in your PHP.INI",Wfi="Maximum file size",zfi="Mime types",Ufi=".pdf , .docx, .jpg",jfi="Comma separated list of allowed mime types, leave blank for all",qfi="Ticket number must be greater than the current ticket number",Kfi="New ticket",Gfi="Selecting a template will send an auto response to a client/contact when a new ticket is created",Yfi="Updated ticket",Qfi="Selecting a template will send an auto response to a client/contact when a ticket is updated",Xfi="Closed ticket",Zfi="Selecting a template will send an auto response to a client/contact when a ticket is closed",Jfi="Default priority",epi="New comment",tpi="Additional new comment notifications",npi="admin@example.com, supervisor@example.com",ipi="Default Agent",rpi="If selected will automatically be assigned to all inbound tickets",opi="Show agent details on responses",spi="Avatar",api="Remove avatar",lpi="Add Template",cpi="Archive Template",upi="Restore Template",dpi="Successfully archived template",hpi="Successfully restored template",fpi="Please enter a message to update the ticket",ppi="Show / Hide all",gpi="Subject required",mpi="If you're using the mobile app you may need to do a full refresh.",_pi="Merge",vpi="Merged",bpi="Agent",ypi="Include in filter",Cpi=":VALUE",wpi=":VALUE",Spi="Compare",Epi="Hosted Login",xpi="Selfhost Login",Tpi="Google Login",kpi="Thank for your patience while we work to implement these features.<br><br>We hope to have them completed in the next few months.<br><br>Until then we'll continue to support the",Ipi="legacy mobile app",Lpi="Today",Dpi="Current",Api="Previous",Npi="Current Period",Rpi="Comparison Period",Opi="Previous Period",Ppi="Previous Year",Mpi="Compare to",Fpi="Last Week",Bpi="Clone to Invoice",$pi="Clone to Quote",Vpi="Convert",Hpi="Last 7 Days",Wpi="Last 30 Days",zpi="Custom JS",Upi="Adjust percent to account for fee",jpi="Show product details",qpi="Include the <b>description and cost</b> in the product dropdown",Kpi="Important",Gpi="Thank you for using our app!",Ypi="If you like it please",Qpi="to rate it.",Xpi="Average",Zpi="Unapproved",Jpi="Please authenticate to change this setting",egi="Locked",tgi="Authenticate",ngi="Please authenticate",igi="Biometric Authentication",rgi="Auto Start Tasks",ogi="Budgeted",sgi="Please enter a name",agi="Click + to add time",lgi="Design",cgi="Password is too short",ugi="Failed to find record",dgi="Valid Until",hgi="Automatically sets the <b>Valid Until</b> value on quotes to this many days in the future. Leave blank to disable.",fgi="Days",pgi="Requires an Enterprise Plan",ggi="Take Picture",mgi="Upload File",_gi="New Document",vgi="Edit Document",bgi="Successfully uploaded document",ygi="Successfully updated document",Cgi="Successfully archived document",wgi="Successfully deleted document",Sgi="Successfully restored document",Egi="No History",xgi="Logged",Tgi="Pending",kgi="Invoiced",Igi="No record selected",Lgi="Please save or cancel your changes",Dgi="Thank you for your purchase!",Agi="Redeem",Ngi="Back",Rgi="Past Purchases",Ogi="Annual Subscription",Pgi="Pro Plan",Mgi="Enterprise Plan",Fgi=":count users",Bgi="Upgrade",$gi="Please enter a first name",Vgi="Please enter a last name",Hgi="Please agree to the terms of service and privacy policy to create an account.",Wgi="I agree to the",zgi="terms of service",Ugi="privacy policy",jgi="View Website",qgi="Create Account",Kgi="Email Login",Ggi="Late Fees",Ygi="Payment Number",Qgi="Before the due date",Xgi="After the due date",Zgi="After the invoice date",Jgi="Filtered by User",emi="Successfully created user",tmi="Primary Font",nmi="Secondary Font",imi="Number Padding",rmi="General",omi="Surcharge Field",smi="Company Value",ami="Credit Field",lmi="Payment Field",cmi="Group Field",umi="Number Counter",dmi="Number Pattern",hmi="Custom JavaScript",fmi="Portal Mode",pmi="Attach PDF",gmi="Attach Documents",mmi="Attach UBL/E-Invoice",_mi="Email Style",vmi="Processed",bmi="Fee Amount",ymi="Fee Percent",Cmi="Fee Cap",wmi="Limits/Fees",Smi="Credentials",Emi="Require client to provide their billing address",xmi="Require client to provide their shipping address",Tmi="Successfully deleted tax rate",kmi="Successfully restored tax rate",Imi="Provider",Lmi="Payment Gateway",Dmi="Payment Gateways",Ami="New Gateway",Nmi="Edit Gateway",Rmi="Successfully created gateway",Omi="Successfully updated gateway",Pmi="Successfully archived gateway",Mmi="Successfully deleted gateway",Fmi="Successfully restored gateway",Bmi="Continue Editing",$mi="Default value",Vmi="Currency Format",Hmi="First Day of the Week",Wmi="First Month of the Year",zmi="Symbol",Umi="Code",jmi="Date Format",qmi="Datetime Format",Kmi="Send Reminders",Gmi="Timezone",Ymi="Filtered by Group",Qmi="Filtered by Invoice",Xmi="Filtered by Client",Zmi="Filtered by Vendor",Jmi="Group Settings",e_i="Groups",t_i="New Group",n_i="Edit Group",i_i="Successfully created group",r_i="Successfully updated group",o_i="Successfully archived group",s_i="Successfully deleted group",a_i="Successfully restored group",l_i="Upload Your Company Logo",c_i="Successfully uploaded logo",u_i="Successfully saved settings",d_i="Device Settings",h_i="Credit Cards & Banks",f_i="Price",p_i="Email Sign Up",g_i="Google Sign Up",m_i="Sign Up With Google",__i="Long-press Multiselect",v_i="Migrate to the next version of Invoice Ninja",b_i="We've been working on next version of Invoice Ninja. Click the button bellow to start the migration.",y_i="Start the migration",C_i="Migration",w_i="Welcome to the new version of Invoice Ninja",S_i="At the next step, we'll let you download your data for the migration.",E_i="Press button below to download the data.",x_i="Custom Company 1",T_i="Custom Company 2",k_i="Custom Company 3",I_i="Custom Company 4",L_i="Custom Product 1",D_i="Custom Product 2",A_i="Custom Product 3",N_i="Custom Product 4",R_i="Custom Client 1",O_i="Custom Client 2",P_i="Custom Client 3",M_i="Custom Client 4",F_i="Custom Contact 1",B_i="Custom Contact 2",$_i="Custom Contact 3",V_i="Custom Contact 4",H_i="Custom Task 1",W_i="Custom Task 2",z_i="Custom Task 3",U_i="Custom Task 4",j_i="Custom Project 1",q_i="Custom Project 2",K_i="Custom Project 3",G_i="Custom Project 4",Y_i="Custom Expense 1",Q_i="Custom Expense 2",X_i="Custom Expense 3",Z_i="Custom Expense 4",J_i="Custom Vendor 1",evi="Custom Vendor 2",tvi="Custom Vendor 3",nvi="Custom Vendor 4",ivi="Custom Invoice 1",rvi="Custom Invoice 2",ovi="Custom Invoice 3",svi="Custom Invoice 4",avi="Custom Payment 1",lvi="Custom Payment 2",cvi="Custom Payment 3",uvi="Custom Payment 4",dvi="Custom Surcharge 1",hvi="Custom Surcharge 2",fvi="Custom Surcharge 3",pvi="Custom Surcharge 4",gvi="Custom Group 1",mvi="Custom Group 2",_vi="Custom Group 3",vvi="Custom Group 4",bvi="Number",yvi="Count",Cvi="Is Active",wvi="Contact Last Login",Svi="Contact Full Name",Evi="Contact Custom Value 1",xvi="Contact Custom Value 2",Tvi="Contact Custom Value 3",kvi="Contact Custom Value 4",Ivi="Assigned To Id",Lvi="Created By Id",Dvi="Add Column",Avi="Edit Columns",Nvi="to learn about Google Fonts",Rvi="Refund Date",Ovi="Multiselect",Pvi="Verify Password",Mvi="Applied",Fvi="Include recent errors from the logs",Bvi="We have received your message and will try to respond promptly.",$vi="Show Product Details",Vvi="Include the description and cost in the product dropdown",Hvi="The PDF renderer requires :version",Wvi="Adjust Fee Percent",zvi="Configure Settings",Uvi="About",jvi="Credit Email",qvi="Domain URL",Kvi="Password must contain an upper case character and a number",Gvi="Client Portal Tasks",Yvi="Client Portal Dashboard",Qvi="Please enter a value",Xvi="Successfully deleted logo",Zvi="Generate Number",Jvi="When Saved",ebi="When Sent",tbi="Select Company",nbi="Float",ibi="Collapse",rbi="Show/hide",obi="Menu Sidebar",sbi="History Sidebar",abi="Tablet",lbi="Layout",cbi="Module",ubi="First Custom",dbi="Second Custom",hbi="Third Custom",fbi="Show Cost",pbi="Display a product cost field to track the markup/profit",gbi="Show Product Quantity",mbi="Display a product quantity field, otherwise default to one",_bi="Show Invoice Quantity",vbi="Display a line item quantity field, otherwise default to one",bbi="Default Quantity",ybi="Automatically set the line item quantity to one",Cbi="One Tax Rate",wbi="Two Tax Rates",Sbi="Three Tax Rates",Ebi="Default Tax Rate",xbi="Invoice Tax",Tbi="Line Item Tax",kbi="Inclusive Taxes",Ibi="Invoice Tax Rates",Lbi="Item Tax Rates",Dbi="Configure rates",Abi="Tax Rates",Nbi="Accent Color",Rbi="Comma separated list",Obi="Single-line text",Pbi="Multi-line text",Mbi="Dropdown",Fbi="Field Type",Bbi="A password recovery email has been sent",$bi="Successfully removed user",Vbi="Three Years",Hbi="24 Hour Display",Wbi="Click here",zbi="Successfully marked invoice as paid",Ubi="Successfully marked invoices as sent",jbi="Successfully marked invoices as paid",qbi="System failed to email invoice :invoice",Kbi="Custom Value 3",Gbi="Custom Value 4",Ybi="Custom Email Style",Qbi="Custom Dashboard Message",Xbi="Custom Unpaid Invoice Message",Zbi="Custom Paid Invoice Message",Jbi="Custom Unapproved Quote Message",e0i="Lock Sent Invoices",t0i="Translations",n0i="Task Number Pattern",i0i="Task Number Counter",r0i="Expense Number Pattern",o0i="Expense Number Counter",s0i="Vendor Number Pattern",a0i="Vendor Number Counter",l0i="Ticket Number Pattern",c0i="Ticket Number Counter",u0i="Payment Number Pattern",d0i="Payment Number Counter",h0i="Invoice Number Pattern",f0i="Quote Number Pattern",p0i="Credit Number Pattern",g0i="Credit Number Counter",m0i="Credit Number Pattern",_0i="Credit Number Counter",v0i="Reset Counter Date",b0i="Counter Padding",y0i="Share Invoice/Quote Counter",C0i="Default Tax Name 1",w0i="Default Tax Rate 1",S0i="Default Tax Name 2",E0i="Default Tax Rate 2",x0i="Default Tax Name 3",T0i="Default Tax Rate 3",k0i="Email Invoice Subject",I0i="Email Quote Subject",L0i="Email Payment Subject",D0i="Switch List Table",A0i="Client City",N0i="Client State",R0i="Client Country",O0i="Client is Active",P0i="Client Balance",M0i="Client Street",F0i="Client Apt/Suite",B0i="Client Shipping Street",$0i="Client Shipping Apt/Suite",V0i="Tax Rate 1",H0i="Tax Rate 2",W0i="Tax Rate 3",z0i="Archived At",U0i="Has Expenses",j0i="Custom Taxes 1",q0i="Custom Taxes 2",K0i="Custom Taxes 3",G0i="Custom Taxes 4",Y0i="Custom Surcharge 1",Q0i="Custom Surcharge 2",X0i="Custom Surcharge 3",Z0i="Custom Surcharge 4",J0i="Is Deleted",eyi="Vendor City",tyi="Vendor State",nyi="Vendor Country",iyi="Credit Footer",ryi="Credit Terms",oyi="Untitled Company",syi="Successfully added company",ayi="Supported Events",lyi="Third Custom",cyi="Fourth Custom",uyi="Optional",dyi="License",hyi="Invoice Balance",fyi="Successfully saved design",pyi="Client Details",gyi="Company Address",myi="Quote Details",_yi="Credit Details",vyi="Product Columns",byi="Task Columns",yyi="Add Field",Cyi="All Events",wyi="Owned",Syi="Payment Success",Eyi="Payment Failure",xyi="Quote Sent",Tyi="Credit Sent",kyi="Invoice Viewed",Iyi="Quote Viewed",Lyi="Credit Viewed",Dyi="Quote Approved",Ayi="Receive All Notifications",Nyi="Purchase License",Ryi="Enable Modules",Oyi="Successfully converted quote",Pyi="Credit Design",Myi="Includes",Fyi="CSS Framework",Byi="Custom Designs",$yi="Designs",Vyi="New Design",Hyi="Edit Design",Wyi="Successfully created design",zyi="Successfully updated design",Uyi="Successfully archived design",jyi="Successfully deleted design",qyi="Successfully removed design",Kyi="Successfully restored design",Gyi="Recurring Tasks",Yyi="Successfully removed credit",Qyi="Latest Version",Xyi="Update Now",Zyi="A new version of the web app is available",Jyi="Update Available",e1i="Update successfully completed",t1i="Integrations",n1i="Tracking Id",i1i="Slack Webhook URL",r1i="Partial Payment",o1i="Partial Payment Email",s1i="Clone to Credit",a1i="Successfully emailed credit",l1i="Successfully marked credit as sent",c1i="Email Partial Payment Subject",u1i="Is Approved",d1i="Oops, something went wrong! Please make sure you have setup an Invoice Ninja v5 instance before starting the migration.",h1i='Cross account migration is not allowed. Please read more about it here: <a href="https://invoiceninja.github.io/docs/migration/#troubleshooting">https://invoiceninja.github.io/docs/migration/#troubleshooting</a>',f1i="Email Credit",p1i="Client does not have an email address set",g1i="Ledger",m1i="View PDF",_1i="All records",v1i="Owned by user",b1i="Credit Remaining",y1i="Use default",C1i="Endless Reminders",w1i="Number of days",S1i="Configure Payment Terms",E1i="Payment Term",x1i="New Payment Term",T1i="Successfully deleted payment term",k1i="Successfully removed payment term",I1i="Successfully restored payment term",L1i="Full Width Editor",D1i="Full Height Filter",A1i="Sign in with email",N1i="Change",R1i="Change to the mobile layout?",O1i="Change to the desktop layout?",P1i="Send from Gmail",M1i="Reversed",F1i="Cancelled",B1i="Quote Amount",$1i="Hosted",V1i="Self-Hosted",H1i="Hide Menu",W1i="Show Menu",z1i="Partially Refunded",U1i="Search Documents",j1i="Search Designs",q1i="Search Invoices",K1i="Search Clients",G1i="Search Products",Y1i="Search Quotes",Q1i="Search Credits",X1i="Search Vendors",Z1i="Search Users",J1i="Search Tax Rates",eCi="Search Tasks",tCi="Search Settings",nCi="Search Projects",iCi="Search Expenses",rCi="Search Payments",oCi="Search Groups",sCi="Search Company",aCi="Successfully cancelled invoice",lCi="Successfully cancelled invoices",cCi="Successfully reversed invoice",uCi="Successfully reversed invoices",dCi="Reverse",hCi="Filtered by Project",fCi="Sign in with Google",pCi=":user reversed invoice :invoice",gCi=":user cancelled invoice :invoice",mCi="Reconciliation Failure",_Ci="Reconciliation Success",vCi="Gateway Success",bCi="Gateway Failure",yCi="Gateway Error",CCi="Email Send",wCi="Email Retry Queue",SCi="Failure",ECi="Quota Exceeded",xCi="Upstream Failure",TCi="System Logs",kCi="Copy Link",ICi="Welcome to Invoice Ninja",LCi="Opt-In",DCi="Opt-Out",ACi="Auto Convert",NCi="Reminder 1 Sent",RCi="Reminder 2 Sent",OCi="Reminder 3 Sent",PCi="Reminder Last Sent",MCi="Page :current of :total",FCi="Successfully emailed credits",BCi="View in Stripe",$Ci="Rows Per Page",VCi="Apply Payment",HCi="Unapplied",WCi="Custom Labels",zCi="Record Type",UCi="Record Name",jCi="File Type",qCi="Height",KCi="Width",GCi="Health Check",YCi="Last Login At",QCi="Company Key",XCi="Storefront",ZCi="Enable third-party apps to create invoices",JCi=":count records selected",ewi=":count record selected",twi="Client Created",nwi="Online Payment Email",iwi="Manual Payment Email",rwi="Completed",owi="Gross",swi="Net Amount",awi="Net Balance",lwi="Client Settings",cwi="Selected Invoices",uwi="Selected Payments",dwi="Selected Quotes",hwi="Selected Tasks",fwi="Selected Expenses",pwi="Past Due Invoices",gwi="Create Payment",mwi="Update Quote",_wi="Update Invoice",vwi="Update Client",bwi="Update Vendor",ywi="Create Expense",Cwi="Update Expense",wwi="Update Task",Swi="Approve Quote",Ewi="When Paid",xwi="Expires On",Twi="Show Sidebar",kwi="Hide Sidebar",Iwi="Event Type",Lwi="Copy",Dwi="Please restart the app once connected to the internet",Awi="The crons need to be enabled",Nwi="API Webhooks",Rwi="Search :count Webhooks",Owi="Search 1 Webhook",Pwi="Webhook",Mwi="Webhooks",Fwi="New Webhook",Bwi="Edit Webhook",$wi="Successfully created webhook",Vwi="Successfully updated webhook",Hwi="Successfully archived webhook",Wwi="Successfully deleted webhook",zwi="Successfully removed webhook",Uwi="Successfully restored webhook",jwi="Search :count Tokens",qwi="Search 1 Token",Kwi="New Token",Gwi="Successfully removed token",Ywi="Successfully restored token",Qwi="Client Registration",Xwi="Enable clients to self register in the portal",Zwi="Customize & Preview",Jwi="Search 1 Document",eSi="Search 1 Design",tSi="Search 1 Invoice",nSi="Search 1 Client",iSi="Search 1 Product",rSi="Search 1 Quote",oSi="Search 1 Credit",sSi="Search 1 Vendor",aSi="Search 1 User",lSi="Search 1 Tax Rate",cSi="Search 1 Tasks",uSi="Search 1 Project",dSi="Search 1 Expense",hSi="Search 1 Payment",fSi="Search 1 Group",pSi="Created On",gSi="Lock Invoices",mSi="Show Table",_Si="Show List",vSi="View Changes",bSi="Force Update",ySi="You are running the latest version but there may be pending fixes available.",CSi="Track the expense has been paid",wSi="Enable the expense to be invoiced",SSi="Make the documents visible to client",ESi="Set an exchange rate",xSi="Expense Settings",TSi="Clone to Recurring",kSi="Crypto",ISi="User Field",LSi="Variables",DSi="Show Password",ASi="Hide Password",NSi="Copy Error",RSi="Capture Card",OSi="Auto Bill Enabled",PSi="Total Taxes",MSi="Line Taxes",FSi="Total Fields",BSi="Successfully stopped recurring invoice",$Si="Successfully started recurring invoice",VSi="Successfully resumed recurring invoice",HSi="Gateway Refund",WSi="Process the refund with the payment gateway",zSi="Due Date",USi="Paused",jSi="Day :count",qSi="First Day of the Month",KSi="Last Day of the Month",GSi="Use Payment Terms",YSi="Endless",QSi="Next Send Date",XSi="Remaining Cycles",ZSi="Successfully created recurring invoice",JSi="Successfully updated recurring invoice",eEi="Successfully removed recurring invoice",tEi="Search 1 Recurring Invoice",nEi="Search :count Recurring Invoices",iEi="Send Date",rEi="Auto Bill On",oEi="Minimum Under Payment Amount",sEi="Allow Overpayment",aEi="Support paying extra to accept tips",lEi="Allow Underpayment",cEi="Support paying at minimum the partial/deposit amount",uEi="Test Mode",dEi="Calculated Rate",hEi="Default Task Rate",fEi="Clear Cache",pEi="Sort Order",gEi="Status",mEi="Task Statuses",_Ei="New Task Status",vEi="Edit Task Status",bEi="Successfully created task status",yEi="Successfully archived task status",CEi="Successfully deleted task status",wEi="Successfully removed task status",SEi="Successfully restored task status",EEi="Search 1 Task Status",xEi="Search :count Task Statuses",TEi="Show Tasks Table",kEi="Always show the tasks section when creating invoices",IEi="Invoice Task Timelog",LEi="Add time details to the invoice line items",DEi="Start tasks before saving",AEi="Configure Statuses",NEi="Task Settings",REi="Configure Categories",OEi="Edit Expense Category",PEi="Successfully removed expense category",MEi="Search 1 Expense Category",FEi="Search :count Expense Categories",BEi="Use Available Credits",$Ei="Show Option",VEi="The credit amount cannot exceed the payment amount",HEi="Enable the expense to be invoiced",WEi="Configure Gateways",zEi="Partial Payment",UEi="Is Running",jEi="Invoice Currency ID",qEi="Tax Name 1",KEi="Tax Name 2",GEi="Transaction ID",YEi="Invoice Late",QEi="Quote Expired",XEi="Invoice Total",ZEi="Actions",JEi="Expense Number",exi="Task Number",txi="Project Number",nxi="View Settings",ixi="Warning: this company has not yet been activated",rxi="Late Invoice",oxi="Expired Quote",sxi="Remind Invoice",axi="Client Phone",lxi="Required Fields",cxi="Enabled Modules",uxi=":contact viewed quote :quote",dxi=":user updated client :client",hxi=":user updated vendor :vendor",fxi=":user emailed first reminder for invoice :invoice to :contact",pxi=":user emailed second reminder for invoice :invoice to :contact",gxi=":user emailed third reminder for invoice :invoice to :contact",mxi=":user emailed endless reminder for invoice :invoice to :contact",_xi="Expense Category ID",vxi="View Licenses",bxi="Fullscreen Editor",yxi="Sidebar Editor",Cxi='Please type ":value" to confirm',wxi="Purge",Sxi="Clone To",Exi="Clone to Other",xxi="Labels",Txi="Add Custom",kxi="Payment Tax",Ixi="White Label",Lxi="Sent invoices are locked",Dxi="Paid invoices are locked",Axi="Source Code",Nxi="App Platforms",Rxi="Successfully archived :value task statuses",Oxi="Successfully deleted :value task statuses",Pxi="Successfully restored :value task statuses",Mxi="Successfully deleted expense :value categories",Fxi="Successfully restored expense :value categories",Bxi="Successfully archived recurring :value invoices",$xi="Successfully deleted recurring :value invoices",Vxi="Successfully restored recurring :value invoices",Hxi="Successfully archived :value webhooks",Wxi="Successfully deleted :value webhooks",zxi="Successfully removed :value webhooks",Uxi="Successfully restored :value webhooks",jxi="API Docs",qxi="Successfully archived :value tokens",Kxi="Successfully deleted :value tokens",Gxi="Successfully restored :value tokens",Yxi="Successfully archived :value payment terms",Qxi="Successfully deleted :value payment terms",Xxi="Successfully restored :value payment terms",Zxi="Successfully archived :value designs",Jxi="Successfully deleted :value designs",eTi="Successfully restored :value designs",tTi="Successfully restored :value credits",nTi="Successfully archived :value users",iTi="Successfully deleted :value users",rTi="Successfully removed :value users",oTi="Successfully restored :value users",sTi="Successfully archived :value tax rates",aTi="Successfully deleted :value tax rates",lTi="Successfully restored :value tax rates",cTi="Successfully archived :value gateways",uTi="Successfully deleted :value gateways",dTi="Successfully restored :value gateways",hTi="Successfully archived :value groups",fTi="Successfully deleted :value groups",pTi="Successfully restored :value groups",gTi="Successfully archived :value documents",mTi="Successfully deleted :value documents",_Ti="Successfully restored :value documents",vTi="Successfully restored :value vendors",bTi="Successfully restored :value expenses",yTi="Successfully restored :value tasks",CTi="Successfully restored :value projects",wTi="Successfully restored :value products",STi="Successfully restored :value clients",ETi="Successfully restored :value invoices",xTi="Successfully restored :value payments",TTi="Successfully restored :value quotes",kTi="Update App",ITi="Successfully started import",LTi="Duplicate column mapping",DTi="Uses Inclusive Taxes",ATi="Is Amount Discount",NTi="Map To",RTi="Use first row as column names",OTi="No File Selected",PTi="Import Type",MTi="Draft Mode",FTi="Preview updates faster but is less accurate",BTi="Show Product Discount",$Ti="Display a line item discount field",VTi="Tax Name 3",HTi="Debug mode is enabled",WTi="Warning: it is intended for use on local machines, it can leak credentials. Click to learn more.",zTi="Running Tasks",UTi="Recent Tasks",jTi="Recent Expenses",qTi="Upcoming Expenses",KTi="Search 1 Payment Term",GTi="Search :count Payment Terms",YTi="Save and Preview",QTi="Save and Email",XTi="Converted Balance",ZTi="Is Sent",JTi="Document Upload",eki="Enable clients to upload documents",tki="Expense Total",nki="Enter Taxes",iki="By Rate",rki="By Amount",oki="Enter Amount",ski="Before Taxes",aki="After Taxes",lki="Color",cki="Show",uki="Empty Columns",dki="Project Name",hki="To use :client_counter please add either :client_number or :client_id_number to prevent conflicts",fki="This Quarter",pki="To update run",gki="Registration URL",mki="Show Product Cost",_ki="Complete",vki="Next",bki="Next step",yki="Credit :invoice was sent to :client",Cki="Credit :invoice was viewed by :client",wki="The following client :client was emailed Credit :invoice for :amount.",Ski="The following client :client viewed Credit :credit for :amount.",Eki="Enter your email to reset your password.",xki="Password reset",Tki="Welcome! Glad to see you.",kki="Request cancellation",Iki="Delete Payment Method",Lki="You are about to delete the payment method.",Dki="Action can't be reversed",Aki="The profile has been updated successfully.",Nki="Ethiopian Birr",Rki="Use a permanent address where you can receive mail.",Oki="Invoice Status",Pki="This email is already linked to an account",Mki="Locations",Fki="Indefinitely",Bki="Cycles remaining",$ki="I understand, delete",Vki="Download Files",Hki="Use this link to download your files, the link will expire in 1 hour.",Wki="New Signup",zki="A new account has been created by :user - :email - from IP address: :ip",Uki="Payment was made by :client",jki="Partial payment was made by :client",qki="A payment of :amount was made by client :client towards :invoice",Kki="A partial payment of :amount was made by client :client towards :invoice",Gki="Notification Bot",Yki="Invoice # :invoice",Qki=":entity # :entity_number",Xki="If the button above isn't working for you, please click on the link",Zki="Display Log",Jki="Report errors to help improve the app",eIi="Setup",tIi="Quick overview & statistics",nIi="Update your personal information",iIi="Name, website & logo",rIi="Make sure you use full link to your site",oIi="Personal address",sIi="Enter your personal address",aIi="Enter your shipping address",lIi="List of invoices",cIi="With selected",uIi="This invoice is still not paid. Click the button to complete the payment",dIi="List of recurring invoices",hIi="Here are some details about recurring invoice",fIi="Cancellation",pIi="In case you want to stop the recurring invoice, please click to request the cancellation.",gIi="Warning! You are requesting a cancellation of this service. Your service may be cancelled with no further notification to you.",mIi="Cancellation pending, we'll be in touch!",_Ii="List of payments",vIi="Details of the payment",bIi="Associate invoices",yIi="List of payment methods",CIi="Details of payment method",wIi="Permanently remove this payment method.",SIi="Warning! This action can not be reversed!",EIi="Confirmation",xIi="Quotes",TIi="Waiting for approval",kIi="This quote is still not approved",IIi="Credits",LIi="Required extensions",DIi="PHP version",AIi="Writable .env file",NIi=".env file is not writable by the current user.",RIi="Minimum PHP version",OIi="Make sure all requirements are satisfied.",PIi="Oops, something does not look right!",MIi="Open in new tab",FIi="Complete payment",BIi="Authorize payment method for future use",$Ii="Page",VIi="Per page",HIi="Of",WIi="View Credit",zIi="To view the :entity you need to enter password.",UIi="Showing :first to :last out of :total results",jIi="No results found.",qIi="Payment failed for Client :client",KIi="A payment made by client :client failed with message :message",GIi="Register",YIi="Create your account in seconds",QIi="Confirm your password",XIi="Verification",ZIi="Before using a bank account it must be verified.",JIi="Checkout.com",e2i="Copyright © :year :company.",t2i="Provided credit card number is not valid.",n2i="Provided month is not valid.",i2i="Provided year is not valid.",r2i="HTTPS is required, form will fail",o2i="If you need help you can post to our",s2i="After updating password, your account will be confirmed.",a2i="To pay with a bank account, first you have to add it as payment method.",l2i="Let's store basic information about your Invoice Ninja!",c2i="Highly recommended in production",u2i="Enable only for development",d2i="Test PDF",h2i=`Checkout.com can be can saved as payment method for future use, once you complete your first transaction. Don't forget to check "Store credit card details" during payment process.`,f2i=`Bank account (SOFORT) can be can saved as payment method for future use, once you complete your first transaction. Don't forget to check "Store payment details" during payment process.`,p2i="Node status",g2i="NPM status",m2i="I could not find Node anywhere. Is it installed?",_2i="I could not find NPM anywhere. Is it installed?",v2i="This invoice is locked and unable to be modified",b2i="Downloads",y2i="Resource",C2i="Details about the document",w2i="Hash",S2i="Resources",E2i="Allowed file types:",x2i="Common codes and their meanings",T2i="20087: Bad Track Data (invalid CVV and/or expiry date)",k2i="Download selected",I2i="To pay invoices, you have to",L2i="add payment method",D2i="No items selected.",A2i="Payment due",N2i="Account Balance",R2i="Thanks",O2i="Minimum required payment is :amount",P2i="Company doesn't support underpayments.",M2i="Company doesn't support overpayments.",F2i="Saved at :time",B2i="Credit applied to Invoice :invoice_number",$2i="New credit :number from :account",V2i="To view your credit for :amount, click the link below.",H2i="Cryptocurrency",W2i="Credit",z2i="Store for future use",U2i="Pay with credit",j2i="Payment method can't be saved for future use.",q2i="Pay with",K2i='By clicking "Next" you accept terms.',G2i="Not specified",Y2i="Before proceeding with payment, you have to fill following fields",Q2i="After completing, go back to previous page.",X2i="Pay",Z2i="Instructions",J2i="Reminder 1 for Invoice :invoice was sent to :client",eLi="Reminder 2 for Invoice :invoice was sent to :client",tLi="Reminder 3 for Invoice :invoice was sent to :client",nLi="Custom reminder was sent to :client",iLi="Endless reminder for Invoice :invoice was sent to :client",rLi="Assigned User",oLi="To proceed to next step, make sure you test each section.",sLi="Note about Phantom JS. Read more.",aLi="Minimum Payment",lLi="No action provided. If you believe this is wrong, please contact the support.",cLi="No payable invoices selected. Make sure you are not trying to pay draft invoice or invoice with zero balance due.",uLi="Required payment details",dLi="To complete a payment we need more details about you.",hLi="We will save this, so you don't have to enter it next time.",fLi="We were unable to deliver Credit :invoice to :contact. \\n :error",pLi="Unable to deliver Credit :invoice",gLi="Save payment method details",mLi="New card",_Li="Add Bank Account",vLi="Limit of :limit companies per account.",bLi="Total credits applied cannot be MORE than total of invoices",yLi="Credit number already taken",CLi="Credit not found",wLi="Selected invoices are not from a single client",SLi="Duplicate credits submitted.",ELi="Duplicate invoices submitted.",xLi="You must have an invoice set when using a credit in a payment",TLi="Client id is required",kLi="Expense number already taken",ILi="Invoice number already taken",LLi="Payment `id` required.",DLi="Unable to retrieve specified payment",ALi="Invoice id :invoice is not related to this payment",NLi="Credit id :credit is not related to this payment",RLi="Attempting to refund more than allowed for invoice id :invoice, maximum refundable amount is :amount",OLi="Attempting to refund a payment with invoices attached, please specify valid invoice/s to be refunded.",PLi="Attempting to refund a payment with credits attached, please specify valid credits/s to be refunded.",MLi="Attempting to refund more than allowed for credit :credit, maximum refundable amount is :amount",FLi="Project client does not match entity client",BLi="Quote number already taken",$Li="Recurring Invoice number :number already taken",VLi="User not associated with this account",HLi="Amounts do not balance correctly.",WLi="Insufficient applied amount remaining to cover payment.",zLi="Insufficient balance on credit.",ULi="One or more of these invoices have been paid",jLi="Invoice id :number cannot be refunded",qLi="Attempting to refund :amount only :refundable_amount available for refund",KLi="This user is unable to be attached to this company. Perhaps they have already registered a user on another account?",GLi="Migration completed",YLi="Your migration has completed, please review your data after logging in.",QLi="404 | Nothing to see here!",XLi="Cannot load a large account without a updated_at parameter",ZLi="No backup exists for this activity",JLi="Company User record not found",eDi="No credits found.",tDi="The requested action :action is not available.",nDi="No Documents Found",iDi="No group settings found",rDi="Insufficient privileges to access/modify this resource",oDi="Invoice cannot be marked as paid",sDi="Invalid license, or invalid environment :environment",aDi="Route not available",lDi="Invalid custom design object",cDi="Quote/s not found",uDi="Unable to approve this quote as it has expired.",dDi="Scheduler has run",hDi="Scheduler has never run",fDi="Self update not available on this system.",pDi="User detached from company",gDi="Failed to create Webhook",mDi="Thank you for your payment of :amount for :invoice",_Di="Note: Online payments are supported only if amount is larger than $1 or currency equivalent.",vDi="Payment token not found, please try again. If an issue still persist, try with another payment method",bDi="Vendor Street",yDi="Vendor Apt/Suite",CDi="Partially Unapplied",wDi="Please select a user authenticated with Gmail",SDi="List Long Press",EDi="Show Actions",xDi="Start Multiselect",TDi="An email has been sent to confirm the email address",kDi="Converted Paid to Date",IDi="Converted Credit Balance",LDi="Converted Total",DDi="Reply-To Name",ADi="Color Theme",NDi="Start Migration",RDi="Request for recurring invoice cancellation from :contact",ODi=":contact from Client :client requested to cancel Recurring Invoice :invoice",PDi="Hello",MDi="Group documents",FDi="Are you sure you want to approve this quote?",BDi="Select companies to migrate",$Di="Force migration",VDi="Require Password with Social Login",HDi="Stay Logged In",WDi="Warning: Your session is about to expire",zDi=":count Hours",UDi="1 Day",jDi=":count Days",qDi="Web Session Timeout",KDi="Security Settings",GDi="Resend Email",YDi="Please confirm your email address",QDi="FreshBooks",XDi="Invoice2go",ZDi="Invoicely",JDi="Wave Accounting",eAi="Zoho",tAi="Accounting",nAi="Please provide all CSVs.",iAi="Let's continue by authenticating.",rAi="API secret",oAi="You can find API_SECRET in the .env file or Invoice Ninja v5. If property is missing, leave field blank.",sAi="Your discount will be applied on the checkout.",aAi="Use last email",lAi="Activate Company",cAi="Enable emails, recurring invoices and notifications",uAi="An error occurred, please try again",dAi="Please first set a password",hAi="Warning: Changing your phone number will disable 2FA",fAi="Help Translate",pAi="Please select a country",gAi="Successfully disabled 2FA",mAi="Successfully connected account",_Ai="Successfully disconnected account",vAi="Delivered",bAi="Spam",yAi="View Docs",CAi="Please provide a mobile phone number to enable two factor authentication",wAi="Send SMS",SAi="SMS Code",EAi="Connect Google",xAi="Disconnect Google",TAi="Disable Two Factor",kAi="Invoice Task Datelog",IAi="Add date details to the invoice line items",LAi="Promo code",DAi="Recurring invoice issued to",AAi="Subscription",NAi="New Subscription",RAi="Successfully deleted subscription",OAi="Successfully removed subscription",PAi="Successfully restored subscription",MAi="Search 1 Subscription",FAi="Search :count Subscriptions",BAi="Subdomain is not available",$Ai="Connect Gmail",VAi="Disconnect Gmail",HAi="Successfully connected Gmail",WAi="Successfully disconnected Gmail",zAi="Changes to the codebase may be blocking the update, you can run this command to discard the changes:",UAi="Client ID Number",jAi=":count Minutes",qAi="Password Timeout",KAi="Share Invoice/Credit Counter",GAi=":user created subscription :subscription",YAi=":user updated subscription :subscription",QAi=":user archived subscription :subscription",XAi=":user deleted subscription :subscription",ZAi=":user restored subscription :subscription",JAi="The amount is greater than the invoice balance. You cannot overpay an invoice.",eNi="Click to continue",tNi="The following invoice :invoice was created for client :client for :amount.",nNi="Invoice :invoice was created for :client",iNi="The following quote :invoice was created for client :client for :amount.",rNi="Quote :invoice was created for :client",oNi="The following credit :invoice was created for client :client for :amount.",sNi="Credit :invoice was created for :client",aNi="Maximum companies migrated",lNi="You have reached your maximum number of companies. Delete existing companies to migrate new ones.",cNi="Company already migrated",uNi="Looks like you already migrated <b> :company_name </b>to the V5 version of the Invoice Ninja. In case you want to start over, you can force migrate to wipe existing data.",dNi=`This payment method can be can saved for future use, once you complete your first transaction. Don't forget to check "Store details" during payment process.`,hNi="New account",fNi=":user created recurring invoice :recurring_invoice",pNi=":user updated recurring invoice :recurring_invoice",gNi=":user archived recurring invoice :recurring_invoice",mNi=":user deleted recurring invoice :recurring_invoice",_Ni=":user restored recurring invoice :recurring_invoice",vNi="New login detected for your account.",bNi="You recently logged in to your Invoice Ninja account from a new location or device:<br><br><b>IP:</b> :ip<br><b>Time:</b> :time<br><b>Email:</b> :email",yNi="Contact Details",CNi="Your company backup is ready for download",wNi="Account passwordless login",SNi="Cannot add the same user to the same company",ENi="User exists but cannot be crossed linked to multiple accounts",xNi="ACH verification",TNi="Connecting bank accounts require verification. Payment gateway will automatically send two small deposits for this purpose. These deposits take 1-2 business days to appear on the customer's online statement.",kNi="Login link requested",INi="There was a request to login using link. If you did not request this, it's safe to ignore it.",LNi="Your invoices are ready for download",DNi="Migration failed",ANi="Looks like something went wrong with the migration for the following company:",NNi="If you have any questions please contact us, we're here to help!",RNi="Quote was approved",ONi="We would like to inform you that quote was approved.",PNi="Error importing :company",MNi="There was an error importing the company data, the error message was:",FNi="Due Date",BNi="Amount in pennies,pence or cents. ie for $0.10 please enter 10",$Ni="Default Payment Method",VNi="Make this your preferred way of paying.",HNi="This is your preferred way of paying.",WNi="Auto Bill Disabled",zNi="Select a payment method:",UNi="Log in without password",jNi="Email me when an invoice is <b>sent</b>",qNi="One time purchases",KNi="Recurring purchases",GNi="You might be interested in the following",YNi='Only quotes with "Sent" status can be approved. Expired quotes cannot be approved.',QNi="No quotes available for download.",XNi="Copyright",ZNi=":user created :created_user at :time",JNi="Company deleted",eRi="Company [ :company ] was deleted by :user",tRi="Back to :url",nRi="Connect your Stripe Account",iRi="Invoice Ninja v5 uses Stripe Connect to link your Stripe account to Invoice Ninja. This provides an additional layer of security for your account. Now that you data has migrated, you will need to Authorize Stripe to accept payments in v5.<br><br>To do this, navigate to Settings > Online Payments > Configure Gateways. Click on Stripe Connect and then under Settings click Setup Gateway. This will take you to Stripe to authorize Invoice Ninja and on your return your account will be successfully linked!",rRi="Account email quota exceeded.",oRi="In a 24 hour period you have sent :quota emails. <br> We have paused your outbound emails.<br><br> Your email quota will reset at 23:00 UTC.",sRi="Opt in or out of having this invoice automatically charged.",aRi="Arabic",lRi="Persian",cRi="Latvian",uRi="Expiry date",dRi="Card holder name",hRi="Recurring Quote number :number already taken",fRi="Account type",pRi="Locality",gRi="Checking",mRi="Savings",_Ri="Unable to verify payment method.",vRi="Gateway configuration error. Please check your credentials.",bRi="My documents",yRi="This payment method cannot be preauthorized.",CRi="KBC/CBC",wRi="Bancontact",SRi="By providing your IBAN and confirming this payment, you are authorizing :company and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.",ERi="iDEAL",xRi="Bank Account Holder",TRi="All-in-one checkout",kRi="Przelewy24",IRi="I declare that I have familiarized myself with the regulations and information obligation of the Przelewy24 service.",LRi="GiroPay",DRi="By entering your Customer information (such as name, sort code and account number) you (the Customer) agree that this information is given voluntarily.",ARi="Klarna",NRi="EPS",RRi="BECS Direct Debit",ORi="BACS Direct Debit",PRi="BACS Direct Debit",MRi="Please add a payment method first, before trying to pay.",FRi='By providing your bank account details, you agree to this <a class="underline" href="https://stripe.com/au-becs-dd-service-agreement/legal">Direct Debit Request and the Direct Debit Request service agreement</a>, and authorise Stripe Payments Australia Pty Ltd ACN 160 180 343 Direct Debit User ID number 507156 (“Stripe”) to debit your account through the Bulk Electronic Clearing System (BECS) on behalf of :company (the “Merchant”) for any amounts separately communicated to you by the Merchant. You certify that you are either an account holder or an authorised signatory on the account listed above.',BRi="You need to accept the terms before proceeding.",$Ri="Direct Debit",VRi="Clone to Expense",HRi="Checkout",WRi="ACSS Debit",zRi="Invalid amount. Number/Decimal values only.",URi="Payment for Invoice :invoice for amount :amount failed.",jRi="Google Pay, Apple Pay, Microsoft Pay",qRi=`We can't find any credit cards on your device. <a href="https://invoiceninja.github.io/docs/payments#apple-pay-google-pay-microsoft-pay" target="_blank" class="underline">Read more about this.</a>`,KRi="Payment mandate is not ready. Please try again later.",GRi="Instant Bank Pay",YRi="iDEAL",QRi="Przelewy24",XRi="GiroPay",ZRi="EPS",JRi="Bancontact",eOi="BECS",tOi="ACSS",nOi="Gross Line Total",iOi="Slovak",rOi="Normal",oOi="Large",sOi="Extra Large",aOi="Show PDF Preview",lOi="Display PDF preview while editing invoices",cOi="Print PDF",uOi="Remind Me",dOi="Instant Bank Pay",hOi="Click Selected",fOi="Hide Preview",pOi="Edit Record",gOi="The credit amount can not be more than the invoice amount",mOi="Please set an account password",_Oi="We recommend using the desktop app for the best performance",vOi="We recommend using the mobile app for the best performance",bOi="Successfully disconnected gateway",yOi="Disconnect",COi="Add to Invoices",wOi="Download",SOi="Save data locally to enable the app to start faster, disabling may improve performance in large accounts",EOi="Persist UI",xOi="Save UI state locally to enable the app to start at the last location, disabling may improve performance",TOi="Client Postal Code",kOi="Client VAT Number",IOi="Has Tasks",LOi="Registration",DOi="Please authorize Stripe to accept online payments.",AOi="Update all records",NOi="Set Default Company",ROi="Successfully updated company",OOi="KBC",POi="Help us improve by telling us why (optional)",MOi="Webhook Success",FOi="Tasks must all belong to the same client",BOi="Expenses must all belong to the same client",$Oi="App",VOi="For the best performance download the :app app",HOi="Email Invoice",WOi="Email Quote",zOi="Email Credit",UOi="Successfully removed recurring expense",jOi="Search Recurring Expense",qOi="Search Recurring Expenses",KOi="Last Sent Date",GOi="Include Drafts",YOi="Include draft records in reports",QOi="Is Invoiced",XOi="Manage Plan",ZOi="Persist Data",JOi="Customer Count",ePi="Verify Customers",tPi="Google Analytics Tracking ID",nPi="Decimal Comma",iPi="Use comma as decimal place in forms",rPi="Select Method",oPi="Select Platform",sPi="Please use the web app to connect to Gmail",aPi="Item tax rates are disabled",lPi="Enable Markdown",cPi="Convert markdown to HTML on the PDF",uPi="Add Second Contact",dPi="Previous Page",hPi="Next Page",fPi="Export Colors",pPi="Import Colors",gPi="Clear All",mPi="Contrast",_Pi="Custom Colors",vPi="Colors",bPi="Sidebar Active Background Color",yPi="Sidebar Active Font Color",CPi="Sidebar Inactive Background Color",wPi="Sidebar Inactive Font Color",SPi="Table Alternate Row Background Color",EPi="Invoice Header Background Color",xPi="Invoice Header Font Color",TPi="Review App",kPi="Check Status",IPi="Free Trial",LPi="All accounts receive a two week trial of the Pro plan, once the trial ends your account will automatically change to the free plan.",DPi="The Pro plan trial ends in :count days, click to upgrade.",APi="Today is the last day of the Pro plan trial, click to upgrade.",NPi="Change Email",RPi="Optionally configure a separate client portal domain",OPi="Tasks Shown in Portal",PPi="Uninvoiced",MPi="The subdomain is used in the client portal to personalize links to match your brand. ie, https://your-brand.invoicing.co",FPi="Send Time",BPi="Import Settings",$Pi="Please provide the JSON file",VPi="Please select to import the settings and/or data",HPi="JSON",WPi="No payment types enabled",zPi="Please wait for the data to finish loading",UPi="Net Total",jPi="Has Taxes",qPi="Import Customers",KPi="Successfully started importing customers",GPi="Successful Login",YPi="Failed Login",QPi="Once the file is ready you'll receive an email with a download link",XPi="Include Deleted Clients",ZPi="Load records belonging to deleted clients",JPi="Step 1: Sign In",eMi="Step 2: Authorize",tMi="Account ID",nMi="The migration has not yet completed",iMi="Show Task End Date",rMi="Enable specifying the task end date",oMi="Gateway Setup",sMi="Preview Sidebar",aMi="Years Data Shown",lMi="Successfully ended all sessions",cMi="End All Sessions",uMi="1 Session",dMi=":count Sessions",hMi="Invoice Created",fMi="Quote Created",pMi="Credit Created",gMi="Enterprise",mMi="Invoice Item",_Mi="Quote Item",vMi="Order",bMi="Search Kanban",yMi="Search Kanban",CMi="Move Top",wMi="Move Up",SMi="Move Down",EMi="Move Bottom",xMi="Error: the custom email must include a :body variable",TMi="Make sure to include a :body variable",kMi="View Date Formats",IMi="Is Viewed",LMi="Letter",DMi="Legal",AMi="Page Layout",NMi="Portrait",RMi="Landscape",OMi="The account owner can upgrade to a paid plan to enable the advanced advanced settings",PMi="Upgrade to a paid plan to enable the advanced settings",MMi="Invoice Payment Terms",FMi="Quote Valid Until",BMi="No Headers",$Mi="Add Header",VMi="Remove Header",HMi="Return URL",WMi="REST Method",zMi="Header Key",UMi="Header Value",jMi="Recurring Products",qMi="Promo Discount",KMi="Allow Cancellation",GMi="Per Seat Enabled",YMi="Max Seats Limit",QMi="Trial Enabled",XMi="Trial Duration",ZMi="Allow Query Overrides",JMi="Allow Plan Changes",e4i="Plan Map",t4i="Refund Period",n4i="Webhook Configuration",i4i="Purchase Page",r4i="Email Bounced",o4i="Spam Complaint",s4i="Email Delivery",a4i="Webhook Response",l4i="PDF Response",c4i="Authentication Failure",u4i="PDF Failed",d4i="PDF Success",h4i="Modified",f4i="HTML Mode",p4i="Preview updates faster but is less accurate",g4i="Status Color Theme",m4i="Load Color Theme",_4i="Estonian",v4i="Successfully marked credit as paid",b4i="Successfully marked credits as paid",y4i="Data loading - please wait for it to complete",C4i="Data saving - please wait for it to complete",w4i="Note: changes made here are only previewed, they must be applied in the tabs above to be saved",S4i="Remaining",E4i="Invoice Paid",x4i=":user created recurring expense :recurring_expense",T4i=":user updated recurring expense :recurring_expense",k4i=":user archived recurring expense :recurring_expense",I4i=":user deleted recurring expense :recurring_expense",L4i=":user restored recurring expense :recurring_expense",D4i="FPX",A4i="To view the :entity you need to set a password.",N4i="Unsubscribe",R4i="Unsubscribed",O4i="You have been removed from notifications for this document",P4i="Client Shipping State",M4i="Client Shipping City",F4i="Client Shipping Postal Code",B4i="Client Shipping Country",$4i="Load PDF",V4i="Start Free Trial",H4i="Start your FREE 14 day trial of the Pro Plan",W4i="Due on Receipt",z4i="Is Paid",U4i="Paid",j4i="Id",q4i="Convert To",K4i="Client Currency",G4i="Company Currency",Y4i="To prevent spam we require upgrading to a paid account to customize the email",Q4i="Upgrade your plan to add companies",X4i="The file has been saved in the downloads folder",Z4i="Small",J4i="Your quotes are ready for download",e3i="Your credits are ready for download",t3i="Your documents are ready for download",n3i="Reminder for invoice :number for :balance",i3i="Send with GMail invalid credentials",r3i="Your GMail credentials are not correct, please log into the administrator portal and navigate to Settings > User Details and disconnect and reconnect your GMail account. We will send you this notification daily until this issue is resolved",o3i="Totals Fields",s3i="View Task",a3i="Cancel",l3i="Successfully changed task status",c3i="Change Status",u3i="Enable Touch Events",d3i="Support drag events to scroll",h3i="After Saving",f3i="View Record",p3i="Enable Email Markdown",g3i="Use visual markdown editor for emails",m3i="Enable PDF Markdown",_3i="Note: JSON files generated by the v4 app are not supported",v3i="Release Notes",b3i="Upgrade your plan to view reports",y3i="Successfully started :value tasks",C3i="Successfully stopped :value tasks",w3i="Successfully apporved quote",S3i="Successfully :value approved quotes",E3i="Client Website",x3i="Invalid Time",T3i="Signed in as",k3i="Total results",I3i="Restore gateway",L3i="Archive gateway",D3i="Delete gateway",A3i="Exchange currency",N3i="Tax Amount 1",R3i="Tax Amount 2",O3i="Tax Amount 3",P3i="Update Project",M3i="Auto Archive Cancelled Invoice",F3i="Automatically archive invoices when cancelled",B3i="No invoices found",$3i="Successfully created record",V3i="Auto Archive Paid",H3i="Automatically archive invoices when they are paid.",W3i="Auto Archive Cancelled",z3i="Automatically archive invoices when cancelled.",U3i="Alternate PDF Viewer",j3i="Improve scrolling over the PDF preview [BETA]",q3i="Cayman Island Dollar",K3i="Please see attached file to check your report.",G3i="Left",Y3i="Right",Q3i="Center",X3i="Page Numbering",Z3i="Page Numbering Alignment",J3i="Invoice Sent",e5i="Show Product Description",t5i="Include the description in the product dropdown",n5i="Invoice Items",i5i="Quote Items",r5i="Profit and Loss",o5i="Import Format",s5i="Export Format",a5i="Export Type",l5i="Stop On Unpaid",c5i="Stop creating recurring invoices if the last invoice is unpaid.",u5i="Use Quote Terms",d5i="When converting a quote to an invoice",h5i="Add Country",f5i="Enable Tooltips",p5i="Show tooltips when hovering the mouse",g5i="Error: records belong to more than one client",m5i="Login to an existing account",_5i="Purchase Order",v5i="Purchase Order Number",b5i="Purchase Order #",y5i="Inventory threshold notification for product: :product",C5i="Threshold of :amount has been reached for product: :product",w5i=":user created purchase order :purchase_order",S5i=":user updated purchase order :purchase_order",E5i=":user archived purchase order :purchase_order",x5i=":user deleted purchase order :purchase_order",T5i=":user restored purchase order :purchase_order",k5i=":user emailed purchase order :purchase_order",I5i=":contact viewed purchase order :purchase_order",L5i="New Purchase Order :number from :account",D5i="To view your purchase order for :amount, click the link below.",A5i="View Purchase Order",N5i="Your purchase orders are ready for download",R5i="Purchase Order :invoice was viewed by :client",O5i="The following vendor :client viewed Purchase Order :invoice for :amount.",P5i="Purchase Order Date",M5i="Purchase Orders",F5i="Purchase Order # :purchase_order",B5i="Accepted",$5i=":contact accepted purchase order :purchase_order",V5i="Vendor Information",H5i="Purchase Order :purchase_order was accepted by :vendor",W5i="The following vendor :vendor accepted Purchase Order :purchase_order for :amount.",z5i="Amount received",U5i="Already converted to an expense.",j5i="Convert to Expense",q5i="Add to Inventory",K5i="Successfully added purchase order to inventory",G5i="Successfully added purchase orders to inventory",Y5i="Client Document Upload",Q5i="Vendor Document Upload",X5i="Enable vendors to upload documents",Z5i="Are you enjoying the app?",J5i="Yes, it's great!",eFi="Not so much",tFi="Great to hear! Would you like to rate it?",nFi="Sorry to hear it! Would you like to tell us more?",iFi="Sure, happy to",rFi="No, not now",oFi="Add",sFi="Last Sent Template",aFi="Enable Flexible Search",lFi='Match non-contiguous characters, ie. "ct" matches "cat"',cFi="Vendor Details",uFi="Purchase Order Details",dFi="QR IBAN",hFi="BESR ID",fFi="Clone to PO",pFi="Vendor does not have an email address set",gFi="Send Email",mFi="Successfully marked purchase order as sent",_Fi="Successfully marked purchase orders as sent",vFi="Successfully accepted purchase order",bFi="Successfully accepted purchase orders",yFi="Successfully cancelled purchase order",CFi="Successfully cancelled purchase orders",wFi="Please select a vendor",SFi="Purchase Order Total",EFi="Email Purchase Order",xFi="Email Purchase Order",TFi="Successfully disconnected email",kFi="Connect Email",IFi="Disconnect Email",LFi="Please use the web app to connect to Microsoft",DFi="Email Provider",AFi="Connect Microsoft",NFi="Disconnect Microsoft",RFi="Successfully connected Microsoft",OFi="Successfully disconnected Microsoft",PFi="Login with Microsoft",MFi="Sign up with Microsoft",FFi="Successfully queued purchase order to be sent",BFi="Successfully queued purchase orders to be sent",$Fi="Change to the React web app",VFi="Purchase Order Design",HFi="Purchase Order Terms",WFi="Purchase Order Footer",zFi="Purchase Order Signature",UFi="Require vendor to provide their signature.",jFi="New Purchase Order",qFi="Edit Purchase Order",KFi="Successfully created purchase order",GFi="Successfully updated purchase order",YFi="Successfully archived purchase order",QFi="Successfully deleted purchase order",XFi="Successfully removed purchase order",ZFi="Successfully restored purchase order",JFi="Search Purchase Order",e6i="Search Purchase Orders",t6i="Login URL",n6i="Manual Overpayments",i6i="Support adding an overpayment amount manually on a payment",r6i="Stock Quantity",o6i="Notification Threshold",s6i="Track Inventory",a6i="Display a product stock field and update when invoices are sent",l6i="Stock Notifications",c6i="Send an email when the stock reaches the threshold",u6i="VAT",d6i="View Map",h6i="Set Default Design",f6i="Purchase Order issued to",p6i="Archive Task Status",g6i="Delete Task Status",m6i="Restore Task Status",_6i="Hebrew",v6i="Price change accepted",b6i="Price change failed with code",y6i="Restore Purchases",C6i="Activate",w6i="Connect Apple",S6i="Disconnect Apple",E6i="Successfully disconnected Apple",x6i="Send Now",T6i="Received",k6i="Successfully converted to expense",I6i="Successfully converted to expenses",L6i="This document has been removed, please contact the vendor for further information",D6i="Document no longer available",A6i="Field",N6i="Period",R6i="Fields Per Row",O6i="Active Invoices",P6i="Outstanding Invoices",M6i="Completed Payments",F6i="Refunded Payments",B6i="Active Quotes",$6i="Approved Quotes",V6i="Unapproved Quotes",H6i="Logged Tasks",W6i="Invoiced Tasks",z6i="Paid Tasks",U6i="Logged Expenses",j6i="Pending Expenses",q6i="Invoiced Expenses",K6i="Invoice Paid Expenses",G6i="Vendor Portal",Y6i="Send Code",Q6i="Save the record to upload documents",X6i="Expense Tax Rates",Z6i="Invoice Item Tax Rates",J6i="Successfully verified phone number",eBi="A code has been sent via SMS",tBi="Resend",nBi="Verify",iBi="Please provide a phone number",rBi="Invalid phone number",oBi="Verify Phone Number",sBi="Please verify your phone number to send emails",aBi="Successfully merged clients",lBi="Merge Into",cBi="Note: v5.5 requires PHP 8.1",uBi="Email Purchase Orders",dBi="Email Invoices",hBi="Email Quotes",fBi="Email Credits",pBi="Archive Purchase Order",gBi="Restore Purchase Order",mBi="Delete Purchase Order",_Bi="Connect",vBi="Mark Paid Payment Email",bBi="Convert to Project",yBi="Client Email",CBi="Invoice Task Project",wBi="Add the project to the invoice line items",SBi="Bulk Action",EBi="This mobile (cell) phone number is not valid, please enter in E.164 format",xBi="Transaction",TBi="Disable 2FA",kBi="Change Number",IBi="Resend Code",LBi="Base Type",DBi="Category Type",ABi="Transaction",NBi="Print PDF",RBi="Vendor Postal Code",OBi="Preview Location",PBi="Bottom",MBi="Side",FBi="PDF Preview",BBi="Long Press to Select",$Bi="Purchase Order Item",VBi="Would you like to rate the app?",HBi="Include Deleted",WBi="Include deleted records in reports",zBi="Due On",UBi="Use Browser PDF Viewer",jBi="Warning: Prevents interacting with app over the PDF",qBi="Successfully converted transactions",KBi="Default Category",GBi="Connect Accounts",YBi="Manage Rules",QBi="Search 1 Category",XBi="Search :count Categories",ZBi="Min Amount",JBi="Max Amount",e8i="Successfully converted transaction",t8i="Convert to Payment",n8i="Deposit",i8i="Withdrawal",r8i="Deposits",o8i="Withdrawals",s8i="Matched",a8i="Unmatched",l8i="Create Credit",c8i="Transactions",u8i="New Transaction",d8i="Edit Transaction",h8i="Successfully created transaction",f8i="Successfully updated transaction",p8i="Successfully archived transaction",g8i="Successfully deleted transaction",m8i="Successfully removed transaction",_8i="Successfully restored transaction",v8i="Search Transaction",b8i="Search :count Transactions",y8i="Successfully deleted bank account",C8i="Successfully removed bank account",w8i="Successfully restored bank account",S8i="Search Bank Account",E8i="Search :count Bank Accounts",x8i="A code has been sent via SMS to :number",T8i="Please verify your phone number for 2FA backup",k8i="Enable Applying Payments Later",I8i="Line Item Tax Rates",L8i="Show Tasks in Client Portal",D8i="Quote :invoice has expired for :client",A8i="The following Quote :invoice for client :client and :amount has now expired.",N8i="Auto Sync",R8i="Refresh Accounts",O8i="Upgrade to Enterprise to connect your bank account",P8i="Click here to connect your bank account",M8i="Include tax",F8i="E-mail template body can be changed on",B8i="Insufficient permissions, or task may be locked",$8i="Accrual accounting",V8i="Turn on for accrual reporting, turn off for cash basis reporting.",H8i="Expensed reporting",W8i="Turn on for reporting all expenses, turn off for reporting only paid expenses",z8i="Send an email when an online payment is made",U8i="Send an email when manually entering a payment",j8i="Send an email when marking an invoice as paid",q8i="Successfully linked transaction",K8i="Link Payment",G8i="Link Expense",Y8i="Lock Invoiced Tasks",Q8i="Prevent tasks from being edited once invoiced",X8i="Require clients to register",Z8i="Use Inventory Management",J8i="Require products to be in stock",e9i="Optional Products",t9i="Optional Recurring Products",n9i="Convert",i9i="Successfully queued invoice to be auto-billed",r9i="Successfully queued invoices to be auto-billed",o9i="Operator",s9i="Value",a9i="Is",l9i="Contains",c9i="Starts with",u9i="Is empty",d9i="Add Rule",h9i="Match All Rules",f9i="All criteria needs to match for the rule to be applied",p9i="Automatically convert matched transactions to expenses",g9i="Rules",m9i="Transaction Rule",_9i="Transaction Rules",v9i="New Transaction Rule",b9i="Edit Transaction Rule",y9i="Successfully created rule",C9i="Successfully updated transaction rule",w9i="Successfully archived transaction rule",S9i="Successfully deleted transaction rule",E9i="Successfully removed transaction rule",x9i="Successfully restored transaction rule",T9i="Search Transaction Rule",k9i="Search Transaction Rules",I9i="Delete Bank Account",L9i="Archive Transaction",D9i="Delete Transaction",A9i="We have sent a code to :email enter this code to proceed.",N9i="Your one time passcode code",R9i="Your one time passcode is :code",O9i="Delete Tax Rate",P9i="Restore Tax Rate",M9i="Select company backup file",F9i="Please upload the .zip file used to create this backup.",B9i="Backup | Restore",$9i="Create company backup",V9i="Backup",H9i="The following purchase_order :purchase_order was created for vendor :vendor for :amount.",W9i="Purchase Order :purchase_order was created for :vendor",z9i="Purchase Order :purchase_order was sent to :vendor",U9i="The following vendor :vendor was emailed Purchase Order :purchase_order for :amount.",j9i="This product is a restricted item, please contact the vendor for further information.",q9i="Product not available.",K9i="Purchase Order Created",G9i="Purchase Order Sent",Y9i="Purchase Order Viewed",Q9i="Purchase Order Accepted",X9i="The credit amount can not be greater than the payment amount",Z9i="Set an exchange rate when entering a manual payment",J9i="Set an exchange rate when creating an expense",e7i="Matomo URL",t7i="Matomo Id",n7i="Add To Invoice",i7i="Danger Zone",r7i="Import completed",o7i="Your statement from :start_date to :end_date is attached.",s7i="Email queued",a7i="Clone to Recurring Invoice",l7i="Inventory Threshold",c7i="Successfully queued statement to be sent",u7i="Show Email Footer",d7i="Invoice Task Hours",h7i="Add the hours to the invoice line items",f7i="Auto Bill Standard Invoices",p7i="Auto Bill Recurring Invoices",g7i="Email Alignment",m7i="PDF Preview Location",_7i="Mailgun",v7i="Brevo",b7i="Postmark",y7i="Microsoft",C7i="Click + to create a record",w7i="Last 365 Days",S7i="Import Design",E7i="Successfully imported design",x7i="The design is invalid, the :value section is missing",T7i="Would you like to upload your logo?",k7i="Installed Version",I7i="Notify Vendor When Paid",L7i="Send an email to the vendor when the expense is marked as paid",D7i="Update Payment",A7i="Markup",N7i="Unlock Pro",R7i="Upgrade to a paid plan to create schedules",O7i="Next Run",P7i="All Clients",M7i="Show Aging Table",F7i="Show Payments Table",B7i="Only Clients with Invoices",$7i="Email Statement",V7i="Once",H7i="Schedules",W7i="New Schedule",z7i="Edit Schedule",U7i="Successfully created schedule",j7i="Successfully updated schedule",q7i="Successfully archived schedule",K7i="Successfully deleted schedule",G7i="Successfully removed schedule",Y7i="Successfully restored schedule",Q7i="Search Schedule",X7i="Search Schedules",Z7i="Update Product",J7i="Create Purchase Order",e$i="Update Purchase Order",t$i="Sent Invoice",n$i="Sent Quote",i$i="Sent Credit",r$i="Sent Purchase Order",o$i="Image URL",s$i="Max Quantity",a$i="Test URL",l$i="Option is not shown",c$i="Option is shown but not selected",u$i="Option is shown and selected",d$i="Option is not shown",h$i="View All",f$i="Edit All",p$i="Accept Purchase Order Number",g$i="Enable clients to provide a PO number when approving a quote",m$i="From Email",_$i="Show Preview",v$i="Show Paid Stamp",b$i="Show Shipping Address",y$i="There are no documents in the selected records to download",C$i="Pixels",w$i="Logo Size",S$i="Failed",E$i="Client Contacts",x$i="Sync From",T$i="Invoices: :invoices for :amount for client :client",k$i="Payment with no invoice for amount :amount for client :client",I$i="Click here to see all variables.",L$i="Ship to",D$i="Please transfer into the nominated bank account above.",A$i="Branch Name",N$i="Branch Code",R$i="Bank Name",O$i="Bank Code",P$i="BIC",M$i="Upgrade or downgrade your current plan.",F$i="Add Logo",B$i="Add Stripe",$$i="Invalid Coupon",V$i="No billable tasks for this project",H$i="Insufficient permissions to perform this action",W$i="Please verify your account to send emails.",z$i="Thank you for purchasing a white label license. <br><br> Your license key is: <br><br> :license_key <br><br> You can manage your license here: https://invoiceninja.invoicing.co/client/login",U$i="Klarna",j$i="Payable within :payeddue days net until :paydate",q$i="No buyer's reference given",K$i="The invoice needs to be paid online via the provided link",G$i="Pre Payment",Y$i="Number of payments",Q$i="The number of times this payment will be made",X$i="Continue until cancelled",Z$i="Payment :payment was emailed to :client",J$i="Payment :payment was emailed",eVi="Record not found",tVi="Minimum Payment Amount",nVi="Client Initiated Payments",iVi="Support making a payment in the client portal without an invoice",rVi="Share Invoice/Quote Columns",oVi="CC Email",sVi="Payment Balance",aVi="Allow user to access the reports, data is limited to available permissions",lVi="Payment :payment was emailed to :client",cVi="One-Time Products",uVi="Optional One-Time Products",dVi="Required",hVi="Hidden",fVi="Payment Links",pVi="Payment Link",gVi="New Payment Link",mVi="Edit Payment Link",_Vi="Successfully created payment link",vVi="Successfully updated payment link",bVi="Successfully archived payment link",yVi="Successfully deleted payment link",CVi="Successfully removed payment link",wVi="Successfully restored payment link",SVi="Search 1 Payment Link",EVi="Search :count Payment Links",xVi="Increase Prices",TVi="Update Prices",kVi="Successfully queued prices to be increased",IVi="Successfully queued prices to be updated",LVi="API Token",DVi="API Key",AVi="Endpoint",NVi="Not Billable",RVi="Allow Billable Task Items",OVi="Enable configuring which task items are billed",PVi="Show Task Item Description",MVi="Enable specifying task item descriptions",FVi="Email Record",BVi="Invoice Product Columns",$Vi="Quote Product Columns",VVi="Vendors",HVi="Product Sales",WVi="User sales report for client/s :client from :start_date to :end_date",zVi="Customer balance report",UVi="Customer sales report",jVi="User sales report",qVi="Aged Receivable Detailed Report",KVi="Aged Receivable Summary Report",GVi="Taxable Amount",YVi="Tax Summary",QVi="OAuth / Mail",XVi="Preferences",ZVi="Analytics",JVi="Reduced Rate",eHi="Tax All",tHi="Tax Selected",nHi="version",iHi="Seller Subregion",rHi="Calculate Taxes",oHi="Automatically calculate taxes when saving invoices",sHi="Link Expenses",aHi="Converted Client Balance",lHi="Converted Payment Balance",cHi="Total Hours",uHi="Use +days to set the date in the future",dHi="More information ",hHi="here",fHi="Show Credits Table",pHi="Payment Manual",gHi="Tax Summary Report",mHi="Tax Category",_Hi="Physical Goods",vHi="Digital Products",bHi="Services",yHi="Shipping",CHi="Tax Exempt",wHi="Late fee for invoice :invoice added on :date",SHi="Khmer",EHi="Routing ID",xHi="Enable E-Invoice",THi="E-Invoice Type",kHi="Reduced Tax",IHi="Override Tax",LHi="Zero Rated",DHi="Reverse Tax",AHi="Successfully updated the tax category",NHi="Successfully updated the tax categories",RHi="Set Tax Category",OHi="Payment Manual",PHi="Expense Payment Type",MHi="Rename",FHi="Successfully renamed document",BHi="E-Invoice",$Hi="Light/Dark Mode",VHi="Activities",HHi="Here are your company's most recent transactions:",WHi="Palestine",zHi="Taiwan",UHi="Duties",jHi="Order Number",qHi="Order",KHi="Total Invoices Outstanding",GHi="Recent Activity",YHi="Enable auto billing",QHi="Email :count invoices",XHi="Invoice Task Item Description",ZHi="Add the item description to the invoice line items",JHi="Next Send Time",eWi="Successfully uploaded certificate",tWi="Certificate set",nWi="Certificate not set",iWi="Passphrase set",rWi="Passphrase not set",oWi="Upload Certificate",sWi="Certificate Passphrase",aWi="Valid VAT Number",lWi="React Notification Links",cWi="Admin emails will contain links to the react application",uWi="Show Task Billable",dWi="Credit Item",hWi="Drop file here",fWi="Files",pWi="Camera",gWi="Gallery",mWi="Project Location",_Wi="Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments",vWi="Hungarian",bWi="Use your phone subscription settings to manage your plan",yWi="Item Tax3",CWi="Item Tax Rate 1",wWi="Item Tax Rate 2",SWi="Item Tax Rate 3",EWi="Buy Price",xWi="Macedonia",TWi="Admin Initiated Payments",kWi="Support entering a payment in the admin portal without an invoice",IWi="Paid Date",LWi="An email will be sent with the PDFs",DWi="Swazi Lilangeni",AWi="Income",NWi="Enter a value here if the total amount received was MORE than the invoice amount, or when recording a payment with no invoices. Otherwise this field should be left blank.",RWi="Vendor Phone",OWi="Mercado Pago",PWi="MyBank",MWi="Pay in 4",FWi="District",BWi="Region",$Wi="County",VWi="Tax Details",HWi=":contact made payment :payment for invoice :invoice for :client",WWi=":user entered payment :payment for invoice :invoice for :client",zWi="Default Payment Type",UWi="Number precision",jWi="Controls the number of decimals supported in the interface",qWi="Tax Exempt",KWi="Drop files here",GWi="Upload Files",YWi="Download E-Invoice",QWi="Download E-Credit",XWi="Download E-Quote",ZWi="Intra-community triangular transaction",JWi="Tax-free intra-community delivery",ezi="Please note that this supply is subject to reverse charge",tzi="Nicaraguan Córdoba",nzi="Image",izi="Other",rzi="Linked To",ozi="The file has been saved in :path",szi="Successfully unlinked :count transactions",azi="Successfully unlinked transaction",lzi="Allow user to access the dashboard, data is limited to available permissions",czi="Successfully marked credits sent",uzi="Show Document Preview",dzi="Cash accounting",hzi="Click or drop files here",fzi="Set public",pzi="Set private",gzi="Individual",mzi="Business",_zi="Partnership",vzi="Trust",bzi="Charity",yzi="Government",Czi="Stock quantity",wzi="Vendor Contact",Szi="Unpaid",Ezi="Paid",xzi="Note: this feature requires a Zip-Tax API key to lookup US sales tax by address",Tzi="Cache Data",kzi="Unknown",Izi="Webhook Failure",Lzi="Email Opened",Dzi="Email Delivered",Azi="Log",Nzi="Classification",Rzi="Stock :quantity",Ozi="Upcoming",Pzi="Client Contact",Mzi="Uncategorized",Fzi="Login Notification",Bzi="Sends an email notifying that a login has taken place.",$zi="Payment Refund Receipt # :number",Vzi="Payment Receipt # :number",Hzi="The template will be applied to following:",Wzi="Run Template",zzi="Statement Design",Uzi="Delivery Note Design",jzi="Payment Receipt Design",qzi="Payment Refund Design",Kzi="Add the Chrome extension to manage your tasks",Gzi="Watch Video",Yzi="View Extension",Qzi="Reactivate Email",Xzi="Successfully reactivated email",Zzi="Enable using the design as a template",Jzi="Quarter",eUi="Item Description",tUi="Task Item",nUi="Record State",iUi="Save files to this folder",rUi="Downloads Folder",oUi="Invoiced Quotes",sUi="Invoice Paid Quotes",aUi="The downloads folder does not exist :value",lUi="User Logged in Notification",cUi="Send an email when logging in from a new location",uUi="Payment Email To All Contacts",dUi="Sends the payment email to all contacts when enabled",hUi="Add Line",fUi="Expense :expense notification sent to :contact",pUi="Confirmation of payment :amount sent to :vendor",gUi="Payment processed for :amount dated :payment_date. <br>[Transaction Reference: :transaction_reference]",mUi="Receipt",_Ui="Charges",vUi="Email Report",bUi="Payment Type Credit",yUi="Payment Type Debit",CUi="Send Emails To",wUi="Primary Contact",SUi="All Contacts",EUi="Insert Below",xUi="Bank account authentication. Selecting your institution to complete the request with your account credentials.",TUi="An error has occurred",kUi="An unknown error has occurred! Reason:",IUi="Invalid Token",LUi="The provided token was invalid. Contact support for help, if this issue persists.",DUi="Missing Credentials",AUi="Invalid or missing credentials for Gocardless Bank Account Data. Contact support for help, if this issue persists.",NUi="Not Available",RUi="Feature unavailable, Enterprise Plan only.",OUi="Invalid Institution",PUi="The provided institution-id is invalid or no longer valid.",MUi="Invalid Reference",FUi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",BUi="EUA Failure",$Ui="An error occurred during End User Agreement creation:",VUi="Invalid Requisition",HUi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",WUi="Not Ready",zUi="You called this site too early. Please finish authorization and refresh this page. Contact support for help, if this issue persists.",UUi="No Accounts selected",jUi="The service has not returned any valid accounts. Consider restarting the flow.",qUi="Restart flow.",KUi="Return to application.",GUi="Lao",YUi="Lao kip",QUi="Regions: USA, UK, Australia & India",XUi="Regions: Europe & UK",ZUi="Select Provider",JUi="Requisition expired, please reauthenticate.",eji="Access to bank account feeds has expired as set in End User Agreement. <br><br>Please log into Invoice Ninja and re-authenticate with your banks to continue receiving transactions.",tji="Participant",nji="Participant name",iji="Client unsubscribed from emails.",rji="Client :client has unsubscribed from your e-mails. The client needs to consent to receive future emails from you.",oji="Resubscribe",sji="Subscribe",aji="You are currently subscribed and will continue to receive email communications.",lji="You are currently not subscribed, and therefore, will not receive emails at this time.",cji="We were unable to deliver Purchase Order :invoice to :contact. <br><br> :error",uji="Unable to deliver Purchase Order :invoice",dji="Display HTML version of entity when viewing on mobile",hji="For improved visualization, displays a HTML version of the invoice/quote when viewing on mobile.",fji="Please select an invoice or credit",pji="Mobile Version",gji="Venmo",mji="MyBank",_ji="Pay Later",vji="Local Domain",bji="Verify Peer",yji="Note: connecting an account requires a GoCardless/Nordigen API key",Cji="Accounts Receivable Detailed",wji="Accounts Receivable Summary",Sji="Client Sales",Eji="User Sales",xji="iFrame URL",Tji="User unsubscribed from emails :link",kji="Out of stock",Iji=`Component ":step" requires at least one of it's dependencies (":dependencies") in the list.`,Lji='Component ":step" depends on ":dependency". Make component(s) order is correct.',Dji="You must include at least one of authentication methods.",Aji="Cart",Nji="Methods",Rji="Required fields form",Oji="Add step",Pji="Steps",Mji="The order of the steps is important. The first step should not depend on any other step. The second step should depend on the first step, and so on.",Fji="Other steps",Bji="Use Available Payments",$ji="Successfully sent email",Vji="Gateway Type",Hji="Would you like to save this import mapping as a template for future use?",Wji="Save Template Mapping",zji="Checkout is enabled only for existing customers. Please login with existing account to checkout.",Uji="Checkout is enabled only for new customers. Please register a new account to checkout.",jji="Auto bill standard invoices on the due date",qji="Auto bill on send date OR due date (recurring invoices)",Kji="Apply any credit balances to payments prior to charging a payment method",Gji="Use unapplied payments",Yji="Apply any payment balances prior to charging a payment method",Qji="The number of days after the invoice date that payment is due",Xji="The default payment type to be used for payments",Zji="The number of days that the quote is valid for",Jji="The default expense payment type to be used",eqi="Pay in 4",tqi="Payment Provider",nqi="Set your email as the sending user",iqi="Purchase Order Items",rqi="No data found in this CSV file",oqi="Accept Payments Online",sqi="View all payment gateways",aqi="Product cost",lqi="Duration in words",cqi="Upcoming Recurring Invoices",uqi="Shipping Country",dqi="Show table footer",hqi="Displays the totals in the footer of the table",fqi="Total Invoices",pqi="Add to group",gqi="Check Credentials",mqi="Credentials are valid",_qi="E-Quote",vqi="E-Credit",bqi="E-Purchase Order",yqi="E-Quote Type",Cqi="Please upgrade to unlock unlimited clients!",wqi="Download E-Purchase Order",Sqi="We recommend using the new web app or the desktop app for the best performance",Eqi="Rappen Rounding",xqi="Round amount to 5 cents",Tqi="Assign group",kqi="Advanced Card Payments",Iqi="EHLO domain (optional)",Lqi="ie. 25,587,465",Dqi="ie. smtp.gmail.com",Aqi="Always show required fields form",Nqi="Displays the required fields form always at checkout",Rqi="Advanced Cards",Oqi="Statement sent to :client",Pqi="Invoice Net Amount",Mqi="Round To Minutes",Fqi="Task Rounding Direction",Bqi="Round task times up or down.",$qi="Direction",Vqi="Round Up",Hqi="Round Down",Wqi="Round To Nearest",zqi="The interval to round the task to.",Uqi="Successfully updated data",jqi="Bulk Update",qqi="Calculate",Kqi="Sum",Gqi="Money",Yqi="Web App",Qqi="Desktop App",Xqi="Disconnected",Zqi="Reconnect",Jqi="E-Invoice Settings",eKi="Refund of your invoice via BTCPay",tKi="A refund intended for you has been issued. To claim it via BTCPay, please click on this link:",nKi="Mauritanian Ouguiya",iKi="Bhutan Ngultrum",rKi="End Of Month",oKi="Merge E-Invoice and PDF",sKi="New task assignment [Task :task] [ :date ]",aKi="You have been assigned task :task <br><br> Description: :description <br><br> Client: :client",lKi="User :user entered note: :notes",cKi="Reminder: Quote :quote from :company",uKi="Reminder for quote :number for :amount",dKi="First Quote Reminder",hKi="Before the valid until date",fKi="After the valid until date",pKi="After the quote date",gKi="Remind Quote",mKi="Tax currency is different from invoice currency",_Ki="The invoice has already been imported on :date",vKi="Before the valid until",bKi="After the valid until",yKi="Task Assigned Notification",CKi="Send an email when a task is assigned",wKi="Invoices are locked at the end of the month",SKi="Referral URL",EKi="Add Comment",xKi="Successfully saved comment",TKi="Tickets",kKi="Successfully assigned group",IKi="Merge to PDF",LKi="Note: the latest version requires PHP :version",DKi="Automatically expand products table notes",AKi="Automatically expands the notes section within the products table to display more lines.",NKi="Institution Number",RKi="Transit Number",OKi="Personal",PKi="Address Information",MKi="Enter the Information for the Bank Account",FKi="Account Holder Information",BKi="Enter Information for the Account Holder",$Ki="Customer Type",VKi="Process Date",HKi="Forever Free",WKi="Comments Only",zKi="Payment Balance On File",UKi="For more e-invoice settings please navigate :here",jKi="You need to stop the task before adding a new item.",qKi="XML File",KKi="One-Page Checkout",GKi="Enable the new single page payment flow",YKi="Applies To",QKi="Accept Purchase Order",XKi="Round To Seconds",ZKi="Quote :quote reminder 1 sent",JKi="Auto Bill succeeded for invoice :invoice",eGi="Auto Bill failed for invoice :invoice. :notes",tGi="E-Invoice :invoice for :client was sent. :notes",nGi="Payment Failed",iGi="SSL Host Override",rGi="Upload Logo",oGi="Melilla",sGi="Ceuta",aGi="Vietnamese",lGi="Please note that the status of your invoice has been updated. We recommend refreshing the page to view the most current version.",cGi="You’re all caught up! No new notifications.",uGi="How to import data",dGi="Download example file",hGi="Inbound e-mail address",fGi="The inbound email address which accepts expense documents. ie. expense@invoiceninja.com",pGi="Expense Mailbox",gGi="Enables processing of documents such as receipts for expense reporting",mGi="Allow Company Senders",_Gi="Allows users within the company to send expense documents.",vGi="Allow Vendor Senders",bGi="Allows company vendors to send expense documents",yGi="Allow Client Senders",CGi="Allows clients to send expense documents",wGi="Inbound sender allow list",SGi="Comma separated list of emails that should be allowed to send emails for processing",EGi="Inbound sender banned list",xGi="Comma separate list of emails that are disallowed to send emails for processing",TGi="Allow All Senders",kGi="Allow anyone to send an expense email for processing",IGi="Quick Actions",LGi="Logs out all users and requires all active users to reauthenticate.",DGi="Updated Records",AGi="Seller not VAT registered",NGi="No disclosure of sales tax in accordance with § 19 UStG",RGi="Looks like it's your first time using PEPPOL.",OGi="Get Started",PGi="Configure PEPPOL",MGi="Step",FGi="White-label license required in order to use einvoicing over the PEPPOL network.",BGi="Enterprise plan required in order to use einvoicing over the PEPPOL network.",$Gi="Ecredits are required to send and receive einvoices. These are charged on a per document basis.",VGi="Buy E Credits",HGi="PEPPOL successsfully configured.",WGi="Enterprise plan required for PEPPOL. Please upgrade your plan.",zGi="PEPPOL network not yet available for this country.",UGi="Disconnect from the PEPPOL network",jGi="Disconnect from PEPPOL.",qGi="Your VAT number will be withdrawn from the PEPPOL network after disconnecting. You will be unable to send or receive edocuments.",KGi="Time log duration in words",GGi="Time log duration",YGi="Successfully merged vendors",QGi="Somes taxes are hidden due to current tax settings. :link",XGi="Third Tax",ZGi="Are you sure you want to create a negative payment? This cannot be used as a credit or payment.",JGi="Bermudian Dollar",eYi="Central African CFA Franc",tYi="Congolese Franc",nYi="Djiboutian Franc",iYi="Eritrean Nakfa",rYi="Falkland Islands Pound",oYi="Guinean Franc",sYi="Iraqi Dinar",aYi="Lesotho Loti",lYi="Mongolian Tugrik",cYi="Seychellois Rupee",uYi="Solomon Islands Dollar",dYi="Somali Shilling",hYi="South Sudanese Pound",fYi="Sudanese Pound",pYi="Tajikistani Somoni",gYi="Turkmenistani Manat",mYi="Uzbekistani Som",_Yi="Please note that the status of your payment has been updated. We recommend refreshing the page to view the most current version.",vYi="Please note that the status of your credit has been updated. We recommend refreshing the page to view the most current version.",bYi="Credit Updated",yYi="Payment Updated",CYi="Find invoices, clients, and more",wYi="The VAT number is not valid for the selected country. Format should be Country Code followed by number only ie, DE123456789",SYi="Send E-Invoices",EYi="Receive E-Invoices",xYi="PEPPOL token successfully generated.",TYi="Token is used as another step to make sure invoices are sent securely. Unlike white-label licenses, token can be rotated at any point without need to wait on Invoice Ninja support.",kYi="You need to generate a token to continue.",IYi="Generate Token",LYi="Amount of Credits",DYi="Sales above threshold",AYi="You can't change your VAT number or ID number once PEPPOL is set up.",NYi="The full IBAN number",RYi="BIC/Swift code",OYi="The Bank identifer",PYi="Payer Bank Account Number",MYi="The bank account number of the payer",FYi="BSB / Sort Code",BYi="Bank Branch Code",$Yi="Card Type",VYi="ie. VISA, AMEX",HYi="last 4 digits only",WYi="Card Holder Name",zYi="Tokenize",UYi="Tokenize payment method for future use.",jYi="Accept credit card payments using Stripe.",qYi="ACH direct debit. USD payments, instant verification available.",KYi="Alipay allows users in China to pay securely using their mobile wallets.",GYi="Sofort is a popular European payment method that enables bank transfers in real-time, primarily used in Germany and Austria.",YYi="Apple/Google Pay for users with Apple/Android devices, using saved card information for easy checkout.",QYi="SEPA Direct Debit (Single Euro Payments Area).",XYi="Bancontact is a widely used payment method in Belgium.",ZYi="iDEAL is the most popular payment method in the Netherlands.",JYi="Giropay is a German payment method that facilitates secure and immediate online bank transfers.",eQi="Przelewy24 is a common payment method in Poland.",tQi="Stripe Bank Transfers using Stripes virtual bank accounts, available in Japan, UK, USA, Europe and Mexico. Ensure this is enabled in Stripe!",nQi="EPS is an Austrian online payment system.",iQi="ACSS (Automated Clearing Settlement System) Direct Debit for Canadian bank accounts.",rQi="BECS Direct Debit for Australian bank accounts.",oQi="Klarna buy now and pay later in installments or on a set schedule.",sQi="BACS Direct Debit for UK bank accounts, commonly used for subscription billing.",aQi="FPX is a popular online payment method in Malaysia.",lQi="Payment Means",cQi="Send E-Invoice",uQi="Receive E-Invoice",dQi="Saved E-Invoice Settings",hQi="We'll need your license key for future communication to our services. Make sure to LICENSE_KEY as environment variable.",fQi="License not found. Make sure to set LICENSE_KEY as environment variable.",pQi="White label license not found.",gQi="We'll update your company details with the provided information.",mQi="Full client address is required for E-invoicing",_Qi="Connected",vQi="Email :count quotes",bQi="E-Invoice :invoice for :client successfully delivered! :notes",yQi="E-Invoice :invoice for :client failed delivery. :notes",CQi="Routing problem. No recipient/destination found.",wQi="Technical delivery problem. Retry not possible",SQi="Cleared by tax authority, sending to receiver",EQi="Account Name",xQi="The name of the account",TQi="E-Expense :expense received from :vendor",kQi="Additional Tax Identifiers",IQi="If you are registered for VAT in other regions, you can add your VAT numbers for those regions here.",LQi="Configure",DQi="New VAT Number",AQi="Warning! Your credit balance is low.",NQi="Please add credits to your account to avoid interruption of services.",RQi="Warning! Your credit balance is empty.",OQi="Please add credits to your account to avoid interruption of services.",PQi="Comment Saved",MQi='Either "Send E-Invoice" or "Receive E-Invoice" (or both) must be selected.',FQi="Delete identifier",BQi="Deleting this identifier will remove it from the system. Make sure this is the desired action before proceeding.",$Qi="Oops! Something went wrong. Contact us at contact@invoiceninja.com for more information.",VQi="Your Download is now ready! [ :message ]",HQi="Reminder 1 for Quote :invoice was sent to :client",WQi="Custom reminder was sent to :client",zQi="Use System Fonts",UQi="Override the standard fonts with those from the web browser",jQi="Active Tasks",qQi="Enable Notifications",KQi="Enable Public Notifications",GQi="Enable real-time notifications from Invoice Ninja.",YQi="Navigate",QQi="This action will enable line item taxes and disable total taxes. Any open invoices may be recalculated with the new settings!",XQi=":user emailed credit :credit for :client to :contact",ZQi={organization:Jxn,name:eTn,website:tTn,work_phone:nTn,address:iTn,address1:rTn,address2:oTn,city:sTn,state:aTn,postal_code:lTn,country_id:cTn,contacts:uTn,first_name:dTn,last_name:hTn,phone:fTn,email:pTn,additional_info:gTn,payment_terms:mTn,currency_id:_Tn,size_id:vTn,industry_id:bTn,private_notes:yTn,invoice_date:CTn,due_date:wTn,invoice:STn,client:ETn,invoice_number:xTn,invoice_number_short:TTn,po_number:kTn,po_number_short:ITn,frequency_id:LTn,discount:DTn,taxes:ATn,tax:NTn,item:RTn,description:OTn,unit_cost:PTn,quantity:MTn,line_total:FTn,subtotal:BTn,net_subtotal:$Tn,paid_to_date:VTn,balance_due:HTn,invoice_design_id:WTn,terms:zTn,your_invoice:UTn,remove_contact:jTn,add_contact:qTn,create_new_client:KTn,edit_client_details:GTn,enable:YTn,learn_more:QTn,manage_rates:XTn,note_to_client:ZTn,invoice_terms:JTn,save_as_default_terms:ekn,download_pdf:tkn,pay_now:nkn,save_invoice:ikn,clone_invoice:rkn,archive_invoice:okn,delete_invoice:skn,email_invoice:akn,enter_payment:lkn,tax_rates:ckn,rate:ukn,settings:dkn,enable_invoice_tax:hkn,enable_line_item_tax:fkn,dashboard:pkn,dashboard_totals_in_all_currencies_help:gkn,clients:mkn,invoices:_kn,payments:vkn,credits:bkn,history:ykn,search:Ckn,sign_up:wkn,guest:Skn,company_details:Ekn,online_payments:xkn,notifications:Tkn,import_export:kkn,done:Ikn,save:Lkn,create:Dkn,upload:Akn,import:"Import",download:Nkn,cancel:Rkn,close:Okn,provide_email:Pkn,powered_by:Mkn,no_items:Fkn,recurring_invoices:Bkn,recurring_help:$kn,recurring_quotes:Vkn,in_total_revenue:Hkn,billed_client:Wkn,billed_clients:zkn,active_client:Ukn,active_clients:jkn,invoices_past_due:qkn,upcoming_invoices:Kkn,average_invoice:Gkn,archive:Ykn,delete:"Delete",archive_client:Qkn,delete_client:Xkn,archive_payment:Zkn,delete_payment:Jkn,archive_credit:eIn,delete_credit:tIn,show_archived_deleted:nIn,filter:iIn,new_client:rIn,new_invoice:oIn,new_payment:sIn,new_credit:aIn,contact:lIn,date_created:cIn,last_login:uIn,balance:dIn,action:hIn,status:fIn,invoice_total:pIn,frequency:gIn,range:mIn,start_date:_In,end_date:vIn,transaction_reference:bIn,method:yIn,payment_amount:CIn,payment_date:wIn,credit_amount:SIn,credit_balance:EIn,credit_date:xIn,empty_table:TIn,select:kIn,edit_client:IIn,edit_invoice:LIn,create_invoice:DIn,enter_credit:AIn,last_logged_in:NIn,details:RIn,standing:OIn,credit:PIn,activity:MIn,date:FIn,message:BIn,adjustment:$In,are_you_sure:VIn,payment_type_id:HIn,amount:WIn,work_email:zIn,language_id:UIn,timezone_id:jIn,date_format_id:qIn,datetime_format_id:KIn,users:GIn,localization:YIn,remove_logo:QIn,logo_help:XIn,payment_gateway:ZIn,gateway_id:JIn,email_notifications:e2n,email_viewed:t2n,email_paid:n2n,site_updates:i2n,custom_messages:r2n,default_email_footer:o2n,select_file:s2n,first_row_headers:a2n,column:l2n,sample:c2n,import_to:u2n,client_will_create:d2n,clients_will_create:h2n,email_settings:f2n,client_view_styling:p2n,pdf_email_attachment:g2n,custom_css:m2n,import_clients:_2n,csv_file:v2n,export_clients:b2n,created_client:y2n,created_clients:C2n,updated_settings:w2n,removed_logo:S2n,sent_message:E2n,invoice_error:x2n,limit_clients:T2n,payment_error:k2n,registration_required:I2n,confirmation_required:L2n,updated_client:D2n,archived_client:A2n,archived_clients:N2n,deleted_client:R2n,deleted_clients:O2n,updated_invoice:P2n,created_invoice:M2n,cloned_invoice:F2n,emailed_invoice:B2n,and_created_client:$2n,archived_invoice:V2n,archived_invoices:H2n,deleted_invoice:W2n,deleted_invoices:z2n,created_payment:U2n,created_payments:j2n,archived_payment:q2n,archived_payments:K2n,deleted_payment:G2n,deleted_payments:Y2n,applied_payment:Q2n,created_credit:X2n,archived_credit:Z2n,archived_credits:J2n,deleted_credit:eLn,deleted_credits:tLn,imported_file:nLn,updated_vendor:iLn,created_vendor:rLn,archived_vendor:oLn,archived_vendors:sLn,deleted_vendor:aLn,deleted_vendors:lLn,confirmation_subject:cLn,confirmation_header:uLn,confirmation_message:dLn,invoice_subject:hLn,invoice_message:fLn,payment_subject:pLn,payment_message:gLn,email_salutation:mLn,email_signature:_Ln,email_from:vLn,invoice_link_message:bLn,notification_invoice_paid_subject:yLn,notification_invoice_sent_subject:CLn,notification_invoice_viewed_subject:wLn,notification_invoice_paid:SLn,notification_invoice_sent:ELn,notification_invoice_viewed:xLn,stripe_payment_text:TLn,stripe_payment_text_without_invoice:kLn,reset_password:ILn,secure_payment:LLn,card_number:DLn,expiration_month:ALn,expiration_year:NLn,cvv:RLn,logout:OLn,sign_up_to_save:PLn,agree_to_terms:MLn,terms_of_service:FLn,email_taken:BLn,working:$Ln,success:VLn,success_message:HLn,erase_data:WLn,password:zLn,pro_plan_product:ULn,unsaved_changes:jLn,custom_fields:qLn,company_fields:KLn,client_fields:GLn,field_label:YLn,field_value:QLn,edit:XLn,set_name:ZLn,view_as_recipient:JLn,product_library:eDn,product:tDn,products:nDn,fill_products:iDn,fill_products_help:rDn,update_products:oDn,update_products_help:sDn,create_product:aDn,edit_product:lDn,archive_product:cDn,updated_product:uDn,created_product:dDn,archived_product:hDn,pro_plan_custom_fields:fDn,advanced_settings:pDn,pro_plan_advanced_settings:gDn,invoice_design:mDn,specify_colors:_Dn,specify_colors_label:vDn,chart_builder:bDn,ninja_email_footer:yDn,go_pro:CDn,quote:wDn,quotes:SDn,quote_number:EDn,quote_number_short:xDn,quote_date:TDn,quote_total:kDn,your_quote:IDn,total:LDn,clone:DDn,new_quote:ADn,create_quote:NDn,edit_quote:RDn,archive_quote:ODn,delete_quote:PDn,save_quote:MDn,email_quote:FDn,clone_quote:BDn,convert_to_invoice:$Dn,view_invoice:VDn,view_client:HDn,view_quote:WDn,updated_quote:zDn,created_quote:UDn,cloned_quote:jDn,emailed_quote:qDn,archived_quote:KDn,archived_quotes:GDn,deleted_quote:YDn,deleted_quotes:QDn,converted_to_invoice:XDn,quote_subject:ZDn,quote_message:JDn,quote_link_message:eAn,notification_quote_sent_subject:tAn,notification_quote_viewed_subject:nAn,notification_quote_sent:iAn,notification_quote_viewed:rAn,session_expired:oAn,invoice_fields:sAn,invoice_options:aAn,hide_paid_to_date:lAn,hide_paid_to_date_help:cAn,charge_taxes:uAn,user_management:dAn,add_user:hAn,send_invite:fAn,sent_invite:pAn,updated_user:gAn,invitation_message:mAn,register_to_add_user:_An,user_state:vAn,edit_user:bAn,delete_user:yAn,active:CAn,pending:wAn,deleted_user:SAn,confirm_email_invoice:EAn,confirm_email_quote:xAn,confirm_recurring_email_invoice:TAn,confirm_recurring_email_invoice_not_sent:kAn,cancel_account:IAn,cancel_account_message:LAn,go_back:DAn,data_visualizations:AAn,sample_data:NAn,hide:RAn,new_version_available:OAn,invoice_settings:PAn,invoice_number_prefix:MAn,invoice_number_counter:FAn,quote_number_prefix:BAn,quote_number_counter:$An,share_invoice_counter:VAn,invoice_issued_to:HAn,invalid_counter:WAn,mark_sent:zAn,more_designs:UAn,more_designs_title:jAn,more_designs_cloud_header:qAn,more_designs_cloud_text:KAn,more_designs_self_host_text:GAn,buy:YAn,bought_designs:QAn,sent:XAn,vat_number:ZAn,payment_title:JAn,payment_cvv:eNn,payment_footer1:tNn,payment_footer2:nNn,id_number:iNn,white_label_link:rNn,white_label_header:oNn,bought_white_label:sNn,white_labeled:aNn,restore:lNn,restore_invoice:cNn,restore_quote:uNn,restore_client:dNn,restore_credit:hNn,restore_payment:fNn,restored_invoice:pNn,restored_quote:gNn,restored_client:mNn,restored_payment:_Nn,restored_credit:vNn,reason_for_canceling:bNn,discount_percent:yNn,discount_amount:CNn,invoice_history:wNn,quote_history:SNn,current_version:ENn,select_version:xNn,view_history:TNn,edit_payment:kNn,updated_payment:INn,deleted:LNn,restore_user:DNn,restored_user:ANn,show_deleted_users:NNn,email_templates:RNn,invoice_email:ONn,payment_email:PNn,quote_email:MNn,reset_all:FNn,approve:BNn,token_billing_type_id:$Nn,token_billing_1:VNn,token_billing_2:HNn,token_billing_3:WNn,token_billing_4:zNn,token_billing_checkbox:UNn,view_in_gateway:jNn,use_card_on_file:qNn,edit_payment_details:KNn,token_billing:GNn,token_billing_secure:YNn,support:QNn,contact_information:XNn,"256_encryption":"256-Bit Encryption",amount_due:ZNn,billing_address:JNn,billing_method:eRn,order_overview:tRn,match_address:nRn,click_once:iRn,invoice_footer:rRn,save_as_default_footer:oRn,token_management:sRn,tokens:aRn,add_token:lRn,show_deleted_tokens:cRn,deleted_token:uRn,created_token:dRn,updated_token:hRn,edit_token:fRn,delete_token:pRn,token:gRn,add_gateway:mRn,delete_gateway:_Rn,edit_gateway:vRn,updated_gateway:bRn,created_gateway:yRn,deleted_gateway:CRn,pay_with_paypal:wRn,pay_with_card:SRn,change_password:ERn,current_password:xRn,new_password:TRn,confirm_password:kRn,password_error_incorrect:IRn,password_error_invalid:LRn,updated_password:DRn,api_tokens:ARn,users_and_tokens:NRn,account_login:RRn,recover_password:ORn,forgot_password:PRn,email_address:MRn,lets_go:FRn,password_recovery:BRn,send_email:$Rn,set_password:VRn,converted:HRn,email_approved:WRn,notification_quote_approved_subject:zRn,notification_quote_approved:URn,resend_confirmation:jRn,confirmation_resent:qRn,payment_type_credit_card:KRn,payment_type_paypal:GRn,payment_type_bitcoin:YRn,payment_type_gocardless:QRn,knowledge_base:XRn,partial:ZRn,partial_remaining:JRn,more_fields:eOn,less_fields:tOn,client_name:nOn,pdf_settings:iOn,product_settings:rOn,auto_wrap:oOn,duplicate_post:sOn,view_documentation:aOn,app_title:lOn,app_description:cOn,rows:uOn,www:dOn,logo:hOn,subdomain:fOn,provide_name_or_email:pOn,charts_and_reports:gOn,chart:mOn,report:_On,group_by:vOn,paid:bOn,enable_report:yOn,enable_chart:COn,totals:wOn,run:SOn,export:"Export",documentation:EOn,zapier:xOn,recurring:TOn,last_invoice_sent:kOn,processed_updates:IOn,tasks:LOn,new_task:DOn,start_time:AOn,created_task:NOn,updated_task:ROn,edit_task:OOn,clone_task:POn,archive_task:MOn,restore_task:FOn,delete_task:BOn,stop_task:$On,time:VOn,start:HOn,stop:WOn,now:zOn,timer:UOn,manual:jOn,date_and_time:qOn,second:KOn,seconds:GOn,minute:YOn,minutes:QOn,hour:XOn,hours:ZOn,task_details:JOn,duration:ePn,time_log:tPn,end_time:nPn,end:iPn,invoiced:rPn,logged:oPn,running:sPn,task_error_multiple_clients:aPn,task_error_running:lPn,task_error_invoiced:cPn,restored_task:uPn,archived_task:dPn,archived_tasks:hPn,deleted_task:fPn,deleted_tasks:pPn,create_task:gPn,stopped_task:mPn,invoice_task:_Pn,invoice_labels:vPn,prefix:bPn,counter:yPn,payment_type_dwolla:CPn,partial_value:wPn,more_actions:SPn,pro_plan_title:EPn,pro_plan_call_to_action:xPn,pro_plan_feature1:TPn,pro_plan_feature2:kPn,pro_plan_feature3:IPn,pro_plan_feature4:LPn,pro_plan_feature5:DPn,pro_plan_feature6:APn,pro_plan_feature7:NPn,pro_plan_feature8:RPn,resume:OPn,break_duration:PPn,edit_details:MPn,work:FPn,timezone_unset:BPn,click_here:$Pn,email_receipt:VPn,created_payment_emailed_client:HPn,add_company:WPn,untitled:zPn,new_company:UPn,associated_accounts:jPn,unlinked_account:qPn,login:KPn,or:GPn,email_error:YPn,confirm_recurring_timing:QPn,confirm_recurring_timing_not_sent:XPn,unlink_account:ZPn,unlink:JPn,show_address:eMn,show_address_help:tMn,update_address:nMn,update_address_help:iMn,times:rMn,set_now:oMn,dark_mode:sMn,dark_mode_help:aMn,add_to_invoice:lMn,create_new_invoice:cMn,task_errors:uMn,from:dMn,to:hMn,font_size:fMn,primary_color:pMn,secondary_color:gMn,customize_design:mMn,content:_Mn,styles:vMn,defaults:bMn,margins:yMn,header:CMn,footer:wMn,custom:SMn,invoice_to:EMn,invoice_no:xMn,quote_no:TMn,recent_payments:kMn,outstanding:IMn,manage_companies:LMn,total_revenue:DMn,current_user:AMn,new_recurring_invoice:NMn,recurring_invoice:RMn,new_recurring_quote:OMn,recurring_quote:PMn,created_by_invoice:MMn,primary_user:FMn,help:BMn,playground:$Mn,support_forum:VMn,invoice_due_date:HMn,quote_due_date:WMn,valid_until:zMn,reset_terms:UMn,reset_footer:jMn,invoice_sent:qMn,invoices_sent:KMn,status_draft:GMn,status_sent:YMn,status_viewed:QMn,status_partial:XMn,status_paid:ZMn,status_unpaid:JMn,status_all:e4n,show_line_item_tax:t4n,auto_bill:n4n,military_time:i4n,last_sent:r4n,reminder_emails:o4n,quote_reminder_emails:s4n,templates_and_reminders:a4n,subject:l4n,body:c4n,first_reminder:u4n,second_reminder:d4n,third_reminder:h4n,num_days_reminder:f4n,reminder_subject:p4n,reset:g4n,invoice_not_found:m4n,referral_program:_4n,referral_code:v4n,last_sent_on:b4n,page_expire:y4n,upcoming_quotes:C4n,expired_quotes:w4n,sign_up_using:S4n,invalid_credentials:E4n,show_all_options:x4n,user_details:T4n,oneclick_login:k4n,disable:I4n,invoice_quote_number:L4n,invoice_charges:D4n,notification_invoice_bounced:A4n,notification_invoice_bounced_subject:N4n,notification_quote_bounced:R4n,notification_quote_bounced_subject:O4n,custom_invoice_link:P4n,total_invoiced:M4n,open_balance:F4n,verify_email:B4n,basic_settings:$4n,pro:V4n,gateways:H4n,next_send_on:W4n,no_longer_running:z4n,general_settings:U4n,customize:j4n,oneclick_login_help:q4n,referral_code_help:K4n,enable_with_stripe:G4n,tax_settings:Y4n,create_tax_rate:Q4n,updated_tax_rate:X4n,created_tax_rate:Z4n,edit_tax_rate:J4n,archive_tax_rate:e3n,archived_tax_rate:t3n,default_tax_rate_id:n3n,tax_rate:i3n,recurring_hour:r3n,pattern:o3n,pattern_help_title:s3n,pattern_help_1:a3n,pattern_help_2:l3n,pattern_help_3:c3n,see_options:u3n,invoice_counter:d3n,quote_counter:h3n,type:f3n,activity_1:p3n,activity_2:g3n,activity_3:m3n,activity_4:_3n,activity_5:v3n,activity_6:b3n,activity_7:y3n,activity_8:C3n,activity_9:w3n,activity_10:S3n,activity_11:E3n,activity_12:x3n,activity_13:T3n,activity_14:k3n,activity_15:I3n,activity_16:L3n,activity_17:D3n,activity_18:A3n,activity_19:N3n,activity_20:R3n,activity_21:O3n,activity_22:P3n,activity_23:M3n,activity_24:F3n,activity_25:B3n,activity_26:$3n,activity_27:V3n,activity_28:H3n,activity_29:W3n,activity_30:z3n,activity_31:U3n,activity_32:j3n,activity_33:q3n,activity_34:K3n,activity_35:G3n,activity_36:Y3n,activity_37:Q3n,activity_42:X3n,activity_43:Z3n,activity_44:J3n,activity_45:e5n,activity_46:t5n,activity_47:n5n,activity_48:i5n,activity_49:r5n,activity_50:o5n,activity_51:s5n,activity_52:a5n,activity_53:l5n,activity_54:c5n,activity_55:u5n,activity_56:d5n,payment:h5n,system:f5n,signature:p5n,default_messages:g5n,quote_terms:m5n,default_quote_terms:_5n,default_invoice_terms:v5n,default_invoice_footer:b5n,quote_footer:y5n,free:C5n,quote_is_approved:w5n,apply_credit:S5n,system_settings:E5n,archive_token:x5n,archived_token:T5n,archive_user:k5n,archived_user:I5n,archive_account_gateway:L5n,archived_account_gateway:D5n,archive_recurring_invoice:A5n,archived_recurring_invoice:N5n,delete_recurring_invoice:R5n,deleted_recurring_invoice:O5n,restore_recurring_invoice:P5n,restored_recurring_invoice:M5n,archive_recurring_quote:F5n,archived_recurring_quote:B5n,delete_recurring_quote:$5n,deleted_recurring_quote:V5n,restore_recurring_quote:H5n,restored_recurring_quote:W5n,archived:z5n,untitled_account:U5n,before:j5n,after:q5n,reset_terms_help:K5n,reset_footer_help:G5n,export_data:Y5n,user:Q5n,country:X5n,include:Z5n,logo_too_large:J5n,import_freshbooks:eFn,import_data:tFn,source:nFn,csv:iFn,client_file:rFn,invoice_file:oFn,task_file:sFn,no_mapper:aFn,invalid_csv_header:lFn,client_portal:cFn,admin:uFn,disabled:dFn,show_archived_users:hFn,notes:fFn,invoice_will_create:pFn,invoices_will_create:gFn,failed_to_import:mFn,publishable_key:_Fn,secret_key:vFn,missing_publishable_key:bFn,email_design:yFn,due_by:CFn,enable_email_markup:wFn,enable_email_markup_help:SFn,template_help_title:EFn,template_help_1:xFn,email_design_id:TFn,email_design_help:kFn,plain:IFn,light:LFn,dark:DFn,industry_help:AFn,subdomain_help:NFn,website_help:RFn,invoice_number_help:OFn,quote_number_help:PFn,custom_client_fields_helps:MFn,custom_account_fields_helps:FFn,custom_invoice_fields_helps:BFn,custom_invoice_charges_helps:$Fn,token_expired:VFn,invoice_link:HFn,button_confirmation_message:WFn,confirm:zFn,email_preferences:UFn,created_invoices:jFn,next_invoice_number:qFn,next_quote_number:KFn,days_before:GFn,days_after:YFn,field_due_date:QFn,field_invoice_date:XFn,schedule:ZFn,email_designs:JFn,assigned_when_sent:e6n,white_label_purchase_link:t6n,expense:n6n,expenses:i6n,new_expense:r6n,new_vendor:o6n,payment_terms_net:s6n,vendor:a6n,edit_vendor:l6n,archive_vendor:c6n,delete_vendor:u6n,view_vendor:d6n,deleted_expense:h6n,archived_expense:f6n,deleted_expenses:p6n,archived_expenses:g6n,expense_amount:m6n,expense_balance:_6n,expense_date:v6n,expense_should_be_invoiced:b6n,public_notes:y6n,invoice_amount:C6n,exchange_rate:w6n,yes:S6n,no:E6n,should_be_invoiced:x6n,view_expense:T6n,edit_expense:k6n,archive_expense:I6n,delete_expense:L6n,view_expense_num:D6n,updated_expense:A6n,created_expense:N6n,enter_expense:R6n,view:O6n,restore_expense:P6n,invoice_expense:M6n,expense_error_multiple_clients:F6n,expense_error_invoiced:B6n,convert_currency:$6n,num_days:V6n,create_payment_term:H6n,edit_payment_terms:W6n,edit_payment_term:z6n,archive_payment_term:U6n,recurring_due_dates:j6n,recurring_due_date_help:q6n,due:K6n,next_due_on:G6n,use_client_terms:Y6n,day_of_month:Q6n,last_day_of_month:X6n,day_of_week_after:Z6n,sunday:J6n,monday:eBn,tuesday:tBn,wednesday:nBn,thursday:iBn,friday:rBn,saturday:oBn,header_font_id:sBn,body_font_id:aBn,color_font_help:lBn,live_preview:cBn,invalid_mail_config:uBn,invoice_message_button:dBn,quote_message_button:hBn,payment_message_button:fBn,payment_type_direct_debit:pBn,bank_accounts:gBn,add_bank_account:mBn,setup_account:_Bn,import_expenses:vBn,bank_id:bBn,integration_type:yBn,updated_bank_account:CBn,edit_bank_account:wBn,archive_bank_account:SBn,archived_bank_account:EBn,created_bank_account:xBn,validate_bank_account:TBn,bank_password_help:kBn,bank_password_warning:IBn,username:LBn,account_number:DBn,account_name:ABn,bank_account_error:NBn,status_approved:RBn,quote_settings:OBn,auto_convert_quote:PBn,auto_convert_quote_help:MBn,validate:FBn,info:BBn,imported_expenses:$Bn,iframe_url_help3:VBn,expense_error_multiple_currencies:HBn,expense_error_mismatch_currencies:WBn,trello_roadmap:zBn,header_footer:UBn,first_page:jBn,all_pages:qBn,last_page:KBn,all_pages_header:GBn,all_pages_footer:YBn,invoice_currency:QBn,enable_https:XBn,quote_issued_to:ZBn,show_currency_code:JBn,free_year_message:e8n,trial_message:t8n,trial_footer:n8n,trial_footer_last_day:i8n,trial_call_to_action:r8n,trial_success:o8n,overdue:s8n,white_label_text:a8n,user_email_footer:l8n,reset_password_footer:c8n,limit_users:u8n,more_designs_self_host_header:d8n,old_browser:h8n,newer_browser:f8n,white_label_custom_css:p8n,pro_plan_remove_logo:g8n,pro_plan_remove_logo_link:m8n,invitation_status_sent:_8n,invitation_status_opened:v8n,invitation_status_viewed:b8n,email_error_inactive_client:y8n,email_error_inactive_contact:C8n,email_error_inactive_invoice:w8n,email_error_inactive_proposal:S8n,email_error_user_unregistered:E8n,email_error_user_unconfirmed:x8n,email_error_invalid_contact_email:T8n,navigation:k8n,list_invoices:I8n,list_clients:L8n,list_quotes:D8n,list_tasks:A8n,list_expenses:N8n,list_recurring_invoices:R8n,list_payments:O8n,list_credits:P8n,tax_name:M8n,report_settings:F8n,new_user:B8n,new_product:$8n,new_tax_rate:V8n,invoiced_amount:H8n,invoice_item_fields:W8n,custom_invoice_item_fields_help:z8n,recurring_invoice_number:U8n,recurring_invoice_number_prefix_help:j8n,enable_portal_password:q8n,enable_portal_password_help:K8n,send_portal_password:G8n,send_portal_password_help:Y8n,expired:Q8n,invalid_card_number:X8n,invalid_expiry:Z8n,invalid_cvv:J8n,cost:e9n,create_invoice_for_sample:t9n,owner:n9n,administrator:i9n,administrator_help:r9n,user_create_all:o9n,user_view_all:s9n,user_edit_all:a9n,partial_due:l9n,restore_vendor:c9n,restored_vendor:u9n,restored_expense:d9n,permissions:h9n,create_all_help:f9n,view_all_help:p9n,edit_all_help:g9n,view_payment:m9n,january:_9n,february:v9n,march:b9n,april:y9n,may:C9n,june:w9n,july:S9n,august:E9n,september:x9n,october:T9n,november:k9n,december:I9n,documents_header:L9n,email_documents_header:D9n,email_documents_example_1:A9n,email_documents_example_2:N9n,quote_documents:R9n,invoice_documents:O9n,expense_documents:P9n,invoice_embed_documents:M9n,invoice_embed_documents_help:F9n,document_email_attachment:B9n,ubl_email_attachment:$9n,download_documents:V9n,documents_from_expenses:H9n,dropzone_default_message:W9n,dropzone_default_message_disabled:z9n,dropzone_fallback_message:U9n,dropzone_fallback_text:j9n,dropzone_file_too_big:q9n,dropzone_invalid_file_type:K9n,dropzone_response_error:G9n,dropzone_cancel_upload:Y9n,dropzone_cancel_upload_confirmation:Q9n,dropzone_remove_file:X9n,documents:Z9n,document_date:J9n,document_size:e7n,enable_client_portal:t7n,enable_client_portal_help:n7n,enable_client_portal_dashboard:i7n,enable_client_portal_dashboard_help:r7n,account_management:o7n,plan_status:s7n,plan_upgrade:a7n,plan_change:l7n,pending_change_to:c7n,plan_changes_to:u7n,plan_term_changes_to:d7n,cancel_plan_change:h7n,plan:f7n,expires:p7n,renews:g7n,plan_expired:m7n,trial_expired:_7n,never:v7n,plan_free:b7n,plan_pro:y7n,plan_enterprise:C7n,plan_white_label:w7n,plan_free_self_hosted:S7n,plan_trial:E7n,plan_term:x7n,plan_term_monthly:T7n,plan_term_yearly:k7n,plan_term_month:I7n,plan_term_year:L7n,plan_price_monthly:D7n,plan_price_yearly:A7n,updated_plan:N7n,plan_paid:R7n,plan_started:O7n,plan_expires:P7n,white_label_button:M7n,pro_plan_year_description:F7n,pro_plan_month_description:B7n,enterprise_plan_product:$7n,enterprise_plan_year_description:V7n,enterprise_plan_month_description:H7n,plan_credit_product:W7n,plan_credit_description:z7n,plan_pending_monthly:U7n,plan_refunded:j7n,page_size:q7n,live_preview_disabled:K7n,invoice_number_padding:G7n,preview:Y7n,list_vendors:Q7n,add_users_not_supported:X7n,enterprise_plan_features:Z7n,return_to_app:J7n,refund_payment:e$n,refund_max:t$n,refund:n$n,are_you_sure_refund:i$n,status_pending:r$n,status_completed:o$n,status_failed:s$n,status_partially_refunded:a$n,status_partially_refunded_amount:l$n,status_refunded:c$n,status_voided:u$n,refunded_payment:d$n,activity_39:h$n,activity_40:f$n,card_expiration:p$n,card_creditcardother:g$n,card_americanexpress:m$n,card_carteblanche:_$n,card_unionpay:v$n,card_diners:b$n,card_discover:y$n,card_jcb:C$n,card_laser:w$n,card_maestro:S$n,card_mastercard:E$n,card_solo:x$n,card_switch:T$n,card_visacard:k$n,card_ach:I$n,payment_type_stripe:L$n,ach:D$n,enable_ach:A$n,stripe_ach_help:N$n,ach_disabled:R$n,plaid:O$n,client_id:P$n,secret:M$n,public_key:F$n,plaid_optional:B$n,plaid_environment_help:$$n,other_providers:V$n,country_not_supported:H$n,invalid_routing_number:W$n,invalid_account_number:z$n,account_number_mismatch:U$n,missing_account_holder_type:j$n,missing_account_holder_name:q$n,routing_number:K$n,confirm_account_number:G$n,individual_account:Y$n,company_account:Q$n,account_holder_name:X$n,add_account:Z$n,payment_methods:J$n,complete_verification:eVn,verification_amount1:tVn,verification_amount2:nVn,payment_method_verified:iVn,verification_failed:rVn,remove_payment_method:oVn,confirm_remove_payment_method:sVn,remove:aVn,payment_method_removed:lVn,bank_account_verification_help:cVn,bank_account_verification_next_steps:uVn,unknown_bank:dVn,ach_verification_delay_help:hVn,add_credit_card:fVn,payment_method_added:pVn,use_for_auto_bill:gVn,used_for_auto_bill:mVn,payment_method_set_as_default:_Vn,activity_41:vVn,webhook_url:bVn,stripe_webhook_help:yVn,stripe_webhook_help_link_text:CVn,gocardless_webhook_help_link_text:wVn,payment_method_error:SVn,notification_invoice_payment_failed_subject:EVn,notification_invoice_payment_failed:xVn,link_with_plaid:TVn,link_manually:kVn,secured_by_plaid:IVn,plaid_linked_status:LVn,add_payment_method:DVn,account_holder_type:AVn,ach_authorization:NVn,ach_authorization_required:RVn,off:OVn,opt_in:PVn,opt_out:MVn,always:FVn,opted_out:BVn,opted_in:$Vn,manage_auto_bill:VVn,enabled:HVn,paypal:WVn,braintree_enable_paypal:zVn,braintree_paypal_disabled_help:UVn,braintree_paypal_help:jVn,braintree_paypal_help_link_text:qVn,token_billing_braintree_paypal:KVn,add_paypal_account:GVn,no_payment_method_specified:YVn,chart_type:QVn,format:XVn,import_ofx:ZVn,ofx_file:JVn,ofx_parse_failed:eHn,wepay:tHn,sign_up_with_wepay:nHn,use_another_provider:iHn,company_name:rHn,wepay_company_name_help:oHn,wepay_description_help:sHn,wepay_tos_agree:aHn,wepay_tos_link_text:lHn,resend_confirmation_email:cHn,manage_account:uHn,action_required:dHn,finish_setup:hHn,created_wepay_confirmation_required:fHn,switch_to_wepay:pHn,switch:"Switch",restore_account_gateway:gHn,restored_account_gateway:mHn,united_states:_Hn,canada:vHn,accept_debit_cards:bHn,debit_cards:yHn,warn_start_date_changed:CHn,warn_start_date_changed_not_sent:wHn,original_start_date:SHn,new_start_date:EHn,security:xHn,see_whats_new:THn,wait_for_upload:kHn,upgrade_for_permissions:IHn,enable_second_tax_rate:LHn,payment_file:DHn,expense_file:AHn,product_file:NHn,import_products:RHn,products_will_create:OHn,product_key:PHn,created_products:MHn,export_help:FHn,selfhost_export_help:BHn,JSON_file:$Hn,view_dashboard:VHn,client_session_expired:HHn,client_session_expired_message:WHn,auto_bill_notification:zHn,auto_bill_payment_method_bank_transfer:UHn,auto_bill_payment_method_credit_card:jHn,auto_bill_payment_method_paypal:qHn,auto_bill_notification_placeholder:KHn,payment_settings:GHn,on_send_date:YHn,on_due_date:QHn,auto_bill_ach_date_help:XHn,warn_change_auto_bill:ZHn,bank_account:JHn,payment_processed_through_wepay:eWn,privacy_policy:tWn,ach_email_prompt:nWn,verification_pending:iWn,update_font_cache:rWn,more_options:oWn,credit_card:sWn,bank_transfer:aWn,no_transaction_reference:lWn,use_bank_on_file:cWn,auto_bill_email_message:uWn,bitcoin:dWn,gocardless:hWn,added_on:fWn,failed_remove_payment_method:pWn,gateway_exists:gWn,manual_entry:mWn,start_of_week:_Wn,freq_inactive:vWn,freq_daily:bWn,freq_weekly:yWn,freq_biweekly:CWn,freq_two_weeks:wWn,freq_four_weeks:SWn,freq_monthly:EWn,freq_three_months:xWn,freq_four_months:TWn,freq_six_months:kWn,freq_annually:IWn,freq_two_years:LWn,"payment_type_Apply Credit":"Apply Credit","payment_type_Bank Transfer":"Bank Transfer",payment_type_Cash:DWn,payment_type_Debit:AWn,payment_type_ACH:NWn,"payment_type_Visa Card":"Visa Card",payment_type_MasterCard:RWn,"payment_type_American Express":"American Express","payment_type_Discover Card":"Discover Card","payment_type_Diners Card":"Diners Card",payment_type_EuroCard:OWn,payment_type_Nova:PWn,"payment_type_Credit Card Other":"Credit Card Other",payment_type_PayPal:MWn,"payment_type_Google Wallet":"Google Wallet",payment_type_Check:FWn,"payment_type_Carte Blanche":"Carte Blanche",payment_type_UnionPay:BWn,payment_type_JCB:$Wn,payment_type_Laser:VWn,payment_type_Maestro:HWn,payment_type_Solo:WWn,payment_type_Switch:zWn,payment_type_iZettle:UWn,payment_type_Swish:jWn,payment_type_Alipay:qWn,payment_type_Sofort:KWn,payment_type_SEPA:GWn,payment_type_Bitcoin:YWn,payment_type_GoCardless:QWn,payment_type_Zelle:XWn,country_Afghanistan:ZWn,country_Albania:JWn,country_Antarctica:ezn,country_Algeria:tzn,"country_American Samoa":"American Samoa",country_Andorra:nzn,country_Angola:izn,"country_Antigua and Barbuda":"Antigua and Barbuda",country_Azerbaijan:rzn,country_Argentina:ozn,country_Australia:szn,country_Austria:azn,country_Bahamas:lzn,country_Bahrain:czn,country_Bangladesh:uzn,country_Armenia:dzn,country_Barbados:hzn,country_Belgium:fzn,country_Bermuda:pzn,country_Bhutan:gzn,"country_Bolivia, Plurinational State of":"Bolivia, Plurinational State of","country_Bosnia and Herzegovina":"Bosnia and Herzegovina",country_Botswana:mzn,"country_Bouvet Island":"Bouvet Island",country_Brazil:_zn,country_Belize:vzn,"country_British Indian Ocean Territory":"British Indian Ocean Territory","country_Solomon Islands":"Solomon Islands","country_Virgin Islands, British":"Virgin Islands, British","country_Brunei Darussalam":"Brunei Darussalam",country_Bulgaria:bzn,country_Myanmar:yzn,country_Burundi:Czn,country_Belarus:wzn,country_Cambodia:Szn,country_Cameroon:Ezn,country_Canada:xzn,"country_Cape Verde":"Cape Verde","country_Cayman Islands":"Cayman Islands","country_Central African Republic":"Central African Republic","country_Sri Lanka":"Sri Lanka",country_Chad:Tzn,country_Chile:kzn,country_China:Izn,"country_Taiwan, Province of China":"Taiwan, Province of China","country_Christmas Island":"Christmas Island","country_Cocos (Keeling) Islands":"Cocos (Keeling) Islands",country_Colombia:Lzn,country_Comoros:Dzn,country_Mayotte:Azn,country_Congo:Nzn,"country_Congo, the Democratic Republic of the":"Congo, the Democratic Republic of the","country_Cook Islands":"Cook Islands","country_Costa Rica":"Costa Rica",country_Croatia:Rzn,country_Cuba:Ozn,country_Cyprus:Pzn,"country_Czech Republic":"Czech Republic",country_Benin:Mzn,country_Denmark:Fzn,country_Dominica:Bzn,"country_Dominican Republic":"Dominican Republic",country_Ecuador:$zn,"country_El Salvador":"El Salvador","country_Equatorial Guinea":"Equatorial Guinea",country_Ethiopia:Vzn,country_Eritrea:Hzn,country_Estonia:Wzn,"country_Faroe Islands":"Faroe Islands","country_Falkland Islands (Malvinas)":"Falkland Islands (Malvinas)","country_South Georgia and the South Sandwich Islands":"South Georgia and the South Sandwich Islands",country_Fiji:zzn,country_Finland:Uzn,"country_Åland Islands":"Åland Islands",country_France:jzn,"country_French Guiana":"French Guiana","country_French Polynesia":"French Polynesia","country_French Southern Territories":"French Southern Territories",country_Djibouti:qzn,country_Gabon:Kzn,country_Georgia:Gzn,country_Gambia:Yzn,"country_Palestinian Territory, Occupied":"Palestinian Territory, Occupied",country_Germany:Qzn,country_Ghana:Xzn,country_Gibraltar:Zzn,country_Kiribati:Jzn,country_Greece:eUn,country_Greenland:tUn,country_Grenada:nUn,country_Guadeloupe:iUn,country_Guam:rUn,country_Guatemala:oUn,country_Guinea:sUn,country_Guyana:aUn,country_Haiti:lUn,"country_Heard Island and McDonald Islands":"Heard Island and McDonald Islands","country_Holy See (Vatican City State)":"Holy See (Vatican City State)",country_Honduras:cUn,"country_Hong Kong":"Hong Kong",country_Hungary:uUn,country_Iceland:dUn,country_India:hUn,country_Indonesia:fUn,"country_Iran, Islamic Republic of":"Iran, Islamic Republic of",country_Iraq:pUn,country_Ireland:gUn,country_Israel:mUn,country_Italy:_Un,"country_Côte d'Ivoire":"Côte d'Ivoire",country_Jamaica:vUn,country_Japan:bUn,country_Kazakhstan:yUn,country_Jordan:CUn,country_Kenya:wUn,"country_Korea, Democratic People's Republic of":"Korea, Democratic People's Republic of","country_Korea, Republic of":"Korea, Republic of",country_Kuwait:SUn,country_Kyrgyzstan:EUn,"country_Lao People's Democratic Republic":"Lao People's Democratic Republic",country_Lebanon:xUn,country_Lesotho:TUn,country_Latvia:kUn,country_Liberia:IUn,country_Libya:LUn,country_Liechtenstein:DUn,country_Lithuania:AUn,country_Luxembourg:NUn,country_Macao:RUn,country_Madagascar:OUn,country_Malawi:PUn,country_Malaysia:MUn,country_Maldives:FUn,country_Mali:BUn,country_Malta:$Un,country_Martinique:VUn,country_Mauritania:HUn,country_Mauritius:WUn,country_Mexico:zUn,country_Monaco:UUn,country_Mongolia:jUn,"country_Moldova, Republic of":"Moldova, Republic of",country_Montenegro:qUn,country_Montserrat:KUn,country_Morocco:GUn,country_Mozambique:YUn,country_Oman:QUn,country_Namibia:XUn,country_Nauru:ZUn,country_Nepal:JUn,country_Netherlands:ejn,country_Curaçao:"Curaçao",country_Aruba:tjn,"country_Sint Maarten (Dutch part)":"Sint Maarten (Dutch part)","country_Bonaire, Sint Eustatius and Saba":"Bonaire, Sint Eustatius and Saba","country_New Caledonia":"New Caledonia",country_Vanuatu:njn,"country_New Zealand":"New Zealand",country_Nicaragua:ijn,country_Niger:rjn,country_Nigeria:ojn,country_Niue:sjn,"country_Norfolk Island":"Norfolk Island",country_Norway:ajn,"country_Northern Mariana Islands":"Northern Mariana Islands","country_United States Minor Outlying Islands":"United States Minor Outlying Islands","country_Micronesia, Federated States of":"Micronesia, Federated States of","country_Marshall Islands":"Marshall Islands",country_Palau:ljn,country_Pakistan:cjn,country_Panama:ujn,"country_Papua New Guinea":"Papua New Guinea",country_Paraguay:djn,country_Peru:hjn,country_Philippines:fjn,country_Pitcairn:pjn,country_Poland:gjn,country_Portugal:mjn,"country_Guinea-Bissau":"Guinea-Bissau","country_Timor-Leste":"Timor-Leste","country_Puerto Rico":"Puerto Rico",country_Qatar:_jn,country_Réunion:"Réunion",country_Romania:vjn,"country_Russian Federation":"Russian Federation",country_Rwanda:bjn,"country_Saint Barthélemy":"Saint Barthélemy","country_Saint Helena, Ascension and Tristan da Cunha":"Saint Helena, Ascension and Tristan da Cunha","country_Saint Kitts and Nevis":"Saint Kitts and Nevis",country_Anguilla:yjn,"country_Saint Lucia":"Saint Lucia","country_Saint Martin (French part)":"Saint Martin (French part)","country_Saint Pierre and Miquelon":"Saint Pierre and Miquelon","country_Saint Vincent and the Grenadines":"Saint Vincent and the Grenadines","country_San Marino":"San Marino","country_Sao Tome and Principe":"Sao Tome and Principe","country_Saudi Arabia":"Saudi Arabia",country_Senegal:Cjn,country_Serbia:wjn,country_Seychelles:Sjn,"country_Sierra Leone":"Sierra Leone",country_Singapore:Ejn,country_Slovakia:xjn,"country_Viet Nam":"Viet Nam",country_Slovenia:Tjn,country_Somalia:kjn,"country_South Africa":"South Africa",country_Zimbabwe:Ijn,country_Spain:Ljn,"country_South Sudan":"South Sudan",country_Sudan:Djn,"country_Western Sahara":"Western Sahara",country_Suriname:Ajn,"country_Svalbard and Jan Mayen":"Svalbard and Jan Mayen",country_Swaziland:Njn,country_Sweden:Rjn,country_Switzerland:Ojn,"country_Syrian Arab Republic":"Syrian Arab Republic",country_Tajikistan:Pjn,country_Thailand:Mjn,country_Togo:Fjn,country_Tokelau:Bjn,country_Tonga:$jn,"country_Trinidad and Tobago":"Trinidad and Tobago","country_United Arab Emirates":"United Arab Emirates",country_Tunisia:Vjn,country_Turkey:Hjn,country_Turkmenistan:Wjn,"country_Turks and Caicos Islands":"Turks and Caicos Islands",country_Tuvalu:zjn,country_Uganda:Ujn,country_Ukraine:jjn,"country_Macedonia, the former Yugoslav Republic of":"Macedonia, the former Yugoslav Republic of",country_Egypt:qjn,"country_United Kingdom":"United Kingdom",country_Guernsey:Kjn,country_Jersey:Gjn,"country_Isle of Man":"Isle of Man","country_Tanzania, United Republic of":"Tanzania, United Republic of","country_United States":"United States","country_Virgin Islands, U.S.":"Virgin Islands, U.S.","country_Burkina Faso":"Burkina Faso",country_Uruguay:Yjn,country_Uzbekistan:Qjn,"country_Venezuela, Bolivarian Republic of":"Venezuela, Bolivarian Republic of","country_Wallis and Futuna":"Wallis and Futuna",country_Samoa:Xjn,country_Yemen:Zjn,country_Zambia:Jjn,"lang_Brazilian Portuguese":"Brazilian Portuguese",lang_Croatian:eqn,lang_Czech:tqn,lang_Danish:nqn,lang_Dutch:iqn,lang_English:rqn,"lang_English - United States":"English",lang_French:oqn,"lang_French - Canada":"French - Canada",lang_German:sqn,lang_Italian:aqn,lang_Japanese:lqn,lang_Lithuanian:cqn,lang_Norwegian:uqn,lang_Polish:dqn,lang_Spanish:hqn,"lang_Spanish - Spain":"Spanish - Spain",lang_Swedish:fqn,lang_Albanian:pqn,lang_Greek:gqn,"lang_English - United Kingdom":"English - United Kingdom","lang_English - Australia":"English - Australia",lang_Slovenian:mqn,lang_Finnish:_qn,lang_Romanian:vqn,"lang_Turkish - Turkey":"Turkish - Turkey","lang_Portuguese - Brazilian":"Portuguese - Brazilian","lang_Portuguese - Portugal":"Portuguese - Portugal",lang_Thai:bqn,lang_Macedonian:yqn,"lang_Chinese - Taiwan":"Chinese - Taiwan",lang_Serbian:Cqn,lang_Bulgarian:wqn,"lang_Russian (Russia)":"Russian (Russia)","industry_Accounting & Legal":"Accounting & Legal",industry_Advertising:Sqn,industry_Aerospace:Eqn,industry_Agriculture:xqn,industry_Automotive:Tqn,"industry_Banking & Finance":"Banking & Finance",industry_Biotechnology:kqn,industry_Broadcasting:Iqn,"industry_Business Services":"Business Services","industry_Commodities & Chemicals":"Commodities & Chemicals",industry_Communications:Lqn,"industry_Computers & Hightech":"Computers & Hightech",industry_Defense:Dqn,industry_Energy:Aqn,industry_Entertainment:Nqn,industry_Government:Rqn,"industry_Healthcare & Life Sciences":"Healthcare & Life Sciences",industry_Insurance:Oqn,industry_Manufacturing:Pqn,industry_Marketing:Mqn,industry_Media:Fqn,"industry_Nonprofit & Higher Ed":"Nonprofit & Higher Ed",industry_Pharmaceuticals:Bqn,"industry_Professional Services & Consulting":"Professional Services & Consulting","industry_Real Estate":"Real Estate","industry_Retail & Wholesale":"Retail & Wholesale",industry_Sports:$qn,industry_Transportation:Vqn,"industry_Travel & Luxury":"Travel & Luxury",industry_Other:Hqn,industry_Photography:Wqn,view_client_portal:zqn,view_portal:Uqn,vendor_contacts:jqn,all:qqn,selected:Kqn,category:Gqn,categories:Yqn,new_expense_category:Qqn,edit_category:Xqn,archive_expense_category:Zqn,expense_categories:Jqn,list_expense_categories:eKn,updated_expense_category:tKn,created_expense_category:nKn,archived_expense_category:iKn,archived_expense_categories:rKn,restore_expense_category:oKn,restored_expense_category:sKn,apply_taxes:aKn,min_to_max_users:lKn,max_users_reached:cKn,buy_now_buttons:uKn,landing_page:dKn,payment_type:hKn,form:fKn,link:pKn,fields:gKn,dwolla:mKn,buy_now_buttons_warning:_Kn,buy_now_buttons_disabled:vKn,enable_buy_now_buttons_help:bKn,changes_take_effect_immediately:yKn,wepay_account_description:CKn,payment_error_code:wKn,standard_fees_apply:SKn,limit_import_rows:EKn,error_title:xKn,error_contact_text:TKn,no_undo:kKn,no_contact_selected:IKn,no_client_selected:LKn,gateway_config_error:DKn,payment_type_on_file:AKn,invoice_for_client:NKn,intent_not_found:RKn,intent_not_supported:OKn,client_not_found:PKn,not_allowed:MKn,bot_emailed_invoice:FKn,bot_emailed_notify_viewed:BKn,bot_emailed_notify_paid:$Kn,add_product_to_invoice:VKn,not_authorized:HKn,email_not_found:WKn,invalid_code:zKn,list_products:UKn,include_item_taxes_inline:jKn,created_quotes:qKn,warning:KKn,"self-update":"Update",update_invoiceninja_title:GKn,update_invoiceninja_warning:YKn,update_invoiceninja_available:QKn,update_invoiceninja_unavailable:XKn,update_invoiceninja_update_start:ZKn,update_invoiceninja_download_start:JKn,create_new:eGn,toggle_navigation:tGn,toggle_history:nGn,unassigned:iGn,task:rGn,contact_name:oGn,city_state_postal:sGn,postal_city:aGn,custom_field:lGn,account_fields:cGn,facebook_and_twitter:uGn,facebook_and_twitter_help:dGn,reseller_text:hGn,unnamed_client:fGn,day:pGn,week:gGn,month:mGn,inactive_logout:_Gn,reports:vGn,total_profit:bGn,total_expenses:yGn,quote_to:CGn,limit:wGn,min_limit:SGn,max_limit:EGn,no_limit:xGn,set_limits:TGn,enable_min:kGn,enable_max:IGn,min:LGn,max:DGn,limits_not_met:AGn,date_range:NGn,raw:RGn,raw_html:OGn,update:PGn,invoice_fields_help:MGn,new_category:FGn,restore_product:BGn,blank:$Gn,invoice_save_error:VGn,enable_recurring:HGn,disable_recurring:WGn,text:zGn,expense_will_create:UGn,expenses_will_create:jGn,created_expenses:qGn,translate_app:KGn,expense_category:GGn,go_ninja_pro:YGn,go_enterprise:QGn,upgrade_for_features:XGn,pay_annually_discount:ZGn,pro_upgrade_title:JGn,pro_upgrade_feature1:eYn,pro_upgrade_feature2:tYn,enterprise_upgrade_feature1:nYn,enterprise_upgrade_feature2:iYn,much_more:rYn,all_pro_fetaures:oYn,currency_symbol:sYn,currency_code:aYn,buy_license:lYn,apply_license:cYn,submit:uYn,white_label_license_key:dYn,invalid_white_label_license:hYn,created_by:fYn,modules:pYn,financial_year_start:gYn,authentication:mYn,checkbox:_Yn,invoice_signature:vYn,show_accept_invoice_terms:bYn,show_accept_invoice_terms_help:yYn,show_accept_quote_terms:CYn,show_accept_quote_terms_help:wYn,require_invoice_signature:SYn,require_invoice_signature_help:EYn,require_quote_signature:xYn,require_quote_signature_help:TYn,i_agree:kYn,sign_here:IYn,sign_here_ux_tip:LYn,authorization:DYn,signed:AYn,vendor_name:NYn,entity_state:RYn,client_created_at:OYn,postmark_error:PYn,project:MYn,projects:FYn,new_project:BYn,edit_project:$Yn,archive_project:VYn,list_projects:HYn,updated_project:WYn,created_project:zYn,archived_project:UYn,archived_projects:jYn,restore_project:qYn,restored_project:KYn,delete_project:GYn,deleted_project:YYn,deleted_projects:QYn,delete_expense_category:XYn,deleted_expense_category:ZYn,delete_product:JYn,deleted_product:eQn,deleted_products:tQn,restored_product:nQn,update_credit:iQn,updated_credit:rQn,edit_credit:oQn,realtime_preview:sQn,realtime_preview_help:aQn,live_preview_help:lQn,force_pdfjs_help:cQn,force_pdfjs:uQn,redirect_url:dQn,redirect_url_help:hQn,save_draft:fQn,refunded_credit_payment:pQn,keyboard_shortcuts:gQn,toggle_menu:mQn,"new_...":"New ...","list_...":"List ...",created_at:_Qn,contact_us:vQn,user_guide:bQn,promo_message:yQn,discount_message:CQn,mark_paid:wQn,marked_sent_invoice:SQn,marked_sent_invoices:EQn,invoice_name:xQn,product_will_create:TQn,contact_us_response:kQn,last_7_days:IQn,last_30_days:LQn,this_month:DQn,last_month:AQn,current_quarter:NQn,last_quarter:RQn,last_year:OQn,all_time:PQn,custom_range:MQn,url:FQn,debug:BQn,https:$Qn,require:VQn,license_expiring:HQn,security_confirmation:WQn,white_label_expired:zQn,renew_license:UQn,iphone_app_message:jQn,iphone_app:qQn,android_app:KQn,logged_in:GQn,switch_to_primary:YQn,inclusive:QQn,exclusive:XQn,postal_city_state:ZQn,phantomjs_help:JQn,phantomjs_local:eXn,client_number:tXn,client_number_help:nXn,next_client_number:iXn,generated_numbers:rXn,notes_reminder1:oXn,notes_reminder2:sXn,notes_reminder3:aXn,notes_reminder4:lXn,bcc_email:cXn,tax_quote:uXn,tax_invoice:dXn,emailed_invoices:hXn,emailed_quotes:fXn,website_url:pXn,domain:gXn,domain_help:mXn,domain_help_website:_Xn,import_invoices:vXn,new_report:bXn,edit_report:yXn,columns:CXn,filters:wXn,sort_by:SXn,draft:EXn,unpaid:xXn,aging:TXn,age:kXn,days:IXn,age_group_0:LXn,age_group_30:DXn,age_group_60:AXn,age_group_90:NXn,age_group_120:RXn,invoice_details:OXn,qty:PXn,profit_and_loss:MXn,revenue:FXn,profit:BXn,group_when_sorted:$Xn,group_dates_by:VXn,year:HXn,view_statement:WXn,statement:zXn,statement_date:UXn,mark_active:jXn,send_automatically:qXn,initial_email:KXn,invoice_not_emailed:GXn,quote_not_emailed:YXn,sent_by:QXn,recipients:XXn,save_as_default:ZXn,start_of_week_help:JXn,financial_year_start_help:eZn,reports_help:tZn,this_year:nZn,ninja_tagline:iZn,login_or_existing:rZn,sign_up_now:oZn,not_a_member_yet:sZn,login_create_an_account:aZn,invoice_from:lZn,full_name:cZn,month_year:uZn,valid_thru:dZn,product_fields:hZn,custom_product_fields_help:fZn,freq_two_months:pZn,freq_yearly:gZn,profile:mZn,industry_Construction:_Zn,your_statement:vZn,statement_issued_to:bZn,statement_to:yZn,customize_options:CZn,created_payment_term:wZn,updated_payment_term:SZn,archived_payment_term:EZn,resend_invite:xZn,credit_created_by:TZn,created_payment_and_credit:kZn,created_payment_and_credit_emailed_client:IZn,create_project:LZn,create_vendor:DZn,create_expense_category:AZn,pro_plan_reports:NZn,mark_ready:RZn,limits:OZn,fees:PZn,fee:MZn,set_limits_fees:FZn,fees_tax_help:BZn,fees_sample:$Zn,discount_sample:VZn,no_fees:HZn,gateway_fees_disclaimer:WZn,percent:zZn,location:UZn,line_item:jZn,surcharge:qZn,location_first_surcharge:KZn,location_second_surcharge:GZn,location_line_item:YZn,online_payment_surcharge:QZn,gateway_fees:XZn,fees_disabled:ZZn,gateway_fees_help:JZn,gateway:eJn,gateway_fee_change_warning:tJn,fees_surcharge_help:nJn,label_and_taxes:iJn,billable:rJn,logo_warning_too_large:oJn,logo_warning_fileinfo:sJn,logo_warning_invalid:aJn,error_refresh_page:lJn,data:cJn,imported_settings:uJn,reset_counter:dJn,next_reset:hJn,reset_counter_help:fJn,auto_bill_failed:pJn,online_payment_discount:gJn,created_new_company:mJn,fees_disabled_for_gateway:_Jn,logout_and_delete:vJn,tax_rate_type_help:bJn,credit_note:yJn,credit_issued_to:CJn,credit_to:wJn,your_credit:SJn,credit_number:EJn,create_credit_note:xJn,menu:TJn,error_incorrect_gateway_ids:kJn,purge_data:IJn,delete_data:LJn,purge_data_help:DJn,cancel_account_help:AJn,purge_successful:NJn,forbidden:RJn,purge_data_message:OJn,contact_phone:PJn,contact_email:MJn,reply_to_email:FJn,reply_to_email_help:BJn,bcc_email_help:$Jn,import_complete:VJn,confirm_account_to_import:HJn,import_started:WJn,payment_type_Venmo:zJn,"payment_type_Money Order":"Money Order",archived_products:UJn,recommend_on:jJn,recommend_off:qJn,notes_auto_billed:KJn,surcharge_label:GJn,contact_fields:YJn,custom_contact_fields_help:QJn,datatable_info:XJn,credit_total:ZJn,mark_billable:JJn,billed:eei,company_variables:tei,client_variables:nei,invoice_variables:iei,navigation_variables:rei,custom_variables:oei,invalid_file:sei,add_documents_to_invoice:aei,mark_expense_paid:lei,white_label_license_error:cei,plan_price:uei,wrong_confirmation:dei,oauth_taken:hei,emailed_payment:fei,email_payment:pei,invoiceplane_import:gei,duplicate_expense_warning:mei,expense_link:_ei,resume_task:vei,resumed_task:bei,quote_design:yei,default_design:Cei,custom_design1:wei,custom_design2:Sei,custom_design3:Eei,empty:xei,load_design:Tei,accepted_card_logos:kei,google_analytics:Iei,analytics_key:Lei,analytics_key_help:Dei,start_date_required:Aei,application_settings:Nei,database_connection:Rei,driver:Oei,host:Pei,database:Mei,test_connection:Fei,from_name:Bei,from_address:$ei,port:Vei,encryption:Hei,mailgun_domain:Wei,mailgun_private_key:zei,brevo_domain:Uei,brevo_private_key:jei,send_test_email:qei,select_label:Kei,label:Gei,service:Yei,update_payment_details:Qei,updated_payment_details:Xei,update_credit_card:Zei,recurring_expenses:Jei,recurring_expense:eti,new_recurring_expense:tti,edit_recurring_expense:nti,archive_recurring_expense:iti,list_recurring_expense:rti,updated_recurring_expense:oti,created_recurring_expense:sti,archived_recurring_expense:ati,restore_recurring_expense:lti,restored_recurring_expense:cti,delete_recurring_expense:uti,deleted_recurring_expense:dti,view_recurring_expense:hti,taxes_and_fees:fti,import_failed:pti,recurring_prefix:gti,options:mti,credit_number_help:_ti,next_credit_number:vti,padding_help:bti,import_warning_invalid_date:yti,product_notes:Cti,app_version:wti,ofx_version:Sti,charge_late_fee:Eti,late_fee_amount:xti,late_fee_percent:Tti,late_fee_added:kti,download_invoice:Iti,download_quote:Lti,invoices_are_attached:Dti,downloaded_invoice:Ati,downloaded_quote:Nti,downloaded_invoices:Rti,downloaded_quotes:Oti,clone_expense:Pti,default_documents:Mti,send_email_to_client:Fti,refund_subject:Bti,refund_body:$ti,currency_us_dollar:Vti,currency_british_pound:Hti,currency_euro:Wti,currency_south_african_rand:zti,currency_danish_krone:Uti,currency_israeli_shekel:jti,currency_swedish_krona:qti,currency_kenyan_shilling:Kti,currency_canadian_dollar:Gti,currency_philippine_peso:Yti,currency_indian_rupee:Qti,currency_australian_dollar:Xti,currency_singapore_dollar:Zti,currency_norske_kroner:Jti,currency_new_zealand_dollar:eni,currency_vietnamese_dong:tni,currency_swiss_franc:nni,currency_guatemalan_quetzal:ini,currency_malaysian_ringgit:rni,currency_brazilian_real:oni,currency_thai_baht:sni,currency_nigerian_naira:ani,currency_argentine_peso:lni,currency_bangladeshi_taka:cni,currency_united_arab_emirates_dirham:uni,currency_hong_kong_dollar:dni,currency_indonesian_rupiah:hni,currency_mexican_peso:fni,currency_egyptian_pound:pni,currency_colombian_peso:gni,currency_west_african_franc:mni,currency_chinese_renminbi:_ni,currency_rwandan_franc:vni,currency_tanzanian_shilling:bni,currency_netherlands_antillean_guilder:yni,currency_trinidad_and_tobago_dollar:Cni,currency_east_caribbean_dollar:wni,currency_ghanaian_cedi:Sni,currency_bulgarian_lev:Eni,currency_aruban_florin:xni,currency_turkish_lira:Tni,currency_romanian_new_leu:kni,currency_croatian_kuna:Ini,currency_saudi_riyal:Lni,currency_japanese_yen:Dni,currency_maldivian_rufiyaa:Ani,currency_costa_rican_colon:Nni,currency_pakistani_rupee:Rni,currency_polish_zloty:Oni,currency_sri_lankan_rupee:Pni,currency_czech_koruna:Mni,currency_uruguayan_peso:Fni,currency_namibian_dollar:Bni,currency_tunisian_dinar:$ni,currency_russian_ruble:Vni,currency_mozambican_metical:Hni,currency_omani_rial:Wni,currency_ukrainian_hryvnia:zni,currency_macanese_pataca:Uni,currency_taiwan_new_dollar:jni,currency_dominican_peso:qni,currency_chilean_peso:Kni,currency_icelandic_krona:Gni,currency_papua_new_guinean_kina:Yni,currency_jordanian_dinar:Qni,currency_myanmar_kyat:Xni,currency_peruvian_sol:Zni,currency_botswana_pula:Jni,currency_hungarian_forint:eii,currency_ugandan_shilling:tii,currency_barbadian_dollar:nii,currency_brunei_dollar:iii,currency_georgian_lari:rii,currency_qatari_riyal:oii,currency_honduran_lempira:sii,currency_surinamese_dollar:aii,currency_bahraini_dinar:lii,currency_venezuelan_bolivars:cii,currency_south_korean_won:uii,currency_moroccan_dirham:dii,currency_jamaican_dollar:hii,currency_angolan_kwanza:fii,currency_haitian_gourde:pii,currency_zambian_kwacha:gii,currency_nepalese_rupee:mii,currency_cfp_franc:_ii,currency_mauritian_rupee:vii,currency_cape_verdean_escudo:bii,currency_kuwaiti_dinar:yii,currency_algerian_dinar:Cii,currency_macedonian_denar:wii,currency_fijian_dollar:Sii,currency_bolivian_boliviano:Eii,currency_albanian_lek:xii,currency_serbian_dinar:Tii,currency_lebanese_pound:kii,currency_armenian_dram:Iii,currency_azerbaijan_manat:Lii,currency_bosnia_and_herzegovina_convertible_mark:Dii,currency_belarusian_ruble:Aii,currency_moldovan_leu:Nii,currency_kazakhstani_tenge:Rii,currency_gibraltar_pound:Oii,currency_gambia_dalasi:Pii,currency_paraguayan_guarani:Mii,currency_malawi_kwacha:Fii,currency_zimbabwean_dollar:Bii,currency_cambodian_riel:$ii,currency_vanuatu_vatu:Vii,currency_cuban_peso:Hii,currency_bz_dollar:Wii,currency_libyan_dinar:zii,currency_silver_troy_ounce:Uii,currency_gold_troy_ounce:jii,currency_nicaraguan_córdoba:"Nicaraguan Córdoba",currency_malagasy_ariary:qii,currency_tongan_pa_anga:Kii,review_app_help:Gii,writing_a_review:Yii,tax1:Qii,tax2:Xii,fee_help:Zii,format_export:Jii,custom1:eri,custom2:tri,contact_first_name:nri,contact_last_name:iri,contact_custom1:rri,contact_custom2:ori,currency:sri,ofx_help:ari,comments:lri,item_product:cri,item_notes:uri,item_cost:dri,item_quantity:hri,item_tax_rate:fri,item_tax_name:pri,item_tax1:gri,item_tax2:mri,delete_company:_ri,delete_company_help:vri,delete_company_message:bri,applied_discount:yri,applied_free_year:Cri,contact_us_help:wri,include_errors:Sri,include_errors_help:Eri,recent_errors:xri,customer:Tri,customers:kri,created_customer:Iri,created_customers:Lri,purge_details:Dri,deleted_company:Ari,deleted_account:Nri,deleted_company_details:Rri,deleted_account_details:Ori,alipay:Pri,sofort:Mri,sepa:Fri,name_without_special_characters:Bri,enable_alipay:$ri,enable_sofort:Vri,stripe_alipay_help:Hri,calendar:Wri,pro_plan_calendar:zri,what_are_you_working_on:Uri,time_tracker:jri,refresh:qri,filter_sort:Kri,no_description:Gri,time_tracker_login:Yri,save_or_discard:Qri,discard_changes:Xri,tasks_not_enabled:Zri,started_task:Jri,create_client:eoi,download_desktop_app:toi,download_iphone_app:noi,download_android_app:ioi,time_tracker_mobile_help:roi,stopped:ooi,ascending:soi,descending:aoi,sort_field:loi,sort_direction:coi,discard:uoi,time_am:doi,time_pm:hoi,time_mins:foi,time_hr:poi,time_hrs:goi,clear:moi,warn_payment_gateway:_oi,task_rate:voi,task_rate_help:boi,past_due:yoi,document:Coi,invoice_or_expense:woi,invoice_pdfs:Soi,enable_sepa:Eoi,enable_bitcoin:xoi,iban:Toi,sepa_authorization:koi,recover_license:Ioi,purchase:Loi,recover:Doi,apply:Aoi,recover_white_label_header:Noi,apply_white_label_header:Roi,videos:Ooi,video:Poi,return_to_invoice:Moi,partial_due_date:Foi,task_fields:Boi,product_fields_help:$oi,custom_value1:Voi,custom_value2:Hoi,enable_two_factor:Woi,enable_two_factor_help:zoi,two_factor_setup:Uoi,two_factor_setup_help:joi,one_time_password:qoi,set_phone_for_two_factor:Koi,enabled_two_factor:Goi,add_product:Yoi,email_will_be_sent_on:Qoi,invoice_product:Xoi,self_host_login:Zoi,set_self_hoat_url:Joi,local_storage_required:esi,your_password_reset_link:tsi,subdomain_taken:nsi,expense_mailbox_taken:isi,expense_mailbox_invalid:rsi,client_login:osi,converted_amount:ssi,default:"Default",shipping_address:asi,bllling_address:lsi,billing_address1:csi,billing_address2:usi,billing_city:dsi,billing_state:hsi,billing_postal_code:fsi,billing_country:psi,shipping_address1:gsi,shipping_address2:msi,shipping_city:_si,shipping_state:vsi,shipping_postal_code:bsi,shipping_country:ysi,classify:Csi,show_shipping_address_help:wsi,ship_to_billing_address:Ssi,delivery_note:Esi,show_tasks_in_portal:xsi,cancel_schedule:Tsi,scheduled_report:ksi,scheduled_report_help:Isi,created_scheduled_report:Lsi,deleted_scheduled_report:Dsi,scheduled_report_attached:Asi,scheduled_report_error:Nsi,invalid_one_time_password:Rsi,apple_pay:Osi,enable_apple_pay:Psi,requires_subdomain:Msi,subdomain_is_set:Fsi,verification_file:Bsi,verification_file_missing:$si,apple_pay_domain:Vsi,apple_pay_not_supported:Hsi,optional_payment_methods:Wsi,add_subscription:zsi,target_url:Usi,target_url_help:jsi,event:qsi,subscription_event_1:Ksi,subscription_event_2:Gsi,subscription_event_3:Ysi,subscription_event_4:Qsi,subscription_event_5:Xsi,subscription_event_6:Zsi,subscription_event_7:Jsi,subscription_event_8:eai,subscription_event_9:tai,subscription_event_10:nai,subscription_event_11:iai,subscription_event_12:rai,subscription_event_13:oai,subscription_event_14:sai,subscription_event_15:aai,subscription_event_16:lai,subscription_event_17:cai,subscription_event_18:uai,subscription_event_19:dai,subscription_event_20:hai,subscription_event_21:fai,subscriptions:pai,updated_subscription:gai,created_subscription:mai,edit_subscription:_ai,archive_subscription:vai,archived_subscription:bai,project_error_multiple_clients:yai,invoice_project:Cai,module_recurring_invoice:wai,module_credit:Sai,module_quote:Eai,module_task:xai,module_expense:Tai,module_ticket:kai,reminders:Iai,send_client_reminders:Lai,can_view_tasks:Dai,is_not_sent_reminders:Aai,promotion_footer:Nai,unable_to_delete_primary:Rai,please_register:Oai,processing_request:Pai,mcrypt_warning:Mai,edit_times:Fai,inclusive_taxes_help:Bai,inclusive_taxes_notice:$ai,inclusive_taxes_warning:Vai,copy_shipping:Hai,copy_billing:Wai,quote_has_expired:zai,empty_table_footer:Uai,do_not_trust:jai,trust_for_30_days:qai,trust_forever:Kai,kanban:Gai,backlog:Yai,ready_to_do:Qai,in_progress:Xai,add_status:Zai,archive_status:Jai,new_status:eli,convert_products:tli,convert_products_help:nli,improve_client_portal_link:ili,budgeted_hours:rli,progress:oli,view_project:sli,summary:ali,endless_reminder:lli,signature_on_invoice_help:cli,signature_on_pdf:uli,signature_on_pdf_help:dli,expired_white_label:hli,return_to_login:fli,convert_products_tip:pli,amount_greater_than_balance:gli,custom_fields_tip:mli,client_information:_li,updated_client_details:vli,auto:bli,tax_amount:yli,tax_paid:Cli,none:wli,proposal_message_button:Sli,proposal:Eli,proposals:xli,list_proposals:Tli,new_proposal:kli,edit_proposal:Ili,archive_proposal:Lli,delete_proposal:Dli,created_proposal:Ali,updated_proposal:Nli,archived_proposal:Rli,deleted_proposal:Oli,archived_proposals:Pli,deleted_proposals:Mli,restored_proposal:Fli,restore_proposal:Bli,snippet:$li,snippets:Vli,proposal_snippet:Hli,proposal_snippets:Wli,new_proposal_snippet:zli,edit_proposal_snippet:Uli,archive_proposal_snippet:jli,delete_proposal_snippet:qli,created_proposal_snippet:Kli,updated_proposal_snippet:Gli,archived_proposal_snippet:Yli,deleted_proposal_snippet:Qli,archived_proposal_snippets:Xli,deleted_proposal_snippets:Zli,restored_proposal_snippet:Jli,restore_proposal_snippet:eci,template:tci,templates:nci,proposal_template:ici,proposal_templates:rci,new_proposal_template:oci,edit_proposal_template:sci,archive_proposal_template:aci,delete_proposal_template:lci,created_proposal_template:cci,updated_proposal_template:uci,archived_proposal_template:dci,deleted_proposal_template:hci,archived_proposal_templates:fci,deleted_proposal_templates:pci,restored_proposal_template:gci,restore_proposal_template:mci,proposal_category:_ci,proposal_categories:vci,new_proposal_category:bci,edit_proposal_category:yci,archive_proposal_category:Cci,delete_proposal_category:wci,created_proposal_category:Sci,updated_proposal_category:Eci,archived_proposal_category:xci,deleted_proposal_category:Tci,archived_proposal_categories:kci,deleted_proposal_categories:Ici,restored_proposal_category:Lci,restore_proposal_category:Dci,delete_status:Aci,standard:Nci,icon:Rci,proposal_not_found:Oci,create_proposal_category:Pci,clone_proposal_template:Mci,proposal_email:Fci,proposal_subject:Bci,proposal_message:$ci,emailed_proposal:Vci,load_template:Hci,no_assets:Wci,add_image:zci,select_image:Uci,upgrade_to_upload_images:jci,delete_image:qci,delete_image_help:Kci,amount_variable_help:Gci,taxes_are_included_help:Yci,taxes_are_not_included_help:Qci,change_requires_purge:Xci,purging:Zci,warning_local_refund:Jci,email_address_changed:eui,email_address_changed_message:tui,test:nui,beta:iui,email_history:rui,loading:oui,no_messages_found:sui,processing:aui,reactivate:lui,reactivated_email:cui,emails:uui,opened:dui,bounced:hui,total_sent:fui,total_opened:pui,total_bounced:gui,total_spam:mui,platforms:_ui,email_clients:vui,mobile:bui,desktop:yui,webmail:Cui,group:wui,subgroup:Sui,unset:Eui,received_new_payment:xui,slack_webhook_help:Tui,slack_incoming_webhooks:kui,accept:Iui,accepted_terms:Lui,invalid_url:Dui,workflow_settings:Aui,auto_email_invoice:Nui,auto_email_invoice_help:Rui,auto_archive_invoice:Oui,auto_archive_invoice_help:Pui,auto_archive_quote:Mui,auto_archive_quote_help:Fui,require_approve_quote:Bui,require_approve_quote_help:$ui,allow_approve_expired_quote:Vui,allow_approve_expired_quote_help:Hui,invoice_workflow:Wui,quote_workflow:zui,client_must_be_active:Uui,purge_client:jui,purged_client:qui,purge_client_warning:Kui,clone_product:Gui,item_details:Yui,send_item_details_help:Qui,view_proposal:Xui,view_in_portal:Zui,cookie_message:Jui,got_it:edi,vendor_will_create:tdi,vendors_will_create:ndi,created_vendors:idi,import_vendors:rdi,company:odi,client_field:sdi,contact_field:adi,product_field:ldi,task_field:cdi,project_field:udi,expense_field:ddi,vendor_field:hdi,company_field:fdi,invoice_field:pdi,invoice_surcharge:gdi,custom_task_fields_help:mdi,custom_project_fields_help:_di,custom_expense_fields_help:vdi,custom_vendor_fields_help:bdi,messages:ydi,unpaid_invoice:Cdi,paid_invoice:wdi,unapproved_quote:Sdi,unapproved_proposal:Edi,autofills_city_state:xdi,no_match_found:Tdi,password_strength:kdi,strength_weak:Idi,strength_good:Ldi,strength_strong:Ddi,mark:Adi,updated_task_status:Ndi,background_image:Rdi,background_image_help:Odi,proposal_editor:Pdi,background:Mdi,guide:Fdi,gateway_fee_item:Bdi,gateway_fee_description:$di,gateway_fee_discount_description:Vdi,show_payments:Hdi,show_aging:Wdi,reference:zdi,amount_paid:Udi,send_notifications_for:jdi,all_invoices:qdi,my_invoices:Kdi,payment_reference:Gdi,maximum:Ydi,sort:Qdi,refresh_complete:Xdi,please_enter_your_email:Zdi,please_enter_your_password:Jdi,please_enter_your_url:ehi,please_enter_a_product_key:thi,an_error_occurred:nhi,overview:ihi,copied_to_clipboard:rhi,error:ohi,could_not_launch:shi,additional:ahi,ok:lhi,email_is_invalid:chi,items:uhi,partial_deposit:dhi,add_item:hhi,total_amount:fhi,pdf:phi,invoice_status_id:ghi,click_plus_to_add_item:mhi,count_selected:_hi,dismiss:vhi,please_select_a_date:bhi,please_select_a_client:yhi,language:Chi,updated_at:whi,please_enter_an_invoice_number:Shi,please_enter_a_quote_number:Ehi,clients_invoices:xhi,viewed:Thi,approved:khi,invoice_status_1:Ihi,invoice_status_2:Lhi,invoice_status_3:Dhi,invoice_status_4:Ahi,invoice_status_5:Nhi,invoice_status_6:Rhi,marked_invoice_as_sent:Ohi,please_enter_a_client_or_contact_name:Phi,restart_app_to_apply_change:Mhi,refresh_data:Fhi,blank_contact:Bhi,no_records_found:$hi,industry:Vhi,size:Hhi,net:Whi,show_tasks:zhi,email_reminders:Uhi,reminder1:jhi,reminder2:qhi,reminder3:Khi,send:Ghi,auto_billing:Yhi,button:Qhi,more:Xhi,edit_recurring_invoice:Zhi,edit_recurring_quote:Jhi,quote_status:efi,please_select_an_invoice:tfi,filtered_by:nfi,payment_status:ifi,payment_status_1:rfi,payment_status_2:ofi,payment_status_3:sfi,payment_status_4:afi,payment_status_5:lfi,payment_status_6:cfi,send_receipt_to_client:ufi,refunded:dfi,marked_quote_as_sent:hfi,custom_module_settings:ffi,open:pfi,new:"New",closed:gfi,reopened:mfi,priority:_fi,last_updated:vfi,comment:bfi,tags:yfi,linked_objects:Cfi,low:wfi,medium:Sfi,high:Efi,no_due_date:xfi,assigned_to:Tfi,reply:kfi,awaiting_reply:Ifi,mark_spam:Lfi,local_part:Dfi,local_part_unavailable:Afi,local_part_available:Nfi,local_part_invalid:Rfi,local_part_help:Ofi,from_name_help:Pfi,local_part_placeholder:Mfi,from_name_placeholder:Ffi,attachments:Bfi,client_upload:$fi,enable_client_upload_help:Vfi,max_file_size_help:Hfi,max_file_size:Wfi,mime_types:zfi,mime_types_placeholder:Ufi,mime_types_help:jfi,ticket_number_start_help:qfi,new_ticket_template_id:Kfi,new_ticket_autoresponder_help:Gfi,update_ticket_template_id:Yfi,update_ticket_autoresponder_help:Qfi,close_ticket_template_id:Xfi,close_ticket_autoresponder_help:Zfi,default_priority:Jfi,alert_new_comment_id:epi,update_ticket_notification_list:tpi,comma_separated_values:npi,default_agent:ipi,default_agent_help:rpi,show_agent_details:opi,avatar:spi,remove_avatar:api,add_template:lpi,archive_ticket_template:cpi,restore_ticket_template:upi,archived_ticket_template:dpi,restored_ticket_template:hpi,enter_ticket_message:fpi,show_hide_all:ppi,subject_required:gpi,mobile_refresh_warning:mpi,merge:_pi,merged:vpi,agent:bpi,include_in_filter:ypi,custom_client1:Cpi,custom_client2:wpi,compare:Spi,hosted_login:Epi,selfhost_login:xpi,google_login:Tpi,thanks_for_patience:kpi,legacy_mobile_app:Ipi,today:Lpi,current:Dpi,previous:Api,current_period:Npi,comparison_period:Rpi,previous_period:Opi,previous_year:Ppi,compare_to:Mpi,last_week:Fpi,clone_to_invoice:Bpi,clone_to_quote:$pi,convert:Vpi,last7_days:Hpi,last30_days:Wpi,custom_js:zpi,adjust_fee_percent_help:Upi,show_product_notes:jpi,show_product_notes_help:qpi,important:Kpi,thank_you_for_using_our_app:Gpi,if_you_like_it:Ypi,to_rate_it:Qpi,average:Xpi,unapproved:Zpi,authenticate_to_change_setting:Jpi,locked:egi,authenticate:tgi,please_authenticate:ngi,biometric_authentication:igi,auto_start_tasks:rgi,budgeted:ogi,please_enter_a_name:sgi,click_plus_to_add_time:agi,design:lgi,password_is_too_short:cgi,failed_to_find_record:ugi,valid_until_days:dgi,valid_until_days_help:hgi,usually_pays_in_days:fgi,requires_an_enterprise_plan:pgi,take_picture:ggi,upload_file:mgi,new_document:_gi,edit_document:vgi,uploaded_document:bgi,updated_document:ygi,archived_document:Cgi,deleted_document:wgi,restored_document:Sgi,no_history:Egi,expense_status_1:xgi,expense_status_2:Tgi,expense_status_3:kgi,no_record_selected:Igi,error_unsaved_changes:Lgi,thank_you_for_your_purchase:Dgi,redeem:Agi,back:Ngi,past_purchases:Rgi,annual_subscription:Ogi,pro_plan:Pgi,enterprise_plan:Mgi,count_users:Fgi,upgrade:Bgi,please_enter_a_first_name:$gi,please_enter_a_last_name:Vgi,please_agree_to_terms_and_privacy:Hgi,i_agree_to_the:Wgi,terms_of_service_link:zgi,privacy_policy_link:Ugi,view_website:jgi,create_account:qgi,email_login:Kgi,late_fees:Ggi,payment_number:Ygi,before_due_date:Qgi,after_due_date:Xgi,after_invoice_date:Zgi,filtered_by_user:Jgi,created_user:emi,primary_font:tmi,secondary_font:nmi,number_padding:imi,general:rmi,surcharge_field:omi,company_value:smi,credit_field:ami,payment_field:lmi,group_field:cmi,number_counter:umi,number_pattern:dmi,custom_javascript:hmi,portal_mode:fmi,attach_pdf:pmi,attach_documents:gmi,attach_ubl:mmi,email_style:_mi,processed:vmi,fee_amount:bmi,fee_percent:ymi,fee_cap:Cmi,limits_and_fees:wmi,credentials:Smi,require_billing_address_help:Emi,require_shipping_address_help:xmi,deleted_tax_rate:Tmi,restored_tax_rate:kmi,provider:Imi,company_gateway:Lmi,company_gateways:Dmi,new_company_gateway:Ami,edit_company_gateway:Nmi,created_company_gateway:Rmi,updated_company_gateway:Omi,archived_company_gateway:Pmi,deleted_company_gateway:Mmi,restored_company_gateway:Fmi,continue_editing:Bmi,default_value:$mi,currency_format:Vmi,first_day_of_the_week:Hmi,first_month_of_the_year:Wmi,symbol:zmi,ocde:Umi,date_format:jmi,datetime_format:qmi,send_reminders:Kmi,timezone:Gmi,filtered_by_group:Ymi,filtered_by_invoice:Qmi,filtered_by_client:Xmi,filtered_by_vendor:Zmi,group_settings:Jmi,groups:e_i,new_group:t_i,edit_group:n_i,created_group:i_i,updated_group:r_i,archived_group:o_i,deleted_group:s_i,restored_group:a_i,upload_logo:l_i,uploaded_logo:c_i,saved_settings:u_i,device_settings:d_i,credit_cards_and_banks:h_i,price:f_i,email_sign_up:p_i,google_sign_up:g_i,sign_up_with_google:m_i,long_press_multiselect:__i,migrate_to_next_version:v_i,migrate_intro_text:b_i,start_the_migration:y_i,migration:C_i,welcome_to_the_new_version:w_i,next_step_data_download:S_i,download_data:E_i,continue:"Continue",company1:x_i,company2:T_i,company3:k_i,company4:I_i,product1:L_i,product2:D_i,product3:A_i,product4:N_i,client1:R_i,client2:O_i,client3:P_i,client4:M_i,contact1:F_i,contact2:B_i,contact3:$_i,contact4:V_i,task1:H_i,task2:W_i,task3:z_i,task4:U_i,project1:j_i,project2:q_i,project3:K_i,project4:G_i,expense1:Y_i,expense2:Q_i,expense3:X_i,expense4:Z_i,vendor1:J_i,vendor2:evi,vendor3:tvi,vendor4:nvi,invoice1:ivi,invoice2:rvi,invoice3:ovi,invoice4:svi,payment1:avi,payment2:lvi,payment3:cvi,payment4:uvi,surcharge1:dvi,surcharge2:hvi,surcharge3:fvi,surcharge4:pvi,group1:gvi,group2:mvi,group3:_vi,group4:vvi,number:bvi,count:yvi,is_active:Cvi,contact_last_login:wvi,contact_full_name:Svi,contact_custom_value1:Evi,contact_custom_value2:xvi,contact_custom_value3:Tvi,contact_custom_value4:kvi,assigned_to_id:Ivi,created_by_id:Lvi,add_column:Dvi,edit_columns:Avi,to_learn_about_gogle_fonts:Nvi,refund_date:Rvi,multiselect:Ovi,verify_password:Pvi,applied:Mvi,include_recent_errors:Fvi,your_message_has_been_received:Bvi,show_product_details:$vi,show_product_details_help:Vvi,pdf_min_requirements:Hvi,adjust_fee_percent:Wvi,configure_settings:zvi,about:Uvi,credit_email:jvi,domain_url:qvi,password_is_too_easy:Kvi,client_portal_tasks:Gvi,client_portal_dashboard:Yvi,please_enter_a_value:Qvi,deleted_logo:Xvi,generate_number:Zvi,when_saved:Jvi,when_sent:ebi,select_company:tbi,float:nbi,collapse:ibi,show_or_hide:rbi,menu_sidebar:obi,history_sidebar:sbi,tablet:abi,layout:lbi,module:cbi,first_custom:ubi,second_custom:dbi,third_custom:hbi,show_cost:fbi,show_cost_help:pbi,show_product_quantity:gbi,show_product_quantity_help:mbi,show_invoice_quantity:_bi,show_invoice_quantity_help:vbi,default_quantity:bbi,default_quantity_help:ybi,one_tax_rate:Cbi,two_tax_rates:wbi,three_tax_rates:Sbi,default_tax_rate:Ebi,invoice_tax:xbi,line_item_tax:Tbi,inclusive_taxes:kbi,invoice_tax_rates:Ibi,item_tax_rates:Lbi,configure_rates:Dbi,tax_settings_rates:Abi,accent_color:Nbi,comma_sparated_list:Rbi,single_line_text:Obi,multi_line_text:Pbi,dropdown:Mbi,field_type:Fbi,recover_password_email_sent:Bbi,removed_user:$bi,freq_three_years:Vbi,military_time_help:Hbi,click_here_capital:Wbi,marked_invoice_as_paid:zbi,marked_invoices_as_sent:Ubi,marked_invoices_as_paid:jbi,activity_57:qbi,custom_value3:Kbi,custom_value4:Gbi,email_style_custom:Ybi,custom_message_dashboard:Qbi,custom_message_unpaid_invoice:Xbi,custom_message_paid_invoice:Zbi,custom_message_unapproved_quote:Jbi,lock_sent_invoices:e0i,translations:t0i,task_number_pattern:n0i,task_number_counter:i0i,expense_number_pattern:r0i,expense_number_counter:o0i,vendor_number_pattern:s0i,vendor_number_counter:a0i,ticket_number_pattern:l0i,ticket_number_counter:c0i,payment_number_pattern:u0i,payment_number_counter:d0i,invoice_number_pattern:h0i,quote_number_pattern:f0i,client_number_pattern:p0i,client_number_counter:g0i,credit_number_pattern:m0i,credit_number_counter:_0i,reset_counter_date:v0i,counter_padding:b0i,shared_invoice_quote_counter:y0i,default_tax_name_1:C0i,default_tax_rate_1:w0i,default_tax_name_2:S0i,default_tax_rate_2:E0i,default_tax_name_3:x0i,default_tax_rate_3:T0i,email_subject_invoice:k0i,email_subject_quote:I0i,email_subject_payment:L0i,switch_list_table:D0i,client_city:A0i,client_state:N0i,client_country:R0i,client_is_active:O0i,client_balance:P0i,client_address1:M0i,client_address2:F0i,client_shipping_address1:B0i,client_shipping_address2:$0i,tax_rate1:V0i,tax_rate2:H0i,tax_rate3:W0i,archived_at:z0i,has_expenses:U0i,custom_taxes1:j0i,custom_taxes2:q0i,custom_taxes3:K0i,custom_taxes4:G0i,custom_surcharge1:Y0i,custom_surcharge2:Q0i,custom_surcharge3:X0i,custom_surcharge4:Z0i,is_deleted:J0i,vendor_city:eyi,vendor_state:tyi,vendor_country:nyi,credit_footer:iyi,credit_terms:ryi,untitled_company:oyi,added_company:syi,supported_events:ayi,custom3:lyi,custom4:cyi,optional:uyi,license:dyi,invoice_balance:hyi,saved_design:fyi,client_details:pyi,company_address:gyi,quote_details:myi,credit_details:_yi,product_columns:vyi,task_columns:byi,add_field:yyi,all_events:Cyi,owned:wyi,payment_success:Syi,payment_failure:Eyi,quote_sent:xyi,credit_sent:Tyi,invoice_viewed:kyi,quote_viewed:Iyi,credit_viewed:Lyi,quote_approved:Dyi,receive_all_notifications:Ayi,purchase_license:Nyi,enable_modules:Ryi,converted_quote:Oyi,credit_design:Pyi,includes:Myi,css_framework:Fyi,custom_designs:Byi,designs:$yi,new_design:Vyi,edit_design:Hyi,created_design:Wyi,updated_design:zyi,archived_design:Uyi,deleted_design:jyi,removed_design:qyi,restored_design:Kyi,recurring_tasks:Gyi,removed_credit:Yyi,latest_version:Qyi,update_now:Xyi,a_new_version_is_available:Zyi,update_available:Jyi,app_updated:e1i,integrations:t1i,tracking_id:n1i,slack_webhook_url:i1i,partial_payment:r1i,partial_payment_email:o1i,clone_to_credit:s1i,emailed_credit:a1i,marked_credit_as_sent:l1i,email_subject_payment_partial:c1i,is_approved:u1i,migration_went_wrong:d1i,cross_migration_message:h1i,email_credit:f1i,client_email_not_set:p1i,ledger:g1i,view_pdf:m1i,all_records:_1i,owned_by_user:v1i,credit_remaining:b1i,use_default:y1i,reminder_endless:C1i,number_of_days:w1i,configure_payment_terms:S1i,payment_term:E1i,new_payment_term:x1i,deleted_payment_term:T1i,removed_payment_term:k1i,restored_payment_term:I1i,full_width_editor:L1i,full_height_filter:D1i,email_sign_in:A1i,change:N1i,change_to_mobile_layout:R1i,change_to_desktop_layout:O1i,send_from_gmail:P1i,reversed:M1i,cancelled:F1i,quote_amount:B1i,hosted:$1i,selfhosted:V1i,hide_menu:H1i,show_menu:W1i,partially_refunded:z1i,search_documents:U1i,search_designs:j1i,search_invoices:q1i,search_clients:K1i,search_products:G1i,search_quotes:Y1i,search_credits:Q1i,search_vendors:X1i,search_users:Z1i,search_tax_rates:J1i,search_tasks:eCi,search_settings:tCi,search_projects:nCi,search_expenses:iCi,search_payments:rCi,search_groups:oCi,search_company:sCi,cancelled_invoice:aCi,cancelled_invoices:lCi,reversed_invoice:cCi,reversed_invoices:uCi,reverse:dCi,filtered_by_project:hCi,google_sign_in:fCi,activity_58:pCi,activity_59:gCi,payment_reconciliation_failure:mCi,payment_reconciliation_success:_Ci,gateway_success:vCi,gateway_failure:bCi,gateway_error:yCi,email_send:CCi,email_retry_queue:wCi,failure:SCi,quota_exceeded:ECi,upstream_failure:xCi,system_logs:TCi,copy_link:kCi,welcome_to_invoice_ninja:ICi,optin:LCi,optout:DCi,auto_convert:ACi,reminder1_sent:NCi,reminder2_sent:RCi,reminder3_sent:OCi,reminder_last_sent:PCi,pdf_page_info:MCi,emailed_credits:FCi,view_in_stripe:BCi,rows_per_page:$Ci,apply_payment:VCi,unapplied:HCi,custom_labels:WCi,record_type:zCi,record_name:UCi,file_type:jCi,height:qCi,width:KCi,health_check:GCi,last_login_at:YCi,company_key:QCi,storefront:XCi,storefront_help:ZCi,count_records_selected:JCi,count_record_selected:ewi,client_created:twi,online_payment_email:nwi,manual_payment_email:iwi,completed:rwi,gross:owi,net_amount:swi,net_balance:awi,client_settings:lwi,selected_invoices:cwi,selected_payments:uwi,selected_quotes:dwi,selected_tasks:hwi,selected_expenses:fwi,past_due_invoices:pwi,create_payment:gwi,update_quote:mwi,update_invoice:_wi,update_client:vwi,update_vendor:bwi,create_expense:ywi,update_expense:Cwi,update_task:wwi,approve_quote:Swi,when_paid:Ewi,expires_on:xwi,show_sidebar:Twi,hide_sidebar:kwi,event_type:Iwi,copy:Lwi,must_be_online:Dwi,crons_not_enabled:Awi,api_webhooks:Nwi,search_webhooks:Rwi,search_webhook:Owi,webhook:Pwi,webhooks:Mwi,new_webhook:Fwi,edit_webhook:Bwi,created_webhook:$wi,updated_webhook:Vwi,archived_webhook:Hwi,deleted_webhook:Wwi,removed_webhook:zwi,restored_webhook:Uwi,search_tokens:jwi,search_token:qwi,new_token:Kwi,removed_token:Gwi,restored_token:Ywi,client_registration:Qwi,client_registration_help:Xwi,customize_and_preview:Zwi,search_document:Jwi,search_design:eSi,search_invoice:tSi,search_client:nSi,search_product:iSi,search_quote:rSi,search_credit:oSi,search_vendor:sSi,search_user:aSi,search_tax_rate:lSi,search_task:cSi,search_project:uSi,search_expense:dSi,search_payment:hSi,search_group:fSi,created_on:pSi,"payment_status_-1":"Unapplied",lock_invoices:gSi,show_table:mSi,show_list:_Si,view_changes:vSi,force_update:bSi,force_update_help:ySi,mark_paid_help:CSi,mark_invoiceable_help:wSi,add_documents_to_invoice_help:SSi,convert_currency_help:ESi,expense_settings:xSi,clone_to_recurring:TSi,crypto:kSi,user_field:ISi,variables:LSi,show_password:DSi,hide_password:ASi,copy_error:NSi,capture_card:RSi,auto_bill_enabled:OSi,total_taxes:PSi,line_taxes:MSi,total_fields:FSi,stopped_recurring_invoice:BSi,started_recurring_invoice:$Si,resumed_recurring_invoice:VSi,gateway_refund:HSi,gateway_refund_help:WSi,due_date_days:zSi,paused:USi,day_count:jSi,first_day_of_the_month:qSi,last_day_of_the_month:KSi,use_payment_terms:GSi,endless:YSi,next_send_date:QSi,remaining_cycles:XSi,created_recurring_invoice:ZSi,updated_recurring_invoice:JSi,removed_recurring_invoice:eEi,search_recurring_invoice:tEi,search_recurring_invoices:nEi,send_date:iEi,auto_bill_on:rEi,minimum_under_payment_amount:oEi,allow_over_payment:sEi,allow_over_payment_help:aEi,allow_under_payment:lEi,allow_under_payment_help:cEi,test_mode:uEi,calculated_rate:dEi,default_task_rate:hEi,clear_cache:fEi,sort_order:pEi,task_status:gEi,task_statuses:mEi,new_task_status:_Ei,edit_task_status:vEi,created_task_status:bEi,archived_task_status:yEi,deleted_task_status:CEi,removed_task_status:wEi,restored_task_status:SEi,search_task_status:EEi,search_task_statuses:xEi,show_tasks_table:TEi,show_tasks_table_help:kEi,invoice_task_timelog:IEi,invoice_task_timelog_help:LEi,auto_start_tasks_help:DEi,configure_statuses:AEi,task_settings:NEi,configure_categories:REi,edit_expense_category:OEi,removed_expense_category:PEi,search_expense_category:MEi,search_expense_categories:FEi,use_available_credits:BEi,show_option:$Ei,negative_payment_error:VEi,should_be_invoiced_help:HEi,configure_gateways:WEi,payment_partial:zEi,is_running:UEi,invoice_currency_id:jEi,tax_name1:qEi,tax_name2:KEi,transaction_id:GEi,invoice_late:YEi,quote_expired:QEi,recurring_invoice_total:XEi,actions:ZEi,expense_number:JEi,task_number:exi,project_number:txi,view_settings:nxi,company_disabled_warning:ixi,late_invoice:rxi,expired_quote:oxi,remind_invoice:sxi,client_phone:axi,required_fields:lxi,enabled_modules:cxi,activity_60:uxi,activity_61:dxi,activity_62:hxi,activity_63:fxi,activity_64:pxi,activity_65:gxi,activity_66:mxi,expense_category_id:_xi,view_licenses:vxi,fullscreen_editor:bxi,sidebar_editor:yxi,please_type_to_confirm:Cxi,purge:wxi,clone_to:Sxi,clone_to_other:Exi,labels:xxi,add_custom:Txi,payment_tax:kxi,white_label:Ixi,sent_invoices_are_locked:Lxi,paid_invoices_are_locked:Dxi,source_code:Axi,app_platforms:Nxi,archived_task_statuses:Rxi,deleted_task_statuses:Oxi,restored_task_statuses:Pxi,deleted_expense_categories:Mxi,restored_expense_categories:Fxi,archived_recurring_invoices:Bxi,deleted_recurring_invoices:$xi,restored_recurring_invoices:Vxi,archived_webhooks:Hxi,deleted_webhooks:Wxi,removed_webhooks:zxi,restored_webhooks:Uxi,api_docs:jxi,archived_tokens:qxi,deleted_tokens:Kxi,restored_tokens:Gxi,archived_payment_terms:Yxi,deleted_payment_terms:Qxi,restored_payment_terms:Xxi,archived_designs:Zxi,deleted_designs:Jxi,restored_designs:eTi,restored_credits:tTi,archived_users:nTi,deleted_users:iTi,removed_users:rTi,restored_users:oTi,archived_tax_rates:sTi,deleted_tax_rates:aTi,restored_tax_rates:lTi,archived_company_gateways:cTi,deleted_company_gateways:uTi,restored_company_gateways:dTi,archived_groups:hTi,deleted_groups:fTi,restored_groups:pTi,archived_documents:gTi,deleted_documents:mTi,restored_documents:_Ti,restored_vendors:vTi,restored_expenses:bTi,restored_tasks:yTi,restored_projects:CTi,restored_products:wTi,restored_clients:STi,restored_invoices:ETi,restored_payments:xTi,restored_quotes:TTi,update_app:kTi,started_import:ITi,duplicate_column_mapping:LTi,uses_inclusive_taxes:DTi,is_amount_discount:ATi,map_to:NTi,first_row_as_column_names:RTi,no_file_selected:OTi,import_type:PTi,draft_mode:MTi,draft_mode_help:FTi,show_product_discount:BTi,show_product_discount_help:$Ti,tax_name3:VTi,debug_mode_is_enabled:HTi,debug_mode_is_enabled_help:WTi,running_tasks:zTi,recent_tasks:UTi,recent_expenses:jTi,upcoming_expenses:qTi,search_payment_term:KTi,search_payment_terms:GTi,save_and_preview:YTi,save_and_email:QTi,converted_balance:XTi,is_sent:ZTi,document_upload:JTi,document_upload_help:eki,expense_total:tki,enter_taxes:nki,by_rate:iki,by_amount:rki,enter_amount:oki,before_taxes:ski,after_taxes:aki,color:lki,show:cki,empty_columns:uki,project_name:dki,counter_pattern_error:hki,this_quarter:fki,to_update_run:pki,registration_url:gki,show_product_cost:mki,complete:_ki,next:vki,next_step:bki,notification_credit_sent_subject:yki,notification_credit_viewed_subject:Cki,notification_credit_sent:wki,notification_credit_viewed:Ski,reset_password_text:Eki,password_reset:xki,account_login_text:Tki,request_cancellation:kki,delete_payment_method:Iki,about_to_delete_payment_method:Lki,action_cant_be_reversed:Dki,profile_updated_successfully:Aki,currency_ethiopian_birr:Nki,client_information_text:Rki,status_id:Oki,email_already_register:Pki,locations:Mki,freq_indefinitely:Fki,cycles_remaining:Bki,i_understand_delete:$ki,download_files:Vki,download_timeframe:Hki,new_signup:Wki,new_signup_text:zki,notification_payment_paid_subject:Uki,notification_partial_payment_paid_subject:jki,notification_payment_paid:qki,notification_partial_payment_paid:Kki,notification_bot:Gki,invoice_number_placeholder:Yki,entity_number_placeholder:Qki,email_link_not_working:Xki,display_log:Zki,send_fail_logs_to_our_server:Jki,setup:eIi,quick_overview_statistics:tIi,update_your_personal_info:nIi,name_website_logo:iIi,make_sure_use_full_link:rIi,personal_address:oIi,enter_your_personal_address:sIi,enter_your_shipping_address:aIi,list_of_invoices:lIi,with_selected:cIi,invoice_still_unpaid:uIi,list_of_recurring_invoices:dIi,details_of_recurring_invoice:hIi,cancellation:fIi,about_cancellation:pIi,cancellation_warning:gIi,cancellation_pending:mIi,list_of_payments:_Ii,payment_details:vIi,list_of_payment_invoices:bIi,list_of_payment_methods:yIi,payment_method_details:CIi,permanently_remove_payment_method:wIi,warning_action_cannot_be_reversed:SIi,confirmation:EIi,list_of_quotes:xIi,waiting_for_approval:TIi,quote_still_not_approved:kIi,list_of_credits:IIi,required_extensions:LIi,php_version:DIi,writable_env_file:AIi,env_not_writable:NIi,minumum_php_version:RIi,satisfy_requirements:OIi,oops_issues:PIi,open_in_new_tab:MIi,complete_your_payment:FIi,authorize_for_future_use:BIi,page:$Ii,per_page:VIi,of:HIi,view_credit:WIi,to_view_entity_password:zIi,showing_x_of:UIi,no_results:jIi,payment_failed_subject:qIi,payment_failed_body:KIi,register:GIi,register_label:YIi,password_confirmation:QIi,verification:XIi,complete_your_bank_account_verification:ZIi,checkout_com:JIi,footer_label:e2i,credit_card_invalid:t2i,month_invalid:n2i,year_invalid:i2i,https_required:r2i,if_you_need_help:o2i,update_password_on_confirm:s2i,bank_account_not_linked:a2i,application_settings_label:l2i,recommended_in_production:c2i,enable_only_for_development:u2i,test_pdf:d2i,checkout_authorize_label:h2i,sofort_authorize_label:f2i,node_status:p2i,npm_status:g2i,node_status_not_found:m2i,npm_status_not_found:_2i,locked_invoice:v2i,downloads:b2i,resource:y2i,document_details:C2i,hash:w2i,resources:S2i,allowed_file_types:E2i,common_codes:x2i,payment_error_code_20087:T2i,download_selected:k2i,to_pay_invoices:I2i,add_payment_method_first:L2i,no_items_selected:D2i,payment_due:A2i,account_balance:N2i,thanks:R2i,minimum_required_payment:O2i,under_payments_disabled:P2i,over_payments_disabled:M2i,saved_at:F2i,credit_payment:B2i,credit_subject:$2i,credit_message:V2i,payment_type_Crypto:H2i,payment_type_Credit:W2i,store_for_future_use:z2i,pay_with_credit:U2i,payment_method_saving_failed:j2i,pay_with:q2i,"n/a":"N/A",by_clicking_next_you_accept_terms:K2i,not_specified:G2i,before_proceeding_with_payment_warning:Y2i,after_completing_go_back_to_previous_page:Q2i,pay:X2i,instructions:Z2i,notification_invoice_reminder1_sent_subject:J2i,notification_invoice_reminder2_sent_subject:eLi,notification_invoice_reminder3_sent_subject:tLi,notification_invoice_custom_sent_subject:nLi,notification_invoice_reminder_endless_sent_subject:iLi,assigned_user:rLi,setup_steps_notice:oLi,setup_phantomjs_note:sLi,minimum_payment:aLi,no_action_provided:lLi,no_payable_invoices_selected:cLi,required_payment_information:uLi,required_payment_information_more:dLi,required_client_info_save_label:hLi,notification_credit_bounced:fLi,notification_credit_bounced_subject:pLi,save_payment_method_details:gLi,new_card:mLi,new_bank_account:_Li,company_limit_reached:vLi,credits_applied_validation:bLi,credit_number_taken:yLi,credit_not_found:CLi,invoices_dont_match_client:wLi,duplicate_credits_submitted:SLi,duplicate_invoices_submitted:ELi,credit_with_no_invoice:xLi,client_id_required:TLi,expense_number_taken:kLi,invoice_number_taken:ILi,payment_id_required:LLi,unable_to_retrieve_payment:DLi,invoice_not_related_to_payment:ALi,credit_not_related_to_payment:NLi,max_refundable_invoice:RLi,refund_without_invoices:OLi,refund_without_credits:PLi,max_refundable_credit:MLi,project_client_do_not_match:FLi,quote_number_taken:BLi,recurring_invoice_number_taken:$Li,user_not_associated_with_account:VLi,amounts_do_not_balance:HLi,insufficient_applied_amount_remaining:WLi,insufficient_credit_balance:zLi,one_or_more_invoices_paid:ULi,invoice_cannot_be_refunded:jLi,attempted_refund_failed:qLi,user_not_associated_with_this_account:KLi,migration_completed:GLi,migration_completed_description:YLi,api_404:QLi,large_account_update_parameter:XLi,no_backup_exists:ZLi,company_user_not_found:JLi,no_credits_found:eDi,action_unavailable:tDi,no_documents_found:nDi,no_group_settings_found:iDi,access_denied:rDi,invoice_cannot_be_marked_paid:oDi,invoice_license_or_environment:sDi,route_not_available:aDi,invalid_design_object:lDi,quote_not_found:cDi,quote_unapprovable:uDi,scheduler_has_run:dDi,scheduler_has_never_run:hDi,self_update_not_available:fDi,user_detached:pDi,create_webhook_failure:gDi,payment_message_extended:mDi,online_payments_minimum_note:_Di,payment_token_not_found:vDi,vendor_address1:bDi,vendor_address2:yDi,partially_unapplied:CDi,select_a_gmail_user:wDi,list_long_press:SDi,show_actions:EDi,start_multiselect:xDi,email_sent_to_confirm_email:TDi,converted_paid_to_date:kDi,converted_credit_balance:IDi,converted_total:LDi,reply_to_name:DDi,"payment_status_-2":"Partially Unapplied",color_theme:ADi,start_migration:NDi,recurring_cancellation_request:RDi,recurring_cancellation_request_body:ODi,hello:PDi,group_documents:MDi,quote_approval_confirmation_label:FDi,migration_select_company_label:BDi,force_migration:$Di,require_password_with_social_login:VDi,stay_logged_in:HDi,session_about_to_expire:WDi,count_hours:zDi,count_day:UDi,count_days:jDi,web_session_timeout:qDi,security_settings:KDi,resend_email:GDi,confirm_your_email_address:YDi,freshbooks:QDi,invoice2go:XDi,invoicely:ZDi,waveaccounting:JDi,zoho:eAi,accounting:tAi,required_files_missing:nAi,migration_auth_label:iAi,api_secret:rAi,migration_api_secret_notice:oAi,billing_coupon_notice:sAi,use_last_email:aAi,activate_company:lAi,activate_company_help:cAi,an_error_occurred_try_again:uAi,please_first_set_a_password:dAi,changing_phone_disables_two_factor:hAi,help_translate:fAi,please_select_a_country:pAi,disabled_two_factor:gAi,connected_google:mAi,disconnected_google:_Ai,delivered:vAi,spam:bAi,view_docs:yAi,enter_phone_to_enable_two_factor:CAi,send_sms:wAi,sms_code:SAi,connect_google:EAi,disconnect_google:xAi,disable_two_factor:TAi,invoice_task_datelog:kAi,invoice_task_datelog_help:IAi,promo_code:LAi,recurring_invoice_issued_to:DAi,subscription:AAi,new_subscription:NAi,deleted_subscription:RAi,removed_subscription:OAi,restored_subscription:PAi,search_subscription:MAi,search_subscriptions:FAi,subdomain_is_not_available:BAi,connect_gmail:$Ai,disconnect_gmail:VAi,connected_gmail:HAi,disconnected_gmail:WAi,update_fail_help:zAi,client_id_number:UAi,count_minutes:jAi,password_timeout:qAi,shared_invoice_credit_counter:KAi,activity_80:GAi,activity_81:YAi,activity_82:QAi,activity_83:XAi,activity_84:ZAi,amount_greater_than_balance_v5:JAi,click_to_continue:eNi,notification_invoice_created_body:tNi,notification_invoice_created_subject:nNi,notification_quote_created_body:iNi,notification_quote_created_subject:rNi,notification_credit_created_body:oNi,notification_credit_created_subject:sNi,max_companies:aNi,max_companies_desc:lNi,migration_already_completed:cNi,migration_already_completed_desc:uNi,payment_method_cannot_be_authorized_first:dNi,new_account:hNi,activity_100:fNi,activity_101:pNi,activity_102:gNi,activity_103:mNi,activity_104:_Ni,new_login_detected:vNi,new_login_description:bNi,contact_details:yNi,download_backup_subject:CNi,account_passwordless_login:wNi,user_duplicate_error:SNi,user_cross_linked_error:ENi,ach_verification_notification_label:xNi,ach_verification_notification:TNi,login_link_requested_label:kNi,login_link_requested:INi,invoices_backup_subject:LNi,migration_failed_label:DNi,migration_failed:ANi,client_email_company_contact_label:NNi,quote_was_approved_label:RNi,quote_was_approved:ONi,company_import_failure_subject:PNi,company_import_failure_body:MNi,recurring_invoice_due_date:FNi,amount_cents:BNi,default_payment_method_label:$Ni,default_payment_method:VNi,already_default_payment_method:HNi,auto_bill_disabled:WNi,select_payment_method:zNi,login_without_password:UNi,email_sent:jNi,one_time_purchases:qNi,recurring_purchases:KNi,you_might_be_interested_in_following:GNi,quotes_with_status_sent_can_be_approved:YNi,no_quotes_available_for_download:QNi,copyright:XNi,user_created_user:ZNi,company_deleted:JNi,company_deleted_body:eRi,back_to:tRi,stripe_connect_migration_title:nRi,stripe_connect_migration_desc:iRi,email_quota_exceeded_subject:rRi,email_quota_exceeded_body:oRi,auto_bill_option:sRi,lang_Arabic:aRi,lang_Persian:lRi,lang_Latvian:cRi,expiry_date:uRi,cardholder_name:dRi,recurring_quote_number_taken:hRi,account_type:fRi,locality:pRi,checking:gRi,savings:mRi,unable_to_verify_payment_method:_Ri,generic_gateway_error:vRi,my_documents:bRi,payment_method_cannot_be_preauthorized:yRi,kbc_cbc:CRi,bancontact:wRi,sepa_mandat:SRi,ideal:ERi,bank_account_holder:xRi,aio_checkout:TRi,przelewy24:kRi,przelewy24_accept:IRi,giropay:LRi,giropay_law:DRi,klarna:ARi,eps:NRi,becs:RRi,bacs:ORi,payment_type_BACS:PRi,missing_payment_method:MRi,becs_mandate:FRi,you_need_to_accept_the_terms_before_proceeding:BRi,direct_debit:$Ri,clone_to_expense:VRi,checkout:HRi,acss:WRi,invalid_amount:zRi,client_payment_failure_body:URi,browser_pay:jRi,no_available_methods:qRi,gocardless_mandate_not_ready:KRi,payment_type_instant_bank_pay:GRi,payment_type_iDEAL:YRi,payment_type_Przelewy24:QRi,"payment_type_Mollie Bank Transfer":"Mollie Bank Transfer","payment_type_KBC/CBC":"KBC/CBC","payment_type_Instant Bank Pay":"Instant Bank Pay","payment_type_Hosted Page":"Hosted Page",payment_type_GiroPay:XRi,payment_type_EPS:ZRi,"payment_type_Direct Debit":"Direct Debit",payment_type_Bancontact:JRi,payment_type_BECS:eOi,payment_type_ACSS:tOi,gross_line_total:nOi,lang_Slovak:iOi,normal:rOi,large:oOi,extra_large:sOi,show_pdf_preview:aOi,show_pdf_preview_help:lOi,print_pdf:cOi,remind_me:uOi,instant_bank_pay:dOi,click_selected:hOi,hide_preview:fOi,edit_record:pOi,credit_is_more_than_invoice:gOi,please_set_a_password:mOi,recommend_desktop:_Oi,recommend_mobile:vOi,disconnected_gateway:bOi,disconnect:yOi,add_to_invoices:COi,bulk_download:wOi,persist_data_help:SOi,persist_ui:EOi,persist_ui_help:xOi,client_postal_code:TOi,client_vat_number:kOi,has_tasks:IOi,registration:LOi,unauthorized_stripe_warning:DOi,update_all_records:AOi,set_default_company:NOi,updated_company:ROi,kbc:OOi,why_are_you_leaving:POi,webhook_success:MOi,error_cross_client_tasks:FOi,error_cross_client_expenses:BOi,app:$Oi,for_best_performance:VOi,bulk_email_invoice:HOi,bulk_email_quote:WOi,bulk_email_credit:zOi,removed_recurring_expense:UOi,search_recurring_expense:jOi,search_recurring_expenses:qOi,last_sent_date:KOi,include_drafts:GOi,include_drafts_help:YOi,is_invoiced:QOi,change_plan:XOi,persist_data:ZOi,customer_count:JOi,verify_customers:ePi,google_analytics_tracking_id:tPi,decimal_comma:nPi,use_comma_as_decimal_place:iPi,select_method:rPi,select_platform:oPi,use_web_app_to_connect_gmail:sPi,expense_tax_help:aPi,enable_markdown:lPi,enable_markdown_help:cPi,add_second_contact:uPi,previous_page:dPi,next_page:hPi,export_colors:fPi,import_colors:pPi,clear_all:gPi,contrast:mPi,custom_colors:_Pi,colors:vPi,sidebar_active_background_color:bPi,sidebar_active_font_color:yPi,sidebar_inactive_background_color:CPi,sidebar_inactive_font_color:wPi,table_alternate_row_background_color:SPi,invoice_header_background_color:EPi,invoice_header_font_color:xPi,review_app:TPi,check_status:kPi,free_trial:IPi,free_trial_help:LPi,free_trial_ends_in_days:DPi,free_trial_ends_today:APi,change_email:NPi,client_portal_domain_hint:RPi,tasks_shown_in_portal:OPi,uninvoiced:PPi,subdomain_guide:MPi,send_time:FPi,import_settings:BPi,json_file_missing:$Pi,json_option_missing:VPi,json:HPi,no_payment_types_enabled:WPi,wait_for_data:zPi,net_total:UPi,has_taxes:jPi,import_customers:qPi,imported_customers:KPi,login_success:GPi,login_failure:YPi,exported_data:QPi,include_deleted_clients:XPi,include_deleted_clients_help:ZPi,step_1_sign_in:JPi,step_2_authorize:eMi,account_id:tMi,migration_not_yet_completed:nMi,show_task_end_date:iMi,show_task_end_date_help:rMi,gateway_setup:oMi,preview_sidebar:sMi,years_data_shown:aMi,ended_all_sessions:lMi,end_all_sessions:cMi,count_session:uMi,count_sessions:dMi,invoice_created:hMi,quote_created:fMi,credit_created:pMi,enterprise:gMi,invoice_item:mMi,quote_item:_Mi,order:vMi,search_kanban:bMi,search_kanbans:yMi,move_top:CMi,move_up:wMi,move_down:SMi,move_bottom:EMi,body_variable_missing:xMi,add_body_variable_message:TMi,view_date_formats:kMi,is_viewed:IMi,letter:LMi,legal:DMi,page_layout:AMi,portrait:NMi,landscape:RMi,owner_upgrade_to_paid_plan:OMi,upgrade_to_paid_plan:PMi,invoice_payment_terms:MMi,quote_valid_until:FMi,no_headers:BMi,add_header:$Mi,remove_header:VMi,return_url:HMi,rest_method:WMi,header_key:zMi,header_value:UMi,recurring_products:jMi,promo_discount:qMi,allow_cancellation:KMi,per_seat_enabled:GMi,max_seats_limit:YMi,trial_enabled:QMi,trial_duration:XMi,allow_query_overrides:ZMi,allow_plan_changes:JMi,plan_map:e4i,refund_period:t4i,webhook_configuration:n4i,purchase_page:i4i,email_bounced:r4i,email_spam_complaint:o4i,email_delivery:s4i,webhook_response:a4i,pdf_response:l4i,authentication_failure:c4i,pdf_failed:u4i,pdf_success:d4i,modified:h4i,html_mode:f4i,html_mode_help:p4i,status_color_theme:g4i,load_color_theme:m4i,lang_Estonian:_4i,marked_credit_as_paid:v4i,marked_credits_as_paid:b4i,wait_for_loading:y4i,wait_for_saving:C4i,html_preview_warning:w4i,remaining:S4i,invoice_paid:E4i,activity_120:x4i,activity_121:T4i,activity_122:k4i,activity_123:I4i,activity_124:L4i,fpx:D4i,to_view_entity_set_password:A4i,unsubscribe:N4i,unsubscribed:R4i,unsubscribed_text:O4i,client_shipping_state:P4i,client_shipping_city:M4i,client_shipping_postal_code:F4i,client_shipping_country:B4i,load_pdf:$4i,start_free_trial:V4i,start_free_trial_message:H4i,due_on_receipt:W4i,is_paid:z4i,age_group_paid:U4i,id:j4i,convert_to:q4i,client_currency:K4i,company_currency:G4i,custom_emails_disabled_help:Y4i,upgrade_to_add_company:Q4i,file_saved_in_downloads_folder:X4i,small:Z4i,quotes_backup_subject:J4i,credits_backup_subject:e3i,document_download_subject:t3i,reminder_message:n3i,gmail_credentials_invalid_subject:i3i,gmail_credentials_invalid_body:r3i,total_columns:o3i,view_task:s3i,cancel_invoice:a3i,changed_status:l3i,change_status:c3i,enable_touch_events:u3i,enable_touch_events_help:d3i,after_saving:h3i,view_record:f3i,enable_email_markdown:p3i,enable_email_markdown_help:g3i,enable_pdf_markdown:m3i,json_help:_3i,release_notes:v3i,upgrade_to_view_reports:b3i,started_tasks:y3i,stopped_tasks:C3i,approved_quote:w3i,approved_quotes:S3i,client_website:E3i,invalid_time:x3i,signed_in_as:T3i,total_results:k3i,restore_company_gateway:I3i,archive_company_gateway:L3i,delete_company_gateway:D3i,exchange_currency:A3i,tax_amount1:N3i,tax_amount2:R3i,tax_amount3:O3i,update_project:P3i,auto_archive_invoice_cancelled:M3i,auto_archive_invoice_cancelled_help:F3i,no_invoices_found:B3i,created_record:$3i,auto_archive_paid_invoices:V3i,auto_archive_paid_invoices_help:H3i,auto_archive_cancelled_invoices:W3i,auto_archive_cancelled_invoices_help:z3i,alternate_pdf_viewer:U3i,alternate_pdf_viewer_help:j3i,currency_cayman_island_dollar:q3i,download_report_description:K3i,left:G3i,right:Y3i,center:Q3i,page_numbering:X3i,page_numbering_alignment:Z3i,invoice_sent_notification_label:J3i,show_product_description:e5i,show_product_description_help:t5i,invoice_items:n5i,quote_items:i5i,profitloss:r5i,import_format:o5i,export_format:s5i,export_type:a5i,stop_on_unpaid:l5i,stop_on_unpaid_help:c5i,use_quote_terms:u5i,use_quote_terms_help:d5i,add_country:h5i,enable_tooltips:f5i,enable_tooltips_help:p5i,multiple_client_error:g5i,login_label:m5i,purchase_order:_5i,purchase_order_number:v5i,purchase_order_number_short:b5i,inventory_notification_subject:y5i,inventory_notification_body:C5i,activity_130:w5i,activity_131:S5i,activity_132:E5i,activity_133:x5i,activity_134:T5i,activity_135:k5i,activity_136:I5i,purchase_order_subject:L5i,purchase_order_message:D5i,view_purchase_order:A5i,purchase_orders_backup_subject:N5i,notification_purchase_order_viewed_subject:R5i,notification_purchase_order_viewed:O5i,purchase_order_date:P5i,purchase_orders:M5i,purchase_order_number_placeholder:F5i,accepted:B5i,activity_137:$5i,vendor_information:V5i,notification_purchase_order_accepted_subject:H5i,notification_purchase_order_accepted:W5i,amount_received:z5i,purchase_order_already_expensed:U5i,convert_to_expense:j5i,add_to_inventory:q5i,added_purchase_order_to_inventory:K5i,added_purchase_orders_to_inventory:G5i,client_document_upload:Y5i,vendor_document_upload:Q5i,vendor_document_upload_help:X5i,are_you_enjoying_the_app:Z5i,yes_its_great:J5i,not_so_much:eFi,would_you_rate_it:tFi,would_you_tell_us_more:nFi,sure_happy_to:iFi,no_not_now:rFi,add:oFi,last_sent_template:sFi,enable_flexible_search:aFi,enable_flexible_search_help:lFi,vendor_details:cFi,purchase_order_details:uFi,qr_iban:dFi,besr_id:hFi,clone_to_purchase_order:fFi,vendor_email_not_set:pFi,bulk_send_email:gFi,marked_purchase_order_as_sent:mFi,marked_purchase_orders_as_sent:_Fi,accepted_purchase_order:vFi,accepted_purchase_orders:bFi,cancelled_purchase_order:yFi,cancelled_purchase_orders:CFi,please_select_a_vendor:wFi,purchase_order_total:SFi,email_purchase_order:EFi,bulk_email_purchase_order:xFi,disconnected_email:TFi,connect_email:kFi,disconnect_email:IFi,use_web_app_to_connect_microsoft:LFi,email_provider:DFi,connect_microsoft:AFi,disconnect_microsoft:NFi,connected_microsoft:RFi,disconnected_microsoft:OFi,microsoft_sign_in:PFi,microsoft_sign_up:MFi,emailed_purchase_order:FFi,emailed_purchase_orders:BFi,enable_react_app:$Fi,purchase_order_design:VFi,purchase_order_terms:HFi,purchase_order_footer:WFi,require_purchase_order_signature:zFi,require_purchase_order_signature_help:UFi,new_purchase_order:jFi,edit_purchase_order:qFi,created_purchase_order:KFi,updated_purchase_order:GFi,archived_purchase_order:YFi,deleted_purchase_order:QFi,removed_purchase_order:XFi,restored_purchase_order:ZFi,search_purchase_order:JFi,search_purchase_orders:e6i,login_url:t6i,enable_applying_payments:n6i,enable_applying_payments_help:i6i,stock_quantity:r6i,notification_threshold:o6i,track_inventory:s6i,track_inventory_help:a6i,stock_notifications:l6i,stock_notifications_help:c6i,vat:u6i,view_map:d6i,set_default_design:h6i,purchase_order_issued_to:f6i,archive_task_status:p6i,delete_task_status:g6i,restore_task_status:m6i,lang_Hebrew:_6i,price_change_accepted:v6i,price_change_failed:b6i,restore_purchases:y6i,activate:C6i,connect_apple:w6i,disconnect_apple:S6i,disconnected_apple:E6i,send_now:x6i,received:T6i,converted_to_expense:k6i,converted_to_expenses:I6i,entity_removed:L6i,entity_removed_title:D6i,field:A6i,period:N6i,fields_per_row:R6i,total_active_invoices:O6i,total_outstanding_invoices:P6i,total_completed_payments:M6i,total_refunded_payments:F6i,total_active_quotes:B6i,total_approved_quotes:$6i,total_unapproved_quotes:V6i,total_logged_tasks:H6i,total_invoiced_tasks:W6i,total_paid_tasks:z6i,total_logged_expenses:U6i,total_pending_expenses:j6i,total_invoiced_expenses:q6i,total_invoice_paid_expenses:K6i,vendor_portal:G6i,send_code:Y6i,save_to_upload_documents:Q6i,expense_tax_rates:X6i,invoice_item_tax_rates:Z6i,verified_phone_number:J6i,code_was_sent:eBi,resend:tBi,verify:nBi,enter_phone_number:iBi,invalid_phone_number:rBi,verify_phone_number:oBi,verify_phone_number_help:sBi,merged_clients:aBi,merge_into:lBi,php81_required:cBi,bulk_email_purchase_orders:uBi,bulk_email_invoices:dBi,bulk_email_quotes:hBi,bulk_email_credits:fBi,archive_purchase_order:pBi,restore_purchase_order:gBi,delete_purchase_order:mBi,connect:_Bi,mark_paid_payment_email:vBi,convert_to_project:bBi,client_email:yBi,invoice_task_project:CBi,invoice_task_project_help:wBi,bulk_action:SBi,phone_validation_error:EBi,transaction:xBi,disable_2fa:TBi,change_number:kBi,resend_code:IBi,base_type:LBi,category_type:DBi,bank_transaction:ABi,bulk_print:NBi,vendor_postal_code:RBi,preview_location:OBi,bottom:PBi,side:MBi,pdf_preview:FBi,long_press_to_select:BBi,purchase_order_item:$Bi,would_you_rate_the_app:VBi,include_deleted:HBi,include_deleted_help:WBi,due_on:zBi,browser_pdf_viewer:UBi,browser_pdf_viewer_help:jBi,converted_transactions:qBi,default_category:KBi,connect_accounts:GBi,manage_rules:YBi,search_category:QBi,search_categories:XBi,min_amount:ZBi,max_amount:JBi,converted_transaction:e8i,convert_to_payment:t8i,deposit:n8i,withdrawal:i8i,deposits:r8i,withdrawals:o8i,matched:s8i,unmatched:a8i,create_credit:l8i,transactions:c8i,new_transaction:u8i,edit_transaction:d8i,created_transaction:h8i,updated_transaction:f8i,archived_transaction:p8i,deleted_transaction:g8i,removed_transaction:m8i,restored_transaction:_8i,search_transaction:v8i,search_transactions:b8i,deleted_bank_account:y8i,removed_bank_account:C8i,restored_bank_account:w8i,search_bank_account:S8i,search_bank_accounts:E8i,code_was_sent_to:x8i,verify_phone_number_2fa_help:T8i,enable_applying_payments_later:k8i,line_item_tax_rates:I8i,show_tasks_in_client_portal:L8i,notification_quote_expired_subject:D8i,notification_quote_expired:A8i,auto_sync:N8i,refresh_accounts:R8i,upgrade_to_connect_bank_account:O8i,click_here_to_connect_bank_account:P8i,include_tax:M8i,email_template_change:F8i,task_update_authorization_error:B8i,cash_vs_accrual:$8i,cash_vs_accrual_help:V8i,expense_paid_report:H8i,expense_paid_report_help:W8i,online_payment_email_help:z8i,manual_payment_email_help:U8i,mark_paid_payment_email_help:j8i,linked_transaction:q8i,link_payment:K8i,link_expense:G8i,lock_invoiced_tasks:Y8i,lock_invoiced_tasks_help:Q8i,registration_required_help:X8i,use_inventory_management:Z8i,use_inventory_management_help:J8i,optional_products:e9i,optional_recurring_products:t9i,convert_matched:n9i,auto_billed_invoice:i9i,auto_billed_invoices:r9i,operator:o9i,value:s9i,is:a9i,contains:l9i,starts_with:c9i,is_empty:u9i,add_rule:d9i,match_all_rules:h9i,match_all_rules_help:f9i,auto_convert_help:p9i,rules:g9i,transaction_rule:m9i,transaction_rules:_9i,new_transaction_rule:v9i,edit_transaction_rule:b9i,created_transaction_rule:y9i,updated_transaction_rule:C9i,archived_transaction_rule:w9i,deleted_transaction_rule:S9i,removed_transaction_rule:E9i,restored_transaction_rule:x9i,search_transaction_rule:T9i,search_transaction_rules:k9i,"payment_type_Interac E-Transfer":"Interac E-Transfer",delete_bank_account:I9i,archive_transaction:L9i,delete_transaction:D9i,otp_code_message:A9i,otp_code_subject:N9i,otp_code_body:R9i,delete_tax_rate:O9i,restore_tax_rate:P9i,company_backup_file:M9i,company_backup_file_help:F9i,backup_restore:B9i,export_company:$9i,backup:V9i,notification_purchase_order_created_body:H9i,notification_purchase_order_created_subject:W9i,notification_purchase_order_sent_subject:z9i,notification_purchase_order_sent:U9i,subscription_blocked:j9i,subscription_blocked_title:q9i,purchase_order_created:K9i,purchase_order_sent:G9i,purchase_order_viewed:Y9i,purchase_order_accepted:Q9i,credit_payment_error:X9i,convert_payment_currency_help:Z9i,convert_expense_currency_help:J9i,matomo_url:e7i,matomo_id:t7i,action_add_to_invoice:n7i,danger_zone:i7i,import_completed:r7i,client_statement_body:o7i,email_queued:s7i,clone_to_recurring_invoice:a7i,inventory_threshold:l7i,emailed_statement:c7i,show_email_footer:u7i,invoice_task_hours:d7i,invoice_task_hours_help:h7i,auto_bill_standard_invoices:f7i,auto_bill_recurring_invoices:p7i,email_alignment:g7i,pdf_preview_location:m7i,mailgun:_7i,brevo:v7i,postmark:b7i,microsoft:y7i,click_plus_to_create_record:C7i,last365_days:w7i,import_design:S7i,imported_design:E7i,invalid_design:x7i,setup_wizard_logo:T7i,installed_version:k7i,notify_vendor_when_paid:I7i,notify_vendor_when_paid_help:L7i,update_payment:D7i,markup:A7i,unlock_pro:N7i,upgrade_to_paid_plan_to_schedule:R7i,next_run:O7i,all_clients:P7i,show_aging_table:M7i,show_payments_table:F7i,only_clients_with_invoices:B7i,email_statement:$7i,once:V7i,schedules:H7i,new_schedule:W7i,edit_schedule:z7i,created_schedule:U7i,updated_schedule:j7i,archived_schedule:q7i,deleted_schedule:K7i,removed_schedule:G7i,restored_schedule:Y7i,search_schedule:Q7i,search_schedules:X7i,update_product:Z7i,create_purchase_order:J7i,update_purchase_order:e$i,sent_invoice:t$i,sent_quote:n$i,sent_credit:i$i,sent_purchase_order:r$i,image_url:o$i,max_quantity:s$i,test_url:a$i,auto_bill_help_off:l$i,auto_bill_help_optin:c$i,auto_bill_help_optout:u$i,auto_bill_help_always:d$i,view_all:h$i,edit_all:f$i,accept_purchase_order_number:p$i,accept_purchase_order_number_help:g$i,from_email:m$i,show_preview:_$i,show_paid_stamp:v$i,show_shipping_address:b$i,no_documents_to_download:y$i,pixels:C$i,logo_size:w$i,failed:S$i,client_contacts:E$i,sync_from:x$i,gateway_payment_text:T$i,gateway_payment_text_no_invoice:k$i,click_to_variables:I$i,ship_to:L$i,stripe_direct_debit_details:D$i,branch_name:A$i,branch_code:N$i,bank_name:R$i,bank_code:O$i,bic:P$i,change_plan_description:M$i,add_company_logo:F$i,add_stripe:B$i,invalid_coupon:$$i,no_assigned_tasks:V$i,authorization_failure:H$i,authorization_sms_failure:W$i,white_label_body:z$i,payment_type_Klarna:U$i,"payment_type_Interac E Transfer":"Interac E Transfer",xinvoice_payable:j$i,xinvoice_no_buyers_reference:q$i,xinvoice_online_payment:K$i,pre_payment:G$i,number_of_payments:Y$i,number_of_payments_helper:Q$i,pre_payment_indefinitely:X$i,notification_payment_emailed:Z$i,notification_payment_emailed_subject:J$i,record_not_found:eVi,minimum_payment_amount:tVi,client_initiated_payments:nVi,client_initiated_payments_help:iVi,share_invoice_quote_columns:rVi,cc_email:oVi,payment_balance:sVi,view_report_permission:aVi,activity_138:lVi,one_time_products:cVi,optional_one_time_products:uVi,required:dVi,hidden:hVi,payment_links:fVi,payment_link:pVi,new_payment_link:gVi,edit_payment_link:mVi,created_payment_link:_Vi,updated_payment_link:vVi,archived_payment_link:bVi,deleted_payment_link:yVi,removed_payment_link:CVi,restored_payment_link:wVi,search_payment_link:SVi,search_payment_links:EVi,increase_prices:xVi,update_prices:TVi,incresed_prices:kVi,updated_prices:IVi,api_token:LVi,api_key:DVi,endpoint:AVi,not_billable:NVi,allow_billable_task_items:RVi,allow_billable_task_items_help:OVi,show_task_item_description:PVi,show_task_item_description_help:MVi,email_record:FVi,invoice_product_columns:BVi,quote_product_columns:$Vi,vendors:VVi,product_sales:HVi,user_sales_report_header:WVi,client_balance_report:zVi,client_sales_report:UVi,user_sales_report:jVi,aged_receivable_detailed_report:qVi,aged_receivable_summary_report:KVi,taxable_amount:GVi,tax_summary:YVi,oauth_mail:QVi,preferences:XVi,analytics:ZVi,reduced_rate:JVi,tax_all:eHi,tax_selected:tHi,version:nHi,seller_subregion:iHi,calculate_taxes:rHi,calculate_taxes_help:oHi,link_expenses:sHi,converted_client_balance:aHi,converted_payment_balance:lHi,total_hours:cHi,date_picker_hint:uHi,app_help_link:dHi,here:hHi,"industry_Restaurant & Catering":"Restaurant & Catering",show_credits_table:fHi,manual_payment:pHi,tax_summary_report:gHi,tax_category:mHi,physical_goods:_Hi,digital_products:vHi,services:bHi,shipping:yHi,tax_exempt:CHi,late_fee_added_locked_invoice:wHi,lang_Khmer:SHi,routing_id:EHi,enable_e_invoice:xHi,e_invoice_type:THi,reduced_tax:kHi,override_tax:IHi,zero_rated:LHi,reverse_tax:DHi,updated_tax_category:AHi,updated_tax_categories:NHi,set_tax_category:RHi,payment_manual:OHi,expense_payment_type:PHi,"payment_type_Cash App":"Cash App",rename:MHi,renamed_document:FHi,e_invoice:BHi,light_dark_mode:$Hi,activities:VHi,recent_transactions:HHi,country_Palestine:WHi,country_Taiwan:zHi,duties:UHi,order_number:jHi,order_id:qHi,total_invoices_outstanding:KHi,recent_activity:GHi,enable_auto_bill:YHi,email_count_invoices:QHi,invoice_task_item_description:XHi,invoice_task_item_description_help:ZHi,next_send_time:JHi,uploaded_certificate:eWi,certificate_set:tWi,certificate_not_set:nWi,passphrase_set:iWi,passphrase_not_set:rWi,upload_certificate:oWi,certificate_passphrase:sWi,valid_vat_number:aWi,react_notification_link:lWi,react_notification_link_help:cWi,show_task_billable:uWi,credit_item:dWi,drop_file_here:hWi,files:fWi,camera:pWi,gallery:gWi,project_location:mWi,add_gateway_help_message:_Wi,lang_Hungarian:vWi,use_mobile_to_manage_plan:bWi,item_tax3:yWi,item_tax_rate1:CWi,item_tax_rate2:wWi,item_tax_rate3:SWi,buy_price:EWi,country_Macedonia:xWi,admin_initiated_payments:TWi,admin_initiated_payments_help:kWi,paid_date:IWi,downloaded_entities:LWi,"lang_French - Swiss":"French - Swiss",currency_swazi_lilangeni:DWi,income:AWi,amount_received_help:NWi,vendor_phone:RWi,mercado_pago:OWi,mybank:PWi,paypal_paylater:MWi,district:FWi,region:BWi,county:$Wi,tax_details:VWi,activity_10_online:HWi,activity_10_manual:WWi,default_payment_type:zWi,number_precision:UWi,number_precision_help:jWi,is_tax_exempt:qWi,drop_files_here:KWi,upload_files:GWi,download_e_invoice:YWi,download_e_credit:QWi,download_e_quote:XWi,triangular_tax_info:ZWi,intracommunity_tax_info:JWi,reverse_tax_info:ezi,currency_nicaraguan_cordoba:tzi,public:"Public",private:"Private",image:nzi,other:izi,linked_to:rzi,file_saved_in_path:ozi,unlinked_transactions:szi,unlinked_transaction:azi,view_dashboard_permission:lzi,marked_sent_credits:czi,show_document_preview:uzi,cash_accounting:dzi,click_or_drop_files_here:hzi,set_public:fzi,set_private:pzi,individual:gzi,business:mzi,partnership:_zi,trust:vzi,charity:bzi,government:yzi,in_stock_quantity:Czi,vendor_contact:wzi,expense_status_4:Szi,expense_status_5:Ezi,ziptax_help:xzi,cache_data:Tzi,unknown:kzi,webhook_failure:Izi,email_opened:Lzi,email_delivered:Dzi,log:Azi,classification:Nzi,stock_quantity_number:Rzi,upcoming:Ozi,client_contact:Pzi,uncategorized:Mzi,login_notification:Fzi,login_notification_help:Bzi,payment_refund_receipt:$zi,payment_receipt:Vzi,load_template_description:Hzi,run_template:Wzi,statement_design:zzi,delivery_note_design:Uzi,payment_receipt_design:jzi,payment_refund_design:qzi,task_extension_banner:Kzi,watch_video:Gzi,view_extension:Yzi,reactivate_email:Qzi,email_reactivated:Xzi,template_help:Zzi,quarter:Jzi,item_description:eUi,task_item:tUi,record_state:nUi,save_files_to_this_folder:iUi,downloads_folder:rUi,total_invoiced_quotes:oUi,total_invoice_paid_quotes:sUi,downloads_folder_does_not_exist:aUi,user_logged_in_notification:lUi,user_logged_in_notification_help:cUi,payment_email_all_contacts:uUi,payment_email_all_contacts_help:dUi,add_line:hUi,activity_139:fUi,vendor_notification_subject:pUi,vendor_notification_body:gUi,receipt:mUi,charges:_Ui,email_report:vUi,"payment_type_Pay Later":"Pay Later",payment_type_credit:bUi,payment_type_debit:yUi,send_emails_to:CUi,primary_contact:wUi,all_contacts:SUi,insert_below:EUi,nordigen_handler_subtitle:xUi,nordigen_handler_error_heading_unknown:TUi,nordigen_handler_error_contents_unknown:kUi,nordigen_handler_error_heading_token_invalid:IUi,nordigen_handler_error_contents_token_invalid:LUi,nordigen_handler_error_heading_account_config_invalid:DUi,nordigen_handler_error_contents_account_config_invalid:AUi,nordigen_handler_error_heading_not_available:NUi,nordigen_handler_error_contents_not_available:RUi,nordigen_handler_error_heading_institution_invalid:OUi,nordigen_handler_error_contents_institution_invalid:PUi,nordigen_handler_error_heading_ref_invalid:MUi,nordigen_handler_error_contents_ref_invalid:FUi,nordigen_handler_error_heading_eua_failure:BUi,nordigen_handler_error_contents_eua_failure:$Ui,nordigen_handler_error_heading_not_found:VUi,nordigen_handler_error_contents_not_found:HUi,nordigen_handler_error_heading_requisition_invalid_status:WUi,nordigen_handler_error_contents_requisition_invalid_status:zUi,nordigen_handler_error_heading_requisition_no_accounts:UUi,nordigen_handler_error_contents_requisition_no_accounts:jUi,nordigen_handler_restart:qUi,nordigen_handler_return:KUi,lang_Lao:GUi,currency_lao_kip:YUi,yodlee_regions:QUi,nordigen_regions:XUi,select_provider:ZUi,nordigen_requisition_subject:JUi,nordigen_requisition_body:eji,participant:tji,participant_name:nji,client_unsubscribed:iji,client_unsubscribed_help:rji,resubscribe:oji,subscribe:sji,subscribe_help:aji,unsubscribe_help:lji,notification_purchase_order_bounced:cji,notification_purchase_order_bounced_subject:uji,show_pdfhtml_on_mobile:dji,show_pdfhtml_on_mobile_help:hji,please_select_an_invoice_or_credit:fji,mobile_version:pji,venmo:gji,my_bank:mji,pay_later:_ji,local_domain:vji,verify_peer:bji,nordigen_help:yji,ar_detailed:Cji,ar_summary:wji,client_sales:Sji,user_sales:Eji,iframe_url:xji,user_unsubscribed:Tji,out_of_stock:kji,step_dependency_fail:Iji,step_dependency_order_fail:Lji,step_authentication_fail:Dji,"auth.login":"Login","auth.login-or-register":"Login or Register","auth.register":"Register",cart:Aji,methods:Nji,rff:Rji,add_step:Oji,steps:Pji,steps_order_help:Mji,other_steps:Fji,use_available_payments:Bji,test_email_sent:$ji,gateway_type:Vji,save_template_body:Hji,save_as_template:Wji,checkout_only_for_existing_customers:zji,checkout_only_for_new_customers:Uji,auto_bill_standard_invoices_help:jji,auto_bill_on_help:qji,use_available_credits_help:Kji,use_unapplied_payments:Gji,use_unapplied_payments_help:Yji,payment_terms_help:Qji,payment_type_help:Xji,quote_valid_until_help:Zji,expense_payment_type_help:Jji,paylater:eqi,payment_provider:tqi,select_email_provider:nqi,purchase_order_items:iqi,csv_rows_length:rqi,accept_payments_online:oqi,all_payment_gateways:sqi,product_cost:aqi,duration_words:lqi,upcoming_recurring_invoices:cqi,shipping_country_id:uqi,show_table_footer:dqi,show_table_footer_help:hqi,total_invoices:fqi,add_to_group:pqi,check_credentials:gqi,valid_credentials:mqi,e_quote:_qi,e_credit:vqi,e_purchase_order:bqi,e_quote_type:yqi,unlock_unlimited_clients:Cqi,download_e_purchase_order:wqi,flutter_web_warning:Sqi,rappen_rounding:Eqi,rappen_rounding_help:xqi,assign_group:Tqi,paypal_advanced_cards:kqi,local_domain_help:Iqi,port_help:Lqi,host_help:Dqi,always_show_required_fields:Aqi,always_show_required_fields_help:Nqi,advanced_cards:Rqi,activity_140:Oqi,invoice_net_amount:Pqi,round_to_minutes:Mqi,"1_second":"1 Second","1_minute":"1 Minute","5_minutes":"5 Minutes","15_minutes":"15 Minutes","30_minutes":"30 Minutes","1_hour":"1 Hour","1_day":"1 Day",round_tasks:Fqi,round_tasks_help:Bqi,direction:$qi,round_up:Vqi,round_down:Hqi,task_round_to_nearest:Wqi,task_round_to_nearest_help:zqi,bulk_updated:Uqi,bulk_update:jqi,calculate:qqi,sum:Kqi,money:Gqi,web_app:Yqi,desktop_app:Qqi,disconnected:Xqi,reconnect:Zqi,e_invoice_settings:Jqi,btcpay_refund_subject:eKi,btcpay_refund_body:tKi,currency_mauritanian_ouguiya:nKi,currency_bhutan_ngultrum:iKi,end_of_month:rKi,merge_e_invoice_to_pdf:oKi,task_assigned_subject:sKi,task_assigned_body:aKi,activity_141:lKi,quote_reminder_subject:cKi,quote_reminder_message:uKi,quote_reminder1:dKi,before_valid_until_date:hKi,after_valid_until_date:fKi,after_quote_date:pKi,remind_quote:gKi,tax_currency_mismatch:mKi,edocument_import_already_exists:_Ki,before_valid_until:vKi,after_valid_until:bKi,task_assigned_notification:yKi,task_assigned_notification_help:CKi,invoices_locked_end_of_month:wKi,referral_url:SKi,add_comment:EKi,added_comment:xKi,tickets:TKi,assigned_group:kKi,merge_to_pdf:IKi,latest_requires_php_version:LKi,auto_expand_product_table_notes:DKi,auto_expand_product_table_notes_help:AKi,institution_number:NKi,transit_number:RKi,personal:OKi,address_information:PKi,enter_the_information_for_the_bank_account:MKi,account_holder_information:FKi,enter_information_for_the_account_holder:BKi,customer_type:$Ki,process_date:VKi,forever_free:HKi,comments_only:WKi,payment_balance_on_file:zKi,ubl_email_attachment_help:UKi,stop_task_to_add_task_entry:jKi,xml_file:qKi,one_page_checkout:KKi,one_page_checkout_help:GKi,applies_to:YKi,accept_purchase_order:QKi,round_to_seconds:XKi,activity_142:ZKi,activity_143:JKi,activity_144:eGi,activity_145:tGi,payment_failed:nGi,ssl_host_override:iGi,upload_logo_short:rGi,country_Melilla:oGi,country_Ceuta:sGi,"country_Canary Islands":"Canary Islands",lang_Vietnamese:aGi,invoice_status_changed:lGi,no_unread_notifications:cGi,how_to_import_data:uGi,download_example_file:dGi,expense_mailbox:hGi,expense_mailbox_help:fGi,expense_mailbox_active:pGi,expense_mailbox_active_help:gGi,inbound_mailbox_allow_company_users:mGi,inbound_mailbox_allow_company_users_help:_Gi,inbound_mailbox_allow_vendors:vGi,inbound_mailbox_allow_vendors_help:bGi,inbound_mailbox_allow_clients:yGi,inbound_mailbox_allow_clients_help:CGi,inbound_mailbox_whitelist:wGi,inbound_mailbox_whitelist_help:SGi,inbound_mailbox_blacklist:EGi,inbound_mailbox_blacklist_help:xGi,inbound_mailbox_allow_unknown:TGi,inbound_mailbox_allow_unknown_help:kGi,quick_actions:IGi,end_all_sessions_help:LGi,updated_records:DGi,vat_not_registered:AGi,small_company_info:NGi,peppol_onboarding:RGi,get_started:OGi,configure_peppol:PGi,step:MGi,peppol_whitelabel_warning:FGi,peppol_plan_warning:BGi,peppol_credits_info:$Gi,buy_credits:VGi,peppol_successfully_configured:HGi,peppol_not_paid_message:WGi,peppol_country_not_supported:zGi,peppol_disconnect:UGi,peppol_disconnect_short:jGi,peppol_disconnect_long:qGi,log_duration_words:KGi,log_duration:GGi,merged_vendors:YGi,hidden_taxes_warning:QGi,tax3:XGi,negative_payment_warning:ZGi,currency_bermudian_dollar:JGi,currency_central_african_cfa_franc:eYi,currency_congolese_franc:tYi,currency_djiboutian_franc:nYi,currency_eritrean_nakfa:iYi,currency_falkland_islands_pound:rYi,currency_guinean_franc:oYi,currency_iraqi_dinar:sYi,currency_lesotho_loti:aYi,currency_mongolian_tugrik:lYi,currency_seychellois_rupee:cYi,currency_solomon_islands_dollar:uYi,currency_somali_shilling:dYi,currency_south_sudanese_pound:hYi,currency_sudanese_pound:fYi,currency_tajikistani_somoni:pYi,currency_turkmenistani_manat:gYi,currency_uzbekistani_som:mYi,payment_status_changed:_Yi,credit_status_changed:vYi,credit_updated:bYi,payment_updated:yYi,search_placeholder:CYi,invalid_vat_number:wYi,acts_as_sender:SYi,acts_as_receiver:EYi,peppol_token_generated:xYi,peppol_token_description:TYi,peppol_token_warning:kYi,generate_token:IYi,total_credits_amount:LYi,sales_above_threshold:DYi,changing_vat_and_id_number_note:AYi,iban_help:NYi,bic_swift:RYi,bic_swift_help:OYi,payer_bank_account:PYi,payer_bank_account_help:MYi,bsb_sort:FYi,bsb_sort_help:BYi,card_type:$Yi,card_type_help:VYi,card_number_help:HYi,card_holder:WYi,tokenize:zYi,tokenize_help:UYi,credit_card_stripe_help:jYi,bank_transfer_stripe_help:qYi,alipay_stripe_help:KYi,sofort_stripe_help:GYi,apple_pay_stripe_help:YYi,sepa_stripe_help:QYi,bancontact_stripe_help:XYi,ideal_stripe_help:ZYi,giropay_stripe_help:JYi,przelewy24_stripe_help:eQi,direct_debit_stripe_help:tQi,eps_stripe_help:nQi,acss_stripe_help:iQi,becs_stripe_help:rQi,klarna_stripe_help:oQi,bacs_stripe_help:sQi,fpx_stripe_help:aQi,payment_means:lQi,act_as_sender:cQi,act_as_receiver:uQi,saved_einvoice_details:dQi,add_license_to_env:hQi,white_label_license_not_present:fQi,white_label_license_not_found:pQi,details_update_info:gQi,client_address_required:mQi,connected:_Qi,email_count_quotes:vQi,activity_146:bQi,activity_147:yQi,peppol_routing_problem:CQi,peppol_sending_failed:wQi,peppol_cleared_for_sending:SQi,account_holder:EQi,account_holder_help:xQi,activity_148:TQi,additional_tax_identifiers:kQi,additional_tax_identifiers_help:IQi,configure:LQi,new_identifier:DQi,notification_credits_low:AQi,notification_credits_low_text:NQi,notification_no_credits:RQi,notification_no_credits_text:OQi,saved_comment:PQi,acts_as_must_be_true:MQi,delete_identifier:FQi,delete_identifier_description:BQi,einvoice_something_went_wrong:$Qi,download_ready:VQi,notification_quote_reminder1_sent_subject:HQi,custom_reminder_sent:WQi,use_system_fonts:zQi,use_system_fonts_help:UQi,active_tasks:jQi,enable_notifications:qQi,enable_public_notifications:KQi,enable_public_notifications_help:GQi,navigate:YQi,calculate_taxes_warning:QQi,activity_149:XQi};function JQi({children:n}){return p(dt,{children:n})}function eXi(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(r){r(t)}),(i=n.get("*"))&&i.slice().map(function(r){r(e,t)})}}}function tXi(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function YNe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function QNe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?YNe(Object(t),!0).forEach(function(i){tXi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):YNe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function nXi(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function iXi(n,e){if(n==null)return{};var t=nXi(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function rXi(n,e){return oXi(n)||sXi(n,e)||aXi(n,e)||lXi()}function oXi(n){if(Array.isArray(n))return n}function sXi(n,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(n)))){var t=[],i=!0,r=!1,o=void 0;try{for(var s=n[Symbol.iterator](),a;!(i=(a=s.next()).done)&&(t.push(a.value),!(e&&t.length===e));i=!0);}catch(l){r=!0,o=l}finally{try{!i&&s.return!=null&&s.return()}finally{if(r)throw o}}return t}}function aXi(n,e){if(n){if(typeof n=="string")return XNe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return XNe(n,e)}}function XNe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function lXi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cXi(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZNe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function JNe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ZNe(Object(t),!0).forEach(function(i){cXi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ZNe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function uXi(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(i){return e.reduceRight(function(r,o){return o(r)},i)}}function hP(n){return function e(){for(var t=this,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return r.length>=n.length?n.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return e.apply(t,[].concat(r,a))}}}function MW(n){return{}.toString.call(n).includes("Object")}function dXi(n){return!Object.keys(n).length}function f3(n){return typeof n=="function"}function hXi(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function fXi(n,e){return MW(e)||Rw("changeType"),Object.keys(e).some(function(t){return!hXi(n,t)})&&Rw("changeField"),e}function pXi(n){f3(n)||Rw("selectorType")}function gXi(n){f3(n)||MW(n)||Rw("handlerType"),MW(n)&&Object.values(n).some(function(e){return!f3(e)})&&Rw("handlersType")}function mXi(n){n||Rw("initialIsRequired"),MW(n)||Rw("initialType"),dXi(n)&&Rw("initialContent")}function _Xi(n,e){throw new Error(n[e]||n.default)}var vXi={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Rw=hP(_Xi)(vXi),C9={changes:fXi,selector:pXi,handler:gXi,initial:mXi};function bXi(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C9.initial(n),C9.handler(e);var t={current:n},i=hP(wXi)(t,e),r=hP(CXi)(t),o=hP(C9.changes)(n),s=hP(yXi)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return C9.selector(c),c(t.current)}function l(c){uXi(i,r,o,s)(c)}return[a,l]}function yXi(n,e){return f3(e)?e(n.current):e}function CXi(n,e){return n.current=JNe(JNe({},n.current),e),e}function wXi(n,e,t){return f3(e)?e(n.current):Object.keys(t).forEach(function(i){var r;return(r=e[i])===null||r===void 0?void 0:r.call(e,n.current[i])}),t}var SXi={create:bXi},EXi={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function xXi(n){return function e(){for(var t=this,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return r.length>=n.length?n.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return e.apply(t,[].concat(r,a))}}}function TXi(n){return{}.toString.call(n).includes("Object")}function kXi(n){return n||eRe("configIsRequired"),TXi(n)||eRe("configType"),n.urls?(IXi(),{paths:{vs:n.urls.monacoBase}}):n}function IXi(){console.warn(qQe.deprecation)}function LXi(n,e){throw new Error(n[e]||n.default)}var qQe={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning! You are using deprecated way of configuration. Instead of using monaco.config({ urls: { monacoBase: '...' } }) use monaco.config({ paths: { vs: '...' } }) For more please check the link https://github.com/suren-atoyan/monaco-loader#config `},eRe=xXi(LXi)(qQe),DXi={config:kXi},AXi=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(r){return t.reduceRight(function(o,s){return s(o)},r)}};function KQe(n,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&n[t]&&Object.assign(e[t],KQe(n[t],e[t]))}),QNe(QNe({},n),e)}var NXi={type:"cancelation",msg:"operation is manually canceled"};function kee(n){var e=!1,t=new Promise(function(i,r){n.then(function(o){return e?r(NXi):i(o)}),n.catch(r)});return t.cancel=function(){return e=!0},t}var RXi=SXi.create({config:EXi,isInitialized:!1,resolve:null,reject:null,monaco:null}),GQe=rXi(RXi,2),m6=GQe[0],ZK=GQe[1];function OXi(n){var e=DXi.config(n),t=e.monaco,i=iXi(e,["monaco"]);ZK(function(r){return{config:KQe(r.config,i),monaco:t}})}function PXi(){var n=m6(function(e){var t=e.monaco,i=e.isInitialized,r=e.resolve;return{monaco:t,isInitialized:i,resolve:r}});if(!n.isInitialized){if(ZK({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),kee(Iee);if(window.monaco&&window.monaco.editor)return YQe(window.monaco),n.resolve(window.monaco),kee(Iee);AXi(MXi,BXi)($Xi)}return kee(Iee)}function MXi(n){return document.body.appendChild(n)}function FXi(n){var e=document.createElement("script");return n&&(e.src=n),e}function BXi(n){var e=m6(function(i){var r=i.config,o=i.reject;return{config:r,reject:o}}),t=FXi("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return n()},t.onerror=e.reject,t}function $Xi(){var n=m6(function(t){var i=t.config,r=t.resolve,o=t.reject;return{config:i,resolve:r,reject:o}}),e=window.require;e.config(n.config),e(["vs/editor/editor.main"],function(t){YQe(t),n.resolve(t)},function(t){n.reject(t)})}function YQe(n){m6().monaco||ZK({monaco:n})}function VXi(){return m6(function(n){var e=n.monaco;return e})}var Iee=new Promise(function(n,e){return ZK({resolve:n,reject:e})}),JK={config:OXi,init:PXi,__getMonacoInstance:VXi},HXi={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Lee=HXi,WXi={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},zXi=WXi;function UXi({children:n}){return ae.createElement("div",{style:zXi.container},n)}var jXi=UXi,qXi=jXi;function KXi({width:n,height:e,isEditorReady:t,loading:i,_ref:r,className:o,wrapperProps:s}){return ae.createElement("section",{style:{...Lee.wrapper,width:n,height:e},...s},!t&&ae.createElement(qXi,null,i),ae.createElement("div",{ref:r,style:{...Lee.fullWidth,...!t&&Lee.hide},className:o}))}var GXi=KXi,QQe=w.memo(GXi);function YXi(n){w.useEffect(n,[])}var XQe=YXi;function QXi(n,e,t=!0){let i=w.useRef(!0);w.useEffect(i.current||!t?()=>{i.current=!1}:n,e)}var Op=QXi;function TM(){}function tL(n,e,t,i){return XXi(n,i)||ZXi(n,e,t,i)}function XXi(n,e){return n.editor.getModel(ZQe(n,e))}function ZXi(n,e,t,i){return n.editor.createModel(e,t,i?ZQe(n,i):void 0)}function ZQe(n,e){return n.Uri.parse(e)}function JXi({original:n,modified:e,language:t,originalLanguage:i,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:g,wrapperProps:m={},beforeMount:v=TM,onMount:_=TM}){let[b,y]=w.useState(!1),[C,x]=w.useState(!0),E=w.useRef(null),k=w.useRef(null),L=w.useRef(null),D=w.useRef(_),A=w.useRef(v),O=w.useRef(!1);XQe(()=>{let M=JK.init();return M.then(V=>(k.current=V)&&x(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>E.current?B():M.cancel()}),Op(()=>{if(E.current&&k.current){let M=E.current.getOriginalEditor(),V=tL(k.current,n||"",i||t||"text",o||"");V!==M.getModel()&&M.setModel(V)}},[o],b),Op(()=>{if(E.current&&k.current){let M=E.current.getModifiedEditor(),V=tL(k.current,e||"",r||t||"text",s||"");V!==M.getModel()&&M.setModel(V)}},[s],b),Op(()=>{let M=E.current.getModifiedEditor();M.getOption(k.current.editor.EditorOption.readOnly)?M.setValue(e||""):e!==M.getValue()&&(M.executeEdits("",[{range:M.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),M.pushUndoStop())},[e],b),Op(()=>{var M,V;(V=(M=E.current)==null?void 0:M.getModel())==null||V.original.setValue(n||"")},[n],b),Op(()=>{let{original:M,modified:V}=E.current.getModel();k.current.editor.setModelLanguage(M,i||t||"text"),k.current.editor.setModelLanguage(V,r||t||"text")},[t,i,r],b),Op(()=>{var M;(M=k.current)==null||M.editor.setTheme(c)},[c],b),Op(()=>{var M;(M=E.current)==null||M.updateOptions(d)},[d],b);let P=w.useCallback(()=>{var U;if(!k.current)return;A.current(k.current);let M=tL(k.current,n||"",i||t||"text",o||""),V=tL(k.current,e||"",r||t||"text",s||"");(U=E.current)==null||U.setModel({original:M,modified:V})},[t,e,r,n,i,o,s]),F=w.useCallback(()=>{var M;!O.current&&L.current&&(E.current=k.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...d}),P(),(M=k.current)==null||M.editor.setTheme(c),y(!0),O.current=!0)},[d,c,P]);w.useEffect(()=>{b&&D.current(E.current,k.current)},[b]),w.useEffect(()=>{!C&&!b&&F()},[C,b,F]);function B(){var V,U,W,q;let M=(V=E.current)==null?void 0:V.getModel();a||((U=M==null?void 0:M.original)==null||U.dispose()),l||((W=M==null?void 0:M.modified)==null||W.dispose()),(q=E.current)==null||q.dispose()}return ae.createElement(QQe,{width:f,height:h,isEditorReady:b,loading:u,_ref:L,className:g,wrapperProps:m})}var eZi=JXi;w.memo(eZi);function tZi(n){let e=w.useRef();return w.useEffect(()=>{e.current=n},[n]),e.current}var nZi=tZi,w9=new Map;function iZi({defaultValue:n,defaultLanguage:e,defaultPath:t,value:i,language:r,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:g="100%",className:m,wrapperProps:v={},beforeMount:_=TM,onMount:b=TM,onChange:y,onValidate:C=TM}){let[x,E]=w.useState(!1),[k,L]=w.useState(!0),D=w.useRef(null),A=w.useRef(null),O=w.useRef(null),P=w.useRef(b),F=w.useRef(_),B=w.useRef(),M=w.useRef(i),V=nZi(o),U=w.useRef(!1),W=w.useRef(!1);XQe(()=>{let ie=JK.init();return ie.then(se=>(D.current=se)&&L(!1)).catch(se=>(se==null?void 0:se.type)!=="cancelation"&&console.error("Monaco initialization: error:",se)),()=>A.current?H():ie.cancel()}),Op(()=>{var se,Q,Ee,Fe;let ie=tL(D.current,n||i||"",e||r||"",o||t||"");ie!==((se=A.current)==null?void 0:se.getModel())&&(d&&w9.set(V,(Q=A.current)==null?void 0:Q.saveViewState()),(Ee=A.current)==null||Ee.setModel(ie),d&&((Fe=A.current)==null||Fe.restoreViewState(w9.get(o))))},[o],x),Op(()=>{var ie;(ie=A.current)==null||ie.updateOptions(c)},[c],x),Op(()=>{!A.current||i===void 0||(A.current.getOption(D.current.editor.EditorOption.readOnly)?A.current.setValue(i):i!==A.current.getValue()&&(W.current=!0,A.current.executeEdits("",[{range:A.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),A.current.pushUndoStop(),W.current=!1))},[i],x),Op(()=>{var se,Q;let ie=(se=A.current)==null?void 0:se.getModel();ie&&r&&((Q=D.current)==null||Q.editor.setModelLanguage(ie,r))},[r],x),Op(()=>{var ie;a!==void 0&&((ie=A.current)==null||ie.revealLine(a))},[a],x),Op(()=>{var ie;(ie=D.current)==null||ie.editor.setTheme(s)},[s],x);let q=w.useCallback(()=>{var ie;if(!(!O.current||!D.current)&&!U.current){F.current(D.current);let se=o||t,Q=tL(D.current,i||n||"",e||r||"",se||"");A.current=(ie=D.current)==null?void 0:ie.editor.create(O.current,{model:Q,automaticLayout:!0,...c},u),d&&A.current.restoreViewState(w9.get(se)),D.current.editor.setTheme(s),a!==void 0&&A.current.revealLine(a),E(!0),U.current=!0}},[n,e,t,i,r,o,c,u,d,s,a]);w.useEffect(()=>{x&&P.current(A.current,D.current)},[x]),w.useEffect(()=>{!k&&!x&&q()},[k,x,q]),M.current=i,w.useEffect(()=>{var ie,se;x&&y&&((ie=B.current)==null||ie.dispose(),B.current=(se=A.current)==null?void 0:se.onDidChangeModelContent(Q=>{W.current||y(A.current.getValue(),Q)}))},[x,y]),w.useEffect(()=>{if(x){let ie=D.current.editor.onDidChangeMarkers(se=>{var Ee;let Q=(Ee=A.current.getModel())==null?void 0:Ee.uri;if(Q&&se.find(Fe=>Fe.path===Q.path)){let Fe=D.current.editor.getModelMarkers({resource:Q});C==null||C(Fe)}});return()=>{ie==null||ie.dispose()}}return()=>{}},[x,C]);function H(){var ie,se;(ie=B.current)==null||ie.dispose(),h?d&&w9.set(o,A.current.saveViewState()):(se=A.current.getModel())==null||se.dispose(),A.current.dispose()}return ae.createElement(QQe,{width:f,height:g,isEditorReady:x,loading:l,_ref:O,className:m,wrapperProps:v})}var rZi=iZi,oZi=w.memo(rZi),JLr=oZi;function xp(n,e=0){return n[n.length-(1+e)]}function sZi(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Ia(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,r=n.length;i<r;i++)if(!t(n[i],e[i]))return!1;return!0}function aZi(n,e){const t=n.length-1;e<t&&(n[e]=n[t]),n.pop()}function p3(n,e,t){return lZi(n.length,i=>t(n[i],e))}function lZi(n,e){let t=0,i=n-1;for(;t<=i;){const r=(t+i)/2|0,o=e(r);if(o<0)t=r+1;else if(o>0)i=r-1;else return r}return-(t+1)}function Jae(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],r=[],o=[],s=[];for(const a of e){const l=t(a,i);l<0?r.push(a):l>0?o.push(a):s.push(a)}return n<r.length?Jae(n,r,t):n<r.length+s.length?s[0]:Jae(n-(r.length+s.length),o,t)}function tRe(n,e){const t=[];let i;for(const r of n.slice(0).sort(e))!i||e(i[0],r)!==0?(i=[r],t.push(i)):i.push(r);return t}function*JQe(n,e){let t,i;for(const r of n)i!==void 0&&e(i,r)?t.push(r):(t&&(yield t),t=[r]),i=r;t&&(yield t)}function eXe(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function cZi(n,e){for(let t=0;t<n.length;t++)e(t===0?void 0:n[t-1],n[t],t+1===n.length?void 0:n[t+1])}function s0(n){return n.filter(e=>!!e)}function nRe(n){let e=0;for(let t=0;t<n.length;t++)n[t]&&(n[e]=n[t],e+=1);n.length=e}function tXe(n){return!Array.isArray(n)||n.length===0}function Cu(n){return Array.isArray(n)&&n.length>0}function fS(n,e=t=>t){const t=new Set;return n.filter(i=>{const r=e(i);return t.has(r)?!1:(t.add(r),!0)})}function nXe(n,e){return n.length>0?n[0]:e}function hd(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let r=t;r<e;r++)i.push(r);else for(let r=t;r>e;r--)i.push(r);return i}function eG(n,e,t){const i=n.slice(0,e),r=n.slice(e);return i.concat(t,r)}function Dee(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function S9(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function ele(n,e){for(const t of e)n.push(t)}function Kbe(n){return Array.isArray(n)?n:[n]}function uZi(n,e,t){const i=iXe(n,e),r=n.length,o=t.length;n.length=r+o;for(let s=r-1;s>=i;s--)n[s+o]=n[s];for(let s=0;s<o;s++)n[s+i]=t[s]}function iRe(n,e,t,i){const r=iXe(n,e);let o=n.splice(r,t);return o===void 0&&(o=[]),uZi(n,r,i),o}function iXe(n,e){return e<0?Math.max(e+n.length,0):Math.min(e,n.length)}var g3;(function(n){function e(o){return o<0}n.isLessThan=e;function t(o){return o<=0}n.isLessThanOrEqual=t;function i(o){return o>0}n.isGreaterThan=i;function r(o){return o===0}n.isNeitherLessOrGreaterThan=r,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(g3||(g3={}));function sg(n,e){return(t,i)=>e(n(t),n(i))}function dZi(...n){return(e,t)=>{for(const i of n){const r=i(e,t);if(!g3.isNeitherLessOrGreaterThan(r))return r}return g3.neitherLessOrGreaterThan}}const Qy=(n,e)=>n-e,hZi=(n,e)=>Qy(n?1:0,e?1:0);function rXe(n){return(e,t)=>-n(e,t)}class y1{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Gb{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Gb(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Gb(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(r=>((i||g3.isGreaterThan(e(r,t)))&&(i=!1,t=r),!0)),t}}Gb.empty=new Gb(n=>{});function Od(n){return typeof n=="string"}function kd(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function fZi(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function pS(n){return typeof n=="number"&&!isNaN(n)}function rRe(n){return!!n&&typeof n[Symbol.iterator]=="function"}function oXe(n){return n===!0||n===!1}function Bh(n){return typeof n>"u"}function m3(n){return!xf(n)}function xf(n){return Bh(n)||n===null}function Io(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function zx(n){if(xf(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function _3(n){return typeof n=="function"}function pZi(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)gZi(n[i],e[i])}function gZi(n,e){if(Od(e)){if(typeof n!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(_3(e)){try{if(n instanceof e)return}catch{}if(!xf(n)&&n.constructor===e||e.length===1&&e.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function _y(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.entries(n).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?_y(i):i}),e}function mZi(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(sXe.call(t,i)){const r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&!fZi(r)&&e.push(r)}}return n}const sXe=Object.prototype.hasOwnProperty;function aXe(n,e){return tle(n,e,new Set)}function tle(n,e,t){if(xf(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const r=[];for(const o of n)r.push(tle(o,e,t));return r}if(kd(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const r={};for(const o in n)sXe.call(n,o)&&(r[o]=tle(n[o],e,t));return t.delete(n),r}return n}function tG(n,e,t=!0){return kd(n)?(kd(e)&&Object.keys(e).forEach(i=>{i in n?t&&(kd(n[i])&&kd(e[i])?tG(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function jf(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!jf(n[t],e[t]))return!1}else{const r=[];for(i in n)r.push(i);r.sort();const o=[];for(i in e)o.push(i);if(o.sort(),!jf(r,o))return!1;for(t=0;t<r.length;t++)if(!jf(n[r[t]],e[r[t]]))return!1}return!0}function _Zi(n){let e=[];for(;Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}function Gbe(n){const e=[];for(const t of _Zi(n))typeof n[t]=="function"&&e.push(t);return e}function vZi(n,e){const t=r=>function(){const o=Array.prototype.slice.call(arguments,0);return e(r,o)},i={};for(const r of n)i[r]=t(r);return i}globalThis&&globalThis.__awaiter;let bZi=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function yZi(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,r)=>{const o=r[0],s=e[o];let a=i;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),bZi&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function T(n,e,...t){return yZi(e,t)}var Aee;const nL="en";let FW=!1,BW=!1,F$=!1,lXe=!1,Ybe=!1,Qbe=!1,cXe=!1,E9,B$=nL,oRe=nL,CZi,v_;const Tm=typeof self=="object"?self:typeof global=="object"?global:{};let fd;typeof Tm.vscode<"u"&&typeof Tm.vscode.process<"u"?fd=Tm.vscode.process:typeof process<"u"&&(fd=process);const wZi=typeof((Aee=fd==null?void 0:fd.versions)===null||Aee===void 0?void 0:Aee.electron)=="string",SZi=wZi&&(fd==null?void 0:fd.type)==="renderer";if(typeof navigator=="object"&&!SZi)v_=navigator.userAgent,FW=v_.indexOf("Windows")>=0,BW=v_.indexOf("Macintosh")>=0,Qbe=(v_.indexOf("Macintosh")>=0||v_.indexOf("iPad")>=0||v_.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,F$=v_.indexOf("Linux")>=0,cXe=(v_==null?void 0:v_.indexOf("Mobi"))>=0,Ybe=!0,T({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),E9=nL,B$=E9,oRe=navigator.language;else if(typeof fd=="object"){FW=fd.platform==="win32",BW=fd.platform==="darwin",F$=fd.platform==="linux",F$&&fd.env.SNAP&&fd.env.SNAP_REVISION,fd.env.CI||fd.env.BUILD_ARTIFACTSTAGINGDIRECTORY,E9=nL,B$=nL;const n=fd.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];E9=e.locale,oRe=e.osLocale,B$=t||nL,CZi=e._translationsConfigFile}catch{}lXe=!0}else console.error("Unable to resolve platform.");const eu=FW,mr=BW,Zu=F$,cv=lXe,lE=Ybe,EZi=Ybe&&typeof Tm.importScripts=="function",vv=Qbe,xZi=cXe,a0=v_,TZi=B$,kZi=typeof Tm.postMessage=="function"&&!Tm.importScripts,uXe=(()=>{if(kZi){const n=[];Tm.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,r=n.length;i<r;i++){const o=n[i];if(o.id===t.data.vscodeScheduleAsyncWork){n.splice(i,1),o.callback();return}}});let e=0;return t=>{const i=++e;n.push({id:i,callback:t}),Tm.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),Pf=BW||Qbe?2:FW?1:3;let sRe=!0,aRe=!1;function dXe(){if(!aRe){aRe=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,sRe=new Uint16Array(n.buffer)[0]===512+1}return sRe}const hXe=!!(a0&&a0.indexOf("Chrome")>=0),IZi=!!(a0&&a0.indexOf("Firefox")>=0),LZi=!!(!hXe&&a0&&a0.indexOf("Safari")>=0),DZi=!!(a0&&a0.indexOf("Edg/")>=0);a0&&a0.indexOf("Android")>=0;const gu={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var tr;(function(n){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*r(b){yield b}n.single=r;function o(b){return e(b)?b:r(b)}n.wrap=o;function s(b){return b||t}n.from=s;function*a(b){for(let y=b.length-1;y>=0;y--)yield b[y]}n.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(b){return b[Symbol.iterator]().next().value}n.first=c;function u(b,y){for(const C of b)if(y(C))return!0;return!1}n.some=u;function d(b,y){for(const C of b)if(y(C))return C}n.find=d;function*h(b,y){for(const C of b)y(C)&&(yield C)}n.filter=h;function*f(b,y){let C=0;for(const x of b)yield y(x,C++)}n.map=f;function*g(...b){for(const y of b)for(const C of y)yield C}n.concat=g;function m(b,y,C){let x=C;for(const E of b)x=y(x,E);return x}n.reduce=m;function*v(b,y,C=b.length){for(y<0&&(y+=b.length),C<0?C+=b.length:C>b.length&&(C=b.length);y<C;y++)yield b[y]}n.slice=v;function _(b,y=Number.POSITIVE_INFINITY){const C=[];if(y===0)return[C,b];const x=b[Symbol.iterator]();for(let E=0;E<y;E++){const k=x.next();if(k.done)return[C,n.empty()];C.push(k.value)}return[C,{[Symbol.iterator](){return x}}]}n.consume=_})(tr||(tr={}));let ll=class nle{constructor(e){this.element=e,this.next=nle.Undefined,this.prev=nle.Undefined}};ll.Undefined=new ll(void 0);class Id{constructor(){this._first=ll.Undefined,this._last=ll.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ll.Undefined}clear(){let e=this._first;for(;e!==ll.Undefined;){const t=e.next;e.prev=ll.Undefined,e.next=ll.Undefined,e=t}this._first=ll.Undefined,this._last=ll.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new ll(e);if(this._first===ll.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==ll.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ll.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ll.Undefined&&e.next!==ll.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ll.Undefined&&e.next===ll.Undefined?(this._first=ll.Undefined,this._last=ll.Undefined):e.next===ll.Undefined?(this._last=this._last.prev,this._last.next=ll.Undefined):e.prev===ll.Undefined&&(this._first=this._first.next,this._first.prev=ll.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ll.Undefined;)yield e.element,e=e.next}}const fXe="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function AZi(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of fXe)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const Xbe=AZi();function pXe(n){let e=Xbe;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const gXe=new Id;gXe.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function v3(n,e,t,i,r){if(r||(r=tr.first(gXe)),t.length>r.maxLen){let c=n-r.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+r.maxLen/2),v3(n,e,t,i,r)}const o=Date.now(),s=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=r.timeBudget);c++){const u=s-r.windowSize*c;e.lastIndex=Math.max(0,u);const d=NZi(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function NZi(n,e,t,i){let r;for(;r=n.exec(e);){const o=r.index||0;if(o<=t&&n.lastIndex>=t)return r;if(i>0&&o>i)return null}return null}const pC=8;class mXe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class _Xe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Vs{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return nG(e,t)}compute(e,t,i){return i}}class kM{constructor(e,t){this.newValue=e,this.didChange=t}}function nG(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new kM(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Ia(n,e);return new kM(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const r=nG(n[i],e[i]);r.didChange&&(n[i]=r.newValue,t=!0)}return new kM(n,t)}class _6{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return nG(e,t)}validate(e){return this.defaultValue}}class JN{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return nG(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function Bn(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class Cr extends JN{constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=i),super(e,t,i,r)}validate(e){return Bn(e,this.defaultValue)}}function ox(n,e,t,i){if(typeof n>"u")return e;let r=parseInt(n,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(i,r),r|0)}class qo extends JN{static clampedInt(e,t,i,r){return ox(e,t,i,r)}constructor(e,t,i,r,o,s=void 0){typeof s<"u"&&(s.type="integer",s.default=i,s.minimum=r,s.maximum=o),super(e,t,i,s),this.minimum=r,this.maximum=o}validate(e){return qo.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function RZi(n,e,t,i){if(typeof n>"u")return e;const r=_m.float(n,e);return _m.clamp(r,t,i)}class _m extends JN{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,r,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=r}validate(e){return this.validationFn(_m.float(e,this.defaultValue))}}class Rh extends JN{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="string",r.default=i),super(e,t,i,r)}validate(e){return Rh.string(e,this.defaultValue)}}function Ma(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class oa extends JN{constructor(e,t,i,r,o=void 0){typeof o<"u"&&(o.type="string",o.enum=r,o.default=i),super(e,t,i,o),this._allowedValues=r}validate(e){return Ma(e,this.defaultValue,this._allowedValues)}}class x9 extends Vs{constructor(e,t,i,r,o,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=r),super(e,t,i,a),this._allowedValues=o,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function OZi(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class PZi extends Vs{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[T("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),T("accessibilitySupport.on","Optimize for usage with a Screen Reader"),T("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:T("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class MZi extends Vs{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:T("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:T("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Bn(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Bn(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function FZi(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Cc;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(Cc||(Cc={}));function BZi(n){switch(n){case"line":return Cc.Line;case"block":return Cc.Block;case"underline":return Cc.Underline;case"line-thin":return Cc.LineThin;case"block-outline":return Cc.BlockOutline;case"underline-thin":return Cc.UnderlineThin}}class $Zi extends _6{constructor(){super(140)}compute(e,t,i){const r=["monaco-editor"];return t.get(39)&&r.push(t.get(39)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(73)==="default"?r.push("mouse-default"):t.get(73)==="copy"&&r.push("mouse-copy"),t.get(110)&&r.push("showUnused"),t.get(138)&&r.push("showDeprecated"),r.join(" ")}}class VZi extends Cr{constructor(){super(37,"emptySelectionClipboard",!0,{description:T("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class HZi extends Vs{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:T("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[T("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),T("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),T("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:T("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[T("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),T("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),T("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:T("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:T("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:mr},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:T("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:T("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Bn(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Ma(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Ma(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Bn(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Bn(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Bn(t.loop,this.defaultValue.loop)}}}class Tf extends Vs{constructor(){super(51,"fontLigatures",Tf.OFF,{anyOf:[{type:"boolean",description:T("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:T("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:T("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Tf.OFF:e==="true"?Tf.ON:e:e?Tf.ON:Tf.OFF}}Tf.OFF='"liga" off, "calt" off';Tf.ON='"liga" on, "calt" on';class q_ extends Vs{constructor(){super(54,"fontVariations",q_.OFF,{anyOf:[{type:"boolean",description:T("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:T("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:T("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?q_.OFF:e==="true"?q_.TRANSLATE:e:e?q_.TRANSLATE:q_.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}q_.OFF="normal";q_.TRANSLATE="translate";class WZi extends _6{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class zZi extends JN{constructor(){super(52,"fontSize",Uh.fontSize,{type:"number",minimum:6,maximum:100,default:Uh.fontSize,description:T("fontSize","Controls the font size in pixels.")})}validate(e){const t=_m.float(e,this.defaultValue);return t===0?Uh.fontSize:_m.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class mb extends Vs{constructor(){super(53,"fontWeight",Uh.fontWeight,{anyOf:[{type:"number",minimum:mb.MINIMUM_VALUE,maximum:mb.MAXIMUM_VALUE,errorMessage:T("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:mb.SUGGESTION_VALUES}],default:Uh.fontWeight,description:T("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(qo.clampedInt(e,Uh.fontWeight,mb.MINIMUM_VALUE,mb.MAXIMUM_VALUE))}}mb.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];mb.MINIMUM_VALUE=1;mb.MAXIMUM_VALUE=1e3;class UZi extends Vs{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[T("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),T("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),T("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:T("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:T("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:T("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:T("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:T("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:T("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:T("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:T("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:T("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:T("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:T("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,r,o,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Ma(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Ma(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Ma(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(r=a.multipleDeclarations)!==null&&r!==void 0?r:Ma(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Ma(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:Ma(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Rh.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Rh.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Rh.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Rh.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Rh.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class jZi extends Vs{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:T("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:T("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:T("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:T("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:T("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),delay:qo.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Bn(t.sticky,this.defaultValue.sticky),hidingDelay:qo.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Bn(t.above,this.defaultValue.above)}}}class YL extends _6{constructor(){super(143)}compute(e,t,i){return YL.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const o=(i+e.viewLineCount+r)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:r,desiredRatio:o,minimapLineCount:s}}static _computeMinimapLayout(e,t){const i=e.outerWidth,r=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,v=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,C=d?2:3;let x=Math.floor(o*r);const E=x/o;let k=!1,L=!1,D=C*h,A=h/o,O=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:W,extraLinesBeforeFirstLine:q,extraLinesBeyondLastLine:H,desiredRatio:ie,minimapLineCount:se}=YL.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:o});if(_/se>1)k=!0,L=!0,h=1,D=1,A=h/o;else{let Ee=!1,Fe=h+1;if(g==="fit"){const He=Math.ceil((q+_+H)*D);y&&a&&b<=t.stableFitRemainingWidth?(Ee=!0,Fe=t.stableFitMaxMinimapScale):Ee=He>x}if(g==="fill"||Ee){k=!0;const He=h;D=Math.min(l*o,Math.max(1,Math.floor(1/ie))),y&&a&&b<=t.stableFitRemainingWidth&&(Fe=t.stableFitMaxMinimapScale),h=Math.min(Fe,Math.max(1,Math.floor(D/C))),h>He&&(O=Math.min(2,h/He)),A=h/o/O,x=Math.ceil(Math.max(W,q+_+H)*D),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(f*A),F=Math.min(P,Math.max(0,Math.floor((b-v-2)*A/(c+A)))+pC);let B=Math.floor(o*F);const M=B/o;B=Math.floor(B*O);const V=d?1:2,U=m==="left"?0:i-F-v;return{renderMinimap:V,minimapLeft:U,minimapWidth:F,minimapHeightIsEditorHeight:k,minimapIsSampling:L,minimapScale:h,minimapLineHeight:D,minimapCanvasInnerWidth:B,minimapCanvasInnerHeight:x,minimapCanvasOuterWidth:M,minimapCanvasOuterHeight:E}}static computeLayout(e,t){const i=t.outerWidth|0,r=t.outerHeight|0,o=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(135),h=d==="inherit"?e.get(134):d,f=h==="inherit"?e.get(130):h,g=e.get(133),m=t.isDominatedByLongLines,v=e.get(57),_=e.get(67).renderType!==0,b=e.get(68),y=e.get(104),C=e.get(83),x=e.get(72),E=e.get(102),k=E.verticalScrollbarSize,L=E.verticalHasArrows,D=E.arrowSize,A=E.horizontalScrollbarSize,O=e.get(43),P=e.get(109)!=="never";let F=e.get(65);O&&P&&(F+=16);let B=0;if(_){const Me=Math.max(s,b);B=Math.round(Me*l)}let M=0;v&&(M=o*t.glyphMarginDecorationLaneCount);let V=0,U=V+M,W=U+B,q=W+F;const H=i-M-B-F;let ie=!1,se=!1,Q=-1;h==="inherit"&&m?(ie=!0,se=!0):f==="on"||f==="bounded"?se=!0:f==="wordWrapColumn"&&(Q=g);const Ee=YL._computeMinimapLayout({outerWidth:i,outerHeight:r,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:C.top,paddingBottom:C.bottom,minimap:x,verticalScrollbarWidth:k,viewLineCount:u,remainingWidth:H,isViewportWrapping:se},t.memory||new _Xe);Ee.renderMinimap!==0&&Ee.minimapLeft===0&&(V+=Ee.minimapWidth,U+=Ee.minimapWidth,W+=Ee.minimapWidth,q+=Ee.minimapWidth);const Fe=H-Ee.minimapWidth,He=Math.max(1,Math.floor((Fe-k-2)/a)),ke=L?D:0;return se&&(Q=Math.max(1,He),f==="bounded"&&(Q=Math.min(Q,g))),{width:i,height:r,glyphMarginLeft:V,glyphMarginWidth:M,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:U,lineNumbersWidth:B,decorationsLeft:W,decorationsWidth:F,contentLeft:q,contentWidth:Fe,minimap:Ee,viewportColumn:He,isWordWrapMinified:ie,isViewportWrapping:se,wrappingColumn:Q,verticalScrollbarWidth:k,horizontalScrollbarHeight:A,overviewRuler:{top:ke,width:k,height:r-2*ke,right:0}}}}class qZi extends Vs{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[T("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),T("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:T("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ma(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class KZi extends Vs{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:T("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Bn(e.enabled,this.defaultValue.enabled)}}}class GZi extends Vs{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:T("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:T("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:T("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:T("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),maxLineCount:qo.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Ma(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Bn(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class YZi extends Vs{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:T("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[T("editor.inlayHints.on","Inlay hints are enabled"),T("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",mr?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",mr?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:T("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:T("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:T("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ma(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:qo.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Rh.string(t.fontFamily,this.defaultValue.fontFamily),padding:Bn(t.padding,this.defaultValue.padding)}}}class QZi extends Vs{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):qo.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?qo.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class XZi extends _m{constructor(){super(66,"lineHeight",Uh.lineHeight,e=>_m.clamp(e,0,150),{markdownDescription:T("lineHeight",`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class ZZi extends Vs{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:T("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:T("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[T("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),T("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),T("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:T("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:T("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:T("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:T("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:T("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:T("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),autohide:Bn(t.autohide,this.defaultValue.autohide),size:Ma(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ma(t.side,this.defaultValue.side,["right","left"]),showSlider:Ma(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Bn(t.renderCharacters,this.defaultValue.renderCharacters),scale:qo.clampedInt(t.scale,1,1,3),maxColumn:qo.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function JZi(n){return n==="ctrlCmd"?mr?"metaKey":"ctrlKey":"altKey"}class eJi extends Vs{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:T("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:T("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:qo.clampedInt(t.top,0,0,1e3),bottom:qo.clampedInt(t.bottom,0,0,1e3)}}}class tJi extends Vs{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:T("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:T("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),cycle:Bn(t.cycle,this.defaultValue.cycle)}}}class nJi extends _6{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class iJi extends Vs{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[T("on","Quick suggestions show inside the suggest widget"),T("inline","Quick suggestions show as ghost text"),T("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:T("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:T("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:T("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:T("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:r}=e,o=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=Ma(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Ma(i,this.defaultValue.comments,o),typeof r=="boolean"?l=r?"on":"off":l=Ma(r,this.defaultValue.strings,o),{other:s,comments:a,strings:l}}}class rJi extends Vs{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[T("lineNumbers.off","Line numbers are not rendered."),T("lineNumbers.on","Line numbers are rendered as absolute number."),T("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),T("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:T("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function $W(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class oJi extends Vs{constructor(){const e=[],t={type:"number",description:T("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:T("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:T("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:qo.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const r=i;t.push({column:qo.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((i,r)=>i.column-r.column),t}return this.defaultValue}}class sJi extends Vs{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function lRe(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let aJi=class extends Vs{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[T("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),T("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),T("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:T("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[T("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),T("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),T("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:T("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:T("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:T("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:T("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=qo.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=qo.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:qo.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:lRe(t.vertical,this.defaultValue.vertical),horizontal:lRe(t.horizontal,this.defaultValue.horizontal),useShadows:Bn(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Bn(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Bn(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Bn(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Bn(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:qo.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:r,verticalSliderSize:qo.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:Bn(t.scrollByPage,this.defaultValue.scrollByPage)}}};const vf="inUntrustedWorkspace",ih={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class lJi extends Vs{constructor(){const e={nonBasicASCII:vf,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:vf,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[ih.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,vf],default:e.nonBasicASCII,description:T("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[ih.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:T("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[ih.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:T("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[ih.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,vf],default:e.includeComments,description:T("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[ih.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,vf],default:e.includeStrings,description:T("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[ih.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:T("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[ih.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:T("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(jf(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(jf(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const r=super.applyUpdate(e,t);return i?new kM(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:QL(t.nonBasicASCII,vf,[!0,!1,vf]),invisibleCharacters:Bn(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Bn(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:QL(t.includeComments,vf,[!0,!1,vf]),includeStrings:QL(t.includeStrings,vf,[!0,!1,vf]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[r,o]of Object.entries(e))o===!0&&(i[r]=!0);return i}}class cJi extends Vs{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:T("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[T("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),T("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:T("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:T("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),mode:Ma(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Ma(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:Bn(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Bn(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class uJi extends Vs{constructor(){const e={enabled:gu.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:gu.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:T("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Bn(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class dJi extends Vs{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[T("editor.guides.bracketPairs.true","Enables bracket pair guides."),T("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),T("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:T("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[T("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),T("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),T("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:T("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:T("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:T("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[T("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),T("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),T("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:T("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:QL(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:QL(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Bn(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Bn(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:QL(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function QL(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class hJi extends Vs{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[T("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),T("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:T("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:T("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:T("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:T("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[T("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),T("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),T("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),T("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:T("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:T("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:T("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:T("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:T("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:T("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:T("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:T("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Ma(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Bn(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Bn(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Bn(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Bn(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Ma(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Bn(t.showIcons,this.defaultValue.showIcons),showStatusBar:Bn(t.showStatusBar,this.defaultValue.showStatusBar),preview:Bn(t.preview,this.defaultValue.preview),previewMode:Ma(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Bn(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Bn(t.showMethods,this.defaultValue.showMethods),showFunctions:Bn(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Bn(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Bn(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Bn(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Bn(t.showFields,this.defaultValue.showFields),showVariables:Bn(t.showVariables,this.defaultValue.showVariables),showClasses:Bn(t.showClasses,this.defaultValue.showClasses),showStructs:Bn(t.showStructs,this.defaultValue.showStructs),showInterfaces:Bn(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Bn(t.showModules,this.defaultValue.showModules),showProperties:Bn(t.showProperties,this.defaultValue.showProperties),showEvents:Bn(t.showEvents,this.defaultValue.showEvents),showOperators:Bn(t.showOperators,this.defaultValue.showOperators),showUnits:Bn(t.showUnits,this.defaultValue.showUnits),showValues:Bn(t.showValues,this.defaultValue.showValues),showConstants:Bn(t.showConstants,this.defaultValue.showConstants),showEnums:Bn(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Bn(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Bn(t.showKeywords,this.defaultValue.showKeywords),showWords:Bn(t.showWords,this.defaultValue.showWords),showColors:Bn(t.showColors,this.defaultValue.showColors),showFiles:Bn(t.showFiles,this.defaultValue.showFiles),showReferences:Bn(t.showReferences,this.defaultValue.showReferences),showFolders:Bn(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Bn(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Bn(t.showSnippets,this.defaultValue.showSnippets),showUsers:Bn(t.showUsers,this.defaultValue.showUsers),showIssues:Bn(t.showIssues,this.defaultValue.showIssues)}}}class fJi extends Vs{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:T("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:T("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:Bn(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Bn(e.selectSubwords,this.defaultValue.selectSubwords)}}}class pJi extends Vs{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[T("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),T("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),T("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),T("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:T("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class gJi extends _6{constructor(){super(144)}compute(e,t,i){const r=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}}class mJi extends Vs{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:T("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[T("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),T("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),showDropSelector:Ma(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class _Ji extends Vs{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:T("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[T("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),T("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Bn(t.enabled,this.defaultValue.enabled),showPasteSelector:Ma(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const vJi="Consolas, 'Courier New', monospace",bJi="Menlo, Monaco, 'Courier New', monospace",yJi="'Droid Sans Mono', 'monospace', monospace",Uh={fontFamily:mr?bJi:Zu?yJi:vJi,fontWeight:"normal",fontSize:mr?12:14,lineHeight:0,letterSpacing:0},iL=[];function It(n){return iL[n.id]=n,n}const Lv={acceptSuggestionOnCommitCharacter:It(new Cr(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:T("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:It(new oa(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",T("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:T("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:It(new PZi),accessibilityPageSize:It(new qo(3,"accessibilityPageSize",10,1,1073741824,{description:T("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:It(new Rh(4,"ariaLabel",T("editorViewAccessibleLabel","Editor content"))),ariaRequired:It(new Cr(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:It(new Cr(8,"screenReaderAnnounceInlineSuggestion",!0,{description:T("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:It(new oa(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),T("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:T("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:It(new oa(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),T("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:T("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:It(new oa(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",T("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:T("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:It(new oa(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",T("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:T("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:It(new oa(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),T("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:T("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:It(new x9(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],OZi,{enumDescriptions:[T("editor.autoIndent.none","The editor will not insert indentation automatically."),T("editor.autoIndent.keep","The editor will keep the current line's indentation."),T("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),T("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),T("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:T("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:It(new Cr(13,"automaticLayout",!1)),autoSurround:It(new oa(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[T("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),T("editor.autoSurround.quotes","Surround with quotes but not brackets."),T("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:T("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:It(new uJi),bracketPairGuides:It(new dJi),stickyTabStops:It(new Cr(115,"stickyTabStops",!1,{description:T("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:It(new Cr(17,"codeLens",!0,{description:T("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:It(new Rh(18,"codeLensFontFamily","",{description:T("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:It(new qo(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:T("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:It(new Cr(20,"colorDecorators",!0,{description:T("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:It(new oa(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[T("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),T("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),T("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:T("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:It(new qo(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:T("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:It(new Cr(22,"columnSelection",!1,{description:T("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:It(new MZi),contextmenu:It(new Cr(24,"contextmenu",!0)),copyWithSyntaxHighlighting:It(new Cr(25,"copyWithSyntaxHighlighting",!0,{description:T("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:It(new x9(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],FZi,{description:T("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:It(new oa(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[T("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),T("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),T("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:T("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:It(new x9(28,"cursorStyle",Cc.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],BZi,{description:T("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:It(new qo(29,"cursorSurroundingLines",0,0,1073741824,{description:T("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:It(new oa(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[T("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),T("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:T("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:It(new qo(31,"cursorWidth",0,0,1073741824,{markdownDescription:T("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:It(new Cr(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:It(new Cr(33,"disableMonospaceOptimizations",!1)),domReadOnly:It(new Cr(34,"domReadOnly",!1)),dragAndDrop:It(new Cr(35,"dragAndDrop",!0,{description:T("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:It(new VZi),dropIntoEditor:It(new mJi),stickyScroll:It(new GZi),experimentalWhitespaceRendering:It(new oa(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[T("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),T("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),T("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:T("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:It(new Rh(39,"extraEditorClassName","")),fastScrollSensitivity:It(new _m(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:T("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:It(new HZi),fixedOverflowWidgets:It(new Cr(42,"fixedOverflowWidgets",!1)),folding:It(new Cr(43,"folding",!0,{description:T("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:It(new oa(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[T("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),T("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:T("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:It(new Cr(45,"foldingHighlight",!0,{description:T("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:It(new Cr(46,"foldingImportsByDefault",!1,{description:T("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:It(new qo(47,"foldingMaximumRegions",5e3,10,65e3,{description:T("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:It(new Cr(48,"unfoldOnClickAfterEndOfLine",!1,{description:T("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:It(new Rh(49,"fontFamily",Uh.fontFamily,{description:T("fontFamily","Controls the font family.")})),fontInfo:It(new WZi),fontLigatures2:It(new Tf),fontSize:It(new zZi),fontWeight:It(new mb),fontVariations:It(new q_),formatOnPaste:It(new Cr(55,"formatOnPaste",!1,{description:T("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:It(new Cr(56,"formatOnType",!1,{description:T("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:It(new Cr(57,"glyphMargin",!0,{description:T("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:It(new UZi),hideCursorInOverviewRuler:It(new Cr(59,"hideCursorInOverviewRuler",!1,{description:T("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:It(new jZi),inDiffEditor:It(new Cr(61,"inDiffEditor",!1)),letterSpacing:It(new _m(63,"letterSpacing",Uh.letterSpacing,n=>_m.clamp(n,-5,20),{description:T("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:It(new KZi),lineDecorationsWidth:It(new QZi),lineHeight:It(new XZi),lineNumbers:It(new rJi),lineNumbersMinChars:It(new qo(68,"lineNumbersMinChars",5,1,300)),linkedEditing:It(new Cr(69,"linkedEditing",!1,{description:T("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:It(new Cr(70,"links",!0,{description:T("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:It(new oa(71,"matchBrackets","always",["always","near","never"],{description:T("matchBrackets","Highlight matching brackets.")})),minimap:It(new ZZi),mouseStyle:It(new oa(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:It(new _m(74,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:T("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:It(new Cr(75,"mouseWheelZoom",!1,{markdownDescription:T("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:It(new Cr(76,"multiCursorMergeOverlapping",!0,{description:T("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:It(new x9(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],JZi,{markdownEnumDescriptions:[T("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),T("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:T({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:It(new oa(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[T("multiCursorPaste.spread","Each cursor pastes a single line of the text."),T("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:T("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:It(new qo(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:T("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:It(new Cr(80,"occurrencesHighlight",!0,{description:T("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:It(new Cr(81,"overviewRulerBorder",!0,{description:T("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:It(new qo(82,"overviewRulerLanes",3,0,3)),padding:It(new eJi),pasteAs:It(new _Ji),parameterHints:It(new tJi),peekWidgetDefaultFocus:It(new oa(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[T("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),T("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:T("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:It(new Cr(87,"definitionLinkOpensInPeek",!1,{description:T("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:It(new iJi),quickSuggestionsDelay:It(new qo(89,"quickSuggestionsDelay",10,0,1073741824,{description:T("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:It(new Cr(90,"readOnly",!1)),readOnlyMessage:It(new sJi),renameOnType:It(new Cr(92,"renameOnType",!1,{description:T("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:T("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:It(new Cr(93,"renderControlCharacters",!0,{description:T("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:It(new oa(94,"renderFinalNewline",Zu?"dimmed":"on",["off","on","dimmed"],{description:T("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:It(new oa(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",T("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:T("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:It(new Cr(96,"renderLineHighlightOnlyWhenFocus",!1,{description:T("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:It(new oa(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:It(new oa(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",T("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),T("renderWhitespace.selection","Render whitespace characters only on selected text."),T("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:T("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:It(new qo(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:It(new Cr(100,"roundedSelection",!0,{description:T("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:It(new oJi),scrollbar:It(new aJi),scrollBeyondLastColumn:It(new qo(103,"scrollBeyondLastColumn",4,0,1073741824,{description:T("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:It(new Cr(104,"scrollBeyondLastLine",!0,{description:T("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:It(new Cr(105,"scrollPredominantAxis",!0,{description:T("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:It(new Cr(106,"selectionClipboard",!0,{description:T("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Zu})),selectionHighlight:It(new Cr(107,"selectionHighlight",!0,{description:T("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:It(new Cr(108,"selectOnLineNumbers",!0)),showFoldingControls:It(new oa(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[T("showFoldingControls.always","Always show the folding controls."),T("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),T("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:T("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:It(new Cr(110,"showUnused",!0,{description:T("showUnused","Controls fading out of unused code.")})),showDeprecated:It(new Cr(138,"showDeprecated",!0,{description:T("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:It(new YZi),snippetSuggestions:It(new oa(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[T("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),T("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),T("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),T("snippetSuggestions.none","Do not show snippet suggestions.")],description:T("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:It(new fJi),smoothScrolling:It(new Cr(113,"smoothScrolling",!1,{description:T("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:It(new qo(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:It(new hJi),inlineSuggest:It(new cJi),inlineCompletionsAccessibilityVerbose:It(new Cr(147,"inlineCompletionsAccessibilityVerbose",!1,{description:T("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:It(new qo(118,"suggestFontSize",0,0,1e3,{markdownDescription:T("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:It(new qo(119,"suggestLineHeight",0,0,1e3,{markdownDescription:T("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:It(new Cr(120,"suggestOnTriggerCharacters",!0,{description:T("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:It(new oa(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[T("suggestSelection.first","Always select the first suggestion."),T("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),T("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:T("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:It(new oa(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[T("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),T("tabCompletion.off","Disable tab completions."),T("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:T("tabCompletion","Enables tab completions.")})),tabIndex:It(new qo(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:It(new lJi),unusualLineTerminators:It(new oa(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[T("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),T("unusualLineTerminators.off","Unusual line terminators are ignored."),T("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:T("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:It(new Cr(126,"useShadowDOM",!0)),useTabStops:It(new Cr(127,"useTabStops",!0,{description:T("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:It(new oa(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[T("wordBreak.normal","Use the default line break rule."),T("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:T("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:It(new Rh(129,"wordSeparators",fXe,{description:T("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:It(new oa(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[T("wordWrap.off","Lines will never wrap."),T("wordWrap.on","Lines will wrap at the viewport width."),T({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),T({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:T({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:It(new Rh(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:It(new Rh(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:It(new qo(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:T({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:It(new oa(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:It(new oa(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:It(new $Zi),defaultColorDecorators:It(new Cr(145,"defaultColorDecorators",!1,{markdownDescription:T("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:It(new nJi),tabFocusMode:It(new Cr(142,"tabFocusMode",!1,{markdownDescription:T("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:It(new YL),wrappingInfo:It(new gJi),wrappingIndent:It(new pJi),wrappingStrategy:It(new qZi)};class CJi{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?yA.isErrorNoTelemetry(e)?new yA(e.message+` `+e.stack):new Error(e.message+` `+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const vXe=new CJi;function Oi(n){Dv(n)||vXe.onUnexpectedError(n)}function tl(n){Dv(n)||vXe.onUnexpectedExternalError(n)}function cRe(n){if(n instanceof Error){const{name:e,message:t}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:yA.isErrorNoTelemetry(n)}}return n}const VW="Canceled";function Dv(n){return n instanceof cE?!0:n instanceof Error&&n.name===VW&&n.message===VW}class cE extends Error{constructor(){super(VW),this.name=this.message}}function wJi(){const n=new Error(VW);return n.name=n.message,n}function ag(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function Zbe(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class SJi extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class yA extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof yA)return e;const t=new yA;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Qa extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Qa.prototype)}}function gS(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function Jbe(n){return typeof n.dispose=="function"&&n.dispose.length===0}function mo(n){if(tr.is(n)){const e=[];for(const t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function km(...n){return mi(()=>mo(n))}function mi(n){return{dispose:gS(()=>{n()})}}class mt{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{mo(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?mt.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}mt.DISABLE_DISPOSED_WARNING=!1;class Ue{constructor(){this._store=new mt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}Ue.None=Object.freeze({dispose(){}});class Nc{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class EJi{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class xJi{constructor(e){this.object=e}dispose(){}}class e0e{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{mo(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var r;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(r=this._store.get(e))===null||r===void 0||r.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const TJi=globalThis.performance&&typeof globalThis.performance.now=="function";class Eu{static create(e){return new Eu(e)}constructor(e){this._now=TJi&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var nn;(function(n){n.None=()=>Ue.None;function e(P,F){return d(P,()=>{},0,void 0,!0,void 0,F)}n.defer=e;function t(P){return(F,B=null,M)=>{let V=!1,U;return U=P(W=>{if(!V)return U?U.dispose():V=!0,F.call(B,W)},null,M),V&&U.dispose(),U}}n.once=t;function i(P,F,B){return c((M,V=null,U)=>P(W=>M.call(V,F(W)),null,U),B)}n.map=i;function r(P,F,B){return c((M,V=null,U)=>P(W=>{F(W),M.call(V,W)},null,U),B)}n.forEach=r;function o(P,F,B){return c((M,V=null,U)=>P(W=>F(W)&&M.call(V,W),null,U),B)}n.filter=o;function s(P){return P}n.signal=s;function a(...P){return(F,B=null,M)=>{const V=km(...P.map(U=>U(W=>F.call(B,W))));return u(V,M)}}n.any=a;function l(P,F,B,M){let V=B;return i(P,U=>(V=F(V,U),V),M)}n.reduce=l;function c(P,F){let B;const M={onWillAddFirstListener(){B=P(V.fire,V)},onDidRemoveLastListener(){B==null||B.dispose()}},V=new Le(M);return F==null||F.add(V),V.event}function u(P,F){return F instanceof Array?F.push(P):F&&F.add(P),P}function d(P,F,B=100,M=!1,V=!1,U,W){let q,H,ie,se=0,Q;const Ee={leakWarningThreshold:U,onWillAddFirstListener(){q=P(He=>{se++,H=F(H,He),M&&!ie&&(Fe.fire(H),H=void 0),Q=()=>{const ke=H;H=void 0,ie=void 0,(!M||se>1)&&Fe.fire(ke),se=0},typeof B=="number"?(clearTimeout(ie),ie=setTimeout(Q,B)):ie===void 0&&(ie=0,queueMicrotask(Q))})},onWillRemoveListener(){V&&se>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,q.dispose()}},Fe=new Le(Ee);return W==null||W.add(Fe),Fe.event}n.debounce=d;function h(P,F=0,B){return n.debounce(P,(M,V)=>M?(M.push(V),M):[V],F,void 0,!0,void 0,B)}n.accumulate=h;function f(P,F=(M,V)=>M===V,B){let M=!0,V;return o(P,U=>{const W=M||!F(U,V);return M=!1,V=U,W},B)}n.latch=f;function g(P,F,B){return[n.filter(P,F,B),n.filter(P,M=>!F(M),B)]}n.split=g;function m(P,F=!1,B=[],M){let V=B.slice(),U=P(H=>{V?V.push(H):q.fire(H)});M&&M.add(U);const W=()=>{V==null||V.forEach(H=>q.fire(H)),V=null},q=new Le({onWillAddFirstListener(){U||(U=P(H=>q.fire(H)),M&&M.add(U))},onDidAddFirstListener(){V&&(F?setTimeout(W):W())},onDidRemoveLastListener(){U&&U.dispose(),U=null}});return M&&M.add(q),q.event}n.buffer=m;function v(P,F){return(M,V,U)=>{const W=F(new b);return P(function(q){const H=W.evaluate(q);H!==_&&M.call(V,H)},void 0,U)}}n.chain=v;const _=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(B=>(F(B),B)),this}filter(F){return this.steps.push(B=>F(B)?B:_),this}reduce(F,B){let M=B;return this.steps.push(V=>(M=F(M,V),M)),this}latch(F=(B,M)=>B===M){let B=!0,M;return this.steps.push(V=>{const U=B||!F(V,M);return B=!1,M=V,U?V:_}),this}evaluate(F){for(const B of this.steps)if(F=B(F),F===_)break;return F}}function y(P,F,B=M=>M){const M=(...q)=>W.fire(B(...q)),V=()=>P.on(F,M),U=()=>P.removeListener(F,M),W=new Le({onWillAddFirstListener:V,onDidRemoveLastListener:U});return W.event}n.fromNodeEventEmitter=y;function C(P,F,B=M=>M){const M=(...q)=>W.fire(B(...q)),V=()=>P.addEventListener(F,M),U=()=>P.removeEventListener(F,M),W=new Le({onWillAddFirstListener:V,onDidRemoveLastListener:U});return W.event}n.fromDOMEventEmitter=C;function x(P){return new Promise(F=>t(P)(F))}n.toPromise=x;function E(P){const F=new Le;return P.then(B=>{F.fire(B)},()=>{F.fire(void 0)}).finally(()=>{F.dispose()}),F.event}n.fromPromise=E;function k(P,F){return F(void 0),P(B=>F(B))}n.runAndSubscribe=k;function L(P,F){let B=null;function M(U){B==null||B.dispose(),B=new mt,F(U,B)}M(void 0);const V=P(U=>M(U));return mi(()=>{V.dispose(),B==null||B.dispose()})}n.runAndSubscribeWithStore=L;class D{constructor(F,B){this._observable=F,this._counter=0,this._hasChanged=!1;const M={onWillAddFirstListener:()=>{F.addObserver(this)},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new Le(M),B&&B.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,B){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function A(P,F){return new D(P,F).emitter.event}n.fromObservable=A;function O(P){return F=>{let B=0,M=!1;const V={beginUpdate(){B++},endUpdate(){B--,B===0&&(P.reportChanges(),M&&(M=!1,F()))},handlePossibleChange(){},handleChange(){M=!0}};return P.addObserver(V),P.reportChanges(),{dispose(){P.removeObserver(V)}}}}n.fromObservableLight=O})(nn||(nn={}));class CA{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${CA._idPool++}`,CA.all.add(this)}start(e){this._stopWatch=new Eu,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}CA.all=new Set;CA._idPool=0;let kJi=-1;class IJi{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let o,s=0;for(const[a,l]of this._stacks)(!o||s<l)&&(o=a,s=l);console.warn(`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${s}):`),console.warn(o)}return()=>{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class t0e{static create(){var e;return new t0e((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` `))}}class Nee{constructor(e){this.value=e}}const LJi=2;let Le=class{constructor(e){var t,i,r,o,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new IJi((r=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&r!==void 0?r:kJi):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new CA(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,i,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(r=this._leakageMon)===null||r===void 0||r.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,r)=>{var o,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),Ue.None;if(this._disposed)return Ue.None;i&&(t=t.bind(i));const u=new Nee(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=t0e.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof Nee?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new bXe),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||s===void 0||s.call(o,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=mi(()=>{d==null||d(),this._removeListener(u)});return r instanceof mt?r.add(h):Array.isArray(r)&&r.push(h),h}),this._event}_removeListener(e){var t,i,r,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(r=this._options)===null||r===void 0?void 0:r.onDidRemoveLastListener)===null||o===void 0||o.call(r,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*LJi<=s.length){let c=0;for(let u=0;u<s.length;u++)s[u]?s[c++]=s[u]:l&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);s.length=c}}_deliver(e,t){var i;if(!e)return;const r=((i=this._options)===null||i===void 0?void 0:i.onListenerError)||Oi;if(!r){e.value(t);return}try{e.value(t)}catch(o){r(o)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,r,o;if(!((t=this._deliveryQueue)===null||t===void 0)&&t.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)===null||i===void 0||i.stop()),(r=this._perfMon)===null||r===void 0||r.start(this._size),this._listeners)if(this._listeners instanceof Nee)this._deliver(this._listeners,e);else{const s=this._deliveryQueue;s.enqueue(this,e,this._listeners.length),this._deliverQueue(s)}(o=this._perfMon)===null||o===void 0||o.stop()}hasListeners(){return this._size>0}};const DJi=()=>new bXe;class bXe{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class KT extends Le{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Id,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class yXe extends KT{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class AJi extends Le{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class NJi{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Le({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),mi(gS(()=>{this.hasListeners&&this.unhook(t);const r=this.events.indexOf(t);this.events.splice(r,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class n0e{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,r)=>e(o=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(i,o)):t.call(i,o)},void 0,r)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(r=>r()),i}}class uRe{constructor(){this.listening=!1,this.inputEvent=nn.None,this.inputEventListener=Ue.None,this.emitter=new Le({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const CXe=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var nr;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof $$?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:nn.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:CXe})})(nr||(nr={}));class $${constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?CXe:(this._emitter||(this._emitter=new Le),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Va=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new $$),this._token}cancel(){this._token?this._token instanceof $$&&this._token.cancel():this._token=nr.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof $$&&this._token.dispose():this._token=nr.None}};class i0e{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const V$=new i0e,ile=new i0e,rle=new i0e,wXe=new Array(230),RJi=Object.create(null),OJi=Object.create(null),r0e=[];for(let n=0;n<=193;n++)r0e[n]=-1;(function(){const n="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[1,1,"Hyper",0,n,0,n,n,n],[1,2,"Super",0,n,0,n,n,n],[1,3,"Fn",0,n,0,n,n,n],[1,4,"FnLock",0,n,0,n,n,n],[1,5,"Suspend",0,n,0,n,n,n],[1,6,"Resume",0,n,0,n,n,n],[1,7,"Turbo",0,n,0,n,n,n],[1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[1,9,"WakeUp",0,n,0,n,n,n],[0,10,"KeyA",31,"A",65,"VK_A",n,n],[0,11,"KeyB",32,"B",66,"VK_B",n,n],[0,12,"KeyC",33,"C",67,"VK_C",n,n],[0,13,"KeyD",34,"D",68,"VK_D",n,n],[0,14,"KeyE",35,"E",69,"VK_E",n,n],[0,15,"KeyF",36,"F",70,"VK_F",n,n],[0,16,"KeyG",37,"G",71,"VK_G",n,n],[0,17,"KeyH",38,"H",72,"VK_H",n,n],[0,18,"KeyI",39,"I",73,"VK_I",n,n],[0,19,"KeyJ",40,"J",74,"VK_J",n,n],[0,20,"KeyK",41,"K",75,"VK_K",n,n],[0,21,"KeyL",42,"L",76,"VK_L",n,n],[0,22,"KeyM",43,"M",77,"VK_M",n,n],[0,23,"KeyN",44,"N",78,"VK_N",n,n],[0,24,"KeyO",45,"O",79,"VK_O",n,n],[0,25,"KeyP",46,"P",80,"VK_P",n,n],[0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[0,27,"KeyR",48,"R",82,"VK_R",n,n],[0,28,"KeyS",49,"S",83,"VK_S",n,n],[0,29,"KeyT",50,"T",84,"VK_T",n,n],[0,30,"KeyU",51,"U",85,"VK_U",n,n],[0,31,"KeyV",52,"V",86,"VK_V",n,n],[0,32,"KeyW",53,"W",87,"VK_W",n,n],[0,33,"KeyX",54,"X",88,"VK_X",n,n],[0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[0,36,"Digit1",22,"1",49,"VK_1",n,n],[0,37,"Digit2",23,"2",50,"VK_2",n,n],[0,38,"Digit3",24,"3",51,"VK_3",n,n],[0,39,"Digit4",25,"4",52,"VK_4",n,n],[0,40,"Digit5",26,"5",53,"VK_5",n,n],[0,41,"Digit6",27,"6",54,"VK_6",n,n],[0,42,"Digit7",28,"7",55,"VK_7",n,n],[0,43,"Digit8",29,"8",56,"VK_8",n,n],[0,44,"Digit9",30,"9",57,"VK_9",n,n],[0,45,"Digit0",21,"0",48,"VK_0",n,n],[1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,n,0,n,n,n],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[1,64,"F1",59,"F1",112,"VK_F1",n,n],[1,65,"F2",60,"F2",113,"VK_F2",n,n],[1,66,"F3",61,"F3",114,"VK_F3",n,n],[1,67,"F4",62,"F4",115,"VK_F4",n,n],[1,68,"F5",63,"F5",116,"VK_F5",n,n],[1,69,"F6",64,"F6",117,"VK_F6",n,n],[1,70,"F7",65,"F7",118,"VK_F7",n,n],[1,71,"F8",66,"F8",119,"VK_F8",n,n],[1,72,"F9",67,"F9",120,"VK_F9",n,n],[1,73,"F10",68,"F10",121,"VK_F10",n,n],[1,74,"F11",69,"F11",122,"VK_F11",n,n],[1,75,"F12",70,"F12",123,"VK_F12",n,n],[1,76,"PrintScreen",0,n,0,n,n,n],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",n,n],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[1,80,"Home",14,"Home",36,"VK_HOME",n,n],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[1,83,"End",13,"End",35,"VK_END",n,n],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",n,n],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",n,n],[1,94,"NumpadEnter",3,n,0,n,n,n],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",n,n],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",n,n],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",n,n],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",n,n],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",n,n],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",n,n],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",n,n],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",n,n],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",n,n],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",n,n],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",n,n],[1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[1,108,"Power",0,n,0,n,n,n],[1,109,"NumpadEqual",0,n,0,n,n,n],[1,110,"F13",71,"F13",124,"VK_F13",n,n],[1,111,"F14",72,"F14",125,"VK_F14",n,n],[1,112,"F15",73,"F15",126,"VK_F15",n,n],[1,113,"F16",74,"F16",127,"VK_F16",n,n],[1,114,"F17",75,"F17",128,"VK_F17",n,n],[1,115,"F18",76,"F18",129,"VK_F18",n,n],[1,116,"F19",77,"F19",130,"VK_F19",n,n],[1,117,"F20",78,"F20",131,"VK_F20",n,n],[1,118,"F21",79,"F21",132,"VK_F21",n,n],[1,119,"F22",80,"F22",133,"VK_F22",n,n],[1,120,"F23",81,"F23",134,"VK_F23",n,n],[1,121,"F24",82,"F24",135,"VK_F24",n,n],[1,122,"Open",0,n,0,n,n,n],[1,123,"Help",0,n,0,n,n,n],[1,124,"Select",0,n,0,n,n,n],[1,125,"Again",0,n,0,n,n,n],[1,126,"Undo",0,n,0,n,n,n],[1,127,"Cut",0,n,0,n,n,n],[1,128,"Copy",0,n,0,n,n,n],[1,129,"Paste",0,n,0,n,n,n],[1,130,"Find",0,n,0,n,n,n],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,136,"KanaMode",0,n,0,n,n,n],[0,137,"IntlYen",0,n,0,n,n,n],[1,138,"Convert",0,n,0,n,n,n],[1,139,"NonConvert",0,n,0,n,n,n],[1,140,"Lang1",0,n,0,n,n,n],[1,141,"Lang2",0,n,0,n,n,n],[1,142,"Lang3",0,n,0,n,n,n],[1,143,"Lang4",0,n,0,n,n,n],[1,144,"Lang5",0,n,0,n,n,n],[1,145,"Abort",0,n,0,n,n,n],[1,146,"Props",0,n,0,n,n,n],[1,147,"NumpadParenLeft",0,n,0,n,n,n],[1,148,"NumpadParenRight",0,n,0,n,n,n],[1,149,"NumpadBackspace",0,n,0,n,n,n],[1,150,"NumpadMemoryStore",0,n,0,n,n,n],[1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[1,152,"NumpadMemoryClear",0,n,0,n,n,n],[1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",n,n],[1,156,"NumpadClearEntry",0,n,0,n,n,n],[1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[1,0,n,6,"Alt",18,"VK_MENU",n,n],[1,0,n,57,"Meta",91,"VK_COMMAND",n,n],[1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[1,165,"BrightnessUp",0,n,0,n,n,n],[1,166,"BrightnessDown",0,n,0,n,n,n],[1,167,"MediaPlay",0,n,0,n,n,n],[1,168,"MediaRecord",0,n,0,n,n,n],[1,169,"MediaFastForward",0,n,0,n,n,n],[1,170,"MediaRewind",0,n,0,n,n,n],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,174,"Eject",0,n,0,n,n,n],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,180,"SelectTask",0,n,0,n,n,n],[1,181,"LaunchScreenSaver",0,n,0,n,n,n],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[1,189,"ZoomToggle",0,n,0,n,n,n],[1,190,"MailReply",0,n,0,n,n,n],[1,191,"MailForward",0,n,0,n,n,n],[1,192,"MailSend",0,n,0,n,n,n],[1,0,n,114,"KeyInComposition",229,n,n,n],[1,0,n,116,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,0,n,96,"OEM_8",223,"VK_OEM_8",n,n],[1,0,n,0,n,0,"VK_KANA",n,n],[1,0,n,0,n,0,"VK_HANGUL",n,n],[1,0,n,0,n,0,"VK_JUNJA",n,n],[1,0,n,0,n,0,"VK_FINAL",n,n],[1,0,n,0,n,0,"VK_HANJA",n,n],[1,0,n,0,n,0,"VK_KANJI",n,n],[1,0,n,0,n,0,"VK_CONVERT",n,n],[1,0,n,0,n,0,"VK_NONCONVERT",n,n],[1,0,n,0,n,0,"VK_ACCEPT",n,n],[1,0,n,0,n,0,"VK_MODECHANGE",n,n],[1,0,n,0,n,0,"VK_SELECT",n,n],[1,0,n,0,n,0,"VK_PRINT",n,n],[1,0,n,0,n,0,"VK_EXECUTE",n,n],[1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[1,0,n,0,n,0,"VK_HELP",n,n],[1,0,n,0,n,0,"VK_APPS",n,n],[1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[1,0,n,0,n,0,"VK_PACKET",n,n],[1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[1,0,n,0,n,0,"VK_ATTN",n,n],[1,0,n,0,n,0,"VK_CRSEL",n,n],[1,0,n,0,n,0,"VK_EXSEL",n,n],[1,0,n,0,n,0,"VK_EREOF",n,n],[1,0,n,0,n,0,"VK_PLAY",n,n],[1,0,n,0,n,0,"VK_ZOOM",n,n],[1,0,n,0,n,0,"VK_NONAME",n,n],[1,0,n,0,n,0,"VK_PA1",n,n],[1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const r of e){const[o,s,a,l,c,u,d,h,f]=r;if(i[s]||(i[s]=!0,RJi[a]=s,OJi[a.toLowerCase()]=s,o&&(r0e[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);V$.define(l,c),ile.define(l,h||c),rle.define(l,f||h||c)}u&&(wXe[u]=l)}})();var Sy;(function(n){function e(a){return V$.keyCodeToStr(a)}n.toString=e;function t(a){return V$.strToKeyCode(a)}n.fromString=t;function i(a){return ile.keyCodeToStr(a)}n.toUserSettingsUS=i;function r(a){return rle.keyCodeToStr(a)}n.toUserSettingsGeneral=r;function o(a){return ile.strToKeyCode(a)||rle.strToKeyCode(a)}n.fromUserSettings=o;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return V$.keyCodeToStr(a)}n.toElectronAccelerator=s})(Sy||(Sy={}));function ml(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}let XL;if(typeof Tm.vscode<"u"&&typeof Tm.vscode.process<"u"){const n=Tm.vscode.process;XL={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?XL={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:XL={get platform(){return eu?"win32":mr?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const HW=XL.cwd,SXe=XL.env,PJi=XL.platform,MJi=65,FJi=97,BJi=90,$Ji=122,Ow=46,Ru=47,_f=92,iC=58,VJi=63;class EXe extends Error{constructor(e,t,i){let r;typeof t=="string"&&t.indexOf("not ")===0?(r="must not be",t=t.replace(/^not /,"")):r="must be";const o=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${o} ${r} of type ${t}`;s+=`. Received type ${typeof i}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function HJi(n,e){if(n===null||typeof n!="object")throw new EXe(e,"Object",n)}function Yl(n,e){if(typeof n!="string")throw new EXe(e,"string",n)}const uE=PJi==="win32";function Co(n){return n===Ru||n===_f}function ole(n){return n===Ru}function rC(n){return n>=MJi&&n<=BJi||n>=FJi&&n<=$Ji}function WW(n,e,t,i){let r="",o=0,s=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c<n.length)l=n.charCodeAt(c);else{if(i(l))break;l=Ru}if(i(l)){if(!(s===c-1||a===1))if(a===2){if(r.length<2||o!==2||r.charCodeAt(r.length-1)!==Ow||r.charCodeAt(r.length-2)!==Ow){if(r.length>2){const u=r.lastIndexOf(t);u===-1?(r="",o=0):(r=r.slice(0,u),o=r.length-1-r.lastIndexOf(t)),s=c,a=0;continue}else if(r.length!==0){r="",o=0,s=c,a=0;continue}}e&&(r+=r.length>0?`${t}..`:"..",o=2)}else r.length>0?r+=`${t}${n.slice(s+1,c)}`:r=n.slice(s+1,c),o=c-s-1;s=c,a=0}else l===Ow&&a!==-1?++a:a=-1}return r}function xXe(n,e){HJi(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const $h={resolve(...n){let e="",t="",i=!1;for(let r=n.length-1;r>=-1;r--){let o;if(r>=0){if(o=n[r],Yl(o,"path"),o.length===0)continue}else e.length===0?o=HW():(o=SXe[`=${e}`]||HW(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===_f)&&(o=`${e}\\`));const s=o.length;let a=0,l="",c=!1;const u=o.charCodeAt(0);if(s===1)Co(u)&&(a=1,c=!0);else if(Co(u))if(c=!0,Co(o.charCodeAt(1))){let d=2,h=d;for(;d<s&&!Co(o.charCodeAt(d));)d++;if(d<s&&d!==h){const f=o.slice(h,d);for(h=d;d<s&&Co(o.charCodeAt(d));)d++;if(d<s&&d!==h){for(h=d;d<s&&!Co(o.charCodeAt(d));)d++;(d===s||d!==h)&&(l=`\\\\${f}\\${o.slice(h,d)}`,a=d)}}}else a=1;else rC(u)&&o.charCodeAt(1)===iC&&(l=o.slice(0,2),a=2,s>2&&Co(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=WW(t,!i,"\\",Co),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){Yl(n,"path");const e=n.length;if(e===0)return".";let t=0,i,r=!1;const o=n.charCodeAt(0);if(e===1)return ole(o)?"\\":n;if(Co(o))if(r=!0,Co(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!Co(n.charCodeAt(a));)a++;if(a<e&&a!==l){const c=n.slice(l,a);for(l=a;a<e&&Co(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!Co(n.charCodeAt(a));)a++;if(a===e)return`\\\\${c}\\${n.slice(l)}\\`;a!==l&&(i=`\\\\${c}\\${n.slice(l,a)}`,t=a)}}}else t=1;else rC(o)&&n.charCodeAt(1)===iC&&(i=n.slice(0,2),t=2,e>2&&Co(n.charCodeAt(2))&&(r=!0,t=3));let s=t<e?WW(n.slice(t),!r,"\\",Co):"";return s.length===0&&!r&&(s="."),s.length>0&&Co(n.charCodeAt(e-1))&&(s+="\\"),i===void 0?r?`\\${s}`:s:r?`${i}\\${s}`:`${i}${s}`},isAbsolute(n){Yl(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return Co(t)||e>2&&rC(t)&&n.charCodeAt(1)===iC&&Co(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o<n.length;++o){const s=n[o];Yl(s,"path"),s.length>0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let i=!0,r=0;if(typeof t=="string"&&Co(t.charCodeAt(0))){++r;const o=t.length;o>1&&Co(t.charCodeAt(1))&&(++r,o>2&&(Co(t.charCodeAt(2))?++r:i=!1))}if(i){for(;r<e.length&&Co(e.charCodeAt(r));)r++;r>=2&&(e=`\\${e.slice(r)}`)}return $h.normalize(e)},relative(n,e){if(Yl(n,"from"),Yl(e,"to"),n===e)return"";const t=$h.resolve(n),i=$h.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let r=0;for(;r<n.length&&n.charCodeAt(r)===_f;)r++;let o=n.length;for(;o-1>r&&n.charCodeAt(o-1)===_f;)o--;const s=o-r;let a=0;for(;a<e.length&&e.charCodeAt(a)===_f;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===_f;)l--;const c=l-a,u=s<c?s:c;let d=-1,h=0;for(;h<u;h++){const g=n.charCodeAt(r+h);if(g!==e.charCodeAt(a+h))break;g===_f&&(d=h)}if(h!==u){if(d===-1)return i}else{if(c>u){if(e.charCodeAt(a+h)===_f)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}s>u&&(n.charCodeAt(r+h)===_f?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=r+d+1;h<=o;++h)(h===o||n.charCodeAt(h)===_f)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===_f&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=$h.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===_f){if(e.charCodeAt(1)===_f){const t=e.charCodeAt(2);if(t!==VJi&&t!==Ow)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(rC(e.charCodeAt(0))&&e.charCodeAt(1)===iC&&e.charCodeAt(2)===_f)return`\\\\?\\${e}`;return n},dirname(n){Yl(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const r=n.charCodeAt(0);if(e===1)return Co(r)?n:".";if(Co(r)){if(t=i=1,Co(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!Co(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&Co(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!Co(n.charCodeAt(a));)a++;if(a===e)return n;a!==l&&(t=i=a+1)}}}}else rC(r)&&n.charCodeAt(1)===iC&&(t=e>2&&Co(n.charCodeAt(2))?3:2,i=t);let o=-1,s=!0;for(let a=e-1;a>=i;--a)if(Co(n.charCodeAt(a))){if(!s){o=a;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&Yl(e,"ext"),Yl(n,"path");let t=0,i=-1,r=!0,o;if(n.length>=2&&rC(n.charCodeAt(0))&&n.charCodeAt(1)===iC&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let s=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const l=n.charCodeAt(o);if(Co(l)){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(Co(n.charCodeAt(o))){if(!r){t=o+1;break}}else i===-1&&(r=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Yl(n,"path");let e=0,t=-1,i=0,r=-1,o=!0,s=0;n.length>=2&&n.charCodeAt(1)===iC&&rC(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(Co(l)){if(!o){i=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===Ow?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||r===-1||s===0||s===1&&t===r-1&&t===i+1?"":n.slice(t,r)},format:xXe.bind(null,"\\"),parse(n){Yl(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,r=n.charCodeAt(0);if(t===1)return Co(r)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(Co(r)){if(i=1,Co(n.charCodeAt(1))){let d=2,h=d;for(;d<t&&!Co(n.charCodeAt(d));)d++;if(d<t&&d!==h){for(h=d;d<t&&Co(n.charCodeAt(d));)d++;if(d<t&&d!==h){for(h=d;d<t&&!Co(n.charCodeAt(d));)d++;d===t?i=d:d!==h&&(i=d+1)}}}}else if(rC(r)&&n.charCodeAt(1)===iC){if(t<=2)return e.root=e.dir=n,e;if(i=2,Co(n.charCodeAt(2))){if(t===3)return e.root=e.dir=n,e;i=3}}i>0&&(e.root=n.slice(0,i));let o=-1,s=i,a=-1,l=!0,c=n.length-1,u=0;for(;c>=i;--c){if(r=n.charCodeAt(c),Co(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===Ow?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return a!==-1&&(o===-1||u===0||u===1&&o===a-1&&o===s+1?e.base=e.name=n.slice(s,a):(e.name=n.slice(s,o),e.base=n.slice(s,a),e.ext=n.slice(o,a))),s>0&&s!==i?e.dir=n.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},WJi=(()=>{if(uE){const n=/\\/g;return()=>{const e=HW().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>HW()})(),hl={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const r=i>=0?n[i]:WJi();Yl(r,"path"),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===Ru)}return e=WW(e,!t,"/",ole),t?`/${e}`:e.length>0?e:"."},normalize(n){if(Yl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Ru,t=n.charCodeAt(n.length-1)===Ru;return n=WW(n,!e,"/",ole),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return Yl(n,"path"),n.length>0&&n.charCodeAt(0)===Ru},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const i=n[t];Yl(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":hl.normalize(e)},relative(n,e){if(Yl(n,"from"),Yl(e,"to"),n===e||(n=hl.resolve(n),e=hl.resolve(e),n===e))return"";const t=1,i=n.length,r=i-t,o=1,s=e.length-o,a=r<s?r:s;let l=-1,c=0;for(;c<a;c++){const d=n.charCodeAt(t+c);if(d!==e.charCodeAt(o+c))break;d===Ru&&(l=c)}if(c===a)if(s>a){if(e.charCodeAt(o+c)===Ru)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else r>a&&(n.charCodeAt(t+c)===Ru?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Ru)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(Yl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Ru;let t=-1,i=!0;for(let r=n.length-1;r>=1;--r)if(n.charCodeAt(r)===Ru){if(!i){t=r;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&Yl(e,"ext"),Yl(n,"path");let t=0,i=-1,r=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let s=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const l=n.charCodeAt(o);if(l===Ru){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===Ru){if(!r){t=o+1;break}}else i===-1&&(r=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Yl(n,"path");let e=-1,t=0,i=-1,r=!0,o=0;for(let s=n.length-1;s>=0;--s){const a=n.charCodeAt(s);if(a===Ru){if(!r){t=s+1;break}continue}i===-1&&(r=!1,i=s+1),a===Ow?e===-1?e=s:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:xXe.bind(null,"/"),parse(n){Yl(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Ru;let i;t?(e.root="/",i=1):i=0;let r=-1,o=0,s=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const u=n.charCodeAt(l);if(u===Ru){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===Ow?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(s!==-1){const u=o===0&&t?1:o;r===-1||c===0||c===1&&r===s-1&&r===o+1?e.base=e.name=n.slice(u,s):(e.name=n.slice(u,r),e.base=n.slice(u,s),e.ext=n.slice(r,s))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};hl.win32=$h.win32=$h;hl.posix=$h.posix=hl;const TXe=uE?$h.normalize:hl.normalize,zJi=uE?$h.resolve:hl.resolve,UJi=uE?$h.relative:hl.relative,kXe=uE?$h.dirname:hl.dirname,Pw=uE?$h.basename:hl.basename,jJi=uE?$h.extname:hl.extname,uv=uE?$h.sep:hl.sep,qJi=/^\w[\w\d+.-]*$/,KJi=/^\//,GJi=/^\/\//;function YJi(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!qJi.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!KJi.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(GJi.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function QJi(n,e){return!n&&!e?"file":n}function XJi(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==V_&&(e=V_+e):e=V_;break}return e}const Na="",V_="/",ZJi=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Yn{static isUri(e){return e instanceof Yn?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,r,o,s=!1){typeof e=="object"?(this.scheme=e.scheme||Na,this.authority=e.authority||Na,this.path=e.path||Na,this.query=e.query||Na,this.fragment=e.fragment||Na):(this.scheme=QJi(e,s),this.authority=t||Na,this.path=XJi(this.scheme,i||Na),this.query=r||Na,this.fragment=o||Na,YJi(this,s))}get fsPath(){return zW(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:r,query:o,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=Na),i===void 0?i=this.authority:i===null&&(i=Na),r===void 0?r=this.path:r===null&&(r=Na),o===void 0?o=this.query:o===null&&(o=Na),s===void 0?s=this.fragment:s===null&&(s=Na),t===this.scheme&&i===this.authority&&r===this.path&&o===this.query&&s===this.fragment?this:new QI(t,i,r,o,s)}static parse(e,t=!1){const i=ZJi.exec(e);return i?new QI(i[2]||Na,T9(i[4]||Na),T9(i[5]||Na),T9(i[7]||Na),T9(i[9]||Na),t):new QI(Na,Na,Na,Na,Na)}static file(e){let t=Na;if(eu&&(e=e.replace(/\\/g,V_)),e[0]===V_&&e[1]===V_){const i=e.indexOf(V_,2);i===-1?(t=e.substring(2),e=V_):(t=e.substring(2,i),e=e.substring(i)||V_)}return new QI("file",t,e,Na,Na)}static from(e,t){return new QI(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return eu&&e.scheme==="file"?i=Yn.file($h.join(zW(e,!0),...t)).path:i=hl.join(e.path,...t),e.with({path:i})}toString(e=!1){return sle(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof Yn)return e;{const r=new QI(e);return r._formatted=(t=e.external)!==null&&t!==void 0?t:null,r._fsPath=e._sep===IXe&&(i=e.fsPath)!==null&&i!==void 0?i:null,r}}else return e}}const IXe=eu?1:void 0;let QI=class extends Yn{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=zW(this,!1)),this._fsPath}toString(e=!1){return e?sle(this,!0):(this._formatted||(this._formatted=sle(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=IXe),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const LXe={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function dRe(n,e,t){let i,r=-1;for(let o=0;o<n.length;o++){const s=n.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)r!==-1&&(i+=encodeURIComponent(n.substring(r,o)),r=-1),i!==void 0&&(i+=n.charAt(o));else{i===void 0&&(i=n.substr(0,o));const a=LXe[s];a!==void 0?(r!==-1&&(i+=encodeURIComponent(n.substring(r,o)),r=-1),i+=a):r===-1&&(r=o)}}return r!==-1&&(i+=encodeURIComponent(n.substring(r))),i!==void 0?i:n}function JJi(n){let e;for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);i===35||i===63?(e===void 0&&(e=n.substr(0,t)),e+=LXe[i]):e!==void 0&&(e+=n[t])}return e!==void 0?e:n}function zW(n,e){let t;return n.authority&&n.path.length>1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,eu&&(t=t.replace(/\//g,"\\")),t}function sle(n,e){const t=e?JJi:dRe;let i="",{scheme:r,authority:o,path:s,query:a,fragment:l}=n;if(r&&(i+=r,i+=":"),(o||r==="file")&&(i+=V_,i+=V_),o){let c=o.indexOf("@");if(c!==-1){const u=o.substr(0,c);o=o.substr(c+1),c=u.lastIndexOf(":"),c===-1?i+=t(u,!1,!1):(i+=t(u.substr(0,c),!1,!1),i+=":",i+=t(u.substr(c+1),!1,!0)),i+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,c),!1,!0),i+=o.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}i+=t(s,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:dRe(l,!1,!1)),i}function DXe(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+DXe(n.substr(3)):n}}const hRe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function T9(n){return n.match(hRe)?n.replace(hRe,e=>DXe(e)):n}let De=class sx{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new sx(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return sx.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return sx.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(e){return sx.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){const i=e.lineNumber|0,r=t.lineNumber|0;if(i===r){const o=e.column|0,s=t.column|0;return o-s}return i-r}clone(){return new sx(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new sx(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}},J=class hc{constructor(e,t,i,r){e>i||e===i&&t>r?(this.startLineNumber=i,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=r)}isEmpty(){return hc.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return hc.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return hc.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return hc.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return hc.plusRange(this,e)}static plusRange(e,t){let i,r,o,s;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,r=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,r=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,r=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new hc(i,r,o,s)}intersectRanges(e){return hc.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return i<a?(i=a,r=l):i===a&&(r=Math.max(r,l)),o>c?(o=c,s=u):o===c&&(s=Math.min(s,u)),i>o||i===o&&r>s?null:new hc(i,r,o,s)}equalsRange(e){return hc.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return hc.getEndPosition(this)}static getEndPosition(e){return new De(e.endLineNumber,e.endColumn)}getStartPosition(){return hc.getStartPosition(this)}static getStartPosition(e){return new De(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new hc(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new hc(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return hc.collapseToStart(this)}static collapseToStart(e){return new hc(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return hc.collapseToEnd(this)}static collapseToEnd(e){return new hc(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new hc(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new hc(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new hc(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){const o=e.startLineNumber|0,s=t.startLineNumber|0;if(o===s){const a=e.startColumn|0,l=t.startColumn|0;if(a===l){const c=e.endLineNumber|0,u=t.endLineNumber|0;if(c===u){const d=e.endColumn|0,h=t.endColumn|0;return d-h}return c-u}return a-l}return o-s}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}},kn=class om extends J{constructor(e,t,i,r){super(e,t,i,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return om.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new om(this.startLineNumber,this.startColumn,e,t):new om(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new De(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new De(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new om(e,t,this.endLineNumber,this.endColumn):new om(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new om(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new om(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new om(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new om(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i<r;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,i,r,o){return o===0?new om(e,t,i,r):new om(i,r,e,t)}};const ale=Object.create(null);function G(n,e){if(Od(e)){const t=ale[e];if(t===void 0)throw new Error(`${n} references an unknown codicon: ${e}`);e=t}return ale[n]=e,{id:n}}function AXe(){return ale}const Ht={add:G("add",6e4),plus:G("plus",6e4),gistNew:G("gist-new",6e4),repoCreate:G("repo-create",6e4),lightbulb:G("lightbulb",60001),lightBulb:G("light-bulb",60001),repo:G("repo",60002),repoDelete:G("repo-delete",60002),gistFork:G("gist-fork",60003),repoForked:G("repo-forked",60003),gitPullRequest:G("git-pull-request",60004),gitPullRequestAbandoned:G("git-pull-request-abandoned",60004),recordKeys:G("record-keys",60005),keyboard:G("keyboard",60005),tag:G("tag",60006),tagAdd:G("tag-add",60006),tagRemove:G("tag-remove",60006),gitPullRequestLabel:G("git-pull-request-label",60006),person:G("person",60007),personFollow:G("person-follow",60007),personOutline:G("person-outline",60007),personFilled:G("person-filled",60007),gitBranch:G("git-branch",60008),gitBranchCreate:G("git-branch-create",60008),gitBranchDelete:G("git-branch-delete",60008),sourceControl:G("source-control",60008),mirror:G("mirror",60009),mirrorPublic:G("mirror-public",60009),star:G("star",60010),starAdd:G("star-add",60010),starDelete:G("star-delete",60010),starEmpty:G("star-empty",60010),comment:G("comment",60011),commentAdd:G("comment-add",60011),alert:G("alert",60012),warning:G("warning",60012),search:G("search",60013),searchSave:G("search-save",60013),logOut:G("log-out",60014),signOut:G("sign-out",60014),logIn:G("log-in",60015),signIn:G("sign-in",60015),eye:G("eye",60016),eyeUnwatch:G("eye-unwatch",60016),eyeWatch:G("eye-watch",60016),circleFilled:G("circle-filled",60017),primitiveDot:G("primitive-dot",60017),closeDirty:G("close-dirty",60017),debugBreakpoint:G("debug-breakpoint",60017),debugBreakpointDisabled:G("debug-breakpoint-disabled",60017),debugHint:G("debug-hint",60017),primitiveSquare:G("primitive-square",60018),edit:G("edit",60019),pencil:G("pencil",60019),info:G("info",60020),issueOpened:G("issue-opened",60020),gistPrivate:G("gist-private",60021),gitForkPrivate:G("git-fork-private",60021),lock:G("lock",60021),mirrorPrivate:G("mirror-private",60021),close:G("close",60022),removeClose:G("remove-close",60022),x:G("x",60022),repoSync:G("repo-sync",60023),sync:G("sync",60023),clone:G("clone",60024),desktopDownload:G("desktop-download",60024),beaker:G("beaker",60025),microscope:G("microscope",60025),vm:G("vm",60026),deviceDesktop:G("device-desktop",60026),file:G("file",60027),fileText:G("file-text",60027),more:G("more",60028),ellipsis:G("ellipsis",60028),kebabHorizontal:G("kebab-horizontal",60028),mailReply:G("mail-reply",60029),reply:G("reply",60029),organization:G("organization",60030),organizationFilled:G("organization-filled",60030),organizationOutline:G("organization-outline",60030),newFile:G("new-file",60031),fileAdd:G("file-add",60031),newFolder:G("new-folder",60032),fileDirectoryCreate:G("file-directory-create",60032),trash:G("trash",60033),trashcan:G("trashcan",60033),history:G("history",60034),clock:G("clock",60034),folder:G("folder",60035),fileDirectory:G("file-directory",60035),symbolFolder:G("symbol-folder",60035),logoGithub:G("logo-github",60036),markGithub:G("mark-github",60036),github:G("github",60036),terminal:G("terminal",60037),console:G("console",60037),repl:G("repl",60037),zap:G("zap",60038),symbolEvent:G("symbol-event",60038),error:G("error",60039),stop:G("stop",60039),variable:G("variable",60040),symbolVariable:G("symbol-variable",60040),array:G("array",60042),symbolArray:G("symbol-array",60042),symbolModule:G("symbol-module",60043),symbolPackage:G("symbol-package",60043),symbolNamespace:G("symbol-namespace",60043),symbolObject:G("symbol-object",60043),symbolMethod:G("symbol-method",60044),symbolFunction:G("symbol-function",60044),symbolConstructor:G("symbol-constructor",60044),symbolBoolean:G("symbol-boolean",60047),symbolNull:G("symbol-null",60047),symbolNumeric:G("symbol-numeric",60048),symbolNumber:G("symbol-number",60048),symbolStructure:G("symbol-structure",60049),symbolStruct:G("symbol-struct",60049),symbolParameter:G("symbol-parameter",60050),symbolTypeParameter:G("symbol-type-parameter",60050),symbolKey:G("symbol-key",60051),symbolText:G("symbol-text",60051),symbolReference:G("symbol-reference",60052),goToFile:G("go-to-file",60052),symbolEnum:G("symbol-enum",60053),symbolValue:G("symbol-value",60053),symbolRuler:G("symbol-ruler",60054),symbolUnit:G("symbol-unit",60054),activateBreakpoints:G("activate-breakpoints",60055),archive:G("archive",60056),arrowBoth:G("arrow-both",60057),arrowDown:G("arrow-down",60058),arrowLeft:G("arrow-left",60059),arrowRight:G("arrow-right",60060),arrowSmallDown:G("arrow-small-down",60061),arrowSmallLeft:G("arrow-small-left",60062),arrowSmallRight:G("arrow-small-right",60063),arrowSmallUp:G("arrow-small-up",60064),arrowUp:G("arrow-up",60065),bell:G("bell",60066),bold:G("bold",60067),book:G("book",60068),bookmark:G("bookmark",60069),debugBreakpointConditionalUnverified:G("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:G("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:G("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:G("debug-breakpoint-data-unverified",60072),debugBreakpointData:G("debug-breakpoint-data",60073),debugBreakpointDataDisabled:G("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:G("debug-breakpoint-log-unverified",60074),debugBreakpointLog:G("debug-breakpoint-log",60075),debugBreakpointLogDisabled:G("debug-breakpoint-log-disabled",60075),briefcase:G("briefcase",60076),broadcast:G("broadcast",60077),browser:G("browser",60078),bug:G("bug",60079),calendar:G("calendar",60080),caseSensitive:G("case-sensitive",60081),check:G("check",60082),checklist:G("checklist",60083),chevronDown:G("chevron-down",60084),dropDownButton:G("drop-down-button",60084),chevronLeft:G("chevron-left",60085),chevronRight:G("chevron-right",60086),chevronUp:G("chevron-up",60087),chromeClose:G("chrome-close",60088),chromeMaximize:G("chrome-maximize",60089),chromeMinimize:G("chrome-minimize",60090),chromeRestore:G("chrome-restore",60091),circle:G("circle",60092),circleOutline:G("circle-outline",60092),debugBreakpointUnverified:G("debug-breakpoint-unverified",60092),circleSlash:G("circle-slash",60093),circuitBoard:G("circuit-board",60094),clearAll:G("clear-all",60095),clippy:G("clippy",60096),closeAll:G("close-all",60097),cloudDownload:G("cloud-download",60098),cloudUpload:G("cloud-upload",60099),code:G("code",60100),collapseAll:G("collapse-all",60101),colorMode:G("color-mode",60102),commentDiscussion:G("comment-discussion",60103),compareChanges:G("compare-changes",60157),creditCard:G("credit-card",60105),dash:G("dash",60108),dashboard:G("dashboard",60109),database:G("database",60110),debugContinue:G("debug-continue",60111),debugDisconnect:G("debug-disconnect",60112),debugPause:G("debug-pause",60113),debugRestart:G("debug-restart",60114),debugStart:G("debug-start",60115),debugStepInto:G("debug-step-into",60116),debugStepOut:G("debug-step-out",60117),debugStepOver:G("debug-step-over",60118),debugStop:G("debug-stop",60119),debug:G("debug",60120),deviceCameraVideo:G("device-camera-video",60121),deviceCamera:G("device-camera",60122),deviceMobile:G("device-mobile",60123),diffAdded:G("diff-added",60124),diffIgnored:G("diff-ignored",60125),diffModified:G("diff-modified",60126),diffRemoved:G("diff-removed",60127),diffRenamed:G("diff-renamed",60128),diff:G("diff",60129),discard:G("discard",60130),editorLayout:G("editor-layout",60131),emptyWindow:G("empty-window",60132),exclude:G("exclude",60133),extensions:G("extensions",60134),eyeClosed:G("eye-closed",60135),fileBinary:G("file-binary",60136),fileCode:G("file-code",60137),fileMedia:G("file-media",60138),filePdf:G("file-pdf",60139),fileSubmodule:G("file-submodule",60140),fileSymlinkDirectory:G("file-symlink-directory",60141),fileSymlinkFile:G("file-symlink-file",60142),fileZip:G("file-zip",60143),files:G("files",60144),filter:G("filter",60145),flame:G("flame",60146),foldDown:G("fold-down",60147),foldUp:G("fold-up",60148),fold:G("fold",60149),folderActive:G("folder-active",60150),folderOpened:G("folder-opened",60151),gear:G("gear",60152),gift:G("gift",60153),gistSecret:G("gist-secret",60154),gist:G("gist",60155),gitCommit:G("git-commit",60156),gitCompare:G("git-compare",60157),gitMerge:G("git-merge",60158),githubAction:G("github-action",60159),githubAlt:G("github-alt",60160),globe:G("globe",60161),grabber:G("grabber",60162),graph:G("graph",60163),gripper:G("gripper",60164),heart:G("heart",60165),home:G("home",60166),horizontalRule:G("horizontal-rule",60167),hubot:G("hubot",60168),inbox:G("inbox",60169),issueClosed:G("issue-closed",60324),issueReopened:G("issue-reopened",60171),issues:G("issues",60172),italic:G("italic",60173),jersey:G("jersey",60174),json:G("json",60175),bracket:G("bracket",60175),kebabVertical:G("kebab-vertical",60176),key:G("key",60177),law:G("law",60178),lightbulbAutofix:G("lightbulb-autofix",60179),linkExternal:G("link-external",60180),link:G("link",60181),listOrdered:G("list-ordered",60182),listUnordered:G("list-unordered",60183),liveShare:G("live-share",60184),loading:G("loading",60185),location:G("location",60186),mailRead:G("mail-read",60187),mail:G("mail",60188),markdown:G("markdown",60189),megaphone:G("megaphone",60190),mention:G("mention",60191),milestone:G("milestone",60192),gitPullRequestMilestone:G("git-pull-request-milestone",60192),mortarBoard:G("mortar-board",60193),move:G("move",60194),multipleWindows:G("multiple-windows",60195),mute:G("mute",60196),noNewline:G("no-newline",60197),note:G("note",60198),octoface:G("octoface",60199),openPreview:G("open-preview",60200),package:G("package",60201),paintcan:G("paintcan",60202),pin:G("pin",60203),play:G("play",60204),run:G("run",60204),plug:G("plug",60205),preserveCase:G("preserve-case",60206),preview:G("preview",60207),project:G("project",60208),pulse:G("pulse",60209),question:G("question",60210),quote:G("quote",60211),radioTower:G("radio-tower",60212),reactions:G("reactions",60213),references:G("references",60214),refresh:G("refresh",60215),regex:G("regex",60216),remoteExplorer:G("remote-explorer",60217),remote:G("remote",60218),remove:G("remove",60219),replaceAll:G("replace-all",60220),replace:G("replace",60221),repoClone:G("repo-clone",60222),repoForcePush:G("repo-force-push",60223),repoPull:G("repo-pull",60224),repoPush:G("repo-push",60225),report:G("report",60226),requestChanges:G("request-changes",60227),rocket:G("rocket",60228),rootFolderOpened:G("root-folder-opened",60229),rootFolder:G("root-folder",60230),rss:G("rss",60231),ruby:G("ruby",60232),saveAll:G("save-all",60233),saveAs:G("save-as",60234),save:G("save",60235),screenFull:G("screen-full",60236),screenNormal:G("screen-normal",60237),searchStop:G("search-stop",60238),server:G("server",60240),settingsGear:G("settings-gear",60241),settings:G("settings",60242),shield:G("shield",60243),smiley:G("smiley",60244),sortPrecedence:G("sort-precedence",60245),splitHorizontal:G("split-horizontal",60246),splitVertical:G("split-vertical",60247),squirrel:G("squirrel",60248),starFull:G("star-full",60249),starHalf:G("star-half",60250),symbolClass:G("symbol-class",60251),symbolColor:G("symbol-color",60252),symbolCustomColor:G("symbol-customcolor",60252),symbolConstant:G("symbol-constant",60253),symbolEnumMember:G("symbol-enum-member",60254),symbolField:G("symbol-field",60255),symbolFile:G("symbol-file",60256),symbolInterface:G("symbol-interface",60257),symbolKeyword:G("symbol-keyword",60258),symbolMisc:G("symbol-misc",60259),symbolOperator:G("symbol-operator",60260),symbolProperty:G("symbol-property",60261),wrench:G("wrench",60261),wrenchSubaction:G("wrench-subaction",60261),symbolSnippet:G("symbol-snippet",60262),tasklist:G("tasklist",60263),telescope:G("telescope",60264),textSize:G("text-size",60265),threeBars:G("three-bars",60266),thumbsdown:G("thumbsdown",60267),thumbsup:G("thumbsup",60268),tools:G("tools",60269),triangleDown:G("triangle-down",60270),triangleLeft:G("triangle-left",60271),triangleRight:G("triangle-right",60272),triangleUp:G("triangle-up",60273),twitter:G("twitter",60274),unfold:G("unfold",60275),unlock:G("unlock",60276),unmute:G("unmute",60277),unverified:G("unverified",60278),verified:G("verified",60279),versions:G("versions",60280),vmActive:G("vm-active",60281),vmOutline:G("vm-outline",60282),vmRunning:G("vm-running",60283),watch:G("watch",60284),whitespace:G("whitespace",60285),wholeWord:G("whole-word",60286),window:G("window",60287),wordWrap:G("word-wrap",60288),zoomIn:G("zoom-in",60289),zoomOut:G("zoom-out",60290),listFilter:G("list-filter",60291),listFlat:G("list-flat",60292),listSelection:G("list-selection",60293),selection:G("selection",60293),listTree:G("list-tree",60294),debugBreakpointFunctionUnverified:G("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:G("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:G("debug-breakpoint-function-disabled",60296),debugStackframeActive:G("debug-stackframe-active",60297),circleSmallFilled:G("circle-small-filled",60298),debugStackframeDot:G("debug-stackframe-dot",60298),debugStackframe:G("debug-stackframe",60299),debugStackframeFocused:G("debug-stackframe-focused",60299),debugBreakpointUnsupported:G("debug-breakpoint-unsupported",60300),symbolString:G("symbol-string",60301),debugReverseContinue:G("debug-reverse-continue",60302),debugStepBack:G("debug-step-back",60303),debugRestartFrame:G("debug-restart-frame",60304),callIncoming:G("call-incoming",60306),callOutgoing:G("call-outgoing",60307),menu:G("menu",60308),expandAll:G("expand-all",60309),feedback:G("feedback",60310),gitPullRequestReviewer:G("git-pull-request-reviewer",60310),groupByRefType:G("group-by-ref-type",60311),ungroupByRefType:G("ungroup-by-ref-type",60312),account:G("account",60313),gitPullRequestAssignee:G("git-pull-request-assignee",60313),bellDot:G("bell-dot",60314),debugConsole:G("debug-console",60315),library:G("library",60316),output:G("output",60317),runAll:G("run-all",60318),syncIgnored:G("sync-ignored",60319),pinned:G("pinned",60320),githubInverted:G("github-inverted",60321),debugAlt:G("debug-alt",60305),serverProcess:G("server-process",60322),serverEnvironment:G("server-environment",60323),pass:G("pass",60324),stopCircle:G("stop-circle",60325),playCircle:G("play-circle",60326),record:G("record",60327),debugAltSmall:G("debug-alt-small",60328),vmConnect:G("vm-connect",60329),cloud:G("cloud",60330),merge:G("merge",60331),exportIcon:G("export",60332),graphLeft:G("graph-left",60333),magnet:G("magnet",60334),notebook:G("notebook",60335),redo:G("redo",60336),checkAll:G("check-all",60337),pinnedDirty:G("pinned-dirty",60338),passFilled:G("pass-filled",60339),circleLargeFilled:G("circle-large-filled",60340),circleLarge:G("circle-large",60341),circleLargeOutline:G("circle-large-outline",60341),combine:G("combine",60342),gather:G("gather",60342),table:G("table",60343),variableGroup:G("variable-group",60344),typeHierarchy:G("type-hierarchy",60345),typeHierarchySub:G("type-hierarchy-sub",60346),typeHierarchySuper:G("type-hierarchy-super",60347),gitPullRequestCreate:G("git-pull-request-create",60348),runAbove:G("run-above",60349),runBelow:G("run-below",60350),notebookTemplate:G("notebook-template",60351),debugRerun:G("debug-rerun",60352),workspaceTrusted:G("workspace-trusted",60353),workspaceUntrusted:G("workspace-untrusted",60354),workspaceUnspecified:G("workspace-unspecified",60355),terminalCmd:G("terminal-cmd",60356),terminalDebian:G("terminal-debian",60357),terminalLinux:G("terminal-linux",60358),terminalPowershell:G("terminal-powershell",60359),terminalTmux:G("terminal-tmux",60360),terminalUbuntu:G("terminal-ubuntu",60361),terminalBash:G("terminal-bash",60362),arrowSwap:G("arrow-swap",60363),copy:G("copy",60364),personAdd:G("person-add",60365),filterFilled:G("filter-filled",60366),wand:G("wand",60367),debugLineByLine:G("debug-line-by-line",60368),inspect:G("inspect",60369),layers:G("layers",60370),layersDot:G("layers-dot",60371),layersActive:G("layers-active",60372),compass:G("compass",60373),compassDot:G("compass-dot",60374),compassActive:G("compass-active",60375),azure:G("azure",60376),issueDraft:G("issue-draft",60377),gitPullRequestClosed:G("git-pull-request-closed",60378),gitPullRequestDraft:G("git-pull-request-draft",60379),debugAll:G("debug-all",60380),debugCoverage:G("debug-coverage",60381),runErrors:G("run-errors",60382),folderLibrary:G("folder-library",60383),debugContinueSmall:G("debug-continue-small",60384),beakerStop:G("beaker-stop",60385),graphLine:G("graph-line",60386),graphScatter:G("graph-scatter",60387),pieChart:G("pie-chart",60388),bracketDot:G("bracket-dot",60389),bracketError:G("bracket-error",60390),lockSmall:G("lock-small",60391),azureDevops:G("azure-devops",60392),verifiedFilled:G("verified-filled",60393),newLine:G("newline",60394),layout:G("layout",60395),layoutActivitybarLeft:G("layout-activitybar-left",60396),layoutActivitybarRight:G("layout-activitybar-right",60397),layoutPanelLeft:G("layout-panel-left",60398),layoutPanelCenter:G("layout-panel-center",60399),layoutPanelJustify:G("layout-panel-justify",60400),layoutPanelRight:G("layout-panel-right",60401),layoutPanel:G("layout-panel",60402),layoutSidebarLeft:G("layout-sidebar-left",60403),layoutSidebarRight:G("layout-sidebar-right",60404),layoutStatusbar:G("layout-statusbar",60405),layoutMenubar:G("layout-menubar",60406),layoutCentered:G("layout-centered",60407),layoutSidebarRightOff:G("layout-sidebar-right-off",60416),layoutPanelOff:G("layout-panel-off",60417),layoutSidebarLeftOff:G("layout-sidebar-left-off",60418),target:G("target",60408),indent:G("indent",60409),recordSmall:G("record-small",60410),errorSmall:G("error-small",60411),arrowCircleDown:G("arrow-circle-down",60412),arrowCircleLeft:G("arrow-circle-left",60413),arrowCircleRight:G("arrow-circle-right",60414),arrowCircleUp:G("arrow-circle-up",60415),heartFilled:G("heart-filled",60420),map:G("map",60421),mapFilled:G("map-filled",60422),circleSmall:G("circle-small",60423),bellSlash:G("bell-slash",60424),bellSlashDot:G("bell-slash-dot",60425),commentUnresolved:G("comment-unresolved",60426),gitPullRequestGoToChanges:G("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:G("git-pull-request-new-changes",60428),searchFuzzy:G("search-fuzzy",60429),commentDraft:G("comment-draft",60430),send:G("send",60431),sparkle:G("sparkle",60432),insert:G("insert",60433),mic:G("mic",60434),dialogError:G("dialog-error","error"),dialogWarning:G("dialog-warning","warning"),dialogInfo:G("dialog-info","info"),dialogClose:G("dialog-close","close"),treeItemExpanded:G("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:G("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:G("tree-filter-on-type-off","list-selection"),treeFilterClear:G("tree-filter-clear","close"),treeItemLoading:G("tree-item-loading","loading"),menuSelection:G("menu-selection","check"),menuSubmenu:G("menu-submenu","chevron-right"),menuBarMore:G("menubar-more","more"),scrollbarButtonLeft:G("scrollbar-button-left","triangle-left"),scrollbarButtonRight:G("scrollbar-button-right","triangle-right"),scrollbarButtonUp:G("scrollbar-button-up","triangle-up"),scrollbarButtonDown:G("scrollbar-button-down","triangle-down"),toolBarMore:G("toolbar-more","more"),quickInputBack:G("quick-input-back","arrow-left")};var lle=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let eer=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),mi(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const r=new ter(this,e,t);return this._factories.set(e,r),mi(()=>{const o=this._factories.get(e);!o||o!==r||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return lle(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class ter extends Ue{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return lle(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return lle(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}let b3=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class o0e{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class iG{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var y3;(function(n){const e=new Map;e.set(0,Ht.symbolMethod),e.set(1,Ht.symbolFunction),e.set(2,Ht.symbolConstructor),e.set(3,Ht.symbolField),e.set(4,Ht.symbolVariable),e.set(5,Ht.symbolClass),e.set(6,Ht.symbolStruct),e.set(7,Ht.symbolInterface),e.set(8,Ht.symbolModule),e.set(9,Ht.symbolProperty),e.set(10,Ht.symbolEvent),e.set(11,Ht.symbolOperator),e.set(12,Ht.symbolUnit),e.set(13,Ht.symbolValue),e.set(15,Ht.symbolEnum),e.set(14,Ht.symbolConstant),e.set(15,Ht.symbolEnum),e.set(16,Ht.symbolEnumMember),e.set(17,Ht.symbolKeyword),e.set(27,Ht.symbolSnippet),e.set(18,Ht.symbolText),e.set(19,Ht.symbolColor),e.set(20,Ht.symbolFile),e.set(21,Ht.symbolReference),e.set(22,Ht.symbolCustomColor),e.set(23,Ht.symbolFolder),e.set(24,Ht.symbolTypeParameter),e.set(25,Ht.account),e.set(26,Ht.issues);function t(o){let s=e.get(o);return s||(console.info("No codicon found for CompletionItemKind "+o),s=Ht.symbolProperty),s}n.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function r(o,s){let a=i.get(o);return typeof a>"u"&&!s&&(a=9),a}n.fromString=r})(y3||(y3={}));var Xy;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Xy||(Xy={}));class NXe{constructor(e,t,i,r){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=r}equals(e){return J.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Yb;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Yb||(Yb={}));var C3;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(C3||(C3={}));function ner(n){return n&&Yn.isUri(n.uri)&&J.isIRange(n.range)&&(J.isIRange(n.originSelectionRange)||J.isIRange(n.targetSelectionRange))}const ier={17:T("Array","array"),16:T("Boolean","boolean"),4:T("Class","class"),13:T("Constant","constant"),8:T("Constructor","constructor"),9:T("Enum","enumeration"),21:T("EnumMember","enumeration member"),23:T("Event","event"),7:T("Field","field"),0:T("File","file"),11:T("Function","function"),10:T("Interface","interface"),19:T("Key","key"),5:T("Method","method"),1:T("Module","module"),2:T("Namespace","namespace"),20:T("Null","null"),15:T("Number","number"),18:T("Object","object"),24:T("Operator","operator"),3:T("Package","package"),6:T("Property","property"),14:T("String","string"),22:T("Struct","struct"),25:T("TypeParameter","type parameter"),12:T("Variable","variable")};function rer(n,e){return T("symbolAriaLabel","{0} ({1})",n,ier[e])}var UW;(function(n){const e=new Map;e.set(0,Ht.symbolFile),e.set(1,Ht.symbolModule),e.set(2,Ht.symbolNamespace),e.set(3,Ht.symbolPackage),e.set(4,Ht.symbolClass),e.set(5,Ht.symbolMethod),e.set(6,Ht.symbolProperty),e.set(7,Ht.symbolField),e.set(8,Ht.symbolConstructor),e.set(9,Ht.symbolEnum),e.set(10,Ht.symbolInterface),e.set(11,Ht.symbolFunction),e.set(12,Ht.symbolVariable),e.set(13,Ht.symbolConstant),e.set(14,Ht.symbolString),e.set(15,Ht.symbolNumber),e.set(16,Ht.symbolBoolean),e.set(17,Ht.symbolArray),e.set(18,Ht.symbolObject),e.set(19,Ht.symbolKey),e.set(20,Ht.symbolNull),e.set(21,Ht.symbolEnumMember),e.set(22,Ht.symbolStruct),e.set(23,Ht.symbolEvent),e.set(24,Ht.symbolOperator),e.set(25,Ht.symbolTypeParameter);function t(i){let r=e.get(i);return r||(console.info("No codicon found for SymbolKind "+i),r=Ht.symbolProperty),r}n.toIcon=t})(UW||(UW={}));class Ld{static fromValue(e){switch(e){case"comment":return Ld.Comment;case"imports":return Ld.Imports;case"region":return Ld.Region}return new Ld(e)}constructor(e){this.value=e}}Ld.Comment=new Ld("comment");Ld.Imports=new Ld("imports");Ld.Region=new Ld("region");var cle;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(cle||(cle={}));var jW;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(jW||(jW={}));class oer{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const Ks=new eer;var ule;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(ule||(ule={}));var dle;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(dle||(dle={}));var hle;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(hle||(hle={}));var fle;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(fle||(fle={}));var ple;(function(n){n[n.Deprecated=1]="Deprecated"})(ple||(ple={}));var gle;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(gle||(gle={}));var mle;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(mle||(mle={}));var _le;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(_le||(_le={}));var vle;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(vle||(vle={}));var ble;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(ble||(ble={}));var yle;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(yle||(yle={}));var Cle;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.letterSpacing=63]="letterSpacing",n[n.lightbulb=64]="lightbulb",n[n.lineDecorationsWidth=65]="lineDecorationsWidth",n[n.lineHeight=66]="lineHeight",n[n.lineNumbers=67]="lineNumbers",n[n.lineNumbersMinChars=68]="lineNumbersMinChars",n[n.linkedEditing=69]="linkedEditing",n[n.links=70]="links",n[n.matchBrackets=71]="matchBrackets",n[n.minimap=72]="minimap",n[n.mouseStyle=73]="mouseStyle",n[n.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=75]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",n[n.multiCursorModifier=77]="multiCursorModifier",n[n.multiCursorPaste=78]="multiCursorPaste",n[n.multiCursorLimit=79]="multiCursorLimit",n[n.occurrencesHighlight=80]="occurrencesHighlight",n[n.overviewRulerBorder=81]="overviewRulerBorder",n[n.overviewRulerLanes=82]="overviewRulerLanes",n[n.padding=83]="padding",n[n.pasteAs=84]="pasteAs",n[n.parameterHints=85]="parameterHints",n[n.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",n[n.quickSuggestions=88]="quickSuggestions",n[n.quickSuggestionsDelay=89]="quickSuggestionsDelay",n[n.readOnly=90]="readOnly",n[n.readOnlyMessage=91]="readOnlyMessage",n[n.renameOnType=92]="renameOnType",n[n.renderControlCharacters=93]="renderControlCharacters",n[n.renderFinalNewline=94]="renderFinalNewline",n[n.renderLineHighlight=95]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=97]="renderValidationDecorations",n[n.renderWhitespace=98]="renderWhitespace",n[n.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",n[n.roundedSelection=100]="roundedSelection",n[n.rulers=101]="rulers",n[n.scrollbar=102]="scrollbar",n[n.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=104]="scrollBeyondLastLine",n[n.scrollPredominantAxis=105]="scrollPredominantAxis",n[n.selectionClipboard=106]="selectionClipboard",n[n.selectionHighlight=107]="selectionHighlight",n[n.selectOnLineNumbers=108]="selectOnLineNumbers",n[n.showFoldingControls=109]="showFoldingControls",n[n.showUnused=110]="showUnused",n[n.snippetSuggestions=111]="snippetSuggestions",n[n.smartSelect=112]="smartSelect",n[n.smoothScrolling=113]="smoothScrolling",n[n.stickyScroll=114]="stickyScroll",n[n.stickyTabStops=115]="stickyTabStops",n[n.stopRenderingLineAfter=116]="stopRenderingLineAfter",n[n.suggest=117]="suggest",n[n.suggestFontSize=118]="suggestFontSize",n[n.suggestLineHeight=119]="suggestLineHeight",n[n.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",n[n.suggestSelection=121]="suggestSelection",n[n.tabCompletion=122]="tabCompletion",n[n.tabIndex=123]="tabIndex",n[n.unicodeHighlighting=124]="unicodeHighlighting",n[n.unusualLineTerminators=125]="unusualLineTerminators",n[n.useShadowDOM=126]="useShadowDOM",n[n.useTabStops=127]="useTabStops",n[n.wordBreak=128]="wordBreak",n[n.wordSeparators=129]="wordSeparators",n[n.wordWrap=130]="wordWrap",n[n.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=133]="wordWrapColumn",n[n.wordWrapOverride1=134]="wordWrapOverride1",n[n.wordWrapOverride2=135]="wordWrapOverride2",n[n.wrappingIndent=136]="wrappingIndent",n[n.wrappingStrategy=137]="wrappingStrategy",n[n.showDeprecated=138]="showDeprecated",n[n.inlayHints=139]="inlayHints",n[n.editorClassName=140]="editorClassName",n[n.pixelRatio=141]="pixelRatio",n[n.tabFocusMode=142]="tabFocusMode",n[n.layoutInfo=143]="layoutInfo",n[n.wrappingInfo=144]="wrappingInfo",n[n.defaultColorDecorators=145]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(Cle||(Cle={}));var wle;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(wle||(wle={}));var Sle;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(Sle||(Sle={}));var Ele;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(Ele||(Ele={}));var xle;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(xle||(xle={}));var Tle;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Tle||(Tle={}));var kle;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(kle||(kle={}));var Ile;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Ile||(Ile={}));var Lle;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(Lle||(Lle={}));var Dle;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Dle||(Dle={}));var Ale;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(Ale||(Ale={}));var Nle;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Nle||(Nle={}));var Rle;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Rle||(Rle={}));var Ole;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(Ole||(Ole={}));var Ple;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Ple||(Ple={}));var Mle;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(Mle||(Mle={}));var Fle;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(Fle||(Fle={}));var Ble;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(Ble||(Ble={}));var $le;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})($le||($le={}));var Vle;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(Vle||(Vle={}));var Hle;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(Hle||(Hle={}));var Wle;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Wle||(Wle={}));var zle;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(zle||(zle={}));var Ule;(function(n){n[n.Deprecated=1]="Deprecated"})(Ule||(Ule={}));var jle;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(jle||(jle={}));var qle;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(qle||(qle={}));var Kle;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Kle||(Kle={}));var Gle;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(Gle||(Gle={}));let v6=class{static chord(e,t){return ml(e,t)}};v6.CtrlCmd=2048;v6.Shift=1024;v6.Alt=512;v6.WinCtrl=256;function RXe(){return{editor:void 0,languages:void 0,CancellationTokenSource:Va,Emitter:Le,KeyCode:Lle,KeyMod:v6,Position:De,Range:J,Selection:kn,SelectionDirection:Hle,MarkerSeverity:Dle,MarkerTag:Ale,Uri:Yn,Token:b3}}class ser{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class fRe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class dE{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var wA;function OXe(n){return!n||typeof n!="string"?!0:n.trim().length===0}const aer=/{(\d+)}/g;function GT(n,...e){return e.length===0?n:n.replace(aer,function(t,i){const r=parseInt(i,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function qW(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function tp(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function ler(n,e=" "){const t=b6(n,e);return PXe(t,e)}function b6(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function PXe(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let r=i,o=-1;for(;o=n.lastIndexOf(e,r-1),!(o===-1||o+t!==r);){if(o===0)return"";r=o}return n.substring(0,r)}function cer(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function uer(n){return n.replace(/\*/g,"")}function MXe(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=tp(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function der(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function l0(n){return n.split(/\r\n|\r|\n/)}function Yu(n){for(let e=0,t=n.length;e<t;e++){const i=n.charCodeAt(e);if(i!==32&&i!==9)return e}return-1}function Ko(n,e=0,t=n.length){for(let i=e;i<t;i++){const r=n.charCodeAt(i);if(r!==32&&r!==9)return n.substring(e,i)}return n.substring(e,t)}function dv(n,e=n.length-1){for(let t=e;t>=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function w3(n,e){return n<e?-1:n>e?1:0}function s0e(n,e,t=0,i=n.length,r=0,o=e.length){for(;t<i&&r<o;t++,r++){const l=n.charCodeAt(t),c=e.charCodeAt(r);if(l<c)return-1;if(l>c)return 1}const s=i-t,a=o-r;return s<a?-1:s>a?1:0}function Yle(n,e){return y6(n,e,0,n.length,0,e.length)}function y6(n,e,t=0,i=n.length,r=0,o=e.length){for(;t<i&&r<o;t++,r++){let l=n.charCodeAt(t),c=e.charCodeAt(r);if(l===c)continue;if(l>=128||c>=128)return s0e(n.toLowerCase(),e.toLowerCase(),t,i,r,o);JC(l)&&(l-=32),JC(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=i-t,a=o-r;return s<a?-1:s>a?1:0}function k9(n){return n>=48&&n<=57}function JC(n){return n>=97&&n<=122}function sb(n){return n>=65&&n<=90}function rL(n,e){return n.length===e.length&&y6(n,e)===0}function a0e(n,e){const t=e.length;return e.length>n.length?!1:y6(n,e,0,t)===0}function YT(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i<t;i++)if(n.charCodeAt(i)!==e.charCodeAt(i))return i;return t}function KW(n,e){const t=Math.min(n.length,e.length);let i;const r=n.length-1,o=e.length-1;for(i=0;i<t;i++)if(n.charCodeAt(r-i)!==e.charCodeAt(o-i))return i;return t}function Rl(n){return 55296<=n&&n<=56319}function QT(n){return 56320<=n&&n<=57343}function l0e(n,e){return(n-55296<<10)+(e-56320)+65536}function GW(n,e,t){const i=n.charCodeAt(t);if(Rl(i)&&t+1<e){const r=n.charCodeAt(t+1);if(QT(r))return l0e(i,r)}return i}function her(n,e){const t=n.charCodeAt(e-1);if(QT(t)&&e>1){const i=n.charCodeAt(e-2);if(Rl(i))return l0e(i,t)}return t}class c0e{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=her(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=GW(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class YW{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new c0e(e,t)}nextGraphemeLength(){const e=ew.getInstance(),t=this._iterator,i=t.offset;let r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(pRe(r,s)){t.setOffset(o);break}r=s}return t.offset-i}prevGraphemeLength(){const e=ew.getInstance(),t=this._iterator,i=t.offset;let r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(pRe(s,r)){t.setOffset(o);break}r=s}return i-t.offset}eol(){return this._iterator.eol()}}function u0e(n,e){return new YW(n,e).nextGraphemeLength()}function FXe(n,e){return new YW(n,e).prevGraphemeLength()}function fer(n,e){e>0&&QT(n.charCodeAt(e))&&e--;const t=e+u0e(n,e);return[t-FXe(n,t),t]}let Ree;function per(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function SA(n){return Ree||(Ree=per()),Ree.test(n)}const ger=/^[\t\n\r\x20-\x7E]*$/;function C6(n){return ger.test(n)}const BXe=/[\u2028\u2029]/;function $Xe(n){return BXe.test(n)}function mS(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function d0e(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}const mer=String.fromCharCode(65279);function h0e(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function _er(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function VXe(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function pRe(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class ew{static getInstance(){return ew._INSTANCE||(ew._INSTANCE=new ew),ew._INSTANCE}constructor(){this._data=ver()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let r=1;for(;r<=i;)if(e<t[3*r])r=2*r;else if(e>t[3*r+1])r=2*r+1;else return t[3*r+2];return 0}}ew._INSTANCE=null;function ver(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function ber(n,e){if(n===0)return 0;const t=yer(n,e);if(t!==void 0)return t;const i=new c0e(e,n);return i.prevCodePoint(),i.offset}function yer(n,e){const t=new c0e(e,n);let i=t.prevCodePoint();for(;Cer(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!d0e(i))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function Cer(n){return 127995<=n&&n<=127999}const HXe=" ";class XT{static getInstance(e){return wA.cache.get(Array.from(e))}static getLocales(){return wA._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}wA=XT;XT.ambiguousCharacterData=new dE(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));XT.cache=new ser(n=>{function e(c){const u=new Map;for(let d=0;d<c.length;d+=2)u.set(c[d],c[d+1]);return u}function t(c,u){const d=new Map(c);for(const[h,f]of u)d.set(h,f);return d}function i(c,u){if(!c)return u;const d=new Map;for(const[h,f]of c)u.has(h)&&d.set(h,f);return d}const r=wA.ambiguousCharacterData.value;let o=n.filter(c=>!c.startsWith("_")&&c in r);o.length===0&&(o=["_default"]);let s;for(const c of o){const u=e(r[c]);s=i(s,u)}const a=e(r._common),l=t(a,s);return new wA(l)});XT._locales=new dE(()=>Object.keys(wA.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class Qb{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Qb.getRawData())),this._data}static isInvisibleCharacter(e){return Qb.getData().has(e)}static get codePoints(){return Qb.getData()}}Qb._data=void 0;class Qle{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}Qle.INSTANCE=new Qle;class wer extends Ue{constructor(){super(),this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Ser extends Ue{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new wer);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}class Eer{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new Ser),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function WXe(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const S3=new Eer;function xer(){return Qle.INSTANCE.getZoomFactor()}const eR=navigator.userAgent,mg=eR.indexOf("Firefox")>=0,pT=eR.indexOf("AppleWebKit")>=0,f0e=eR.indexOf("Chrome")>=0,C1=!f0e&&eR.indexOf("Safari")>=0,zXe=!f0e&&!C1&&pT;eR.indexOf("Electron/")>=0;const gRe=eR.indexOf("Android")>=0;let H$=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");H$=n.matches,WXe(n,({matches:t})=>{H$&&e.matches||(H$=t)})}function Ter(){return H$}class UXe{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=f_(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=f_(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=f_(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=f_(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=f_(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=f_(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=f_(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=f_(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=f_(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=f_(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=f_(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function f_(n){return typeof n=="number"?`${n}px`:n}function io(n){return new UXe(n)}function Zc(n,e){n instanceof UXe?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}class ker{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class p0e{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Zc(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Zc(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const r=document.createElement("div");Zc(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);const o=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=i),s.type===1&&(a=r),a.appendChild(document.createElement("br"));const l=document.createElement("span");p0e._render(l,s),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let r=0;r<8;r++)i+=i;e.innerText=i}else{let i=t.chr;for(let r=0;r<8;r++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const i=this._requests[e],r=this._testElements[e];i.fulfill(r.offsetWidth/256)}}}function Ier(n,e){new p0e(n,e).read()}const Hp=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Le,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},Ler=mr?1.5:1.35,Oee=8;class gT{static createFromValidatedSettings(e,t,i){const r=e.get(49),o=e.get(53),s=e.get(52),a=e.get(51),l=e.get(54),c=e.get(66),u=e.get(63);return gT._create(r,o,s,a,l,c,u,t,i)}static _create(e,t,i,r,o,s,a,l,c){s===0?s=Ler*i:s<Oee&&(s=s*i),s=Math.round(s),s<Oee&&(s=Oee);const u=1+(c?0:Hp.getZoomLevel()*.1);return i*=u,s*=u,o===q_.TRANSLATE&&(t==="normal"||t==="bold"?o=q_.OFF:(o=`'wght' ${parseInt(t,10)}`,t="normal")),new gT({pixelRatio:l,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:r,fontVariationSettings:o,lineHeight:s,letterSpacing:a})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=Uh.fontFamily,t=gT._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const Der=2;class Xle extends gT{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=Der,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class Aer extends Ue{constructor(){super(),this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._cache=new mRe,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new mRe,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),!t.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=window.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new Xle({pixelRatio:S3.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,r){const o=new ker(e,t);return i.push(o),r==null||r.push(o),o}_actualReadFontInfo(e){const t=[],i=[],r=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),s=this._createRequest(" ",0,t,i),a=this._createRequest("0",0,t,i),l=this._createRequest("1",0,t,i),c=this._createRequest("2",0,t,i),u=this._createRequest("3",0,t,i),d=this._createRequest("4",0,t,i),h=this._createRequest("5",0,t,i),f=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),m=this._createRequest("8",0,t,i),v=this._createRequest("9",0,t,i),_=this._createRequest("→",0,t,i),b=this._createRequest("→",0,t,null),y=this._createRequest("·",0,t,i),C=this._createRequest(String.fromCharCode(11825),0,t,null),x="|/-_ilm%";for(let A=0,O=x.length;A<O;A++)this._createRequest(x.charAt(A),0,t,i),this._createRequest(x.charAt(A),1,t,i),this._createRequest(x.charAt(A),2,t,i);Ier(e,t);const E=Math.max(a.width,l.width,c.width,u.width,d.width,h.width,f.width,g.width,m.width,v.width);let k=e.fontFeatureSettings===Tf.OFF;const L=i[0].width;for(let A=1,O=i.length;k&&A<O;A++){const P=L-i[A].width;if(P<-.001||P>.001){k=!1;break}}let D=!0;return k&&b.width!==L&&(D=!1),b.width>_.width&&(D=!1),new Xle({pixelRatio:S3.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:k,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:s.width,middotWidth:y.width,wsmiddotWidth:C.width,maxDigitWidth:E},!0)}}class mRe{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const Zle=new Aer;var ev;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(ev||(ev={}));const di=or("instantiationService");function Ner(n,e,t){e[ev.DI_TARGET]===e?e[ev.DI_DEPENDENCIES].push({id:n,index:t}):(e[ev.DI_DEPENDENCIES]=[{id:n,index:t}],e[ev.DI_TARGET]=e)}function or(n){if(ev.serviceIds.has(n))return ev.serviceIds.get(n);const e=function(t,i,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ner(e,t,r)};return e.toString=()=>n,ev.serviceIds.set(n,e),e}const eo=or("codeEditorService"),Ds=or("modelService"),bh=or("textModelService");var EA=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Pd extends Ue{constructor(e,t="",i="",r=!0,o){super(),this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=r,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return EA(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class xA extends Ue{constructor(){super(...arguments),this._onWillRun=this._register(new Le),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new Le),this.onDidRun=this._onDidRun.event}run(e,t){return EA(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(r){i=r}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return EA(this,void 0,void 0,function*(){yield e.run(t)})}}class oc{constructor(){this.id=oc.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new oc,...i]:t=i);return t}run(){return EA(this,void 0,void 0,function*(){})}}oc.ID="vs.actions.separator";class TA{get actions(){return this._actions}constructor(e,t,i,r){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=i}run(){return EA(this,void 0,void 0,function*(){})}}class rG extends Pd{constructor(){super(rG.ID,T("submenu.empty","(empty)"),void 0,!1)}}rG.ID="vs.actions.empty";function ZL(n){var e,t;return{id:n.id,label:n.label,class:void 0,enabled:(e=n.enabled)!==null&&e!==void 0?e:!0,checked:(t=n.checked)!==null&&t!==void 0?t:!1,run:(...i)=>EA(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var Jle;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(Jle||(Jle={}));var Qn;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(Ht.error);const[,g,m]=f,v=["codicon","codicon-"+g];return m&&v.push("codicon-modifier-"+m.substring(1)),v}n.asClassNameArray=t;function i(h){return t(h).join(" ")}n.asClassName=i;function r(h){return"."+t(h).join(".")}n.asCSSSelector=r;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||Jle.isThemeColor(h.color))}n.isThemeIcon=o;const s=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}n.fromString=a;function l(h){return{id:h}}n.fromId=l;function c(h,f){let g=h.id;const m=g.lastIndexOf("~");return m!==-1&&(g=g.substring(0,m)),f&&(g=`${g}~${f}`),{id:g}}n.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}n.getModifier=u;function d(h,f){var g,m;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((m=f.color)===null||m===void 0?void 0:m.id)}n.isEqual=d})(Qn||(Qn={}));const _a=or("commandService"),_r=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Le,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const s=[];for(const l of n.description.args)s.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return pZi(c,s),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new Id,this._commands.set(t,i));const r=i.unshift(n),o=mi(()=>{r();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return _r.registerCommand(n,(t,...i)=>t.get(_a).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return tr.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};_r.registerCommand("noop",()=>{});function Pee(...n){switch(n.length){case 1:return T("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return T("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return T("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const Rer=T("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Oer=T("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let Cx=class ece{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw Zbe(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(Pee("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(Pee("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Pee("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=ece._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Rer);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Oer);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e<this._input.length&&ece._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const r=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:r,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};Cx._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));Cx._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const xu=new Map;xu.set("false",!1);xu.set("true",!0);xu.set("isMac",mr);xu.set("isLinux",Zu);xu.set("isWindows",eu);xu.set("isWeb",lE);xu.set("isMacNative",mr&&!lE);xu.set("isEdge",DZi);xu.set("isFirefox",IZi);xu.set("isChrome",hXe);xu.set("isSafari",LZi);const Per=Object.prototype.hasOwnProperty,Mer={regexParsingWithErrorRecovery:!0},Fer=T("contextkey.parser.error.emptyString","Empty context key expression"),Ber=T("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),$er=T("contextkey.parser.error.noInAfterNot","'in' after 'not'."),_Re=T("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),Ver=T("contextkey.parser.error.unexpectedToken","Unexpected token"),Her=T("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),Wer=T("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),zer=T("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let jXe=class fP{constructor(e=Mer){this._config=e,this._scanner=new Cx,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Fer,offset:0,lexeme:"",additionalInfo:Ber});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),r=i.type===17?Her:void 0;throw this._parsingErrors.push({message:Ver,offset:i.offset,lexeme:Cx.getLexeme(i),additionalInfo:r}),fP._parseError}return t}catch(t){if(t!==fP._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:at.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:at.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Fd.INSTANCE;case 12:return this._advance(),dh.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,_Re),t==null?void 0:t.negate()}case 17:return this._advance(),eI.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),at.true();case 12:return this._advance(),at.false();case 0:{this._advance();const t=this._expr();return this._consume(1,_Re),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const r=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),r.type!==10)throw this._errExpectedButGot("REGEX",r);const o=r.lexeme,s=o.lastIndexOf("/"),a=s===o.length-1?void 0:this._removeFlagsGY(o.substring(s+1));let l;try{l=new RegExp(o.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",r)}return E3.create(t,l)}switch(r.type){case 10:case 19:{const o=[r.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h<r.lexeme.length;h++)r.lexeme.charCodeAt(h)===40?a++:r.lexeme.charCodeAt(h)===41&&a--;for(;!this._isAtEnd()&&s.type!==15&&s.type!==16;){switch(s.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let h=0;h<s.lexeme.length;h++)s.lexeme.charCodeAt(h)===40?a++:r.lexeme.charCodeAt(h)===41&&a--}if(a<0)break;o.push(Cx.getLexeme(s)),this._advance(),s=this._peek()}const l=o.join(""),c=l.lastIndexOf("/"),u=c===l.length-1?void 0:this._removeFlagsGY(l.substring(c+1));let d;try{d=new RegExp(l.substring(1,c),u)}catch{throw this._errExpectedButGot("REGEX",r)}return at.regex(t,d)}case 18:{const o=r.lexeme;this._advance();let s=null;if(!OXe(o)){const a=o.indexOf("/"),l=o.lastIndexOf("/");if(a!==l&&a>=0){const c=o.slice(a+1,l),u=o[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(s===null)throw this._errExpectedButGot("REGEX",r);return E3.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,$er);const r=this._value();return at.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return at.equals(t,r);switch(r){case"true":return at.has(t);case"false":return at.not(t);default:return at.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return at.notEquals(t,r);switch(r){case"true":return at.not(t);case"false":return at.has(t);default:return at.notEquals(t,r)}}case 5:return this._advance(),dG.create(t,this._value());case 6:return this._advance(),hG.create(t,this._value());case 7:return this._advance(),cG.create(t,this._value());case 8:return this._advance(),uG.create(t,this._value());case 13:return this._advance(),at.in(t,this._value());default:return at.has(t)}}case 20:throw this._parsingErrors.push({message:Wer,offset:e.offset,lexeme:"",additionalInfo:zer}),fP._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const r=T("contextkey.parser.error.expectedButGot",`Expected: {0} Received: '{1}'.`,e,Cx.getLexeme(t)),o=t.offset,s=Cx.getLexeme(t);return this._parsingErrors.push({message:r,offset:o,lexeme:s,additionalInfo:i}),fP._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};jXe._parseError=new Error;class at{static false(){return Fd.INSTANCE}static true(){return dh.INSTANCE}static has(e){return Jk.create(e)}static equals(e,t){return tR.create(e,t)}static notEquals(e,t){return aG.create(e,t)}static regex(e,t){return E3.create(e,t)}static in(e,t){return oG.create(e,t)}static notIn(e,t){return sG.create(e,t)}static not(e){return eI.create(e)}static and(...e){return Ux.create(e,null,!0)}static or(...e){return Ey.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}at._parser=new jXe({regexParsingWithErrorRecovery:!1});function Uer(n,e){const t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function IM(n,e){return n.cmp(e)}class Fd{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return dh.INSTANCE}}Fd.INSTANCE=new Fd;class dh{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Fd.INSTANCE}}dh.INSTANCE=new dh;class Jk{static create(e,t=null){const i=xu.get(e);return typeof i=="boolean"?i?dh.INSTANCE:Fd.INSTANCE:new Jk(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:KXe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=xu.get(this.key);return typeof e=="boolean"?e?dh.INSTANCE:Fd.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=eI.create(this.key,this)),this.negated}}class tR{static create(e,t,i=null){if(typeof t=="boolean")return t?Jk.create(e,i):eI.create(e,i);const r=xu.get(e);return typeof r=="boolean"?t===(r?"true":"false")?dh.INSTANCE:Fd.INSTANCE:new tR(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:tI(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=xu.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?dh.INSTANCE:Fd.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=aG.create(this.key,this.value,this)),this.negated}}class oG{static create(e,t){return new oG(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:tI(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?Per.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=sG.create(this.key,this.valueKey)),this.negated}}class sG{static create(e,t){return new sG(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=oG.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class aG{static create(e,t,i=null){if(typeof t=="boolean")return t?eI.create(e,i):Jk.create(e,i);const r=xu.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Fd.INSTANCE:dh.INSTANCE:new aG(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:tI(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=xu.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Fd.INSTANCE:dh.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=tR.create(this.key,this.value,this)),this.negated}}class eI{static create(e,t=null){const i=xu.get(e);return typeof i=="boolean"?i?Fd.INSTANCE:dh.INSTANCE:new eI(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:KXe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=xu.get(this.key);return typeof e=="boolean"?e?Fd.INSTANCE:dh.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Jk.create(this.key,this)),this.negated}}function lG(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):Fd.INSTANCE}class cG{static create(e,t,i=null){return lG(t,r=>new cG(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:tI(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hG.create(this.key,this.value,this)),this.negated}}class uG{static create(e,t,i=null){return lG(t,r=>new uG(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:tI(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=dG.create(this.key,this.value,this)),this.negated}}class dG{static create(e,t,i=null){return lG(t,r=>new dG(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:tI(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=uG.create(this.key,this.value,this)),this.negated}}class hG{static create(e,t,i=null){return lG(t,r=>new hG(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:tI(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=cG.create(this.key,this.value,this)),this.negated}}class E3{static create(e,t){return new E3(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g0e.create(this)),this.negated}}class g0e{static create(e){return new g0e(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function qXe(n){let e=null;for(let t=0,i=n.length;t<i;t++){const r=n[t].substituteConstants();if(n[t]!==r&&e===null){e=[];for(let o=0;o<t;o++)e[o]=n[o]}e!==null&&(e[t]=r)}return e===null?n:e}class Ux{static create(e,t,i){return Ux._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const r=IM(this.expr[t],e.expr[t]);if(r!==0)return r}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=qXe(this.expr);return e===this.expr?this:Ux.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){const r=[];let o=!1;for(const s of e)if(s){if(s.type===1){o=!0;continue}if(s.type===0)return Fd.INSTANCE;if(s.type===6){r.push(...s.expr);continue}r.push(s)}if(r.length===0&&o)return dh.INSTANCE;if(r.length!==0){if(r.length===1)return r[0];r.sort(IM);for(let s=1;s<r.length;s++)r[s-1].equals(r[s])&&(r.splice(s,1),s--);if(r.length===1)return r[0];for(;r.length>1;){const s=r[r.length-1];if(s.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=Ey.create(s.expr.map(u=>Ux.create([u,a],null,i)),null,l);c&&(r.push(c),r.sort(IM))}if(r.length===1)return r[0];if(i){for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++)if(r[s].negate().equals(r[a]))return Fd.INSTANCE;if(r.length===1)return r[0]}return new Ux(r,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Ey.create(e,this,!0)}return this.negated}}class Ey{static create(e,t,i){return Ey._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const r=IM(this.expr[t],e.expr[t]);if(r!==0)return r}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=qXe(this.expr);return e===this.expr?this:Ey.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let r=[],o=!1;if(e){for(let s=0,a=e.length;s<a;s++){const l=e[s];if(l){if(l.type===0){o=!0;continue}if(l.type===1)return dh.INSTANCE;if(l.type===9){r=r.concat(l.expr);continue}r.push(l)}}if(r.length===0&&o)return Fd.INSTANCE;r.sort(IM)}if(r.length!==0){if(r.length===1)return r[0];for(let s=1;s<r.length;s++)r[s-1].equals(r[s])&&(r.splice(s,1),s--);if(r.length===1)return r[0];if(i){for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++)if(r[s].negate().equals(r[a]))return dh.INSTANCE;if(r.length===1)return r[0]}return new Ey(r,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),r=[];for(const o of bRe(t))for(const s of bRe(i))r.push(Ux.create([o,s],null,!1));e.unshift(Ey.create(r,null,!1))}this.negated=Ey.create(e,this,!0)}return this.negated}}class sn extends Jk{static all(){return sn._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?sn._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&sn._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return tR.create(this.key,e)}}sn._info=[];const vi=or("contextKeyService");function KXe(n,e){return n<e?-1:n>e?1:0}function tI(n,e,t,i){return n<t?-1:n>t?1:e<i?-1:e>i?1:0}function tce(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?vRe(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(tce(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return vRe(e.expr,n.expr);for(const t of n.expr)if(tce(t,e))return!0;return!1}return n.equals(e)}function vRe(n,e){let t=0,i=0;for(;t<n.length&&i<e.length;){const r=n[t].cmp(e[i]);if(r<0)return!1;r===0&&t++,i++}return t===n.length}function bRe(n){return n.type===9?n.expr:[n]}function nce(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new Mee([I9(t,e),I9(i,e)]):new Mee([I9(t,e)])}else{const t=[];for(let i=0;i<n.length;i++)t.push(I9(n[i],e));return new Mee(t)}}function I9(n,e){const t=!!(n&2048),i=!!(n&256),r=e===2?i:t,o=!!(n&1024),s=!!(n&512),a=e===2?t:i,l=n&255;return new w1(r,o,s,a,l)}class w1{constructor(e,t,i,r,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=r,this.keyCode=o}equals(e){return e instanceof w1&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class Mee{constructor(e){if(e.length===0)throw ag("chords");this.chords=e}}class jer{constructor(e,t,i,r,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=r,this.keyLabel=o,this.keyAriaLabel=s}}class qer{}function Fee(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function fG(n,e="Unreachable"){throw new Error(e)}function x3(n){if(!n()){debugger;n(),Oi(new Qa("Assertion Failed"))}}function GXe(n,e){let t=0;for(;t<n.length-1;){const i=n[t],r=n[t+1];if(!e(i,r))return!1;t++}return!0}class Ker{constructor(){this.data=new Map}add(e,t){Fee(Od(e)),Fee(kd(t)),Fee(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}const Hs=new Ker;class m0e{constructor(){this._coreKeybindings=new Id,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(Pf===1){if(e&&e.win)return e.win}else if(Pf===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=m0e.bindToCurrentPlatform(e),i=new mt;if(t&&t.primary){const r=nce(t.primary,Pf);r&&i.add(this._registerDefaultKeybinding(r,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let r=0,o=t.secondary.length;r<o;r++){const s=t.secondary[r],a=nce(s,Pf);a&&i.add(this._registerDefaultKeybinding(a,e.id,e.args,e.weight,-r-1,e.when))}return i}registerCommandAndKeybindingRule(e){return km(this.registerKeybindingRule(e),_r.registerCommand(e))}_registerDefaultKeybinding(e,t,i,r,o,s){const a=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:s,weight1:r,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,mi(()=>{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Yer)),this._cachedMergedKeybindings.slice(0)}}const hh=new m0e,Ger={EditorModes:"platform.keybindingsRegistry"};Hs.add(Ger.EditorModes,hh);function Yer(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.command<e.command)return-1;if(n.command>e.command)return 1}return n.weight2-e.weight2}var Qer=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Xer=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t},W$;function oL(n){return n.command!==void 0}function Zer(n){return n.submenu!==void 0}class ue{constructor(e){if(ue._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);ue._instances.set(e,this),this.id=e}}ue._instances=new Map;ue.CommandPalette=new ue("CommandPalette");ue.DebugBreakpointsContext=new ue("DebugBreakpointsContext");ue.DebugCallStackContext=new ue("DebugCallStackContext");ue.DebugConsoleContext=new ue("DebugConsoleContext");ue.DebugVariablesContext=new ue("DebugVariablesContext");ue.DebugWatchContext=new ue("DebugWatchContext");ue.DebugToolBar=new ue("DebugToolBar");ue.DebugToolBarStop=new ue("DebugToolBarStop");ue.EditorContext=new ue("EditorContext");ue.SimpleEditorContext=new ue("SimpleEditorContext");ue.EditorContent=new ue("EditorContent");ue.EditorLineNumberContext=new ue("EditorLineNumberContext");ue.EditorContextCopy=new ue("EditorContextCopy");ue.EditorContextPeek=new ue("EditorContextPeek");ue.EditorContextShare=new ue("EditorContextShare");ue.EditorTitle=new ue("EditorTitle");ue.EditorTitleRun=new ue("EditorTitleRun");ue.EditorTitleContext=new ue("EditorTitleContext");ue.EditorTitleContextShare=new ue("EditorTitleContextShare");ue.EmptyEditorGroup=new ue("EmptyEditorGroup");ue.EmptyEditorGroupContext=new ue("EmptyEditorGroupContext");ue.EditorTabsBarContext=new ue("EditorTabsBarContext");ue.ExplorerContext=new ue("ExplorerContext");ue.ExplorerContextShare=new ue("ExplorerContextShare");ue.ExtensionContext=new ue("ExtensionContext");ue.GlobalActivity=new ue("GlobalActivity");ue.CommandCenter=new ue("CommandCenter");ue.CommandCenterCenter=new ue("CommandCenterCenter");ue.LayoutControlMenuSubmenu=new ue("LayoutControlMenuSubmenu");ue.LayoutControlMenu=new ue("LayoutControlMenu");ue.MenubarMainMenu=new ue("MenubarMainMenu");ue.MenubarAppearanceMenu=new ue("MenubarAppearanceMenu");ue.MenubarDebugMenu=new ue("MenubarDebugMenu");ue.MenubarEditMenu=new ue("MenubarEditMenu");ue.MenubarCopy=new ue("MenubarCopy");ue.MenubarFileMenu=new ue("MenubarFileMenu");ue.MenubarGoMenu=new ue("MenubarGoMenu");ue.MenubarHelpMenu=new ue("MenubarHelpMenu");ue.MenubarLayoutMenu=new ue("MenubarLayoutMenu");ue.MenubarNewBreakpointMenu=new ue("MenubarNewBreakpointMenu");ue.PanelAlignmentMenu=new ue("PanelAlignmentMenu");ue.PanelPositionMenu=new ue("PanelPositionMenu");ue.MenubarPreferencesMenu=new ue("MenubarPreferencesMenu");ue.MenubarRecentMenu=new ue("MenubarRecentMenu");ue.MenubarSelectionMenu=new ue("MenubarSelectionMenu");ue.MenubarShare=new ue("MenubarShare");ue.MenubarSwitchEditorMenu=new ue("MenubarSwitchEditorMenu");ue.MenubarSwitchGroupMenu=new ue("MenubarSwitchGroupMenu");ue.MenubarTerminalMenu=new ue("MenubarTerminalMenu");ue.MenubarViewMenu=new ue("MenubarViewMenu");ue.MenubarHomeMenu=new ue("MenubarHomeMenu");ue.OpenEditorsContext=new ue("OpenEditorsContext");ue.OpenEditorsContextShare=new ue("OpenEditorsContextShare");ue.ProblemsPanelContext=new ue("ProblemsPanelContext");ue.SCMChangeContext=new ue("SCMChangeContext");ue.SCMResourceContext=new ue("SCMResourceContext");ue.SCMResourceContextShare=new ue("SCMResourceContextShare");ue.SCMResourceFolderContext=new ue("SCMResourceFolderContext");ue.SCMResourceGroupContext=new ue("SCMResourceGroupContext");ue.SCMSourceControl=new ue("SCMSourceControl");ue.SCMTitle=new ue("SCMTitle");ue.SearchContext=new ue("SearchContext");ue.SearchActionMenu=new ue("SearchActionContext");ue.StatusBarWindowIndicatorMenu=new ue("StatusBarWindowIndicatorMenu");ue.StatusBarRemoteIndicatorMenu=new ue("StatusBarRemoteIndicatorMenu");ue.StickyScrollContext=new ue("StickyScrollContext");ue.TestItem=new ue("TestItem");ue.TestItemGutter=new ue("TestItemGutter");ue.TestMessageContext=new ue("TestMessageContext");ue.TestMessageContent=new ue("TestMessageContent");ue.TestPeekElement=new ue("TestPeekElement");ue.TestPeekTitle=new ue("TestPeekTitle");ue.TouchBarContext=new ue("TouchBarContext");ue.TitleBarContext=new ue("TitleBarContext");ue.TitleBarTitleContext=new ue("TitleBarTitleContext");ue.TunnelContext=new ue("TunnelContext");ue.TunnelPrivacy=new ue("TunnelPrivacy");ue.TunnelProtocol=new ue("TunnelProtocol");ue.TunnelPortInline=new ue("TunnelInline");ue.TunnelTitle=new ue("TunnelTitle");ue.TunnelLocalAddressInline=new ue("TunnelLocalAddressInline");ue.TunnelOriginInline=new ue("TunnelOriginInline");ue.ViewItemContext=new ue("ViewItemContext");ue.ViewContainerTitle=new ue("ViewContainerTitle");ue.ViewContainerTitleContext=new ue("ViewContainerTitleContext");ue.ViewTitle=new ue("ViewTitle");ue.ViewTitleContext=new ue("ViewTitleContext");ue.CommentEditorActions=new ue("CommentEditorActions");ue.CommentThreadTitle=new ue("CommentThreadTitle");ue.CommentThreadActions=new ue("CommentThreadActions");ue.CommentThreadAdditionalActions=new ue("CommentThreadAdditionalActions");ue.CommentThreadTitleContext=new ue("CommentThreadTitleContext");ue.CommentThreadCommentContext=new ue("CommentThreadCommentContext");ue.CommentTitle=new ue("CommentTitle");ue.CommentActions=new ue("CommentActions");ue.InteractiveToolbar=new ue("InteractiveToolbar");ue.InteractiveCellTitle=new ue("InteractiveCellTitle");ue.InteractiveCellDelete=new ue("InteractiveCellDelete");ue.InteractiveCellExecute=new ue("InteractiveCellExecute");ue.InteractiveInputExecute=new ue("InteractiveInputExecute");ue.NotebookToolbar=new ue("NotebookToolbar");ue.NotebookStickyScrollContext=new ue("NotebookStickyScrollContext");ue.NotebookCellTitle=new ue("NotebookCellTitle");ue.NotebookCellDelete=new ue("NotebookCellDelete");ue.NotebookCellInsert=new ue("NotebookCellInsert");ue.NotebookCellBetween=new ue("NotebookCellBetween");ue.NotebookCellListTop=new ue("NotebookCellTop");ue.NotebookCellExecute=new ue("NotebookCellExecute");ue.NotebookCellExecutePrimary=new ue("NotebookCellExecutePrimary");ue.NotebookDiffCellInputTitle=new ue("NotebookDiffCellInputTitle");ue.NotebookDiffCellMetadataTitle=new ue("NotebookDiffCellMetadataTitle");ue.NotebookDiffCellOutputsTitle=new ue("NotebookDiffCellOutputsTitle");ue.NotebookOutputToolbar=new ue("NotebookOutputToolbar");ue.NotebookEditorLayoutConfigure=new ue("NotebookEditorLayoutConfigure");ue.NotebookKernelSource=new ue("NotebookKernelSource");ue.BulkEditTitle=new ue("BulkEditTitle");ue.BulkEditContext=new ue("BulkEditContext");ue.TimelineItemContext=new ue("TimelineItemContext");ue.TimelineTitle=new ue("TimelineTitle");ue.TimelineTitleContext=new ue("TimelineTitleContext");ue.TimelineFilterSubMenu=new ue("TimelineFilterSubMenu");ue.AccountsContext=new ue("AccountsContext");ue.PanelTitle=new ue("PanelTitle");ue.AuxiliaryBarTitle=new ue("AuxiliaryBarTitle");ue.TerminalInstanceContext=new ue("TerminalInstanceContext");ue.TerminalEditorInstanceContext=new ue("TerminalEditorInstanceContext");ue.TerminalNewDropdownContext=new ue("TerminalNewDropdownContext");ue.TerminalTabContext=new ue("TerminalTabContext");ue.TerminalTabEmptyAreaContext=new ue("TerminalTabEmptyAreaContext");ue.WebviewContext=new ue("WebviewContext");ue.InlineCompletionsActions=new ue("InlineCompletionsActions");ue.NewFile=new ue("NewFile");ue.MergeInput1Toolbar=new ue("MergeToolbar1Toolbar");ue.MergeInput2Toolbar=new ue("MergeToolbar2Toolbar");ue.MergeBaseToolbar=new ue("MergeBaseToolbar");ue.MergeInputResultToolbar=new ue("MergeToolbarResultToolbar");ue.InlineSuggestionToolbar=new ue("InlineSuggestionToolbar");ue.ChatContext=new ue("ChatContext");ue.ChatCodeBlock=new ue("ChatCodeblock");ue.ChatMessageTitle=new ue("ChatMessageTitle");ue.ChatExecute=new ue("ChatExecute");ue.ChatInputSide=new ue("ChatInputSide");ue.AccessibleView=new ue("AccessibleView");const L0=or("menuService");class xy{static for(e){let t=this._all.get(e);return t||(t=new xy(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof xy&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}xy._all=new Map;const xc=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new AJi({merge:xy.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(xy.for(ue.CommandPalette)),mi(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(xy.for(ue.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new Id,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(xy.for(n)),mi(()=>{i(),this._onDidChangeMenu.fire(xy.for(n))})}appendMenuItems(n){const e=new mt;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===ue.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)oL(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class T3 extends TA{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let zm=W$=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,r,o,s){var a,l;this.hideActions=r,this._commandService=s,this.id=e.id,this.label=W$.label(e,i),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Qn.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Qn.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new W$(t,void 0,i,r,o,s):void 0,this._options=i,this.class=c&&Qn.asClassName(c)}run(...e){var t,i;let r=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(r=[...r,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(r=[...r,...e]),this._commandService.executeCommand(this.id,...r)}};zm=W$=Qer([yRe(4,vi),yRe(5,_a)],zm);class up{constructor(e){this.desc=e}}function ws(n){const e=new mt,t=new n,i=t.desc,{f1:r,menu:o,keybinding:s,description:a}=i,l=Xer(i,["f1","menu","keybinding","description"]);if(e.add(_r.registerCommand({id:l.id,handler:(c,...u)=>t.run(c,...u),description:a})),Array.isArray(o))for(const c of o)e.add(xc.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(xc.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(r&&(e.add(xc.appendMenuItem(ue.CommandPalette,{command:l,when:l.precondition})),e.add(xc.addCommand(l))),Array.isArray(s))for(const c of s)e.add(hh.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?at.and(l.precondition,c.when):c.when})));else s&&e.add(hh.registerKeybindingRule(Object.assign(Object.assign({},s),{id:l.id,when:l.precondition?at.and(l.precondition,s.when):s.when})));return e}const dp=or("telemetryService"),hp=or("logService");var qc;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(qc||(qc={}));const YXe=qc.Info;class QXe extends Ue{constructor(){super(...arguments),this.level=YXe,this._onDidChangeLogLevel=this._register(new Le),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==qc.Off&&this.level<=e}}class Jer extends QXe{constructor(e=YXe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(qc.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(qc.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(qc.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(qc.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(qc.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class etr extends QXe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function ttr(n){switch(n){case qc.Trace:return"trace";case qc.Debug:return"debug";case qc.Info:return"info";case qc.Warning:return"warn";case qc.Error:return"error";case qc.Off:return"off"}}new sn("logLevel",ttr(qc.Info));const _0e={clipboard:{writeText:cv||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:cv||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>cv||Ter()?0:navigator.keyboard||C1?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function ntr(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return Sy.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(mg)switch(e){case 59:return 85;case 60:if(Zu)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(mr)return 57;break}else if(pT){if(mr&&e===93)return 57;if(!mr&&e===92)return 57}return wXe[e]||0}const itr=mr?256:2048,rtr=512,otr=1024,str=mr?2048:256;class hs{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=ntr(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=itr),this.altKey&&(t|=rtr),this.shiftKey&&(t|=otr),this.metaKey&&(t|=str),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new w1(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let CRe=!1,yO=null;function atr(n){if(!n.parent||n.parent===n)return null;try{const e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return CRe=!0,null}catch{return CRe=!0,null}return n.parent}class ltr{static getSameOriginWindowChain(){if(!yO){yO=[];let e=window,t;do t=atr(e),t?yO.push({window:e,iframeElement:e.frameElement||null}):yO.push({window:e,iframeElement:null}),e=t;while(e)}return yO.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,r=0;const o=this.getSameOriginWindowChain();for(const s of o){if(i+=s.window.scrollY,r+=s.window.scrollX,s.window===t||!s.iframeElement)break;const a=s.iframeElement.getBoundingClientRect();i+=a.top,r+=a.left}return{top:i,left:r}}}class Zp{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=ltr.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class ZT{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const r=e,o=e;if(typeof r.wheelDeltaY<"u")this.deltaY=r.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?mg&&!mr?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")C1&&eu?this.deltaX=-(r.wheelDeltaX/120):this.deltaX=r.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?mg&&!mr?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:XXe,setPrototypeOf:wRe,isFrozen:ctr,getPrototypeOf:utr,getOwnPropertyDescriptor:dtr}=Object;let{freeze:Xh,seal:bv,create:htr}=Object,{apply:ice,construct:rce}=typeof Reflect<"u"&&Reflect;ice||(ice=function(e,t,i){return e.apply(t,i)});Xh||(Xh=function(e){return e});bv||(bv=function(e){return e});rce||(rce=function(e,t){return new e(...t)});const ftr=Um(Array.prototype.forEach),SRe=Um(Array.prototype.pop),CO=Um(Array.prototype.push),z$=Um(String.prototype.toLowerCase),Bee=Um(String.prototype.toString),ptr=Um(String.prototype.match),p_=Um(String.prototype.replace),gtr=Um(String.prototype.indexOf),mtr=Um(String.prototype.trim),Tp=Um(RegExp.prototype.test),wO=_tr(TypeError);function Um(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return ice(n,e,i)}}function _tr(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return rce(n,t)}}function xo(n,e,t){var i;t=(i=t)!==null&&i!==void 0?i:z$,wRe&&wRe(n,null);let r=e.length;for(;r--;){let o=e[r];if(typeof o=="string"){const s=t(o);s!==o&&(ctr(e)||(e[r]=s),o=s)}n[o]=!0}return n}function XI(n){const e=htr(null);for(const[t,i]of XXe(n))e[t]=i;return e}function L9(n,e){for(;n!==null;){const i=dtr(n,e);if(i){if(i.get)return Um(i.get);if(typeof i.value=="function")return Um(i.value)}n=utr(n)}function t(i){return console.warn("fallback value for",i),null}return t}const ERe=Xh(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$ee=Xh(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Vee=Xh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vtr=Xh(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hee=Xh(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),btr=Xh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xRe=Xh(["#text"]),TRe=Xh(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Wee=Xh(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kRe=Xh(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D9=Xh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ytr=bv(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ctr=bv(/<%[\w\W]*|[\w\W]*%>/gm),wtr=bv(/\${[\w\W]*}/gm),Str=bv(/^data-[\-\w.\u00B7-\uFFFF]/),Etr=bv(/^aria-[\-\w]+$/),ZXe=bv(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xtr=bv(/^(?:\w+script|data):/i),Ttr=bv(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),JXe=bv(/^html$/i);var IRe=Object.freeze({__proto__:null,MUSTACHE_EXPR:ytr,ERB_EXPR:Ctr,TMPLIT_EXPR:wtr,DATA_ATTR:Str,ARIA_ATTR:Etr,IS_ALLOWED_URI:ZXe,IS_SCRIPT_OR_DATA:xtr,ATTR_WHITESPACE:Ttr,DOCTYPE_NAME:JXe});const ktr=()=>typeof window>"u"?null:window,Itr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(i=t.getAttribute(r));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function eZe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ktr();const e=ut=>eZe(ut);if(e.version="3.0.5",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;const t=n.document,i=t.currentScript;let{document:r}=n;const{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=n,g=l.prototype,m=L9(g,"cloneNode"),v=L9(g,"nextSibling"),_=L9(g,"childNodes"),b=L9(g,"parentNode");if(typeof s=="function"){const ut=r.createElement("template");ut.content&&ut.content.ownerDocument&&(r=ut.content.ownerDocument)}let y,C="";const{implementation:x,createNodeIterator:E,createDocumentFragment:k,getElementsByTagName:L}=r,{importNode:D}=t;let A={};e.isSupported=typeof XXe=="function"&&typeof b=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:P,TMPLIT_EXPR:F,DATA_ATTR:B,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:U}=IRe;let{IS_ALLOWED_URI:W}=IRe,q=null;const H=xo({},[...ERe,...$ee,...Vee,...Hee,...xRe]);let ie=null;const se=xo({},[...TRe,...Wee,...kRe,...D9]);let Q=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ee=null,Fe=null,He=!0,ke=!0,Me=!1,je=!0,qe=!1,Be=!1,_t=!1,Wt=!1,Tt=!1,rn=!1,_n=!1,wt=!0,pt=!1;const ot="user-content-";let we=!0,Se=!1,re={},Y=null;const Z=xo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let le=null;const te=xo({},["audio","video","img","source","image","track"]);let me=null;const Oe=xo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",Et="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let At=Qe,Ut=!1,fe=null;const Re=xo({},[et,Et,Qe],Bee);let Je;const Ot=["application/xhtml+xml","text/html"],Ft="text/html";let jt,Jt=null;const ei=r.createElement("form"),sr=function(Ie){return Ie instanceof RegExp||Ie instanceof Function},zn=function(Ie){if(!(Jt&&Jt===Ie)){if((!Ie||typeof Ie!="object")&&(Ie={}),Ie=XI(Ie),Je=Ot.indexOf(Ie.PARSER_MEDIA_TYPE)===-1?Je=Ft:Je=Ie.PARSER_MEDIA_TYPE,jt=Je==="application/xhtml+xml"?Bee:z$,q="ALLOWED_TAGS"in Ie?xo({},Ie.ALLOWED_TAGS,jt):H,ie="ALLOWED_ATTR"in Ie?xo({},Ie.ALLOWED_ATTR,jt):se,fe="ALLOWED_NAMESPACES"in Ie?xo({},Ie.ALLOWED_NAMESPACES,Bee):Re,me="ADD_URI_SAFE_ATTR"in Ie?xo(XI(Oe),Ie.ADD_URI_SAFE_ATTR,jt):Oe,le="ADD_DATA_URI_TAGS"in Ie?xo(XI(te),Ie.ADD_DATA_URI_TAGS,jt):te,Y="FORBID_CONTENTS"in Ie?xo({},Ie.FORBID_CONTENTS,jt):Z,Ee="FORBID_TAGS"in Ie?xo({},Ie.FORBID_TAGS,jt):{},Fe="FORBID_ATTR"in Ie?xo({},Ie.FORBID_ATTR,jt):{},re="USE_PROFILES"in Ie?Ie.USE_PROFILES:!1,He=Ie.ALLOW_ARIA_ATTR!==!1,ke=Ie.ALLOW_DATA_ATTR!==!1,Me=Ie.ALLOW_UNKNOWN_PROTOCOLS||!1,je=Ie.ALLOW_SELF_CLOSE_IN_ATTR!==!1,qe=Ie.SAFE_FOR_TEMPLATES||!1,Be=Ie.WHOLE_DOCUMENT||!1,Tt=Ie.RETURN_DOM||!1,rn=Ie.RETURN_DOM_FRAGMENT||!1,_n=Ie.RETURN_TRUSTED_TYPE||!1,Wt=Ie.FORCE_BODY||!1,wt=Ie.SANITIZE_DOM!==!1,pt=Ie.SANITIZE_NAMED_PROPS||!1,we=Ie.KEEP_CONTENT!==!1,Se=Ie.IN_PLACE||!1,W=Ie.ALLOWED_URI_REGEXP||ZXe,At=Ie.NAMESPACE||Qe,Q=Ie.CUSTOM_ELEMENT_HANDLING||{},Ie.CUSTOM_ELEMENT_HANDLING&&sr(Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&sr(Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&typeof Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),qe&&(ke=!1),rn&&(Tt=!0),re&&(q=xo({},[...xRe]),ie=[],re.html===!0&&(xo(q,ERe),xo(ie,TRe)),re.svg===!0&&(xo(q,$ee),xo(ie,Wee),xo(ie,D9)),re.svgFilters===!0&&(xo(q,Vee),xo(ie,Wee),xo(ie,D9)),re.mathMl===!0&&(xo(q,Hee),xo(ie,kRe),xo(ie,D9))),Ie.ADD_TAGS&&(q===H&&(q=XI(q)),xo(q,Ie.ADD_TAGS,jt)),Ie.ADD_ATTR&&(ie===se&&(ie=XI(ie)),xo(ie,Ie.ADD_ATTR,jt)),Ie.ADD_URI_SAFE_ATTR&&xo(me,Ie.ADD_URI_SAFE_ATTR,jt),Ie.FORBID_CONTENTS&&(Y===Z&&(Y=XI(Y)),xo(Y,Ie.FORBID_CONTENTS,jt)),we&&(q["#text"]=!0),Be&&xo(q,["html","head","body"]),q.table&&(xo(q,["tbody"]),delete Ee.tbody),Ie.TRUSTED_TYPES_POLICY){if(typeof Ie.TRUSTED_TYPES_POLICY.createHTML!="function")throw wO('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ie.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wO('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=Ie.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=Itr(f,i)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));Xh&&Xh(Ie),Jt=Ie}},Tn=xo({},["mi","mo","mn","ms","mtext"]),pi=xo({},["foreignobject","desc","title","annotation-xml"]),Ei=xo({},["title","style","font","a","script"]),$i=xo({},$ee);xo($i,Vee),xo($i,vtr);const Pr=xo({},Hee);xo(Pr,btr);const ro=function(Ie){let nt=b(Ie);(!nt||!nt.tagName)&&(nt={namespaceURI:At,tagName:"template"});const Ve=z$(Ie.tagName),ye=z$(nt.tagName);return fe[Ie.namespaceURI]?Ie.namespaceURI===Et?nt.namespaceURI===Qe?Ve==="svg":nt.namespaceURI===et?Ve==="svg"&&(ye==="annotation-xml"||Tn[ye]):!!$i[Ve]:Ie.namespaceURI===et?nt.namespaceURI===Qe?Ve==="math":nt.namespaceURI===Et?Ve==="math"&&pi[ye]:!!Pr[Ve]:Ie.namespaceURI===Qe?nt.namespaceURI===Et&&!pi[ye]||nt.namespaceURI===et&&!Tn[ye]?!1:!Pr[Ve]&&(Ei[Ve]||!$i[Ve]):!!(Je==="application/xhtml+xml"&&fe[Ie.namespaceURI]):!1},Vo=function(Ie){CO(e.removed,{element:Ie});try{Ie.parentNode.removeChild(Ie)}catch{Ie.remove()}},oo=function(Ie,nt){try{CO(e.removed,{attribute:nt.getAttributeNode(Ie),from:nt})}catch{CO(e.removed,{attribute:null,from:nt})}if(nt.removeAttribute(Ie),Ie==="is"&&!ie[Ie])if(Tt||rn)try{Vo(nt)}catch{}else try{nt.setAttribute(Ie,"")}catch{}},ta=function(Ie){let nt,Ve;if(Wt)Ie="<remove></remove>"+Ie;else{const yt=ptr(Ie,/^[\r\n\t ]+/);Ve=yt&&yt[0]}Je==="application/xhtml+xml"&&At===Qe&&(Ie='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ie+"</body></html>");const ye=y?y.createHTML(Ie):Ie;if(At===Qe)try{nt=new h().parseFromString(ye,Je)}catch{}if(!nt||!nt.documentElement){nt=x.createDocument(At,"template",null);try{nt.documentElement.innerHTML=Ut?C:ye}catch{}}const Xe=nt.body||nt.documentElement;return Ie&&Ve&&Xe.insertBefore(r.createTextNode(Ve),Xe.childNodes[0]||null),At===Qe?L.call(nt,Be?"html":"body")[0]:Be?nt.documentElement:Xe},Mr=function(Ie){return E.call(Ie.ownerDocument||Ie,Ie,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},er=function(Ie){return Ie instanceof d&&(typeof Ie.nodeName!="string"||typeof Ie.textContent!="string"||typeof Ie.removeChild!="function"||!(Ie.attributes instanceof u)||typeof Ie.removeAttribute!="function"||typeof Ie.setAttribute!="function"||typeof Ie.namespaceURI!="string"||typeof Ie.insertBefore!="function"||typeof Ie.hasChildNodes!="function")},on=function(Ie){return typeof a=="object"?Ie instanceof a:Ie&&typeof Ie=="object"&&typeof Ie.nodeType=="number"&&typeof Ie.nodeName=="string"},hi=function(Ie,nt,Ve){A[Ie]&&ftr(A[Ie],ye=>{ye.call(e,nt,Ve,Jt)})},to=function(Ie){let nt;if(hi("beforeSanitizeElements",Ie,null),er(Ie))return Vo(Ie),!0;const Ve=jt(Ie.nodeName);if(hi("uponSanitizeElement",Ie,{tagName:Ve,allowedTags:q}),Ie.hasChildNodes()&&!on(Ie.firstElementChild)&&(!on(Ie.content)||!on(Ie.content.firstElementChild))&&Tp(/<[/\w]/g,Ie.innerHTML)&&Tp(/<[/\w]/g,Ie.textContent))return Vo(Ie),!0;if(!q[Ve]||Ee[Ve]){if(!Ee[Ve]&&xt(Ve)&&(Q.tagNameCheck instanceof RegExp&&Tp(Q.tagNameCheck,Ve)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(Ve)))return!1;if(we&&!Y[Ve]){const ye=b(Ie)||Ie.parentNode,Xe=_(Ie)||Ie.childNodes;if(Xe&&ye){const yt=Xe.length;for(let it=yt-1;it>=0;--it)ye.insertBefore(m(Xe[it],!0),v(Ie))}}return Vo(Ie),!0}return Ie instanceof l&&!ro(Ie)||(Ve==="noscript"||Ve==="noembed"||Ve==="noframes")&&Tp(/<\/no(script|embed|frames)/i,Ie.innerHTML)?(Vo(Ie),!0):(qe&&Ie.nodeType===3&&(nt=Ie.textContent,nt=p_(nt,O," "),nt=p_(nt,P," "),nt=p_(nt,F," "),Ie.textContent!==nt&&(CO(e.removed,{element:Ie.cloneNode()}),Ie.textContent=nt)),hi("afterSanitizeElements",Ie,null),!1)},Ge=function(Ie,nt,Ve){if(wt&&(nt==="id"||nt==="name")&&(Ve in r||Ve in ei))return!1;if(!(ke&&!Fe[nt]&&Tp(B,nt))){if(!(He&&Tp(M,nt))){if(!ie[nt]||Fe[nt]){if(!(xt(Ie)&&(Q.tagNameCheck instanceof RegExp&&Tp(Q.tagNameCheck,Ie)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(Ie))&&(Q.attributeNameCheck instanceof RegExp&&Tp(Q.attributeNameCheck,nt)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(nt))||nt==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&Tp(Q.tagNameCheck,Ve)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(Ve))))return!1}else if(!me[nt]){if(!Tp(W,p_(Ve,U,""))){if(!((nt==="src"||nt==="xlink:href"||nt==="href")&&Ie!=="script"&>r(Ve,"data:")===0&&le[Ie])){if(!(Me&&!Tp(V,p_(Ve,U,"")))){if(Ve)return!1}}}}}}return!0},xt=function(Ie){return Ie.indexOf("-")>0},qt=function(Ie){let nt,Ve,ye,Xe;hi("beforeSanitizeAttributes",Ie,null);const{attributes:yt}=Ie;if(!yt)return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ie};for(Xe=yt.length;Xe--;){nt=yt[Xe];const{name:fn,namespaceURI:In}=nt;if(Ve=fn==="value"?nt.value:mtr(nt.value),ye=jt(fn),it.attrName=ye,it.attrValue=Ve,it.keepAttr=!0,it.forceKeepAttr=void 0,hi("uponSanitizeAttribute",Ie,it),Ve=it.attrValue,it.forceKeepAttr||(oo(fn,Ie),!it.keepAttr))continue;if(!je&&Tp(/\/>/i,Ve)){oo(fn,Ie);continue}qe&&(Ve=p_(Ve,O," "),Ve=p_(Ve,P," "),Ve=p_(Ve,F," "));const ti=jt(Ie.nodeName);if(Ge(ti,ye,Ve)){if(pt&&(ye==="id"||ye==="name")&&(oo(fn,Ie),Ve=ot+Ve),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!In)switch(f.getAttributeType(ti,ye)){case"TrustedHTML":{Ve=y.createHTML(Ve);break}case"TrustedScriptURL":{Ve=y.createScriptURL(Ve);break}}try{In?Ie.setAttributeNS(In,fn,Ve):Ie.setAttribute(fn,Ve),SRe(e.removed)}catch{}}}hi("afterSanitizeAttributes",Ie,null)},hn=function ut(Ie){let nt;const Ve=Mr(Ie);for(hi("beforeSanitizeShadowDOM",Ie,null);nt=Ve.nextNode();)hi("uponSanitizeShadowNode",nt,null),!to(nt)&&(nt.content instanceof o&&ut(nt.content),qt(nt));hi("afterSanitizeShadowDOM",Ie,null)};return e.sanitize=function(ut){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt,Ve,ye,Xe;if(Ut=!ut,Ut&&(ut="<!-->"),typeof ut!="string"&&!on(ut))if(typeof ut.toString=="function"){if(ut=ut.toString(),typeof ut!="string")throw wO("dirty is not a string, aborting")}else throw wO("toString is not a function");if(!e.isSupported)return ut;if(_t||zn(Ie),e.removed=[],typeof ut=="string"&&(Se=!1),Se){if(ut.nodeName){const fn=jt(ut.nodeName);if(!q[fn]||Ee[fn])throw wO("root node is forbidden and cannot be sanitized in-place")}}else if(ut instanceof a)nt=ta("<!---->"),Ve=nt.ownerDocument.importNode(ut,!0),Ve.nodeType===1&&Ve.nodeName==="BODY"||Ve.nodeName==="HTML"?nt=Ve:nt.appendChild(Ve);else{if(!Tt&&!qe&&!Be&&ut.indexOf("<")===-1)return y&&_n?y.createHTML(ut):ut;if(nt=ta(ut),!nt)return Tt?null:_n?C:""}nt&&Wt&&Vo(nt.firstChild);const yt=Mr(Se?ut:nt);for(;ye=yt.nextNode();)to(ye)||(ye.content instanceof o&&hn(ye.content),qt(ye));if(Se)return ut;if(Tt){if(rn)for(Xe=k.call(nt.ownerDocument);nt.firstChild;)Xe.appendChild(nt.firstChild);else Xe=nt;return(ie.shadowroot||ie.shadowrootmode)&&(Xe=D.call(t,Xe,!0)),Xe}let it=Be?nt.outerHTML:nt.innerHTML;return Be&&q["!doctype"]&&nt.ownerDocument&&nt.ownerDocument.doctype&&nt.ownerDocument.doctype.name&&Tp(JXe,nt.ownerDocument.doctype.name)&&(it="<!DOCTYPE "+nt.ownerDocument.doctype.name+`> `+it),qe&&(it=p_(it,O," "),it=p_(it,P," "),it=p_(it,F," ")),y&&_n?y.createHTML(it):it},e.setConfig=function(ut){zn(ut),_t=!0},e.clearConfig=function(){Jt=null,_t=!1},e.isValidAttribute=function(ut,Ie,nt){Jt||zn({});const Ve=jt(ut),ye=jt(Ie);return Ge(Ve,ye,nt)},e.addHook=function(ut,Ie){typeof Ie=="function"&&(A[ut]=A[ut]||[],CO(A[ut],Ie))},e.removeHook=function(ut){if(A[ut])return SRe(A[ut])},e.removeHooks=function(ut){A[ut]&&(A[ut]=[])},e.removeAllHooks=function(){A={}},e}var D0=eZe();D0.version;D0.isSupported;const tZe=D0.sanitize;D0.setConfig;D0.clearConfig;D0.isValidAttribute;const nZe=D0.addHook,iZe=D0.removeHook;D0.removeHooks;D0.removeAllHooks;var Gi;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm"})(Gi||(Gi={}));const Ltr="tkn";class Dtr{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${Gi.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Oi(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const r=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(s+=`&${Ltr}=${encodeURIComponent(o)}`),Yn.from({scheme:lE?this._preferredWebSchema:Gi.vscodeRemoteResource,authority:`${i}:${r}`,path:this._remoteResourcesPath,query:s})}}const rZe=new Dtr;class k3{uriToBrowserUri(e){return e.scheme===Gi.vscodeRemote?rZe.rewrite(e):e.scheme===Gi.file&&(cv||EZi&&Tm.origin===`${Gi.vscodeFileResource}://${k3.FALLBACK_AUTHORITY}`)?e.with({scheme:Gi.vscodeFileResource,authority:e.authority||k3.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}k3.FALLBACK_AUTHORITY="vscode-app";const oZe=new k3;var LRe;(function(n){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let s;typeof o=="string"?s=new URL(o).searchParams:o instanceof URL?s=o.searchParams:Yn.isUri(o)&&(s=new URL(o.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function r(o,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}n.addSearchParam=r})(LRe||(LRe={}));const{registerWindow:lDr,getWindows:Atr,onDidCreateWindow:cDr}=function(){const n=[],e=new Le;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new mt;return i.add(mi(()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function Ic(n){for(;n.firstChild;)n.firstChild.remove()}function v0e(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class Ntr{constructor(e,t,i,r){this._node=e,this._type=t,this._handler=i,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function tt(n,e,t,i){return new Ntr(n,e,t,i)}function sZe(n){return function(e){return n(new Zp(e))}}function Rtr(n){return function(e){return n(new hs(e))}}const $a=function(e,t,i,r){let o=i;return t==="click"||t==="mousedown"?o=sZe(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Rtr(i)),tt(e,t,o,r)},Otr=function(e,t,i){const r=sZe(t);return Ptr(e,r,i)};function Ptr(n,e,t){return tt(n,vv&&_0e.pointerEvents?Yt.POINTER_DOWN:Yt.MOUSE_DOWN,e,t)}let QW,_g;class zee{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Oi(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1;const r=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort(zee.sort),e.shift().execute();i=!1};_g=(o,s=0)=>{const a=new zee(o,s);return n.push(a),t||(t=!0,requestAnimationFrame(r)),a},QW=(o,s)=>{if(i){const a=new zee(o,s);return e.push(a),a}else return _g(o,s)}})();function pG(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function nR(n){var e;const t=n.ownerDocument,i=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(n!==t.body)return new qr(n.clientWidth,n.clientHeight);if(vv&&(i!=null&&i.visualViewport))return new qr(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new qr(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new qr(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new qr(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class wa{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const r=pG(e),o=r?r.getPropertyValue(t):"0";return wa.convertToPixels(e,o)}static getBorderLeftWidth(e){return wa.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return wa.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return wa.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return wa.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return wa.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return wa.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return wa.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return wa.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return wa.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return wa.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return wa.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return wa.getDimension(e,"margin-bottom","marginBottom")}}class qr{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new qr(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof qr?e:new qr(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}qr.None=new qr(0,0);function aZe(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const r=lZe(n)?null:pG(n);r&&(i-=r.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=wa.getBorderLeftWidth(n),t+=wa.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Mtr(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function pl(n){var e,t,i,r;const o=n.getBoundingClientRect();return{left:o.left+((t=(e=n.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:o.top+((r=(i=n.ownerDocument.defaultView)===null||i===void 0?void 0:i.scrollY)!==null&&r!==void 0?r:0),width:o.width,height:o.height}}function Ftr(n){let e=n,t=1;do{const i=pG(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function th(n){const e=wa.getMarginLeft(n)+wa.getMarginRight(n);return n.offsetWidth+e}function Uee(n){const e=wa.getBorderLeftWidth(n)+wa.getBorderRightWidth(n),t=wa.getPaddingLeft(n)+wa.getPaddingRight(n);return n.offsetWidth-e-t}function Btr(n){const e=wa.getBorderTopWidth(n)+wa.getBorderBottomWidth(n),t=wa.getPaddingTop(n)+wa.getPaddingBottom(n);return n.offsetHeight-e-t}function jx(n){const e=wa.getMarginTop(n)+wa.getMarginBottom(n);return n.offsetHeight+e}function Qc(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function $tr(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function jee(n,e,t){return!!$tr(n,e,t)}function lZe(n){return n&&!!n.host&&!!n.mode}function XW(n){return!!JT(n)}function JT(n){for(var e;n.parentNode;){if(n===((e=n.ownerDocument)===null||e===void 0?void 0:e.body))return null;n=n.parentNode}return lZe(n)?n:null}function Im(){let n=gG().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function gG(){var n;return(n=[document,...Atr().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function vg(n=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),n.appendChild(t),t}let qee=null;function cZe(){return qee||(qee=vg()),qee}function Vtr(n){var e,t;return!((e=n==null?void 0:n.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n==null?void 0:n.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function oce(n,e,t=cZe()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function DRe(n,e=cZe()){if(!e)return;const t=Vtr(e),i=[];for(let r=0;r<t.length;r++)t[r].selectorText.indexOf(n)!==-1&&i.push(r);for(let r=i.length-1;r>=0;r--)e.sheet.deleteRule(i[r])}function b0e(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const Yt={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:pT?"webkitAnimationStart":"animationstart",ANIMATION_END:pT?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:pT?"webkitAnimationIteration":"animationiteration"};function Htr(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const zi={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function Wtr(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function ztr(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class ZW extends Ue{static hasFocusWithin(e){if(b0e(e)){const t=JT(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Qc(i,e)}else return Qc(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new Le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Le),this.onDidBlur=this._onDidBlur.event;let t=ZW.hasFocusWithin(e),i=!1;const r=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{ZW.hasFocusWithin(e)!==t&&(t?o():r())},this._register(tt(e,Yt.FOCUS,r,!0)),this._register(tt(e,Yt.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(tt(e,Yt.FOCUS_IN,()=>this._refreshStateHandler())),this._register(tt(e,Yt.FOCUS_OUT,()=>this._refreshStateHandler())))}}function c0(n){return new ZW(n)}function lt(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function uZe(n,e){return n.insertBefore(e,n.firstChild),e}function Lc(n,...e){n.innerText="",lt(n,...e)}const Utr=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var I3;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(I3||(I3={}));function dZe(n,e,t,...i){const r=Utr.exec(e);if(!r)throw new Error("Bad use of emmet");const o=r[1]||"div";let s;return n!==I3.HTML?s=document.createElementNS(n,o):s=document.createElement(o),r[3]&&(s.id=r[3]),r[4]&&(s.className=r[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...i),s}function kt(n,e,...t){return dZe(I3.HTML,n,e,...t)}kt.SVG=function(n,e,...t){return dZe(I3.SVG,n,e,...t)};function jtr(n,...e){n?Mh(...e):bd(...e)}function Mh(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function bd(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function ARe(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function hZe(n){window.open(n,"_blank","noopener")}function qtr(n){const e=()=>{n(),t=_g(e)};let t=_g(e);return mi(()=>t.dispose())}rZe.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function _S(n){return n?`url('${oZe.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function NRe(n){return`'${n.replace(/'/g,"%27")}'`}function mT(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=mT(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function Ktr(n,e=!1){const t=document.createElement("a");return nZe("afterSanitizeAttributes",i=>{for(const r of["href","src"])if(i.hasAttribute(r)){const o=i.getAttribute(r);if(r==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&r==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(r)}}}),mi(()=>{iZe("afterSanitizeAttributes")})}const Gtr=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Py extends Le{constructor(){super(),this._subscriptions=new mt,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(tt(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new hs(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(tt(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(tt(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(tt(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(tt(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(tt(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Py.instance||(Py.instance=new Py),Py.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Ytr extends Ue{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(tt(this.element,Yt.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(tt(this.element,Yt.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(tt(this.element,Yt.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(tt(this.element,Yt.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(tt(this.element,Yt.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const Qtr=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function _c(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const r=Qtr.exec(n);if(!r||!r.groups)throw new Error("Bad use of h");const o=r.groups.tag||"div",s=document.createElement(o);r.groups.id&&(s.id=r.groups.id);const a=[];if(r.groups.class)for(const c of r.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=s),i)for(const c of i)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(RRe(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(RRe(c),u.toString());return l.root=s,l}function RRe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class mG{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=at.and(i,this.precondition):i=this.precondition);const r={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};hh.registerKeybindingRule(r)}}_r.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){xc.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class iR extends mG{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,r){return this._implementations.push({priority:e,name:t,implementation:i,when:r}),this._implementations.sort((o,s)=>s.priority-o.priority),{dispose:()=>{for(let o=0;o<this._implementations.length;o++)if(this._implementations[o].implementation===i){this._implementations.splice(o,1);return}}}}runCommand(e,t){const i=e.get(hp),r=e.get(vi);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const o of this._implementations){if(o.when){const a=r.getContext(Im());if(!o.when.evaluate(a))continue}const s=o.implementation(e,t);if(s)return i.trace(`Command '${this.id}' was handled by '${o.name}'.`),typeof s=="boolean"?void 0:s}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class fZe extends mG{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class ac extends mG{static bindToContribution(e){return class extends ac{constructor(i){super(i),this._callback=i.handler}runEditorCommand(i,r,o){const s=e(r);s&&this._callback(s,o)}}}static runEditorCommand(e,t,i,r){const o=e.get(eo),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext(a=>{if(a.get(vi).contextMatchesRules(i??void 0))return r(a,s,t)})}runCommand(e,t){return ac.runEditorCommand(e,t,this.precondition,(i,r,o)=>this.runEditorCommand(i,r,o))}}class mn extends ac{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(r){return r.menuId||(r.menuId=ue.EditorContext),r.title||(r.title=e.label),r.when=at.and(e.precondition,r.when),r}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(mn.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(dp).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class pZe extends mn{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,r)=>r[0]-i[0]),{dispose:()=>{for(let i=0;i<this._implementations.length;i++)if(this._implementations[i][1]===t){this._implementations.splice(i,1);return}}}}run(e,t,i){for(const r of this._implementations){const o=r[1](e,t,i);if(o)return typeof o=="boolean"?void 0:o}}}class Av extends up{run(e,...t){const i=e.get(eo),r=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(r)return r.invokeWithinContext(o=>{var s,a;const l=o.get(vi),c=o.get(hp);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,r,...t)})}}function A0(n,e){_r.registerCommand(n,function(t,...i){const r=t.get(di),[o,s]=i;Io(Yn.isUri(o)),Io(De.isIPosition(s));const a=t.get(Ds).getModel(o);if(a){const l=De.lift(s);return r.invokeFunction(e,a,l,...i.slice(2))}return t.get(bh).createModelReference(o).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,De.lift(s),i.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function zt(n){return Wp.INSTANCE.registerEditorCommand(n),n}function Dt(n){const e=new n;return Wp.INSTANCE.registerEditorAction(e),e}function gZe(n){return Wp.INSTANCE.registerEditorAction(n),n}function Xtr(n){Wp.INSTANCE.registerEditorAction(n)}function Vr(n,e,t){Wp.INSTANCE.registerEditorContribution(n,e,t)}var JL;(function(n){function e(s){return Wp.INSTANCE.getEditorCommand(s)}n.getEditorCommand=e;function t(){return Wp.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return Wp.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function r(s){return Wp.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}n.getSomeEditorContributions=r;function o(){return Wp.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(JL||(JL={}));const Ztr={EditorCommonContributions:"editor.contributions"};class Wp{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Wp.INSTANCE=new Wp;Hs.add(Ztr.EditorCommonContributions,Wp.INSTANCE);function w6(n){return n.register(),n}const mZe=w6(new iR({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:ue.MenubarEditMenu,group:"1_do",title:T({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:ue.CommandPalette,group:"",title:T("undo","Undo"),order:1}]}));w6(new fZe(mZe,{id:"default:undo",precondition:void 0}));const _Ze=w6(new iR({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:ue.MenubarEditMenu,group:"1_do",title:T({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:ue.CommandPalette,group:"",title:T("redo","Redo"),order:1}]}));w6(new fZe(_Ze,{id:"default:redo",precondition:void 0}));const Jtr=w6(new iR({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:ue.MenubarSelectionMenu,group:"1_basic",title:T({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:ue.CommandPalette,group:"",title:T("selectAll","Select All"),order:1}]})),vZe=Symbol("MicrotaskDelay");var Ap=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},pP=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};function sce(n){return!!n&&typeof n.then=="function"}function Sl(n){const e=new Va,t=n(e.token),i=new Promise((r,o)=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),o(new cE)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),r(a)},a=>{s.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel()}then(r,o){return i.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return i.finally(r)}}}function _G(n,e,t){return new Promise((i,r)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,r).finally(()=>o.dispose())})}class enr{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(r=>{this.activePromise=null,t(r)},r=>{this.activePromise=null,i(r)})})}dispose(){this.isDisposed=!0}}const tnr=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},nnr=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class jm{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((r,o)=>{this.doResolve=r,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const r=this.task;return this.task=null,r()}}));const i=()=>{var r;this.deferred=null,(r=this.doResolve)===null||r===void 0||r.call(this,null)};return this.deferred=t===vZe?nnr(i):tnr(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new cE),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class bZe{constructor(e){this.delayer=new jm(e),this.throttler=new enr}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function vS(n,e){return e?new Promise((t,i)=>{const r=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(r),o.dispose(),i(new cE)})}):Sl(t=>vS(n,t))}function bS(n,e=0,t){const i=setTimeout(()=>{n(),t&&r.dispose()},e),r=mi(()=>{clearTimeout(i),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function yZe(n,e=i=>!!i,t=null){let i=0;const r=n.length,o=()=>{if(i>=r)return Promise.resolve(t);const s=n[i++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class Zm{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class S6{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class $o{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let My;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?My=n=>{uXe(()=>{if(e)return;const t=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:My=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class U${constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=My(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class vG{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new cE)}}var ace;(function(n){function e(i){return Ap(this,void 0,void 0,function*(){let r;const o=yield Promise.all(i.map(s=>s.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return o})}n.settled=e;function t(i){return new Promise((r,o)=>Ap(this,void 0,void 0,function*(){try{yield i(r,o)}catch(s){o(s)}}))}n.withAsyncBody=t})(ace||(ace={}));class Ya{static fromArray(e){return new Ya(t=>{t.emitMany(e)})}static fromPromise(e){return new Ya(t=>Ap(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Ya(t=>Ap(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>Ap(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new Ya(t=>Ap(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var r,o,s;return Ap(this,void 0,void 0,function*(){var a,l,c,u;try{for(r=!0,o=pP(i);s=yield o.next(),a=s.done,!a;r=!0){u=s.value,r=!1;const d=u;t.emitOne(d)}}catch(d){l={error:d}}finally{try{!r&&!a&&(c=o.return)&&(yield c.call(o))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new Le,queueMicrotask(()=>Ap(this,void 0,void 0,function*(){const t={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>Ap(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};yield nn.toPromise(this._onStateChanged.event)}while(!0)})}}static map(e,t){return new Ya(i=>Ap(this,void 0,void 0,function*(){var r,o,s,a;try{for(var l=!0,c=pP(e),u;u=yield c.next(),r=u.done,!r;l=!0){a=u.value,l=!1;const d=a;i.emitOne(t(d))}}catch(d){o={error:d}}finally{try{!l&&!r&&(s=c.return)&&(yield s.call(c))}finally{if(o)throw o.error}}}))}map(e){return Ya.map(this,e)}static filter(e,t){return new Ya(i=>Ap(this,void 0,void 0,function*(){var r,o,s,a;try{for(var l=!0,c=pP(e),u;u=yield c.next(),r=u.done,!r;l=!0){a=u.value,l=!1;const d=a;t(d)&&i.emitOne(d)}}catch(d){o={error:d}}finally{try{!l&&!r&&(s=c.return)&&(yield s.call(c))}finally{if(o)throw o.error}}}))}filter(e){return Ya.filter(this,e)}static coalesce(e){return Ya.filter(e,t=>!!t)}coalesce(){return Ya.coalesce(this)}static toPromise(e){var t,i,r,o,s,a,l;return Ap(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=pP(e);r=yield i.next(),o=r.done,!o;t=!0){l=r.value,t=!1;const u=l;c.push(u)}}catch(u){s={error:u}}finally{try{!t&&!o&&(a=i.return)&&(yield a.call(i))}finally{if(s)throw s.error}}return c})}toPromise(){return Ya.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}Ya.EMPTY=Ya.fromArray([]);class inr extends Ya{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function rnr(n){const e=new Va,t=n(e.token);return new inr(e,i=>Ap(this,void 0,void 0,function*(){var r,o,s,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new cE)});try{try{for(var c=!0,u=pP(t),d;d=yield u.next(),r=d.done,!r;c=!0){a=d.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;i.emitOne(h)}}catch(h){o={error:h}}finally{try{!c&&!r&&(s=u.return)&&(yield s.call(u))}finally{if(o)throw o.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),i.reject(h)}}))}const onr="$initialize";let ORe=!1;function lce(n){lE&&(ORe||(ORe=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class snr{constructor(e,t,i,r){this.vsWorker=e,this.req=t,this.method=i,this.args=r,this.type=0}}class PRe{constructor(e,t,i,r){this.vsWorker=e,this.seq=t,this.res=i,this.err=r,this.type=1}}class anr{constructor(e,t,i,r){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=r,this.type=2}}class lnr{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class cnr{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class unr{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((r,o)=>{this._pendingReplies[i]={resolve:r,reject:o},this._send(new snr(this._workerId,i,e,t))})}listen(e,t){let i=null;const r=new Le({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,r),this._send(new anr(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new cnr(this._workerId,i)),i=null}});return r.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(r=>{this._send(new PRe(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=cRe(r.detail)),this._send(new PRe(this._workerId,t,void 0,cRe(r)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(r=>{this._send(new lnr(this._workerId,t,r))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else e.type===1&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class dnr extends Ue{constructor(e,t,i){super();let r=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",u=>{this._protocol.handleMessage(u)},u=>{r==null||r(u)})),this._protocol=new unr({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof i[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(i[u].apply(i,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(wZe(u)){const h=i[u].call(i,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(CZe(u)){const h=i[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const s=globalThis.require;typeof s<"u"&&typeof s.getConfig=="function"?o=s.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=Gbe(i);this._onModuleLoaded=this._protocol.sendMessage(onr,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{r=d,this._onModuleLoaded.then(h=>{u(hnr(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,r)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,r)},r)})}_onError(e,t){console.error(e),console.info(t)}}function CZe(n){return n[0]==="o"&&n[1]==="n"&&sb(n.charCodeAt(2))}function wZe(n){return/^onDynamic/.test(n)&&sb(n.charCodeAt(9))}function hnr(n,e,t){const i=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},r=s=>function(a){return t(s,a)},o={};for(const s of n){if(wZe(s)){o[s]=r(s);continue}if(CZe(s)){o[s]=t(s,void 0);continue}o[s]=i(s)}return o}function R1(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(r){Oi(r);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(r){Oi(r);return}}const MRe=R1("defaultWorkerFactory",{createScriptURL:n=>n});function fnr(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(MRe?MRe.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function pnr(n){return typeof n.then=="function"}class gnr{constructor(e,t,i,r,o){this.id=t,this.label=i;const s=fnr(i);pnr(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){r(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(r=>{try{r.postMessage(e,t)}catch(o){Oi(o),Oi(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class bG{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const r=++bG.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new gnr(e,r,this._label||"anonymous"+r,t,o=>{lce(o),this._webWorkerFailedBeforeError=o,i(o)})}}bG.LAST_WORKER_ID=0;var Xa;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Xa||(Xa={}));class Kee{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1;break}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(e.getTokenCount()===0)return!0;const i=e.findTokenIndexAtOffset(t-2),r=e.getStandardTokenType(i);return this.isOK(r)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const r=String.fromCharCode(i);if(!this.open.includes(r)&&!this.close.includes(r))return r}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class mnr{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)SO(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),SO(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),SO(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),SO(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&SO(this.autoClosingPairsCloseSingleChar,t.close,t)}}function SO(n,e,t){n.has(e)?n.get(e).push(t):n.set(e,[t])}function yG(n,e){const t=n.getCount(),i=n.findTokenIndexAtOffset(e),r=n.getLanguageId(i);let o=i;for(;o+1<t&&n.getLanguageId(o+1)===r;)o++;let s=i;for(;s>0&&n.getLanguageId(s-1)===r;)s--;return new _nr(n,r,s,o+1,n.getStartOffset(s),n.getEndOffset(o))}class _nr{constructor(e,t,i,r,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=r,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function jv(n){return(n&3)!==0}class kA{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Kee(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Kee({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Kee({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:kA.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:kA.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}kA.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `;kA.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> `;const FRe=typeof Buffer<"u";let Gee;class CG{static wrap(e){return FRe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new CG(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return FRe?this.buffer.toString():(Gee||(Gee=new TextDecoder),Gee.decode(this.buffer))}}function vnr(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function bnr(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function x_(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function T_(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function BRe(n,e){return n[e]}function $Re(n,e,t){n[t]=e}let Yee;function SZe(){return Yee||(Yee=new TextDecoder("UTF-16LE")),Yee}let Qee;function ynr(){return Qee||(Qee=new TextDecoder("UTF-16BE")),Qee}let Xee;function EZe(){return Xee||(Xee=dXe()?SZe():ynr()),Xee}function Cnr(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?wnr(n,e,t):SZe().decode(i)}function wnr(n,e,t){const i=[];let r=0;for(let o=0;o<t;o++){const s=vnr(n,e);e+=2,i[r++]=String.fromCharCode(s)}return i.join("")}class rR{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return EZe().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||Rl(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class JW{constructor(e,t,i,r,o,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=r,this.forwardRegex=o,this.reversedRegex=s,this._openSet=JW._toSet(this.open),this._closeSet=JW._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}function Snr(n){const e=n.length;n=n.map(s=>[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s<e;s++)t[s]=s;const i=(s,a)=>{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},r=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u<e;u++)t[u]===c&&(t[u]=l)};for(let s=0;s<e;s++){const a=n[s];for(let l=s+1;l<e;l++){const c=n[l];i(a,c)&&r(t[s],t[l])}}const o=[];for(let s=0;s<e;s++){const a=[],l=[];for(let c=0;c<e;c++)if(t[c]===s){const[u,d]=n[c];a.push(u),l.push(d)}a.length>0&&o.push({open:a,close:l})}return o}class Enr{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Snr(t);this.brackets=i.map((r,o)=>new JW(e,o,r.open,r.close,xnr(r.open,r.close,i,o),Tnr(r.open,r.close,i,o))),this.forwardRegex=knr(this.brackets),this.reversedRegex=Inr(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const r of this.brackets){for(const o of r.open)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of r.close)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function xZe(n,e,t,i){for(let r=0,o=e.length;r<o;r++){if(r===t)continue;const s=e[r];for(const a of s.open)a.indexOf(n)>=0&&i.push(a);for(const a of s.close)a.indexOf(n)>=0&&i.push(a)}}function TZe(n,e){return n.length-e.length}function wG(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function xnr(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let o=0,s=r.length;o<s;o++)xZe(r[o],t,i,r);return r=wG(r),r.sort(TZe),r.reverse(),SG(r)}function Tnr(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let o=0,s=r.length;o<s;o++)xZe(r[o],t,i,r);return r=wG(r),r.sort(TZe),r.reverse(),SG(r.map(y0e))}function knr(n){let e=[];for(const t of n){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=wG(e),SG(e)}function Inr(n){let e=[];for(const t of n){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=wG(e),SG(e.map(y0e))}function Lnr(n){const e=/^[\w ]+$/.test(n);return n=tp(n),e?`\\b${n}\\b`:n}function SG(n){const e=`(${n.map(Lnr).join(")|(")})`;return MXe(e,!0)}const y0e=function(){function n(i){const r=new Uint16Array(i.length);let o=0;for(let s=i.length-1;s>=0;s--)r[o++]=i.charCodeAt(s);return EZe().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=n(e)),t}}();class sm{static _findPrevBracketInText(e,t,i,r){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),a=o[0].length,l=r+s;return new J(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,r,o){const a=y0e(i).substring(i.length-o,i.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,i,r){const o=i.match(e);if(!o)return null;const s=o.index||0,a=o[0].length;if(a===0)return null;const l=r+s;return new J(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,r,o){const s=i.substring(r,o);return this.findNextBracketInText(e,t,s,r)}}class Dnr{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const r=i.charAt(i.length-1);e.push(r)}return fS(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(i-1);if(jv(t.getStandardTokenType(r)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,a=sm.findPrevBracketInRange(o,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function A9(n){return n.global&&(n.lastIndex=0),!0}class Anr{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&A9(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&A9(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&A9(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&A9(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class sL{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=sL._createOpenBracketRegExp(t[0]),r=sL._createCloseBracketRegExp(t[1]);i&&r&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:r})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,r){if(e>=3)for(let o=0,s=this._regExpRules.length;o<s;o++){const a=this._regExpRules[o];if([{reg:a.beforeText,text:i},{reg:a.afterText,text:r},{reg:a.previousLineText,text:t}].every(c=>c.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&r.length>0)for(let o=0,s=this._brackets.length;o<s;o++){const a=this._brackets[o];if(a.openRegExp.test(i)&&a.closeRegExp.test(r))return{indentAction:Xa.IndentOutdent}}if(e>=2&&i.length>0){for(let o=0,s=this._brackets.length;o<s;o++)if(this._brackets[o].openRegExp.test(i))return{indentAction:Xa.Indent}}return null}static _createOpenBracketRegExp(e){let t=tp(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",sL._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=tp(e);return/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"),t="^\\s*"+t,sL._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return Oi(t),null}}}const dr=or("configurationService");function cce(n,e){const t=Object.create(null);for(const i in n)kZe(t,i,n[i],e);return t}function kZe(n,e,t,i){const r=e.split("."),o=r.pop();let s=n;for(let a=0;a<r.length;a++){const l=r[a];let c=s[l];switch(typeof c){case"undefined":c=s[l]=Object.create(null);break;case"object":break;default:i(`Ignoring ${e} as ${r.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}s=c}if(typeof s=="object"&&s!==null)try{s[o]=t}catch{i(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(s)}`)}else i(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(s)}`)}function Nnr(n,e){const t=e.split(".");IZe(n,t)}function IZe(n,e){const t=e.shift();if(e.length===0){delete n[t];return}if(Object.keys(n).indexOf(t)!==-1){const i=n[t];typeof i=="object"&&!Array.isArray(i)&&(IZe(i,e),Object.keys(i).length===0&&delete n[t])}}function VRe(n,e,t){function i(s,a){let l=s;for(const c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}const r=e.split("."),o=i(n,r);return typeof o>"u"?t:o}function Rnr(n){return n.replace(/[\[\]]/g,"")}const xs=or("languageService");class ab{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const LZe=[];function vr(n,e,t){e instanceof ab||(e=new ab(e,[],!!t)),LZe.push([n,e])}function HRe(){return LZe}const Ta=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),EG={JSONContribution:"base.contributions.json"};function Onr(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class Pnr{constructor(){this._onDidChangeSchema=new Le,this.schemasById={}}registerSchema(e,t){this.schemasById[Onr(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Mnr=new Pnr;Hs.add(EG.JSONContribution,Mnr);const Nv={Configuration:"base.contributions.configuration"},EO="vscode://schemas/settings/resourceLanguage",WRe=Hs.as(EG.JSONContribution);class Fnr{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new Le,this._onDidUpdateConfiguration=new Le,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:T("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},WRe.registerSchema(EO,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),WRe.registerSchema(EO,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const r=[];for(const{overrides:o,source:s}of e)for(const a in o)if(t.add(a),yS.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(s)for(const f of Object.keys(o[a]))c.set(f,s);const u=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),o[a]);this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=Rnr(a),h={type:"object",default:u,description:T("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:EO,defaultDefaultValue:u,source:Od(s)?void 0:s,defaultValueSource:s};r.push(...ez(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(r)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(r=>{this.validateAndRegisterProperties(r,t,r.extensionInfo,r.restrictedProperties,void 0,i),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}validateAndRegisterProperties(e,t=!0,i,r,o=3,s){var a;o=xf(e.scope)?o:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&Vnr(u,d)){delete l[u];continue}if(d.source=i,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),yS.test(u)?d.scope=void 0:(d.scope=xf(d.scope)?o:d.scope,d.restricted=xf(d.restricted)?!!(r!=null&&r.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,i,r,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const r=i.properties;if(r)for(const s in r)this.updateSchema(s,r[s]);const o=i.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:T("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:T("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:EO};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){T("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),T("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let r=i==null?void 0:i.value,o=i==null?void 0:i.source;Bh(r)&&(r=t.defaultDefaultValue,o=void 0),Bh(r)&&(r=$nr(t.type)),t.default=r,t.defaultValueSource=o}}const DZe="\\[([^\\]]+)\\]",zRe=new RegExp(DZe,"g"),Bnr=`^(${DZe})+$`,yS=new RegExp(Bnr);function ez(n){const e=[];if(yS.test(n)){let t=zRe.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=zRe.exec(n)}}return fS(e)}function $nr(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const j$=new Fnr;Hs.add(Nv.Configuration,j$);function Vnr(n,e){var t,i,r,o;return n.trim()?yS.test(n)?T("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):j$.getConfigurationProperties()[n]!==void 0?T("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&j$.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?T("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(r=e.policy)===null||r===void 0?void 0:r.name,j$.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:T("config.property.empty","Cannot register an empty property")}const Hnr={ModesRegistry:"editor.modesRegistry"};class Wnr{constructor(){this._onDidChangeLanguages=new Le,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e){this._languages.splice(t,1);return}}}}getLanguages(){return this._languages}}const IA=new Wnr;Hs.add(Hnr.ModesRegistry,IA);const qf="plaintext",znr=".txt";IA.registerLanguage({id:qf,extensions:[znr],aliases:[T("plainText.alias","Plain Text"),"text"],mimetypes:[Ta.text]});Hs.as(Nv.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class Unr{constructor(e,t){this.languageId=e;const i=t.brackets?URe(t.brackets):[],r=new fRe(a=>{const l=new Set;return{info:new jnr(this,a,l),closing:l}}),o=new fRe(a=>{const l=new Set,c=new Set;return{info:new qnr(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?URe(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function URe(n){return n.filter(([e,t])=>e!==""&&t!=="")}class AZe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class jnr extends AZe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class qnr extends AZe{constructor(e,t,i,r){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=r,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Knr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Zee{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const rs=or("languageConfigurationService");let uce=class extends Ue{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Xnr),this.onDidChangeEmitter=this._register(new Le),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(dce));this._register(this.configurationService.onDidChangeConfiguration(r=>{const o=r.change.keys.some(a=>i.has(a)),s=r.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new Zee(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Zee(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new Zee(r.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Gnr(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};uce=Knr([jRe(0,dr),jRe(1,xs)],uce);function Gnr(n,e,t,i){let r=e.getLanguageConfiguration(n);if(!r){if(!i.isRegisteredLanguageId(n))return new tD(n,{});r=new tD(n,{})}const o=Ynr(r.languageId,t),s=RZe([r.underlyingConfig,o]);return new tD(r.languageId,s)}const dce={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Ynr(n,e){const t=e.getValue(dce.brackets,{overrideIdentifier:n}),i=e.getValue(dce.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:qRe(t),colorizedBracketPairs:qRe(i)}}function qRe(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function NZe(n,e,t){const i=n.getLineContent(e);let r=Ko(i);return r.length>t-1&&(r=r.substring(0,t-1)),r}function eD(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),r=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return yG(i,r)}class Qnr{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new KRe(e,t,++this._order);return this._entries.push(i),this._resolved=null,mi(()=>{for(let r=0;r<this._entries.length;r++)if(this._entries[r]===i){this._entries.splice(r,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new tD(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(KRe.cmp),RZe(this._entries.map(e=>e.configuration)))}}function RZe(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class KRe{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class GRe{constructor(e){this.languageId=e}}class Xnr extends Ue{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._register(this.register(qf,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let r=this._entries.get(e);r||(r=new Qnr(e),this._entries.set(e,r));const o=r.register(t,i);return this._onDidChange.fire(new GRe(e)),mi(()=>{o.dispose(),this._onDidChange.fire(new GRe(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class tD{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new sL(this.underlyingConfig):null,this.comments=tD._handleComments(this.underlyingConfig),this.characterPair=new kA(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Xbe,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Anr(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Unr(e,this.underlyingConfig)}getWordDefinition(){return pXe(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Enr(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Dnr(this.brackets)),this._electricCharacter}onEnter(e,t,i,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,r):null}getAutoClosingPairs(){return new mnr(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[r,o]=t.blockComment;i.blockCommentStartToken=r,i.blockCommentEndToken=o}return i}}vr(rs,uce,1);class gC{constructor(e,t,i,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function OZe(n){return xG(n,0)}function xG(n,e){switch(typeof n){case"object":return n===null?Fy(349,e):Array.isArray(n)?Jnr(n,e):eir(n,e);case"string":return C0e(n,e);case"boolean":return Znr(n,e);case"number":return Fy(n,e);case"undefined":return Fy(937,e);default:return Fy(617,e)}}function Fy(n,e){return(e<<5)-e+n|0}function Znr(n,e){return Fy(n?433:863,e)}function C0e(n,e){e=Fy(149417,e);for(let t=0,i=n.length;t<i;t++)e=Fy(n.charCodeAt(t),e);return e}function Jnr(n,e){return e=Fy(104579,e),n.reduce((t,i)=>xG(i,t),e)}function eir(n,e){return e=Fy(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=C0e(i,t),xG(n[i],t)),e)}function Jee(n,e,t=32){const i=t-e,r=~((1<<i)-1);return(n<<e|(r&n)>>>i)>>>0}function YRe(n,e=0,t=n.byteLength,i=0){for(let r=0;r<t;r++)n[e+r]=i}function tir(n,e,t="0"){for(;n.length<e;)n=t+n;return n}function xO(n,e=32){return n instanceof ArrayBuffer?Array.from(new Uint8Array(n)).map(t=>t.toString(16).padStart(2,"0")).join(""):tir((n>>>0).toString(16),e/4)}class TG{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let r=this._buffLen,o=this._leftoverHighSurrogate,s,a;for(o!==0?(s=o,a=-1,o=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(Rl(s))if(a+1<t){const c=e.charCodeAt(a+1);QT(c)?(a++,l=l0e(s,c)):l=65533}else{o=s;break}else QT(s)&&(l=65533);if(r=this._push(i,r,l),a++,a<t)s=e.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=o}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(i&1984)>>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),xO(this._h0)+xO(this._h1)+xO(this._h2)+xO(this._h3)+xO(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,YRe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),YRe(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=TG._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,Jee(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let i=this._h0,r=this._h1,o=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&o|~r&s,c=1518500249):d<40?(l=r^o^s,c=1859775393):d<60?(l=r&o|r&s|o&s,c=2400959708):(l=r^o^s,c=3395469782),u=Jee(i,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=o,o=Jee(r,30),r=i,i=u;this._h0=this._h0+i&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}TG._bigBlock32=new DataView(new ArrayBuffer(320));class QRe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,r=e.length;i<r;i++)t[i]=e.charCodeAt(i);return t}}function nir(n,e,t){return new _b(new QRe(n),new QRe(e)).ComputeDiff(t).changes}class ZI{static Assert(e,t){if(!e)throw new Error(t)}}class JI{static Copy(e,t,i,r,o){for(let s=0;s<o;s++)i[r+s]=e[t+s]}static Copy2(e,t,i,r,o){for(let s=0;s<o;s++)i[r+s]=e[t+s]}}class XRe{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new gC(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class _b{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[r,o,s]=_b._getElements(e),[a,l,c]=_b._getElements(t);this._hasStrings=s&&c,this._originalStringElements=r,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(_b._isStringArray(t)){const i=new Int32Array(t.length);for(let r=0,o=t.length;r<o;r++)i[r]=C0e(t[r],0);return[t,i,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._modifiedStringElements[t]:!0}ElementsAreStrictEqual(e,t){if(!this.ElementsAreEqual(e,t))return!1;const i=_b._getStrictElement(this._originalSequence,e),r=_b._getStrictElement(this._modifiedSequence,t);return i===r}static _getStrictElement(e,t){return typeof e.getStrictElement=="function"?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._originalElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._originalStringElements[t]:!0}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._modifiedStringElements[e]===this._modifiedStringElements[t]:!0}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,r,o){const s=[!1];let a=this.ComputeDiffRecursive(e,t,i,r,s);return o&&(a=this.PrettifyChanges(a)),{quitEarly:s[0],changes:a}}ComputeDiffRecursive(e,t,i,r,o){for(o[0]=!1;e<=t&&i<=r&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&r>=i&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||i>r){let d;return i<=r?(ZI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new gC(e,0,i,r-i+1)]):e<=t?(ZI.Assert(i===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new gC(e,t-e+1,i,0)]):(ZI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),ZI.Assert(i===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,r,s,a,o),c=s[0],u=a[0];if(l!==null)return l;if(!o[0]){const d=this.ComputeDiffRecursive(e,c,i,u,o);let h=[];return o[0]?h=[new gC(c+1,t-(c+1)+1,u+1,r-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,r,o),this.ConcatenateChanges(d,h)}return[new gC(e,t-e+1,i,r-i+1)]}WALKTRACE(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m,v,_,b){let y=null,C=null,x=new XRe,E=t,k=i,L=f[0]-v[0]-r,D=-1073741824,A=this.m_forwardHistory.length-1;do{const O=L+e;O===E||O<k&&c[O-1]<c[O+1]?(d=c[O+1],g=d-L-r,d<D&&x.MarkNextChange(),D=d,x.AddModifiedElement(d+1,g),L=O+1-e):(d=c[O-1]+1,g=d-L-r,d<D&&x.MarkNextChange(),D=d-1,x.AddOriginalElement(d,g+1),L=O-1-e),A>=0&&(c=this.m_forwardHistory[A],e=c[0],E=1,k=c.length-1)}while(--A>=-1);if(y=x.getReverseChanges(),b[0]){let O=f[0]+1,P=v[0]+1;if(y!==null&&y.length>0){const F=y[y.length-1];O=Math.max(O,F.getOriginalEnd()),P=Math.max(P,F.getModifiedEnd())}C=[new gC(O,h-O+1,P,m-P+1)]}else{x=new XRe,E=s,k=a,L=f[0]-v[0]-l,D=1073741824,A=_?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const O=L+o;O===E||O<k&&u[O-1]>=u[O+1]?(d=u[O+1]-1,g=d-L-l,d>D&&x.MarkNextChange(),D=d+1,x.AddOriginalElement(d+1,g+1),L=O+1-o):(d=u[O-1],g=d-L-l,d>D&&x.MarkNextChange(),D=d,x.AddModifiedElement(d+1,g+1),L=O-1-o),A>=0&&(u=this.m_reverseHistory[A],o=u[0],E=1,k=u.length-1)}while(--A>=-1);C=x.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,r,o,s,a){let l=0,c=0,u=0,d=0,h=0,f=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(r-i),m=g+1,v=new Int32Array(m),_=new Int32Array(m),b=r-i,y=t-e,C=e-i,x=t-r,k=(y-b)%2===0;v[b]=e,_[y]=t,a[0]=!1;for(let L=1;L<=g/2+1;L++){let D=0,A=0;u=this.ClipDiagonalBound(b-L,L,b,m),d=this.ClipDiagonalBound(b+L,L,b,m);for(let P=u;P<=d;P+=2){P===u||P<d&&v[P-1]<v[P+1]?l=v[P+1]:l=v[P-1]+1,c=l-(P-b)-C;const F=l;for(;l<t&&c<r&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(v[P]=l,l+c>D+A&&(D=l,A=c),!k&&Math.abs(P-y)<=L-1&&l>=_[P])return o[0]=l,s[0]=c,F<=_[P]&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,f,x,v,_,l,t,o,c,r,s,k,a):null}const O=(D-e+(A-i)-L)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(D,O))return a[0]=!0,o[0]=D,s[0]=A,O>0&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,f,x,v,_,l,t,o,c,r,s,k,a):(e++,i++,[new gC(e,t-e+1,i,r-i+1)]);h=this.ClipDiagonalBound(y-L,L,y,m),f=this.ClipDiagonalBound(y+L,L,y,m);for(let P=h;P<=f;P+=2){P===h||P<f&&_[P-1]>=_[P+1]?l=_[P+1]-1:l=_[P-1],c=l-(P-y)-x;const F=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(_[P]=l,k&&Math.abs(P-b)<=L&&l<=v[P])return o[0]=l,s[0]=c,F>=v[P]&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,f,x,v,_,l,t,o,c,r,s,k,a):null}if(L<=1447){let P=new Int32Array(d-u+2);P[0]=b-u+1,JI.Copy2(v,u,P,1,d-u+1),this.m_forwardHistory.push(P),P=new Int32Array(f-h+2),P[0]=y-h+1,JI.Copy2(_,h,P,1,f-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(b,u,d,C,y,h,f,x,v,_,l,t,o,c,r,s,k,a)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],r=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength<r&&i.modifiedStart+i.modifiedLength<o&&(!s||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!a||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const c=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!c)break;i.originalStart++,i.modifiedStart++}const l=[null];if(t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],l)){e[t]=l[0],e.splice(t+1,1),t--;continue}}for(let t=e.length-1;t>=0;t--){const i=e[t];let r=0,o=0;if(t>0){const d=e[t-1];r=d.originalStart+d.originalLength,o=d.modifiedStart+d.modifiedLength}const s=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let d=1;;d++){const h=i.originalStart-d,f=i.modifiedStart-d;if(h<r||f<o||s&&!this.OriginalElementsAreEqual(h,h+i.originalLength)||a&&!this.ModifiedElementsAreEqual(f,f+i.modifiedLength))break;const m=(h===r&&f===o?5:0)+this._boundaryScore(h,i.originalLength,f,i.modifiedLength);m>c&&(c=m,l=d)}i.originalStart-=l,i.modifiedStart-=l;const u=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],u)){e[t-1]=u[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const r=e[t-1],o=e[t],s=o.originalStart-r.originalStart-r.originalLength,a=r.originalStart,l=o.originalStart+o.originalLength,c=l-a,u=r.modifiedStart,d=o.modifiedStart+o.modifiedLength,h=d-u;if(s<5&&c<20&&h<20){const f=this._findBetterContiguousSequence(a,c,u,h,s);if(f){const[g,m]=f;(g!==r.originalStart+r.originalLength||m!==r.modifiedStart+r.modifiedLength)&&(r.originalLength=g-r.originalStart,r.modifiedLength=m-r.modifiedStart,o.originalStart=g+s,o.modifiedStart=m+s,o.originalLength=l-o.originalStart,o.modifiedLength=d-o.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,r,o){if(t<o||r<o)return null;const s=e+t-o+1,a=i+r-o+1;let l=0,c=0,u=0;for(let d=e;d<s;d++)for(let h=i;h<a;h++){const f=this._contiguousSequenceScore(d,h,o);f>0&&f>l&&(l=f,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,i){let r=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;r+=this._originalStringElements[e+o].length}return r}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,r){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(i,r)?1:0;return o+s}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const r=new Array(e.length+t.length-1);return JI.Copy(e,0,r,0,e.length-1),r[e.length-1]=i[0],JI.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return JI.Copy(e,0,r,0,e.length),JI.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,i){if(ZI.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),ZI.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const r=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new gC(r,o,s,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,r){if(e>=0&&e<r)return e;const o=i,s=r-i-1,a=t%2===0;if(e<0){const l=o%2===0;return a===l?0:1}else{const l=s%2===0;return a===l?r-1:r-2}}}function tz(n){return n<0?0:n>255?255:n|0}function e2(n){return n<0?0:n>4294967295?4294967295:n|0}class iir{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=e2(e);const i=this.values,r=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=e2(e),t=e2(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=e2(e),t=e2(t);const i=this.values,r=this.prefixSum;if(e>=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=e2(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,r=0,o=0,s=0;for(;t<=i;)if(r=t+(i-t)/2|0,o=this.prefixSum[r],s=o-this.values[r],e<s)i=r-1;else if(e>=o)t=r+1;else break;return new PZe(r,e-s)}}class rir{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new PZe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=eG(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const i=this._values[e],r=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=r+i;for(let o=0;o<i;o++)this._indexBySum[r+o]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class PZe{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class oir{constructor(e,t,i,r){this._uri=e,this._lines=t,this._eol=i,this._versionId=r,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new De(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let r=0;r<t;r++)i[r]=this._lines[r].length+e;this._lineStarts=new iir(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1));return}this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){if(t.length===0)return;const i=l0(t);if(i.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);const r=new Uint32Array(i.length-1);for(let o=1;o<i.length;o++)this._lines.splice(e.lineNumber+o-1,0,i[o]),r[o-1]=i[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,r)}}class oR{constructor(e){const t=tz(e);this._defaultValue=t,this._asciiMap=oR._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=tz(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class nz{constructor(){this._actual=new oR(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class sir{constructor(e,t,i){const r=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)r[o]=i;this._data=r,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class air{constructor(e){let t=0,i=0;for(let o=0,s=e.length;o<s;o++){const[a,l,c]=e[o];l>t&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const r=new sir(i,t,0);for(let o=0,s=e.length;o<s;o++){const[a,l,c]=e[o];r.set(a,l,c)}this._states=r,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let ete=null;function lir(){return ete===null&&(ete=new air([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),ete}let TO=null;function cir(){if(TO===null){TO=new oR(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<n.length;t++)TO.set(n.charCodeAt(t),1);const e=".,;:";for(let t=0;t<e.length;t++)TO.set(e.charCodeAt(t),2)}return TO}class iz{static _createLink(e,t,i,r,o){let s=o-1;do{const a=t.charCodeAt(s);if(e.get(a)!==2)break;s--}while(s>r);if(r>0){const a=t.charCodeAt(r-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:i,startColumn:r+1,endLineNumber:i,endColumn:s+2},url:t.substring(r,s+1)}}static computeLinks(e,t=lir()){const i=cir(),r=[];for(let o=1,s=e.getLineCount();o<=s;o++){const a=e.getLineContent(o),l=a.length;let c=0,u=0,d=0,h=1,f=!1,g=!1,m=!1,v=!1;for(;c<l;){let _=!1;const b=a.charCodeAt(c);if(h===13){let y;switch(b){case 40:f=!0,y=0;break;case 41:y=f?0:1;break;case 91:m=!0,g=!0,y=0;break;case 93:m=!1,y=g?0:1;break;case 123:v=!0,y=0;break;case 125:y=v?0:1;break;case 39:case 34:case 96:d===b?y=1:d===39||d===34||d===96?y=0:y=1;break;case 42:y=d===42?1:0;break;case 124:y=d===124?1:0;break;case 32:y=m?0:1;break;default:y=i.get(b)}y===1&&(r.push(iz._createLink(i,a,o,u,c)),_=!0)}else if(h===12){let y;b===91?(g=!0,y=0):y=i.get(b),y===1?_=!0:h=13}else h=t.nextState(h,b),h===0&&(_=!0);_&&(h=1,f=!1,g=!1,v=!1,u=c+1,d=b),c++}h===13&&r.push(iz._createLink(i,a,o,u,l))}return r}}function uir(n){return!n||typeof n.getLineCount!="function"||typeof n.getLineContent!="function"?[]:iz.computeLinks(n)}class hce{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,r,o){if(e&&t){const s=this.doNavigateValueSet(t,o);if(s)return{range:e,value:s}}if(i&&r){const s=this.doNavigateValueSet(r,o);if(s)return{range:i,value:s}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return i!==null?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let r=Number(e);const o=parseFloat(e);return!isNaN(r)&&!isNaN(o)&&r===o?r===0&&!t?null:(r=Math.floor(r*i),r+=t?i:-i,String(r/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let r=null;for(let o=0,s=e.length;r===null&&o<s;o++)r=this.valueSetReplace(e[o],t,i);return r}valueSetReplace(e,t,i){let r=e.indexOf(t);return r>=0?(r+=i?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null}}hce.INSTANCE=new hce;class dir extends oR{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}function hir(n){const e={};return t=>(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const bg=hir(n=>new dir(n));var np;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(np||(np={}));var nD;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(nD||(nD={}));var jh;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(jh||(jh={}));var tv;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(tv||(tv={}));class q${get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&jf(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class L3{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function fir(n){return n&&typeof n.read=="function"}class tte{constructor(e,t,i,r,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class pir{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class gir{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function mir(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const _ir=999;class ax{constructor(e,t,i,r){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=r}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=vir(this.searchString):e=this.searchString.indexOf(` `)>=0;let t=null;try{t=MXe(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new pir(t,this.wordSeparators?bg(this.wordSeparators):null,i?this.searchString:null)}}function vir(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e<t;e++){const i=n.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const r=n.charCodeAt(e);if(r===110||r===114||r===87)return!0}}return!1}function wx(n,e,t){if(!t)return new L3(n,null);const i=[];for(let r=0,o=e.length;r<o;r++)i[r]=e[r];return new L3(n,i)}class ZRe{constructor(e){const t=[];let i=0;for(let r=0,o=e.length;r<o;r++)e.charCodeAt(r)===10&&(t[i++]=r);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,r=t.length-1;if(r===-1||e<=t[0])return 0;for(;i<r;){const o=i+((r-i)/2>>0);t[o]>=e?r=o-1:t[o+1]>=e?(i=o,r=o):i=o+1}return i+1}}class N9{static findMatches(e,t,i,r,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new aL(s.wordSeparators,s.regex),r,o):this._doFindMatchesLineByLine(e,i,s,r,o):[]}static _getMultilineMatchRange(e,t,i,r,o,s){let a,l=0;r?(l=r.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(r){const f=r.findLineFeedCountBeforeOffset(o+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new J(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,r,o){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r `?new ZRe(a):null,c=[];let u=0,d;for(i.reset(0);d=i.next(a);)if(c[u++]=wx(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,r),u>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,r,o){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,s,r,o),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,s,r,o);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<o;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,s,r,o);if(a<o){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,s,r,o)}return s}static _findMatchesInLine(e,t,i,r,o,s,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=t.length;let m=-f;for(;(m=t.indexOf(h,m+f))!==-1;)if((!c||w0e(c,t,g,m,f))&&(s[o++]=new L3(new J(i,m+1+r,i,m+1+f+r),null),o>=l))return o;return o}const u=new aL(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[o++]=wx(new J(i,d.index+1+r,i,d.index+1+d[0].length+r),d,a),o>=l))return o;while(d);return o}static findNextMatch(e,t,i,r){const o=t.parseSearchRequest();if(!o)return null;const s=new aL(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,r):this._doFindNextMatchLineByLine(e,i,s,r)}static _doFindNextMatchMultiline(e,t,i,r){const o=new De(t.lineNumber,1),s=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new J(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r `?new ZRe(l):null;i.reset(t.column-1);const u=i.next(l);return u?wx(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new De(1,1),i,r):null}static _doFindNextMatchLineByLine(e,t,i,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(i,a,s,t.column,r);if(l)return l;for(let c=1;c<=o;c++){const u=(s+c-1)%o,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(i,d,u+1,1,r);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,r,o){e.reset(r-1);const s=e.next(t);return s?wx(new J(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,r){const o=t.parseSearchRequest();if(!o)return null;const s=new aL(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,r):this._doFindPreviousMatchLineByLine(e,i,s,r)}static _doFindPreviousMatchMultiline(e,t,i,r){const o=this._doFindMatchesMultiline(e,new J(1,1,t.lineNumber,t.column),i,r,10*_ir);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new De(s,e.getLineMaxColumn(s)),i,r):null}static _doFindPreviousMatchLineByLine(e,t,i,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,s,r);if(l)return l;for(let c=1;c<=o;c++){const u=(o+s-c-1)%o,d=e.getLineContent(u+1),h=this._findLastMatchInLine(i,d,u+1,r);if(h)return h}return null}static _findLastMatchInLine(e,t,i,r){let o=null,s;for(e.reset(0);s=e.next(t);)o=wx(new J(i,s.index+1,i,s.index+1+s[0].length),s,r);return o}}function bir(n,e,t,i,r){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(i);if(n.get(s)!==0)return!0}return!1}function yir(n,e,t,i,r){if(i+r===t)return!0;const o=e.charCodeAt(i+r);if(n.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(i+r-1);if(n.get(s)!==0)return!0}return!1}function w0e(n,e,t,i,r){return bir(n,e,t,i,r)&&yir(n,e,t,i,r)}class aL{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const r=i.index,o=i[0].length;if(r===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){GW(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=o,!this._wordSeparators||w0e(this._wordSeparators,e,t,r,o))return i}while(i);return null}}class S0e{static computeUnicodeHighlights(e,t,i){const r=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new JRe(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${Cir(Array.from(a))}`,"g");const c=new aL(null,l),u=[];let d=!1,h,f=0,g=0,m=0;e:for(let v=r,_=o;v<=_;v++){const b=e.getLineContent(v),y=b.length;c.reset(0);do if(h=c.next(b),h){let C=h.index,x=h.index+h[0].length;if(C>0){const D=b.charCodeAt(C-1);Rl(D)&&C--}if(x+1<y){const D=b.charCodeAt(x-1);Rl(D)&&x++}const E=b.substring(C,x);let k=v3(C+1,Xbe,b,0);k&&k.endColumn<=C+1&&(k=null);const L=s.shouldHighlightNonBasicASCII(E,k?k.word:null);if(L!==0){L===3?f++:L===2?g++:L===1?m++:fG();const D=1e3;if(u.length>=D){d=!0;break e}u.push(new J(v,C+1,v,x+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new JRe(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),s=i.ambiguousCharacters.getPrimaryConfusable(o),a=XT.getLocales().filter(l=>!XT.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function Cir(n,e){return`[${tp(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class JRe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=XT.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Qb.codePoints)eOe(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let r=!1,o=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=C6(s);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Qb.isInvisibleCharacter(a)&&(o=!0)}return!r&&o?0:this.options.invisibleCharacters&&!eOe(e)&&Qb.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function eOe(n){return n===" "||n===` `||n===" "}class K${constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class MZe{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class rr{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let r=i;for(;r<t.length&&t[r].start<=e.endExclusive;)r++;if(i===r)t.splice(i,0,e);else{const o=Math.min(e.start,t[i].start),s=Math.max(e.endExclusive,t[r-1].endExclusive);t.splice(i,r-i,new rr(o,s))}}static tryCreate(e,t){if(!(e>t))return new rr(e,t)}static ofLength(e){return new rr(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Qa(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new rr(this.start+e,this.endExclusive+e)}deltaStart(e){return new rr(this.start+e,this.endExclusive)}deltaEnd(e){return new rr(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new rr(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new rr(t,i)}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Qa(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Qa(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}class E0e{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const r=Math.min(e.start,this._sortedRanges[t].start),o=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new rr(r,o))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new E0e;for(const i of this._sortedRanges){const r=i.intersect(e);r&&t.addRange(r)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}}function rz(n,e,t){const i=wir(n,e);if(i!==-1)return n[i]}function wir(n,e,t=n.length-1){for(let i=t;i>=0;i--){const r=n[i];if(e(r))return i}return-1}function D3(n,e){const t=A3(n,e);return t===-1?void 0:n[t]}function A3(n,e,t=0,i=n.length){let r=t,o=i;for(;r<o;){const s=Math.floor((r+o)/2);e(n[s])?r=s+1:o=s}return r-1}function Sir(n,e){const t=N3(n,e);return t===n.length?void 0:n[t]}function N3(n,e,t=0,i=n.length){let r=t,o=i;for(;r<o;){const s=Math.floor((r+o)/2);e(n[s])?o=s:r=s+1}return r}class E6{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(E6.assertInvariants){if(this._prevFindLastPredicate){for(const i of this._array)if(this._prevFindLastPredicate(i)&&!e(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const t=A3(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}}E6.assertInvariants=!1;function FZe(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i<n.length;i++){const r=n[i];e(r,t)>0&&(t=r)}return t}function Eir(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i<n.length;i++){const r=n[i];e(r,t)>=0&&(t=r)}return t}function xir(n,e){return FZe(n,(t,i)=>-e(t,i))}function Tir(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i<n.length;i++){const r=n[i];e(r,n[t])>0&&(t=i)}return t}function kir(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let cr=class mC{static fromRange(e){return new mC(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new vb(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new vb(e[i].slice()));return t.ranges}static ofLength(e,t){return new mC(e,e+t)}static deserialize(e){return new mC(e[0],e[1])}constructor(e,t){if(e>t)throw new Qa(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new mC(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new mC(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new mC(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumberExclusive,e.endLineNumberExclusive);if(t<=i)return new mC(t,i)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}overlapOrTouch(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new J(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new J(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){const t=[];for(let i=this.startLineNumber;i<this.endLineNumberExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}includes(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}toOffsetRange(){return new rr(this.startLineNumber-1,this.endLineNumberExclusive-1)}};class vb{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(e.length===0)return;const t=N3(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=A3(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const r=this._normalizedRanges[t];this._normalizedRanges[t]=r.join(e)}else{const r=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,r)}}contains(e){const t=D3(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,r=0,o=null;for(;i<this._normalizedRanges.length||r<e._normalizedRanges.length;){let s=null;if(i<this._normalizedRanges.length&&r<e._normalizedRanges.length){const a=this._normalizedRanges[i],l=e._normalizedRanges[r];a.startLineNumber<l.startLineNumber?(s=a,i++):(s=l,r++)}else i<this._normalizedRanges.length?(s=this._normalizedRanges[i],i++):(s=e._normalizedRanges[r],r++);o===null?o=s:o.endLineNumberExclusive>=s.startLineNumber?o=new cr(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return o!==null&&t.push(o),new vb(t)}subtractFrom(e){const t=N3(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),i=A3(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new vb([e]);const r=[];let o=e.startLineNumber;for(let s=t;s<i;s++){const a=this._normalizedRanges[s];a.startLineNumber>o&&r.push(new cr(o,a.startLineNumber)),o=a.endLineNumberExclusive}return o<e.endLineNumberExclusive&&r.push(new cr(o,e.endLineNumberExclusive)),new vb(r)}toString(){return this._normalizedRanges.map(e=>e.toString()).join(", ")}getIntersection(e){const t=[];let i=0,r=0;for(;i<this._normalizedRanges.length&&r<e._normalizedRanges.length;){const o=this._normalizedRanges[i],s=e._normalizedRanges[r],a=o.intersect(s);a&&!a.isEmpty&&t.push(a),o.endLineNumberExclusive<s.endLineNumberExclusive?i++:r++}return new vb(t)}getWithDelta(e){return new vb(this._normalizedRanges.map(t=>t.delta(e)))}}class u0{static inverse(e,t,i){const r=[];let o=1,s=1;for(const l of e){const c=new yg(new cr(o,l.original.startLineNumber),new cr(s,l.modified.startLineNumber),void 0);c.modified.isEmpty||r.push(c),o=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new yg(new cr(o,t+1),new cr(s,i+1),void 0);return a.modified.isEmpty||r.push(a),r}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new u0(this.modified,this.original)}join(e){return new u0(this.original.join(e.original),this.modified.join(e.modified))}}class yg extends u0{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new yg(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class CS{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new CS(this.modifiedRange,this.originalRange)}}const Iir=3;class Lir{computeDiff(e,t,i){var r;const s=new Nir(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new cr(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new cr(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new cr(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new cr(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new yg(u,d,(r=c.charChanges)===null||r===void 0?void 0:r.map(f=>new CS(new J(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new J(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new yg(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return x3(()=>GXe(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive<u.original.startLineNumber&&c.modified.endLineNumberExclusive<u.modified.startLineNumber)),new K$(a,[],s.quitEarly)}}function BZe(n,e,t,i){return new _b(n,e,t).ComputeDiff(i)}let tOe=class{constructor(e){const t=[],i=[];for(let r=0,o=e.length;r<o;r++)t[r]=fce(e[r],1),i[r]=pce(e[r],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const r=[],o=[],s=[];let a=0;for(let l=t;l<=i;l++){const c=this.lines[l],u=e?this._startColumns[l]:1,d=e?this._endColumns[l]:c.length+1;for(let h=u;h<d;h++)r[a]=c.charCodeAt(h-1),o[a]=l+1,s[a]=h,a++;!e&&l<i&&(r[a]=10,o[a]=l+1,s[a]=c.length+1,a++)}return new Dir(r,o,s)}};class Dir{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map((e,t)=>(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class iD{constructor(e,t,i,r,o,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=r,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const r=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),u=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new iD(r,o,s,a,l,c,u,d)}}function Air(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,r=n.length;i<r;i++){const o=n[i],s=o.originalStart-(t.originalStart+t.originalLength),a=o.modifiedStart-(t.modifiedStart+t.modifiedLength);Math.min(s,a)<Iir?(t.originalLength=o.originalStart+o.originalLength-t.originalStart,t.modifiedLength=o.modifiedStart+o.modifiedLength-t.modifiedStart):(e.push(o),t=o)}return e}class LM{constructor(e,t,i,r,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=r,this.charChanges=o}static createFromDiffResult(e,t,i,r,o,s,a){let l,c,u,d,h;if(t.originalLength===0?(l=i.getStartLineNumber(t.originalStart)-1,c=0):(l=i.getStartLineNumber(t.originalStart),c=i.getEndLineNumber(t.originalStart+t.originalLength-1)),t.modifiedLength===0?(u=r.getStartLineNumber(t.modifiedStart)-1,d=0):(u=r.getStartLineNumber(t.modifiedStart),d=r.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),s&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let m=BZe(f,g,o,!0).changes;a&&(m=Air(m)),h=[];for(let v=0,_=m.length;v<_;v++)h.push(iD.createFromDiffChange(m[v],f,g))}}return new LM(l,c,u,d,h)}}class Nir{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new tOe(e),this.modified=new tOe(t),this.continueLineDiff=nOe(i.maxComputationTime),this.continueCharDiff=nOe(i.maxComputationTime===0?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(this.original.lines.length===1&&this.original.lines[0].length===0)return this.modified.lines.length===1&&this.modified.lines[0].length===0?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(this.modified.lines.length===1&&this.modified.lines[0].length===0)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=BZe(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const a=[];for(let l=0,c=t.length;l<c;l++)a.push(LM.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[l],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:a}}const r=[];let o=0,s=0;for(let a=-1,l=t.length;a<l;a++){const c=a+1<l?t[a+1]:null,u=c?c.originalStart:this.originalLines.length,d=c?c.modifiedStart:this.modifiedLines.length;for(;o<u&&s<d;){const h=this.originalLines[o],f=this.modifiedLines[s];if(h!==f){{let g=fce(h,1),m=fce(f,1);for(;g>1&&m>1;){const v=h.charCodeAt(g-2),_=f.charCodeAt(m-2);if(v!==_)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(r,o+1,1,g,s+1,1,m)}{let g=pce(h,1),m=pce(f,1);const v=h.length+1,_=f.length+1;for(;g<v&&m<_;){const b=h.charCodeAt(g-1),y=h.charCodeAt(m-1);if(b!==y)break;g++,m++}(g<v||m<_)&&this._pushTrimWhitespaceCharChange(r,o+1,g,v,s+1,m,_)}}o++,s++}c&&(r.push(LM.createFromDiffResult(this.shouldIgnoreTrimWhitespace,c,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=c.originalLength,s+=c.modifiedLength)}return{quitEarly:i,changes:r}}_pushTrimWhitespaceCharChange(e,t,i,r,o,s,a){if(this._mergeTrimWhitespaceCharChange(e,t,i,r,o,s,a))return;let l;this.shouldComputeCharChanges&&(l=[new iD(t,i,t,r,o,s,o,a)]),e.push(new LM(t,t,o,o,l))}_mergeTrimWhitespaceCharChange(e,t,i,r,o,s,a){const l=e.length;if(l===0)return!1;const c=e[l-1];return c.originalEndLineNumber===0||c.modifiedEndLineNumber===0?!1:c.originalEndLineNumber===t&&c.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&c.charChanges&&c.charChanges.push(new iD(t,i,t,r,o,s,o,a)),!0):c.originalEndLineNumber+1===t&&c.modifiedEndLineNumber+1===o?(c.originalEndLineNumber=t,c.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&c.charChanges&&c.charChanges.push(new iD(t,i,t,r,o,s,o,a)),!0):!1}}function fce(n,e){const t=Yu(n);return t===-1?e:t+1}function pce(n,e){const t=dv(n);return t===-1?e:t+2}function nOe(n){if(n===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<n}class Zy{static trivial(e,t){return new Zy([new vc(rr.ofLength(e.length),rr.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new Zy([new vc(rr.ofLength(e.length),rr.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class vc{static invert(e,t){const i=[];return eXe(e,(r,o)=>{i.push(vc.fromOffsetPairs(r?r.getEndExclusives():Ab.zero,o?o.getStarts():new Ab(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new vc(new rr(e.offset1,t.offset1),new rr(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new vc(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new vc(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new vc(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new vc(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new vc(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new vc(t,i)}getStarts(){return new Ab(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Ab(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Ab{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Ab.zero=new Ab(0,0);Ab.max=new Ab(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class R3{isValid(){return!0}}R3.instance=new R3;class Rir{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Qa("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime<this.timeout)&&this.valid){this.valid=!1;debugger}return this.valid}}class nte{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function gce(n){return n===32||n===9}class LA{static getKey(e){let t=this.chrKeys.get(e);return t===void 0&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let r=0;for(let o=e.startLineNumber-1;o<e.endLineNumberExclusive-1;o++){const s=t[o];for(let l=0;l<s.length;l++){r++;const c=s[l],u=LA.getKey(c);this.histogram[u]=(this.histogram[u]||0)+1}r++;const a=LA.getKey(` `);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=r}computeSimilarity(e){var t,i;let r=0;const o=Math.max(this.histogram.length,e.histogram.length);for(let s=0;s<o;s++)r+=Math.abs(((t=this.histogram[s])!==null&&t!==void 0?t:0)-((i=e.histogram[s])!==null&&i!==void 0?i:0));return 1-r/(this.totalCount+e.totalCount)}}LA.chrKeys=new Map;class Oir{compute(e,t,i=R3.instance,r){if(e.length===0||t.length===0)return Zy.trivial(e,t);const o=new nte(e.length,t.length),s=new nte(e.length,t.length),a=new nte(e.length,t.length);for(let g=0;g<e.length;g++)for(let m=0;m<t.length;m++){if(!i.isValid())return Zy.trivialTimedOut(e,t);const v=g===0?0:o.get(g-1,m),_=m===0?0:o.get(g,m-1);let b;e.getElement(g)===t.getElement(m)?(g===0||m===0?b=0:b=o.get(g-1,m-1),g>0&&m>0&&s.get(g-1,m-1)===3&&(b+=a.get(g-1,m-1)),b+=r?r(g,m):1):b=-1;const y=Math.max(v,_,b);if(y===b){const C=g>0&&m>0?a.get(g-1,m-1):0;a.set(g,m,C+1),s.set(g,m,3)}else y===v?(a.set(g,m,0),s.set(g,m,1)):y===_&&(a.set(g,m,0),s.set(g,m,2));o.set(g,m,y)}const l=[];let c=e.length,u=t.length;function d(g,m){(g+1!==c||m+1!==u)&&l.push(new vc(new rr(g+1,c),new rr(m+1,u))),c=g,u=m}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new Zy(l,!1)}}class $Ze{compute(e,t,i=R3.instance){if(e.length===0||t.length===0)return Zy.trivial(e,t);const r=e,o=t;function s(m,v){for(;m<r.length&&v<o.length&&r.getElement(m)===o.getElement(v);)m++,v++;return m}let a=0;const l=new Pir;l.set(0,s(0,0));const c=new Mir;c.set(0,l.get(0)===0?null:new iOe(null,0,0,l.get(0)));let u=0;e:for(;;){if(a++,!i.isValid())return Zy.trivialTimedOut(r,o);const m=-Math.min(a,o.length+a%2),v=Math.min(a,r.length+a%2);for(u=m;u<=v;u+=2){const _=u===v?-1:l.get(u+1),b=u===m?-1:l.get(u-1)+1,y=Math.min(Math.max(_,b),r.length),C=y-u;if(y>r.length||C>o.length)continue;const x=s(y,C);l.set(u,x);const E=y===_?c.get(u+1):c.get(u-1);if(c.set(u,x!==y?new iOe(E,y,C,x-y):E),l.get(u)===r.length&&l.get(u)-u===o.length)break e}}let d=c.get(u);const h=[];let f=r.length,g=o.length;for(;;){const m=d?d.x+d.length:0,v=d?d.y+d.length:0;if((m!==f||v!==g)&&h.push(new vc(new rr(m,f),new rr(v,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new Zy(h,!1)}}class iOe{constructor(e,t,i,r){this.prev=e,this.x=t,this.y=i,this.length=r}}class Pir{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class Mir{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var rOe,oOe;class Fir{constructor(e,t){this.uri=e,this.value=t}}function Bir(n){return Array.isArray(n)}class mu{constructor(e,t){if(this[rOe]="ResourceMap",e instanceof mu)this.map=new Map(e.map),this.toKey=t??mu.defaultToKey;else if(Bir(e)){this.map=new Map,this.toKey=t??mu.defaultToKey;for(const[i,r]of e)this.set(i,r)}else this.map=new Map,this.toKey=e??mu.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Fir(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,r]of this.map)e(r.value,r.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(rOe=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}mu.defaultToKey=n=>n.toString();class $ir{constructor(){this[oOe]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let r=this._map.get(e);if(r)r.value=t,i!==0&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}[(oOe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class hE extends $ir{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class Vir{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class x0e{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class oz{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let r=!1;t.start>0&&t.endExclusive>=e.length&&(t=new rr(t.start-1,t.endExclusive),r=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;o<this.lineRange.endExclusive;o++){let s=e[o],a=0;if(r)a=s.length,s="",r=!1;else if(!i){const l=s.trimStart();a=s.length-l.length,s=l.trimEnd()}this.additionalOffsetByLine.push(a);for(let l=0;l<s.length;l++)this.elements.push(s.charCodeAt(l));o<e.length-1&&(this.elements.push(` `.charCodeAt(0)),this.firstCharOffsetByLine[o-this.lineRange.start+1]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new rr(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(t=>String.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=aOe(e>0?this.elements[e-1]:-1),i=aOe(e<this.elements.length?this.elements[e]:-1);if(t===6&&i===7)return 0;let r=0;return t!==i&&(r+=10,t===0&&i===1&&(r+=1)),r+=sOe(t),r+=sOe(i),r}translateOffset(e){if(this.lineRange.isEmpty)return new De(this.lineRange.start+1,1);const t=A3(this.firstCharOffsetByLine,i=>i<=e);return new De(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return J.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!ite(this.elements[e]))return;let t=e;for(;t>0&&ite(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&ite(this.elements[i]);)i++;return new rr(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){var t,i;const r=(t=D3(this.firstCharOffsetByLine,s=>s<=e.start))!==null&&t!==void 0?t:0,o=(i=Sir(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&i!==void 0?i:this.elements.length;return new rr(r,o)}}function ite(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const Hir={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function sOe(n){return Hir[n]}function aOe(n){return n===10?7:n===13?6:gce(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function Wir(n,e,t,i,r,o){let{moves:s,excludedChanges:a}=zir(n,e,t,o);if(!o.isValid())return[];const l=n.filter(u=>!a.has(u)),c=Uir(l,i,r,e,t,o);return ele(s,c),s=jir(s),s=s.filter(u=>u.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` `).length>=10),s=qir(n,s),s}function zir(n,e,t,i){const r=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new LA(l.original,e,l)),s=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new LA(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,u;for(const d of s){const h=l.computeSimilarity(d);h>c&&(c=h,u=d)}if(c>.9&&u&&(s.delete(u),r.push(new u0(l.range,u.range)),a.add(l.source),a.add(u.source)),!i.isValid())return{moves:r,excludedChanges:a}}return{moves:r,excludedChanges:a}}function Uir(n,e,t,i,r,o){const s=[],a=new x0e;for(const h of n)for(let f=h.original.startLineNumber;f<h.original.endLineNumberExclusive-2;f++){const g=`${e[f-1]}:${e[f+1-1]}:${e[f+2-1]}`;a.add(g,{range:new cr(f,f+3)})}const l=[];n.sort(sg(h=>h.modified.startLineNumber,Qy));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g<h.modified.endLineNumberExclusive-2;g++){const m=`${t[g-1]}:${t[g+1-1]}:${t[g+2-1]}`,v=new cr(g,g+3),_=[];a.forEach(m,({range:b})=>{for(const C of f)if(C.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&C.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){C.originalLineRange=new cr(C.originalLineRange.startLineNumber,b.endLineNumberExclusive),C.modifiedLineRange=new cr(C.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),_.push(C);return}const y={modifiedLineRange:v,originalLineRange:b};l.push(y),_.push(y)}),f=_}if(!o.isValid())return[]}l.sort(rXe(sg(h=>h.modifiedLineRange.length,Qy)));const c=new vb,u=new vb;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),m=u.subtractFrom(h.originalLineRange).getWithDelta(f),v=g.getIntersection(m);for(const _ of v.ranges){if(_.length<3)continue;const b=_,y=_.delta(-f);s.push(new u0(y,b)),c.addRange(b),u.addRange(y)}}s.sort(sg(h=>h.original.startLineNumber,Qy));const d=new E6(n);for(let h=0;h<s.length;h++){const f=s[h],g=d.findLastMonotonous(E=>E.original.startLineNumber<=f.original.startLineNumber),m=D3(n,E=>E.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),_=d.findLastMonotonous(E=>E.original.startLineNumber<f.original.endLineNumberExclusive),b=D3(n,E=>E.modified.startLineNumber<f.modified.endLineNumberExclusive),y=Math.max(_.original.endLineNumberExclusive-f.original.endLineNumberExclusive,b.modified.endLineNumberExclusive-f.modified.endLineNumberExclusive);let C;for(C=0;C<v;C++){const E=f.original.startLineNumber-C-1,k=f.modified.startLineNumber-C-1;if(E>i.length||k>r.length||c.contains(k)||u.contains(E)||!lOe(i[E-1],r[k-1],o))break}C>0&&(u.addRange(new cr(f.original.startLineNumber-C,f.original.startLineNumber)),c.addRange(new cr(f.modified.startLineNumber-C,f.modified.startLineNumber)));let x;for(x=0;x<y;x++){const E=f.original.endLineNumberExclusive+x,k=f.modified.endLineNumberExclusive+x;if(E>i.length||k>r.length||c.contains(k)||u.contains(E)||!lOe(i[E-1],r[k-1],o))break}x>0&&(u.addRange(new cr(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+x)),c.addRange(new cr(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+x))),(C>0||x>0)&&(s[h]=new u0(new cr(f.original.startLineNumber-C,f.original.endLineNumberExclusive+x),new cr(f.modified.startLineNumber-C,f.modified.endLineNumberExclusive+x)))}return s}function lOe(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const r=new $Ze().compute(new oz([n],new rr(0,1),!1),new oz([e],new rr(0,1),!1),t);let o=0;const s=vc.invert(r.diffs,n.length);for(const u of s)u.seq1Range.forEach(d=>{gce(n.charCodeAt(d))||o++});function a(u){let d=0;for(let h=0;h<n.length;h++)gce(u.charCodeAt(h))||d++;return d}const l=a(n.length>e.length?n:e);return o/l>.6&&l>10}function jir(n){if(n.length===0)return n;n.sort(sg(t=>t.original.startLineNumber,Qy));const e=[n[0]];for(let t=1;t<n.length;t++){const i=e[e.length-1],r=n[t],o=r.original.startLineNumber-i.original.endLineNumberExclusive,s=r.modified.startLineNumber-i.modified.endLineNumberExclusive;if(o>=0&&s>=0&&o+s<=2){e[e.length-1]=i.join(r);continue}e.push(r)}return e}function qir(n,e){const t=new E6(n);return e=e.filter(i=>{const r=t.findLastMonotonous(a=>a.original.endLineNumberExclusive<i.original.endLineNumberExclusive)||new u0(new cr(1,1),new cr(1,1)),o=D3(n,a=>a.modified.endLineNumberExclusive<i.modified.endLineNumberExclusive);return r!==o}),e}function mce(n,e,t){let i=t;return i=Kir(n,e,i),i=Gir(n,e,i),i}function Kir(n,e,t){if(t.length===0)return t;const i=[];i.push(t[0]);for(let o=1;o<t.length;o++){const s=i[i.length-1];let a=t[o];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){const l=a.seq1Range.start-s.seq1Range.endExclusive;let c;for(c=1;c<=l&&!(n.getElement(a.seq1Range.start-c)!==n.getElement(a.seq1Range.endExclusive-c)||e.getElement(a.seq2Range.start-c)!==e.getElement(a.seq2Range.endExclusive-c));c++);if(c--,c===l){i[i.length-1]=new vc(new rr(s.seq1Range.start,a.seq1Range.endExclusive-l),new rr(s.seq2Range.start,a.seq2Range.endExclusive-l));continue}a=a.delta(-c)}i.push(a)}const r=[];for(let o=0;o<i.length-1;o++){const s=i[o+1];let a=i[o];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){const l=s.seq1Range.start-a.seq1Range.endExclusive;let c;for(c=0;c<l&&!(!n.isStronglyEqual(a.seq1Range.start+c,a.seq1Range.endExclusive+c)||!e.isStronglyEqual(a.seq2Range.start+c,a.seq2Range.endExclusive+c));c++);if(c===l){i[o+1]=new vc(new rr(a.seq1Range.start+l,s.seq1Range.endExclusive),new rr(a.seq2Range.start+l,s.seq2Range.endExclusive));continue}c>0&&(a=a.delta(c))}r.push(a)}return i.length>0&&r.push(i[i.length-1]),r}function Gir(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i<t.length;i++){const r=i>0?t[i-1]:void 0,o=t[i],s=i+1<t.length?t[i+1]:void 0,a=new rr(r?r.seq1Range.start+1:0,s?s.seq1Range.endExclusive-1:n.length),l=new rr(r?r.seq2Range.start+1:0,s?s.seq2Range.endExclusive-1:e.length);o.seq1Range.isEmpty?t[i]=cOe(o,n,e,a,l):o.seq2Range.isEmpty&&(t[i]=cOe(o.swap(),e,n,l,a).swap())}return t}function cOe(n,e,t,i,r){let s=1;for(;n.seq1Range.start-s>=i.start&&n.seq2Range.start-s>=r.start&&t.isStronglyEqual(n.seq2Range.start-s,n.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;n.seq1Range.start+a<i.endExclusive&&n.seq2Range.endExclusive+a<r.endExclusive&&t.isStronglyEqual(n.seq2Range.start+a,n.seq2Range.endExclusive+a)&&a<100;)a++;if(s===0&&a===0)return n;let l=0,c=-1;for(let u=-s;u<=a;u++){const d=n.seq2Range.start+u,h=n.seq2Range.endExclusive+u,f=n.seq1Range.start+u,g=e.getBoundaryScore(f)+t.getBoundaryScore(d)+t.getBoundaryScore(h);g>c&&(c=g,l=u)}return n.delta(l)}function Yir(n,e,t){const i=[];for(const r of t){const o=i[i.length-1];if(!o){i.push(r);continue}r.seq1Range.start-o.seq1Range.endExclusive<=2||r.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new vc(o.seq1Range.join(r.seq1Range),o.seq2Range.join(r.seq2Range)):i.push(r)}return i}function Qir(n,e,t){const i=[];let r;function o(){if(!r)return;const a=r.s1Range.length-r.deleted;r.s2Range.length-r.added,Math.max(r.deleted,r.added)+(r.count-1)>a&&i.push(new vc(r.s1Range,r.s2Range)),r=void 0}for(const a of t){let l=function(f,g){var m,v,_,b;if(!r||!r.s1Range.containsRange(f)||!r.s2Range.containsRange(g))if(r&&!(r.s1Range.endExclusive<f.start&&r.s2Range.endExclusive<g.start)){const x=rr.tryCreate(r.s1Range.endExclusive,f.start),E=rr.tryCreate(r.s2Range.endExclusive,g.start);r.deleted+=(m=x==null?void 0:x.length)!==null&&m!==void 0?m:0,r.added+=(v=E==null?void 0:E.length)!==null&&v!==void 0?v:0,r.s1Range=r.s1Range.join(f),r.s2Range=r.s2Range.join(g)}else o(),r={added:0,deleted:0,count:0,s1Range:f,s2Range:g};const y=f.intersect(a.seq1Range),C=g.intersect(a.seq2Range);r.count++,r.deleted+=(_=y==null?void 0:y.length)!==null&&_!==void 0?_:0,r.added+=(b=C==null?void 0:C.length)!==null&&b!==void 0?b:0};const c=n.findWordContaining(a.seq1Range.start-1),u=e.findWordContaining(a.seq2Range.start-1),d=n.findWordContaining(a.seq1Range.endExclusive),h=e.findWordContaining(a.seq2Range.endExclusive);c&&d&&u&&h&&c.equals(d)&&u.equals(h)?l(c,u):(c&&u&&l(c,u),d&&h&&l(d,h))}return o(),Xir(t,i)}function Xir(n,e){const t=[];for(;n.length>0||e.length>0;){const i=n[0],r=e[0];let o;i&&(!r||i.seq1Range.start<r.seq1Range.start)?o=n.shift():o=e.shift(),t.length>0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function Zir(n,e,t){let i=t;if(i.length===0)return i;let r=0,o;do{o=!1;const s=[i[0]];for(let a=1;a<i.length;a++){let u=function(h,f){const g=new rr(c.seq1Range.endExclusive,l.seq1Range.start);return n.getText(g).replace(/\s/g,"").length<=4&&(h.seq1Range.length+h.seq2Range.length>5||f.seq1Range.length+f.seq2Range.length>5)};const l=i[a],c=s[s.length-1];u(c,l)?(o=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}i=s}while(r++<10&&o);return i}function Jir(n,e,t){let i=t;if(i.length===0)return i;let r=0,o;do{o=!1;const a=[i[0]];for(let l=1;l<i.length;l++){let d=function(f,g){const m=new rr(u.seq1Range.endExclusive,c.seq1Range.start);if(n.countLinesIn(m)>5||m.length>500)return!1;const _=n.getText(m).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),y=f.seq1Range.length,C=e.countLinesIn(f.seq2Range),x=f.seq2Range.length,E=n.countLinesIn(g.seq1Range),k=g.seq1Range.length,L=e.countLinesIn(g.seq2Range),D=g.seq2Range.length,A=2*40+50;function O(P){return Math.min(P,A)}return Math.pow(Math.pow(O(b*40+y),1.5)+Math.pow(O(C*40+x),1.5),1.5)+Math.pow(Math.pow(O(E*40+k),1.5)+Math.pow(O(L*40+D),1.5),1.5)>Math.pow(Math.pow(A,1.5),1.5)*1.3};const c=i[l],u=a[a.length-1];d(u,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(r++<10&&o);const s=[];return cZi(i,(a,l,c)=>{let u=l;function d(_){return _.length>0&&_.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=n.extendToFullLines(l.seq1Range),f=n.getText(new rr(h.start,l.seq1Range.start));d(f)&&(u=u.deltaStart(-f.length));const g=n.getText(new rr(l.seq1Range.endExclusive,h.endExclusive));d(g)&&(u=u.deltaEnd(g.length));const m=vc.fromOffsetPairs(a?a.getEndExclusives():Ab.zero,c?c.getStarts():Ab.max),v=u.intersect(m);s.push(v)}),s}class uOe{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:dOe(this.lines[e-1]),i=e===this.lines.length?0:dOe(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` `)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function dOe(n){let e=0;for(;e<n.length&&(n.charCodeAt(e)===32||n.charCodeAt(e)===9);)e++;return e}class VZe{constructor(){this.dynamicProgrammingDiffing=new Oir,this.myersDiffingAlgorithm=new $Ze}computeDiff(e,t,i){if(e.length<=1&&Ia(e,t,(x,E)=>x===E))return new K$([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new K$([new yg(new cr(1,e.length+1),new cr(1,t.length+1),[new CS(new J(1,1,e.length,e[0].length+1),new J(1,1,t.length,t[0].length+1))])],[],!1);const r=i.maxComputationTimeMs===0?R3.instance:new Rir(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,s=new Map;function a(x){let E=s.get(x);return E===void 0&&(E=s.size,s.set(x,E)),E}const l=e.map(x=>a(x.trim())),c=t.map(x=>a(x.trim())),u=new uOe(l,e),d=new uOe(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(x,E)=>e[x]===t[E]?t[E].length===0?.1:1+Math.log(1+t[E].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=mce(u,d,f),f=Zir(u,d,f);const m=[],v=x=>{if(o)for(let E=0;E<x;E++){const k=_+E,L=b+E;if(e[k]!==t[L]){const D=this.refineDiff(e,t,new vc(new rr(k,k+1),new rr(L,L+1)),r,o);for(const A of D.mappings)m.push(A);D.hitTimeout&&(g=!0)}}};let _=0,b=0;for(const x of f){x3(()=>x.seq1Range.start-_===x.seq2Range.start-b);const E=x.seq1Range.start-_;v(E),_=x.seq1Range.endExclusive,b=x.seq2Range.endExclusive;const k=this.refineDiff(e,t,x,r,o);k.hitTimeout&&(g=!0);for(const L of k.mappings)m.push(L)}v(e.length-_);const y=hOe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,l,c,r,o)),x3(()=>{function x(k,L){if(k.lineNumber<1||k.lineNumber>L.length)return!1;const D=L[k.lineNumber-1];return!(k.column<1||k.column>D.length+1)}function E(k,L){return!(k.startLineNumber<1||k.startLineNumber>L.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>L.length+1)}for(const k of y){if(!k.innerChanges)return!1;for(const L of k.innerChanges)if(!(x(L.modifiedRange.getStartPosition(),t)&&x(L.modifiedRange.getEndPosition(),t)&&x(L.originalRange.getStartPosition(),e)&&x(L.originalRange.getEndPosition(),e)))return!1;if(!E(k.modified,t)||!E(k.original,e))return!1}return!0}),new K$(y,C,g)}computeMoves(e,t,i,r,o,s,a){return Wir(e,t,i,r,o,s).map(u=>{const d=this.refineDiff(t,i,new vc(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=hOe(d.mappings,t,i,!0);return new MZe(u,h)})}refineDiff(e,t,i,r,o){const s=new oz(e,i.seq1Range,o),a=new oz(t,i.seq2Range,o),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,r):this.myersDiffingAlgorithm.compute(s,a,r);let c=l.diffs;return c=mce(s,a,c),c=Qir(s,a,c),c=Yir(s,a,c),c=Jir(s,a,c),{mappings:c.map(d=>new CS(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function hOe(n,e,t,i=!1){const r=[];for(const o of JQe(n.map(s=>err(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=o[0],a=o[o.length-1];r.push(new yg(s.original.join(a.original),s.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return x3(()=>!i&&r.length>0&&r[0].original.startLineNumber!==r[0].modified.startLineNumber?!1:GXe(r,(o,s)=>s.original.startLineNumber-o.original.endLineNumberExclusive===s.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive<s.original.startLineNumber&&o.modified.endLineNumberExclusive<s.modified.startLineNumber)),r}function err(n,e,t){let i=0,r=0;n.modifiedRange.endColumn===1&&n.originalRange.endColumn===1&&n.originalRange.startLineNumber+i<=n.originalRange.endLineNumber&&n.modifiedRange.startLineNumber+i<=n.modifiedRange.endLineNumber&&(r=-1),n.modifiedRange.startColumn-1>=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+r&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+r&&(i=1);const o=new cr(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+r),s=new cr(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+r);return new yg(o,s,[n])}const fOe={getLegacy:()=>new Lir,getDefault:()=>new VZe};function Mw(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class gr{constructor(e,t,i,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=Mw(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class hm{constructor(e,t,i,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Mw(Math.max(Math.min(1,t),0),3),this.l=Mw(Math.max(Math.min(1,i),0),3),this.a=Mw(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,r=e.b/255,o=e.a,s=Math.max(t,i,r),a=Math.min(t,i,r);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(i-r)/d+(i<r?6:0);break;case i:l=(r-t)/d+2;break;case r:l=(t-i)/d+4;break}l*=60,l=Math.round(l)}return new hm(l,c,u,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:r,a:o}=e;let s,a,l;if(i===0)s=a=l=r;else{const c=r<.5?r*(1+i):r+i-r*i,u=2*r-c;s=hm._hue2rgb(u,c,t+1/3),a=hm._hue2rgb(u,c,t),l=hm._hue2rgb(u,c,t-1/3)}return new gr(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}}class Nb{constructor(e,t,i,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Mw(Math.max(Math.min(1,t),0),3),this.v=Mw(Math.max(Math.min(1,i),0),3),this.a=Mw(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,r=e.b/255,o=Math.max(t,i,r),s=Math.min(t,i,r),a=o-s,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((i-r)/a%6+6)%6:o===i?c=(r-t)/a+2:c=(t-i)/a+4,new Nb(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:r,a:o}=e,s=r*i,a=s*(1-Math.abs(t/60%2-1)),l=r-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new gr(c,u,d,o)}}class ze{static fromHex(e){return ze.Format.CSS.parseHex(e)||ze.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:hm.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Nb.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof gr)this.rgba=e;else if(e instanceof hm)this._hsla=e,this.rgba=hm.toRGBA(e);else if(e instanceof Nb)this._hsva=e,this.rgba=Nb.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&gr.equals(this.rgba,e.rgba)&&hm.equals(this.hsla,e.hsla)&&Nb.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ze._relativeLuminanceForComponent(this.rgba.r),t=ze._relativeLuminanceForComponent(this.rgba.g),i=ze._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*i;return Mw(r,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t<i}lighten(e){return new ze(new hm(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new ze(new hm(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:r,a:o}=this.rgba;return new ze(new gr(t,i,r,o*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new ze(new gr(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}makeOpaque(e){if(this.isOpaque()||e.rgba.a!==1)return this;const{r:t,g:i,b:r,a:o}=this.rgba;return new ze(new gr(e.rgba.r-o*(e.rgba.r-t),e.rgba.g-o*(e.rgba.g-i),e.rgba.b-o*(e.rgba.b-r),1))}toString(){return this._toString||(this._toString=ze.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const r=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-r)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const r=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(r-o)/r,e.darken(i)}}ze.white=new ze(new gr(255,255,255,1));ze.black=new ze(new gr(0,0,0,1));ze.red=new ze(new gr(255,0,0,1));ze.blue=new ze(new gr(0,0,255,1));ze.green=new ze(new gr(0,255,0,1));ze.cyan=new ze(new gr(0,255,255,1));ze.lightgrey=new ze(new gr(211,211,211,1));ze.transparent=new ze(new gr(0,0,0,0));(function(n){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:n.Format.CSS.formatRGBA(f)}t.formatRGB=i;function r(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=r;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(f)}t.formatHSL=o;function s(f){return`hsla(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%, ${f.hsla.a.toFixed(2)})`}t.formatHSLA=s;function a(f){const g=f.toString(16);return g.length!==2?"0"+g:g}function l(f){return`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}`}t.formatHex=l;function c(f,g=!1){return g&&f.rgba.a===1?n.Format.CSS.formatHex(f):`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}${a(Math.round(f.rgba.a*255))}`}t.formatHexA=c;function u(f){return f.isOpaque()?n.Format.CSS.formatHex(f):n.Format.CSS.formatRGBA(f)}t.format=u;function d(f){const g=f.length;if(g===0||f.charCodeAt(0)!==35)return null;if(g===7){const m=16*h(f.charCodeAt(1))+h(f.charCodeAt(2)),v=16*h(f.charCodeAt(3))+h(f.charCodeAt(4)),_=16*h(f.charCodeAt(5))+h(f.charCodeAt(6));return new n(new gr(m,v,_,1))}if(g===9){const m=16*h(f.charCodeAt(1))+h(f.charCodeAt(2)),v=16*h(f.charCodeAt(3))+h(f.charCodeAt(4)),_=16*h(f.charCodeAt(5))+h(f.charCodeAt(6)),b=16*h(f.charCodeAt(7))+h(f.charCodeAt(8));return new n(new gr(m,v,_,b/255))}if(g===4){const m=h(f.charCodeAt(1)),v=h(f.charCodeAt(2)),_=h(f.charCodeAt(3));return new n(new gr(16*m+m,16*v+v,16*_+_))}if(g===5){const m=h(f.charCodeAt(1)),v=h(f.charCodeAt(2)),_=h(f.charCodeAt(3)),b=h(f.charCodeAt(4));return new n(new gr(16*m+m,16*v+v,16*_+_,(16*b+b)/255))}return null}t.parseHex=d;function h(f){switch(f){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(n.Format||(n.Format={}))})(ze||(ze={}));function HZe(n){const e=[];for(const t of n){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function T0e(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function kO(n,e){const t=e.index,i=e[0].length;if(!t)return;const r=n.positionAt(t);return{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:r.lineNumber,endColumn:r.column+i}}function trr(n,e){if(!n)return;const t=ze.Format.CSS.parseHex(e);if(t)return{range:n,color:T0e(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function pOe(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),o=HZe(r);return{range:n,color:T0e(o[0],o[1],o[2],t?o[3]:1)}}function gOe(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),o=HZe(r),s=new ze(new hm(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:n,color:T0e(s.rgba.r,s.rgba.g,s.rgba.b,s.rgba.a)}}function IO(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function nrr(n){const e=[],i=IO(n,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const r of i){const o=r.filter(c=>c!==void 0),s=o[1],a=o[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=pOe(kO(n,r),IO(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=pOe(kO(n,r),IO(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=gOe(kO(n,r),IO(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=gOe(kO(n,r),IO(a,c),!0)}else s==="#"&&(l=trr(kO(n,r),s+a));l&&e.push(l)}return e}function irr(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:nrr(n)}var oC=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class rrr extends oir{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;i<this._lines.length;i++){const r=this._lines[i],o=this.offsetAt(new De(i+1,1)),s=r.matchAll(e);for(const a of s)(a.index||a.index===0)&&(a.index=a.index+o),t.push(a)}return t}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=v3(e.column,pXe(t),this._lines[e.lineNumber-1],0);return i?new J(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let r=0,o="",s=0,a=[];return{*[Symbol.iterator](){for(;;)if(s<a.length){const l=o.substring(a[s].start,a[s].end);s+=1,yield l}else if(r<t.length)o=t[r],a=i(o,e),s=0,r+=1;else break}}}getLineWords(e,t){const i=this._lines[e-1],r=this._wordenize(i,t),o=[];for(const s of r)o.push({word:i.substring(s.start,s.end),startColumn:s.start+1,endColumn:s.end+1});return o}_wordenize(e,t){const i=[];let r;for(t.lastIndex=0;(r=t.exec(e))&&r[0].length!==0;)i.push({start:r.index,end:r.index+r[0].length});return i}getValueInRange(e){if(e=this._validateRange(e),e.startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,r=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let s=i+1;s<r;s++)o.push(this._lines[s]);return o.push(this._lines[r].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!De.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,r=!1;if(t<1)t=1,i=1,r=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,r=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,r=!0):i>o&&(i=o,r=!0)}return r?{lineNumber:t,column:i}:e}}class Fw{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new rrr(Yn.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return oC(this,void 0,void 0,function*(){const r=this._getModel(e);return r?S0e.computeUnicodeHighlights(r,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,r){return oC(this,void 0,void 0,function*(){const o=this._getModel(e),s=this._getModel(t);return!o||!s?null:Fw.computeDiff(o,s,i,r)})}static computeDiff(e,t,i,r){const o=r==="advanced"?fOe.getDefault():fOe.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(s,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),r=t.getLineCount();if(i!==r)return!1;for(let o=1;o<=i;o++){const s=e.getLineContent(o),a=t.getLineContent(o);if(s!==a)return!1}return!0}computeMoreMinimalEdits(e,t,i){return oC(this,void 0,void 0,function*(){const r=this._getModel(e);if(!r)return t;const o=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return J.compareRangesUsingStarts(l.range,c.range);const u=l.range?0:1,d=c.range?0:1;return u-d});let a=0;for(let l=1;l<t.length;l++)J.getEndPosition(t[a].range).equals(J.getStartPosition(t[l].range))?(t[a].range=J.fromPositions(J.getStartPosition(t[a].range),J.getEndPosition(t[l].range)),t[a].text+=t[l].text):(a++,t[a]=t[l]);t.length=a+1;for(let{range:l,text:c,eol:u}of t){if(typeof u=="number"&&(s=u),J.isEmpty(l)&&!c)continue;const d=r.getValueInRange(l);if(c=c.replace(/\r\n|\n|\r/g,r.eol),d===c)continue;if(Math.max(c.length,d.length)>Fw._diffLimit){o.push({range:l,text:c});continue}const h=nir(d,c,i),f=r.offsetAt(J.lift(l).getStartPosition());for(const g of h){const m=r.positionAt(f+g.originalStart),v=r.positionAt(f+g.originalStart+g.originalLength),_={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};r.getValueInRange(_.range)!==_.text&&o.push(_)}}return typeof s=="number"&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return oC(this,void 0,void 0,function*(){const t=this._getModel(e);return t?uir(t):null})}computeDefaultDocumentColors(e){return oC(this,void 0,void 0,function*(){const t=this._getModel(e);return t?irr(t):null})}textualSuggest(e,t,i,r){return oC(this,void 0,void 0,function*(){const o=new Eu,s=new RegExp(i,r),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>Fw._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,r){return oC(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,r),a=Object.create(null);for(let l=t.startLineNumber;l<t.endLineNumber;l++){const c=o.getLineWords(l,s);for(const u of c){if(!isNaN(Number(u.word)))continue;let d=a[u.word];d||(d=[],a[u.word]=d),d.push({startLineNumber:l,startColumn:u.startColumn,endLineNumber:l,endColumn:u.endColumn})}}return a})}navigateValueSet(e,t,i,r,o){return oC(this,void 0,void 0,function*(){const s=this._getModel(e);if(!s)return null;const a=new RegExp(r,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const l=s.getValueInRange(t),c=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},a);if(!c)return null;const u=s.getValueInRange(c);return hce.INSTANCE.navigateValueSet(t,l,c,u,i)})}loadForeignModule(e,t,i){const s={host:vZi(i,(a,l)=>this._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Gbe(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}Fw._diffLimit=1e5;Fw._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=RXe());const k0e=or("textResourceConfigurationService"),WZe=or("textResourcePropertiesService"),bn=or("ILanguageFeaturesService");var orr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},LO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sz=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const mOe=60*1e3,_Oe=5*60*1e3;function Sx(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let _ce=class extends Ue{constructor(e,t,i,r,o){super(),this._modelService=e,this._workerManager=this._register(new arr(this._modelService,r)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>Sx(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new srr(this._workerManager,t,this._modelService,r)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return Sx(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(r=>r.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,r){return sz(this,void 0,void 0,function*(){const o=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,r));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new MZe(new u0(new cr(l[0],l[1]),new cr(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new yg(new cr(c[0],c[1]),new cr(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new CS(new J(d[0],d[1],d[2],d[3]),new J(d[4],d[5],d[6],d[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(Cu(t)){if(!Sx(this._modelService,e))return Promise.resolve(t);const r=Eu.create(),o=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),r.elapsed())),Promise.race([o,vS(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return Sx(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(r=>r.navigateValueSet(e,t,i))}canComputeWordRanges(e){return Sx(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};_ce=orr([LO(0,Ds),LO(1,k0e),LO(2,hp),LO(3,rs),LO(4,bn)],_ce);class srr{constructor(e,t,i,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return sz(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const r=[];if(i.wordBasedSuggestionsMode==="currentDocument")Sx(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())Sx(this._modelService,d.uri)&&(d===e?r.unshift(d.uri):(i.wordBasedSuggestionsMode==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&r.push(d.uri));if(r.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new J(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):J.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=yield(yield this._workerManager.withWorker()).textualSuggest(r,s==null?void 0:s.word,o);if(u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}})}}class arr extends Ue{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new S6).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(_Oe/2)),this._register(this._modelService.onModelRemoved(r=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>_Oe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new I0e(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class lrr extends Ue{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const r=new S6;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(mOe/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)mo(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const r=i.toString();this._syncedModels[r]||this._beginModelSync(i,t),this._syncedModels[r]&&(this._syncedModelsLastUsedTime[r]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>mOe&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const r=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new mt;o.add(i.onDidChangeContent(s=>{this._proxy.acceptModelChanged(r.toString(),s)})),o.add(i.onWillDispose(()=>{this._stopModelSync(r)})),o.add(mi(()=>{this._proxy.acceptRemovedModel(r)})),this._syncedModels[r]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],mo(t)}}class vOe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class rte{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class I0e extends Ue{constructor(e,t,i,r){super(),this.languageConfigurationService=r,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new bG(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new dnr(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new rte(this)))}catch(e){lce(e),this._worker=new vOe(new Fw(new rte(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(lce(e),this._worker=new vOe(new Fw(new rte(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new lrr(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return sz(this,void 0,void 0,function*(){return this._disposed?Promise.reject(wJi()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(r=>r.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,r){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,r))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(r=>r.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,i){return sz(this,void 0,void 0,function*(){const r=yield this._withSyncedResources(e),o=i.source,s=i.flags;return r.textualSuggest(e.map(a=>a.toString()),t,o,s)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const r=this._modelService.getModel(e);if(!r)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),s=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(r=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return r.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function crr(n,e,t){return new urr(n,e,t)}class urr extends I0e{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Gbe(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const r=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of i)s[a]=o(a,r);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const x6={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},DA=new class{clone(){return this}equals(n){return this===n}};function L0e(n,e){return new o0e([new b3(0,"",n)],e)}function kG(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new iG(t,e===null?DA:e)}class Kc{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const r=this.getFontStyle(e);return r&1&&(i+=" mtki"),r&2&&(i+=" mtkb"),r&4&&(i+=" mtku"),r&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),r=this.getFontStyle(e);let o=`color: ${t[i]};`;r&1&&(o+="font-style: italic;"),r&2&&(o+="font-weight: bold;");let s="";return r&4&&(s+=" underline"),r&8&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class Ol{static createEmpty(e,t){const i=Ol.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=i,new Ol(r,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof Ol?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const r=t<<1,o=r+(i<<1);for(let s=r;s<o;s++)if(this._tokens[s]!==e._tokens[s])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Kc.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Kc.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Kc.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Kc.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Kc.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Kc.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Ol.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new D0e(this,e,t,i)}static convertToEndOffset(e,t){const r=(e.length>>>1)-1;for(let o=0;o<r;o++)e[o<<1]=e[o+1<<1];e[r<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,r=(e.length>>>1)-1;for(;i<r;){const o=i+Math.floor((r-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(r=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,r="";const o=new Array;let s=0;for(;;){const a=t<this._tokensCount?this._tokens[t<<1]:-1,l=i<e.length?e[i]:null;if(a!==-1&&(l===null||a<=l.offset)){r+=this._text.substring(s,a);const c=this._tokens[(t<<1)+1];o.push(r.length,c),t++,s=a}else if(l){if(l.offset>s){r+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];o.push(r.length,c),s=l.offset}r+=l.text,o.push(r.length,l.tokenMetadata),i++}else break}return new Ol(new Uint32Array(o),r,this._languageIdCodec)}}Ol.defaultTokenMetadata=(32768|2<<24)>>>0;class D0e{constructor(e,t,i,r){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o<s&&!(e.getStartOffset(o)>=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof D0e?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class Vh{constructor(e,t,i,r){this.startColumn=e,this.endColumn=t,this.className=i,this.type=r,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,r=t.length;if(i!==r)return!1;for(let o=0;o<i;o++)if(!Vh._equals(e[o],t[o]))return!1;return!0}static extractWrapped(e,t,i){if(e.length===0)return e;const r=t+1,o=i+1,s=i-t,a=[];let l=0;for(const c of e)c.endColumn<=r||c.startColumn>=o||(a[l++]=new Vh(Math.max(1,c.startColumn-r+1),Math.min(s+1,c.endColumn-r+1),c.className,c.type));return a}static filter(e,t,i,r){if(e.length===0)return[];const o=[];let s=0;for(let a=0,l=e.length;a<l;a++){const c=e[a],u=c.range;if(u.endLineNumber<t||u.startLineNumber>t||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:i,h=u.endLineNumber===t?u.endColumn:r;o[s++]=new Vh(d,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=Vh._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className<t.className?-1:1:0}}class bOe{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=r}}class az{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,r=e.length;i<r;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let r=0;for(;r+1<this.count&&this.stopOffsets[r]===this.stopOffsets[r+1];)r++;i.push(new bOe(t,this.stopOffsets[r],this.classNames.join(" "),az._metadata(this.metadata))),t=this.stopOffsets[r]+1,this.stopOffsets.splice(0,r+1),this.classNames.splice(0,r+1),this.metadata.splice(0,r+1),this.count-=r+1}return this.count>0&&t<e&&(i.push(new bOe(t,e-1,this.classNames.join(" "),az._metadata(this.metadata))),t=e),t}insert(e,t,i){if(this.count===0||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let r=0;r<this.count;r++)if(this.stopOffsets[r]>=e){this.stopOffsets.splice(r,0,e),this.classNames.splice(r,0,t),this.metadata.splice(r,0,i);break}this.count++}}class drr{static normalize(e,t){if(t.length===0)return[];const i=[],r=new az;let o=0;for(let s=0,a=t.length;s<a;s++){const l=t[s];let c=l.startColumn,u=l.endColumn;const d=l.className,h=l.type===1?2:l.type===2?4:0;if(c>1){const m=e.charCodeAt(c-2);Rl(m)&&c--}if(u>1){const m=e.charCodeAt(u-2);Rl(m)&&u--}const f=c-1,g=u-2;o=r.consumeLowerThan(f,o,i),r.count===0&&(o=f),r.insert(g,d,h)}return r.consumeLowerThan(1073741824,o,i),i}}class Jl{constructor(e,t,i,r){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=r,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class zZe{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class fE{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m,v,_,b,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=r,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(Vh.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=_,this.fontLigatures=b,this.selectionsOnLine=y&&y.sort((E,k)=>E.startOffset<k.startOffset?-1:1);const C=Math.abs(g-h),x=Math.abs(f-h);C<x?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=f,this.renderSpaceCharCode=183)}sameSelection(e){if(this.selectionsOnLine===null)return e===null;if(e===null||e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&Vh.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class UZe{constructor(e,t){this.partIndex=e,this.charIndex=t}}class lb{static getPartIndex(e){return(e&4294901760)>>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,r){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=r}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=lb.getPartIndex(t),r=lb.getCharIndex(t);return new UZe(i,r)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const r=(e<<16|i<<0)>>>0;let o=0,s=this.length-1;for(;o+1<s;){const m=o+s>>>1,v=this._data[m];if(v===r)return m;v>r?s=m:o=m}if(o===s)return o;const a=this._data[o],l=this._data[s];if(a===r)return o;if(l===r)return s;const c=lb.getPartIndex(a),u=lb.getCharIndex(a),d=lb.getPartIndex(l);let h;c!==d?h=t:h=lb.getCharIndex(l);const f=i-u,g=h-i;return f<=g?o:s}}class vce{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function T6(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("<span>");let t=0,i=0,r=0;for(const s of n.lineDecorations)(s.type===1||s.type===2)&&(e.appendString('<span class="'),e.appendString(s.className),e.appendString('"></span>'),s.type===1&&(r|=1,t++),s.type===2&&(r|=2,i++));e.appendString("</span>");const o=new lb(1,t+i);return o.setColumnInfo(1,t,0,0),new vce(o,!1,r)}return e.appendString("<span><span></span></span>"),new vce(new lb(0,0),!1,0)}return yrr(prr(n),e)}class hrr{constructor(e,t,i,r){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=r}}function IG(n){const e=new rR(1e4),t=T6(n,e);return new hrr(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class frr{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=r,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=v}}function prr(n){const e=n.lineContent;let t,i,r;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter<e.length?(t=!0,i=e.length-n.stopRenderingLineAfter,r=n.stopRenderingLineAfter):(t=!1,i=0,r=e.length);let o=grr(e,n.containsRTL,n.lineTokens,n.fauxIndentLength,r);n.renderControlCharacters&&!n.isBasicASCII&&(o=_rr(e,o)),(n.renderWhitespace===4||n.renderWhitespace===1||n.renderWhitespace===2&&n.selectionsOnLine||n.renderWhitespace===3&&!n.continuesWithWrappedLine)&&(o=vrr(n,e,r,o));let s=0;if(n.lineDecorations.length>0){for(let a=0,l=n.lineDecorations.length;a<l;a++){const c=n.lineDecorations[a];c.type===3||c.type===1?s|=1:c.type===2&&(s|=2)}o=brr(e,r,o,n.lineDecorations)}return n.containsRTL||(o=mrr(e,o,!n.isBasicASCII||n.fontLigatures)),new frr(n.useMonospaceOptimizations,n.canUseHalfwidthRightwardsArrow,e,r,t,i,o,s,n.fauxIndentLength,n.tabSize,n.startVisibleColumn,n.containsRTL,n.spaceWidth,n.renderSpaceCharCode,n.renderWhitespace,n.renderControlCharacters)}function grr(n,e,t,i,r){const o=[];let s=0;i>0&&(o[s++]=new Jl(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l<c;l++){const u=t.getEndOffset(l);if(u<=i)continue;const d=t.getClassName(l);if(u>=r){const f=e?SA(n.substring(a,r)):!1;o[s++]=new Jl(r,d,0,f);break}const h=e?SA(n.substring(a,u)):!1;o[s++]=new Jl(u,d,0,h),a=u}return o}function mrr(n,e,t){let i=0;const r=[];let o=0;if(t)for(let s=0,a=e.length;s<a;s++){const l=e[s],c=l.endIndex;if(i+50<c){const u=l.type,d=l.metadata,h=l.containsRTL;let f=-1,g=i;for(let m=i;m<c;m++)n.charCodeAt(m)===32&&(f=m),f!==-1&&m-g>=50&&(r[o++]=new Jl(f+1,u,d,h),g=f+1,f=-1);g!==c&&(r[o++]=new Jl(c,u,d,h))}else r[o++]=l;i=c}else for(let s=0,a=e.length;s<a;s++){const l=e[s],c=l.endIndex,u=c-i;if(u>50){const d=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(u/50);for(let m=1;m<g;m++){const v=i+m*50;r[o++]=new Jl(v,d,h,f)}r[o++]=new Jl(c,d,h,f)}else r[o++]=l;i=c}return r}function jZe(n){return n<32?n!==9:n===127||n>=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function _rr(n,e){const t=[];let i=new Jl(0,"",0,!1),r=0;for(const o of e){const s=o.endIndex;for(;r<s;r++){const a=n.charCodeAt(r);jZe(a)&&(r>i.endIndex&&(i=new Jl(r,o.type,o.metadata,o.containsRTL),t.push(i)),i=new Jl(r+1,"mtkcontrol",o.metadata,!1),t.push(i))}r>i.endIndex&&(i=new Jl(s,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function vrr(n,e,t,i){const r=n.continuesWithWrappedLine,o=n.fauxIndentLength,s=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,u=n.renderWhitespace===1,d=n.renderWhitespace===3,h=n.renderSpaceWidth!==n.spaceWidth,f=[];let g=0,m=0,v=i[m].type,_=i[m].containsRTL,b=i[m].endIndex;const y=i.length;let C=!1,x=Yu(e),E;x===-1?(C=!0,x=t,E=t):E=dv(e);let k=!1,L=0,D=c&&c[L],A=a%s;for(let P=o;P<t;P++){const F=e.charCodeAt(P);D&&P>=D.endOffset&&(L++,D=c&&c[L]);let B;if(P<x||P>E)B=!0;else if(F===9)B=!0;else if(F===32)if(u)if(k)B=!0;else{const M=P+1<t?e.charCodeAt(P+1):0;B=M===32||M===9}else B=!0;else B=!1;if(B&&c&&(B=!!D&&D.startOffset<=P&&D.endOffset>P),B&&d&&(B=C||P>E),B&&_&&P>=x&&P<=E&&(B=!1),k){if(!B||!l&&A>=s){if(h){const M=g>0?f[g-1].endIndex:o;for(let V=M+1;V<=P;V++)f[g++]=new Jl(V,"mtkw",1,!1)}else f[g++]=new Jl(P,"mtkw",1,!1);A=A%s}}else(P===b||B&&P>o)&&(f[g++]=new Jl(P,v,0,_),A=A%s);for(F===9?A=s:mS(F)?A+=2:A++,k=B;P===b&&(m++,m<y);)v=i[m].type,_=i[m].containsRTL,b=i[m].endIndex}let O=!1;if(k)if(r&&u){const P=t>0?e.charCodeAt(t-1):0,F=t>1?e.charCodeAt(t-2):0;P===32&&F!==32&&F!==9||(O=!0)}else O=!0;if(O)if(h){const P=g>0?f[g-1].endIndex:o;for(let F=P+1;F<=t;F++)f[g++]=new Jl(F,"mtkw",1,!1)}else f[g++]=new Jl(t,"mtkw",1,!1);else f[g++]=new Jl(t,v,0,_);return f}function brr(n,e,t,i){i.sort(Vh.compare);const r=drr.normalize(n,i),o=r.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;d<h;d++){const f=t[d],g=f.endIndex,m=f.type,v=f.metadata,_=f.containsRTL;for(;s<o&&r[s].startOffset<g;){const b=r[s];if(b.startOffset>c&&(c=b.startOffset,a[l++]=new Jl(c,m,v,_)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new Jl(c,m+" "+b.className,v|b.metadata,_),s++;else{c=g,a[l++]=new Jl(c,m+" "+b.className,v|b.metadata,_);break}}g>c&&(c=g,a[l++]=new Jl(c,m,v,_))}const u=t[t.length-1].endIndex;if(s<o&&r[s].startOffset===u)for(;s<o&&r[s].startOffset===u;){const d=r[s];a[l++]=new Jl(c,d.className,d.metadata,!1),s++}return a}function yrr(n,e){const t=n.fontIsMonospace,i=n.canUseHalfwidthRightwardsArrow,r=n.containsForeignElements,o=n.lineContent,s=n.len,a=n.isOverflowing,l=n.overflowingCharCount,c=n.parts,u=n.fauxIndentLength,d=n.tabSize,h=n.startVisibleColumn,f=n.containsRTL,g=n.spaceWidth,m=n.renderSpaceCharCode,v=n.renderWhitespace,_=n.renderControlCharacters,b=new lb(s+1,c.length);let y=!1,C=0,x=h,E=0,k=0,L=0;f?e.appendString('<span dir="ltr">'):e.appendString("<span>");for(let D=0,A=c.length;D<A;D++){const O=c[D],P=O.endIndex,F=O.type,B=O.containsRTL,M=v!==0&&O.isWhitespace(),V=M&&!t&&(F==="mtkw"||!r),U=C===P&&O.isPseudoAfter();if(E=0,e.appendString("<span "),B&&e.appendString('style="unicode-bidi:isolate" '),e.appendString('class="'),e.appendString(V?"mtkz":F),e.appendASCIICharCode(34),M){let W=0;{let q=C,H=x;for(;q<P;q++){const se=(o.charCodeAt(q)===9?d-H%d:1)|0;W+=se,q>=u&&(H+=se)}}for(V&&(e.appendString(' style="width:'),e.appendString(String(g*W)),e.appendString('px"')),e.appendASCIICharCode(62);C<P;C++){b.setColumnInfo(C+1,D-L,E,k),L=0;const q=o.charCodeAt(C);let H,ie;if(q===9){H=d-x%d|0,ie=H,!i||ie>1?e.appendCharCode(8594):e.appendCharCode(65515);for(let se=2;se<=ie;se++)e.appendCharCode(160)}else H=2,ie=1,e.appendCharCode(m),e.appendCharCode(8204);E+=H,k+=ie,C>=u&&(x+=ie)}}else for(e.appendASCIICharCode(62);C<P;C++){b.setColumnInfo(C+1,D-L,E,k),L=0;const W=o.charCodeAt(C);let q=1,H=1;switch(W){case 9:q=d-x%d,H=q;for(let ie=1;ie<=q;ie++)e.appendCharCode(160);break;case 32:e.appendCharCode(160);break;case 60:e.appendString("<");break;case 62:e.appendString(">");break;case 38:e.appendString("&");break;case 0:_?e.appendCharCode(9216):e.appendString("�");break;case 65279:case 8232:case 8233:case 133:e.appendCharCode(65533);break;default:mS(W)&&H++,_&&W<32?e.appendCharCode(9216+W):_&&W===127?e.appendCharCode(9249):_&&jZe(W)?(e.appendString("[U+"),e.appendString(Crr(W)),e.appendString("]"),q=8,H=q):e.appendCharCode(W)}E+=q,k+=H,C>=u&&(x+=H)}U?L++:L=0,C>=s&&!y&&O.isPseudoAfter()&&(y=!0,b.setColumnInfo(C+1,D,E,k)),e.appendString("</span>")}return y||b.setColumnInfo(s+1,c.length-1,E,k),a&&(e.appendString('<span class="mtkoverflow">'),e.appendString(T("showMore","Show more ({0})",wrr(l))),e.appendString("</span>")),e.appendString("</span>"),new vce(b,f,r)}function Crr(n){return n.toString(16).toUpperCase().padStart(4,"0")}function wrr(n){return n<1024?T("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class yOe{constructor(e,t,i,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=r|0}}class Srr{constructor(e,t){this.tabSize=e,this.data=t}}class A0e{constructor(e,t,i,r,o,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=r,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=a}}class ip{constructor(e,t,i,r,o,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=r,this.isBasicASCII=ip.isBasicASCII(i,s),this.containsRTL=ip.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?C6(e):!0}static containsRTL(e,t,i){return!t&&i?SA(e):!1}}class DM{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Err{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new DM(new J(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class qZe{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class O3{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ia(e.data,t.data)}static equalsArr(e,t){return Ia(e,t,O3.equals)}}function xrr(n){return Array.isArray(n)}function Trr(n){return!xrr(n)}function KZe(n){return typeof n=="string"}function COe(n){return!KZe(n)}function x2(n){return!n}function Bw(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function wOe(n){return n.replace(/[&<>'"_]/g,"-")}function krr(n,e){console.log(`${n.languageId}: ${e}`)}function bs(n,e){return new Error(`${n.languageId}: ${e}`)}function BC(n,e,t,i,r){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(o,function(a,l,c,u,d,h,f,g,m){return x2(c)?x2(u)?!x2(d)&&d<i.length?Bw(n,i[d]):!x2(f)&&n&&typeof n[f]=="string"?n[f]:(s===null&&(s=r.split("."),s.unshift(r)),!x2(h)&&h<s.length?Bw(n,s[h]):""):Bw(n,t):"$"})}function R9(n,e){let t=e;for(;t&&t.length>0;){const i=n.tokenizer[t];if(i)return i;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return null}function Irr(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return!1}var Lrr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Drr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},bce;const GZe=5;class P3{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new rD(e,t);let i=rD.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let r=this._entries[i];return r||(r=new rD(e,t),this._entries[i]=r,r)}}P3._INSTANCE=new P3(GZe);class rD{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return rD._equals(this,e)}push(e){return P3.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return P3.create(this.parent,e)}}class lL{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new lL(this.languageId,this.state)}}class $C{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new AM(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new AM(e,t);const i=rD.getStackElementId(e);let r=this._entries[i];return r||(r=new AM(e,null),this._entries[i]=r,r)}}$C._INSTANCE=new $C(GZe);class AM{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:$C.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof AM)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class Arr{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new b3(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,r){const o=i.languageId,s=i.state,a=Ks.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenize(e,t,s);if(r!==0)for(const c of l.tokens)this._tokens.push(new b3(c.offset+r,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new o0e(this._tokens,e)}}class lz{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const r=e!==null?e.length:0,o=t.length,s=i!==null?i.length:0;if(r===0&&o===0&&s===0)return new Uint32Array(0);if(r===0&&o===0)return i;if(o===0&&s===0)return e;const a=new Uint32Array(r+o+s);e!==null&&a.set(e);for(let l=0;l<o;l++)a[r+l]=t[l];return i!==null&&a.set(i,r+o),a}nestedLanguageTokenize(e,t,i,r){const o=i.languageId,s=i.state,a=Ks.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenizeEncoded(e,t,s);if(r!==0)for(let c=0,u=l.tokens.length;c<u;c+=2)l.tokens[c]+=r;return this._prependTokens=lz._merge(this._prependTokens,this._tokens,l.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,l.endState}finalize(e){return new iG(lz._merge(this._prependTokens,this._tokens,null),e)}}let M3=bce=class extends Ue{constructor(e,t,i,r,o){super(),this._configurationService=o,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=r,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let s=!1;this._register(Ks.onDidChange(a=>{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c<u;c++){const d=a.changedLanguages[c];if(this._embeddedLanguages[d]){l=!0;break}}l&&(s=!0,Ks.handleChange([this._languageId]),s=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration(a=>{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=Ks.get(t);if(i){if(i instanceof bce){const r=i.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}Ks.isResolved(t)||e.push(Ks.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=P3.create(null,this._lexer.start);return $C.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return L0e(this._languageId,i);const r=new Arr,o=this._tokenize(e,t,i,r);return r.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return kG(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const r=new lz(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,r);return r.finalize(o)}_tokenize(e,t,i,r){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,r):this._myTokenize(e,t,i,0,r)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=R9(this._lexer,t.stack.state),!i))throw bs(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,o=!1;for(const s of i){if(!COe(s.action)||s.action.nextEmbedded!=="@pop")continue;o=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(r===-1||c<r)&&(r=c)}if(!o)throw bs(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return r}_nestedTokenize(e,t,i,r,o){const s=this._findLeavingNestedLanguageOffset(e,i);if(s===-1){const c=o.nestedLanguageTokenize(e,t,i.embeddedLanguageData,r);return $C.create(i.stack,new lL(i.embeddedLanguageData.languageId,c))}const a=e.substring(0,s);a.length>0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,r);const l=e.substring(s);return this._myTokenize(l,t,i,r+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,r,o){o.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` `:e,l=a.length;let c=i.embeddedLanguageData,u=i.stack,d=0,h=null,f=!0;for(;f||d<l;){const g=d,m=u.depth,v=h?h.groups.length:0,_=u.state;let b=null,y=null,C=null,x=null,E=null;if(h){b=h.matches;const D=h.groups.shift();y=D.matched,C=D.action,x=h.rule,h.groups.length===0&&(h=null)}else{if(!f&&d>=l)break;f=!1;let D=this._lexer.tokenizer[_];if(!D&&(D=R9(this._lexer,_),!D))throw bs(this._lexer,"tokenizer state is not defined: "+_);const A=a.substr(d);for(const O of D)if((d===0||!O.matchOnlyAtLineStart)&&(b=A.match(O.regex),b)){y=b[0],C=O.action;break}}if(b||(b=[""],y=""),C||(d<l&&(b=[a.charAt(d)],y=b[0]),C=this._lexer.defaultToken),y===null)break;for(d+=y.length;Trr(C)&&COe(C)&&C.test;)C=C.test(y,b,_,d===l);let k=null;if(typeof C=="string"||Array.isArray(C))k=C;else if(C.group)k=C.group;else if(C.token!==null&&C.token!==void 0){if(C.tokenSubst?k=BC(this._lexer,C.token,y,b,_):k=C.token,C.nextEmbedded)if(C.nextEmbedded==="@pop"){if(!c)throw bs(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw bs(this._lexer,"cannot enter embedded language from within an embedded language");E=BC(this._lexer,C.nextEmbedded,y,b,_)}if(C.goBack&&(d=Math.max(0,d-C.goBack)),C.switchTo&&typeof C.switchTo=="string"){let D=BC(this._lexer,C.switchTo,y,b,_);if(D[0]==="@"&&(D=D.substr(1)),R9(this._lexer,D))u=u.switchTo(D);else throw bs(this._lexer,"trying to switch to a state '"+D+"' that is undefined in rule: "+this._safeRuleName(x))}else{if(C.transform&&typeof C.transform=="function")throw bs(this._lexer,"action.transform not supported");if(C.next)if(C.next==="@push"){if(u.depth>=this._lexer.maxStack)throw bs(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(_)}else if(C.next==="@pop"){if(u.depth<=1)throw bs(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(x));u=u.pop()}else if(C.next==="@popall")u=u.popall();else{let D=BC(this._lexer,C.next,y,b,_);if(D[0]==="@"&&(D=D.substr(1)),R9(this._lexer,D))u=u.push(D);else throw bs(this._lexer,"trying to set a next state '"+D+"' that is undefined in rule: "+this._safeRuleName(x))}}C.log&&typeof C.log=="string"&&krr(this._lexer,this._lexer.languageId+": "+BC(this._lexer,C.log,y,b,_))}if(k===null)throw bs(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(x));const L=D=>{const A=this._languageService.getLanguageIdByLanguageName(D)||this._languageService.getLanguageIdByMimeType(D)||D,O=this._getNestedEmbeddedLanguageData(A);if(d<l){const P=e.substr(d);return this._nestedTokenize(P,t,$C.create(u,O),r+d,o)}else return $C.create(u,O)};if(Array.isArray(k)){if(h&&h.groups.length>0)throw bs(this._lexer,"groups cannot be nested: "+this._safeRuleName(x));if(b.length!==k.length+1)throw bs(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(x));let D=0;for(let A=1;A<b.length;A++)D+=b[A].length;if(D!==y.length)throw bs(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(x));h={rule:x,matches:b,groups:[]};for(let A=0;A<k.length;A++)h.groups[A]={action:k[A],matched:b[A+1]};d-=y.length;continue}else{if(k==="@rematch"&&(d-=y.length,y="",b=null,k="",E!==null))return L(E);if(y.length===0){if(l===0||m!==u.depth||_!==u.state||(h?h.groups.length:0)!==v)continue;throw bs(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(x))}let D=null;if(KZe(k)&&k.indexOf("@brackets")===0){const A=k.substr(9),O=Nrr(this._lexer,y);if(!O)throw bs(this._lexer,"@brackets token returned but no bracket defined as: "+y);D=wOe(O.token+A)}else{const A=k===""?"":k+this._lexer.tokenPostfix;D=wOe(A)}g<s&&o.emit(g+r,D)}if(E!==null)return L(E)}return $C.create(u,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new lL(e,DA);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),Ks.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=Ks.get(e);return t?new lL(e,t.getInitialState()):new lL(e,DA)}};M3=bce=Lrr([Drr(4,dr)],M3);function Nrr(n,e){if(!e)return null;e=Bw(n,e);const t=n.brackets;for(const i of t){if(i.open===e)return{token:i.token,bracketType:1};if(i.close===e)return{token:i.token,bracketType:-1}}return null}var Rrr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const ote=R1("standaloneColorizer",{createHTML:n=>n});class N0e{static colorizeElement(e,t,i,r){r=r||{};const o=r.theme||"vs",s=r.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const c=u=>{var d;const h=(d=ote==null?void 0:ote.createHTML(u))!==null&&d!==void 0?d:u;i.innerHTML=h};return this.colorize(t,l||"",a,r).then(c,u=>console.error(u))}static colorize(e,t,i,r){return Rrr(this,void 0,void 0,function*(){const o=e.languageIdCodec;let s=4;r&&typeof r.tabSize=="number"&&(s=r.tabSize),h0e(t)&&(t=t.substr(1));const a=l0(t);if(!e.isRegisteredLanguageId(i))return SOe(a,s,o);const l=yield Ks.getOrCreate(i);return l?Orr(a,s,l,o):SOe(a,s,o)})}static colorizeLine(e,t,i,r,o=4){const s=ip.isBasicASCII(e,t),a=ip.containsRTL(e,s,i);return IG(new fE(!1,!0,e,!1,s,a,0,r,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const r=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function Orr(n,e,t,i){return new Promise((r,o)=>{const s=()=>{const a=Prr(n,e,t,i);if(t instanceof M3){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,o);return}}r(a)};s()})}function SOe(n,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,a=n.length;s<a;s++){const l=n[s];o[0]=l.length;const c=new Ol(o,l,t),u=ip.isBasicASCII(l,!0),d=ip.containsRTL(l,u,!0),h=IG(new fE(!1,!0,l,!1,u,d,0,c,[],e,0,0,0,0,-1,"none",!1,!1,null));i=i.concat(h.html),i.push("<br/>")}return i.join("")}function Prr(n,e,t,i){let r=[],o=t.getInitialState();for(let s=0,a=n.length;s<a;s++){const l=n[s],c=t.tokenizeEncoded(l,!0,o);Ol.convertToEndOffset(c.tokens,l.length);const u=new Ol(c.tokens,l,i),d=ip.isBasicASCII(l,!0),h=ip.containsRTL(l,d,!0),f=IG(new fE(!1,!0,l,!1,d,h,0,u.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));r=r.concat(f.html),r.push("<br/>"),o=c.endState}return r.join("")}const EOe=2e4;let Ex,G$,yce,Y$,Cce;function Mrr(n){Ex=document.createElement("div"),Ex.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),Ex.appendChild(i),i};G$=e(),yce=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),Ex.appendChild(i),i};Y$=t(),Cce=t(),n.appendChild(Ex)}function bu(n){Ex&&(G$.textContent!==n?(Ic(yce),cz(G$,n)):(Ic(G$),cz(yce,n)))}function wS(n){Ex&&(Y$.textContent!==n?(Ic(Cce),cz(Y$,n)):(Ic(Y$),cz(Cce,n)))}function cz(n,e){Ic(n),e.length>EOe&&(e=e.substr(0,EOe)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const R0e=or("markerDecorationsService");var Frr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Brr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let F3=class{constructor(e,t){}dispose(){}};F3.ID="editor.contrib.markerDecorations";F3=Frr([Brr(1,R0e)],F3);Vr(F3.ID,F3,0);class YZe extends Ue{constructor(e,t){super(),this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,r=!1;const o=()=>{if(i&&!r)try{i=!1,r=!0,t()}finally{requestAnimationFrame(()=>{r=!1,o()})}};this._resizeObserver=new ResizeObserver(s=>{e=s&&s[0]&&s[0].contentRect?s[0].contentRect:null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,r=0;t?(i=t.width,r=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),i=Math.max(5,i),r=Math.max(5,r),(this._width!==i||this._height!==r)&&(this._width=i,this._height=r,e&&this._onDidChange.fire())}}class $w{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=$w._read(e,this.key),i=o=>$w._read(e,o),r=(o,s)=>$w._write(e,o,s);this.migrate(t,i,r)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const r=t.substring(0,i);return this._read(e[r],t.substring(i+1))}return e[t]}static _write(e,t,i){const r=t.indexOf(".");if(r>=0){const o=t.substring(0,r);e[o]=e[o]||{},this._write(e[o],t.substring(r+1),i);return}e[t]=i}}$w.items=[];function pE(n,e){$w.items.push(new $w(n,e))}function Rg(n,e){pE(n,(t,i,r)=>{if(typeof t<"u"){for(const[o,s]of e)if(t===o){r(n,s);return}}})}function $rr(n){$w.items.forEach(e=>e.apply(n))}Rg("wordWrap",[[!0,"on"],[!1,"off"]]);Rg("lineNumbers",[[!0,"on"],[!1,"off"]]);Rg("cursorBlinking",[["visible","solid"]]);Rg("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Rg("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Rg("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Rg("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Rg("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Rg("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Rg("autoIndent",[[!1,"advanced"],[!0,"full"]]);Rg("matchBrackets",[[!0,"always"],[!1,"never"]]);Rg("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Rg("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);pE("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});pE("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});pE("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const Vrr={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};pE("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(Vrr))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});pE("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});pE("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});pE("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});class Hrr{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new Le,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const AA=new Hrr,O1=or("accessibilityService"),k6=new sn("accessibilityModeEnabled",!1);var Wrr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zrr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let wce=class extends Ue{constructor(e,t,i,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new Le),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new _Xe,this.isSimpleWidget=e,this._containerObserver=this._register(new YZe(i,t.dimension)),this._rawOptions=xOe(t),this._validatedOptions=VC.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Hp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(AA.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Zle.onDidChange(()=>this._recomputeOptions())),this._register(S3.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=VC.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=gT.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:AA.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return VC.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:jrr(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:pT||mg,pixelRatio:S3.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Zle.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=xOe(e);VC.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=VC.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=Urr(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};wce=Wrr([zrr(3,O1)],wce);function Urr(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function jrr(){let n="";return!C1&&!zXe&&(n+="no-user-select "),C1&&(n+="no-minimap-shadow ",n+="enable-user-select "),mr&&(n+="mac "),n}class qrr{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Krr{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class VC{static validateOptions(e){const t=new qrr;for(const i of iL){const r=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(r))}return t}static computeOptions(e,t){const i=new Krr;for(const r of iL)i._write(r.id,r.compute(t,i,e._read(r.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ia(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!VC._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let r=!1;for(const o of iL){const s=!VC._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(r=!0)}return r?new mXe(i):null}static applyUpdate(e,t){let i=!1;for(const r of iL)if(t.hasOwnProperty(r.name)){const o=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=o.newValue,i=i||o.didChange}return i}}function xOe(n){const e=_y(n);return $rr(e),e}function Wa(n,e,t){let i=null,r=null;if(typeof t.value=="function"?(i="value",r=t.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",r=t.get),!r)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...s){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,s)}),this[o]}}var Grr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jo;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Jo||(Jo={}));class Zo extends Ue{constructor(){super(),this.dispatched=!1,this.targets=new Id,this.ignoreTargets=new Id,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(tt(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(tt(document,"touchend",e=>this.onTouchEnd(e))),this._register(tt(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Zo.isTouchDevice())return Ue.None;Zo.INSTANCE||(Zo.INSTANCE=new Zo);const t=Zo.INSTANCE.targets.push(e);return mi(t)}static ignoreTarget(e){if(!Zo.isTouchDevice())return Ue.None;Zo.INSTANCE||(Zo.INSTANCE=new Zo);const t=Zo.INSTANCE.ignoreTargets.push(e);return mi(t)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,r=e.targetTouches.length;i<r;i++){const o=e.targetTouches.item(i);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:t,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[t],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};const s=this.newGestureEvent(Jo.Start,o.target);s.pageX=o.pageX,s.pageY=o.pageY,this.dispatchEvent(s)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){const t=Date.now(),i=Object.keys(this.activeTouches).length;for(let r=0,o=e.changedTouches.length;r<o;r++){const s=e.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("move of an UNKNOWN touch",s);continue}const a=this.activeTouches[s.identifier],l=Date.now()-a.initialTimeStamp;if(l<Zo.HOLD_DELAY&&Math.abs(a.initialPageX-xp(a.rollingPageX))<30&&Math.abs(a.initialPageY-xp(a.rollingPageY))<30){const c=this.newGestureEvent(Jo.Tap,a.initialTarget);c.pageX=xp(a.rollingPageX),c.pageY=xp(a.rollingPageY),this.dispatchEvent(c)}else if(l>=Zo.HOLD_DELAY&&Math.abs(a.initialPageX-xp(a.rollingPageX))<30&&Math.abs(a.initialPageY-xp(a.rollingPageY))<30){const c=this.newGestureEvent(Jo.Contextmenu,a.initialTarget);c.pageX=xp(a.rollingPageX),c.pageY=xp(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=xp(a.rollingPageX),u=xp(a.rollingPageY),d=xp(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=u-a.rollingPageY[0],g=[...this.targets].filter(m=>a.initialTarget instanceof Node&&m.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/d,h>0?1:-1,c,Math.abs(f)/d,f>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(Jo.End,a.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Jo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Zo.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Jo.Change||e.type===Jo.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,r,o,s,a,l){this.handle=_g(()=>{const c=Date.now(),u=c-t;let d=0,h=0,f=!0;i+=Zo.SCROLL_FRICTION*u,s+=Zo.SCROLL_FRICTION*u,i>0&&(f=!1,d=r*i*u),s>0&&(f=!1,h=a*s*u);const g=this.newGestureEvent(Jo.Change);g.translationX=d,g.translationY=h,e.forEach(m=>m.dispatchEvent(g)),f||this.inertia(e,c,i,r,o+d,s,a,l+h)})}onTouchMove(e){const t=Date.now();for(let i=0,r=e.changedTouches.length;i<r;i++){const o=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}const s=this.activeTouches[o.identifier],a=this.newGestureEvent(Jo.Change,s.initialTarget);a.translationX=o.pageX-xp(s.rollingPageX),a.translationY=o.pageY-xp(s.rollingPageY),a.pageX=o.pageX,a.pageY=o.pageY,this.dispatchEvent(a),s.rollingPageX.length>3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(o.pageX),s.rollingPageY.push(o.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Zo.SCROLL_FRICTION=-.005;Zo.HOLD_DELAY=700;Zo.CLEAR_TAP_COUNT_TIME=400;Grr([Wa],Zo,"isTouchDevice",null);class sR{constructor(){this._hooks=new mt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(mi(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=window}this._hooks.add(tt(s,Yt.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(tt(s,Yt.POINTER_UP,a=>this.stopMonitoring(!0)))}}function O0e(n){return`--vscode-${n.replace(/\./g,"-")}`}function an(n){return`var(${O0e(n)})`}function Yrr(n,e){return`var(${O0e(n)}, ${e})`}const QZe={ColorContribution:"base.contributions.colors"};class Qrr{constructor(){this._onDidChangeSchema=new Le,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,r=!1,o){const s={id:e,description:i,defaults:t,needsTransparency:r,deprecationMessage:o};this.colorsById[e]=s;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const r=i.defaults[t.type];return b_(r,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const r=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return r!==o?r-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` `)}}const LG=new Qrr;Hs.add(QZe.ColorContribution,LG);function he(n,e,t,i,r){return LG.registerColor(n,e,t,i,r)}const Rt=he("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},T("foreground","Overall foreground color. This color is only used if not overridden by a component."));he("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},T("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const Xrr=he("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},T("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));he("descriptionForeground",{light:"#717171",dark:Mn(Rt,.7),hcDark:Mn(Rt,.7),hcLight:Mn(Rt,.7)},T("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const tw=he("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},T("iconForeground","The default color for icons in the workbench.")),Mf=he("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},T("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),ur=he("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},T("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),ys=he("contrastActiveBorder",{light:null,dark:null,hcDark:Mf,hcLight:Mf},T("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));he("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},T("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));he("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ze.black,hcLight:"#292929"},T("textSeparatorForeground","Color for text separators."));const Zrr=he("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},T("textLinkForeground","Foreground color for links in text."));he("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},T("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));he("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},T("textPreformatForeground","Foreground color for preformatted text segments."));he("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},T("textBlockQuoteBackground","Background color for block quotes in text."));he("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ze.white,hcLight:"#292929"},T("textBlockQuoteBorder","Border color for block quotes in text."));he("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ze.black,hcLight:"#F2F2F2"},T("textCodeBlockBackground","Background color for code blocks in text."));const Rb=he("widget.shadow",{dark:Mn(ze.black,.36),light:Mn(ze.black,.16),hcDark:null,hcLight:null},T("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),P0e=he("widget.border",{dark:null,light:null,hcDark:ur,hcLight:ur},T("widgetBorder","Border color of widgets such as find/replace inside the editor.")),XZe=he("input.background",{dark:"#3C3C3C",light:ze.white,hcDark:ze.black,hcLight:ze.white},T("inputBoxBackground","Input box background.")),ZZe=he("input.foreground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("inputBoxForeground","Input box foreground.")),JZe=he("input.border",{dark:null,light:null,hcDark:ur,hcLight:ur},T("inputBoxBorder","Input box border.")),M0e=he("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:ur,hcLight:ur},T("inputBoxActiveOptionBorder","Border color of activated options in input fields."));he("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},T("inputOption.hoverBackground","Background color of activated options in input fields."));const qx=he("inputOption.activeBackground",{dark:Mn(Mf,.4),light:Mn(Mf,.2),hcDark:ze.transparent,hcLight:ze.transparent},T("inputOption.activeBackground","Background hover color of options in input fields.")),F0e=he("inputOption.activeForeground",{dark:ze.white,light:ze.black,hcDark:Rt,hcLight:Rt},T("inputOption.activeForeground","Foreground color of activated options in input fields."));he("input.placeholderForeground",{light:Mn(Rt,.5),dark:Mn(Rt,.5),hcDark:Mn(Rt,.7),hcLight:Mn(Rt,.7)},T("inputPlaceholderForeground","Input box foreground color for placeholder text."));const Jrr=he("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ze.black,hcLight:ze.white},T("inputValidationInfoBackground","Input validation background color for information severity.")),eor=he("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Rt},T("inputValidationInfoForeground","Input validation foreground color for information severity.")),tor=he("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:ur,hcLight:ur},T("inputValidationInfoBorder","Input validation border color for information severity.")),nor=he("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ze.black,hcLight:ze.white},T("inputValidationWarningBackground","Input validation background color for warning severity.")),ior=he("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Rt},T("inputValidationWarningForeground","Input validation foreground color for warning severity.")),ror=he("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:ur,hcLight:ur},T("inputValidationWarningBorder","Input validation border color for warning severity.")),oor=he("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ze.black,hcLight:ze.white},T("inputValidationErrorBackground","Input validation background color for error severity.")),sor=he("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Rt},T("inputValidationErrorForeground","Input validation foreground color for error severity.")),aor=he("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:ur,hcLight:ur},T("inputValidationErrorBorder","Input validation border color for error severity.")),Ob=he("dropdown.background",{dark:"#3C3C3C",light:ze.white,hcDark:ze.black,hcLight:ze.white},T("dropdownBackground","Dropdown background.")),lor=he("dropdown.listBackground",{dark:null,light:null,hcDark:ze.black,hcLight:ze.white},T("dropdownListBackground","Dropdown list background.")),By=he("dropdown.foreground",{dark:"#F0F0F0",light:Rt,hcDark:ze.white,hcLight:Rt},T("dropdownForeground","Dropdown foreground.")),cL=he("dropdown.border",{dark:Ob,light:"#CECECE",hcDark:ur,hcLight:ur},T("dropdownBorder","Dropdown border.")),gP=he("button.foreground",{dark:ze.white,light:ze.white,hcDark:ze.white,hcLight:ze.white},T("buttonForeground","Button foreground color.")),cor=he("button.separator",{dark:Mn(gP,.4),light:Mn(gP,.4),hcDark:Mn(gP,.4),hcLight:Mn(gP,.4)},T("buttonSeparator","Button separator color.")),mP=he("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},T("buttonBackground","Button background color.")),uor=he("button.hoverBackground",{dark:hv(mP,.2),light:nI(mP,.2),hcDark:mP,hcLight:mP},T("buttonHoverBackground","Button background color when hovering.")),dor=he("button.border",{dark:ur,light:ur,hcDark:ur,hcLight:ur},T("buttonBorder","Button border color.")),hor=he("button.secondaryForeground",{dark:ze.white,light:ze.white,hcDark:ze.white,hcLight:Rt},T("buttonSecondaryForeground","Secondary button foreground color.")),Sce=he("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ze.white},T("buttonSecondaryBackground","Secondary button background color.")),por=he("button.secondaryHoverBackground",{dark:hv(Sce,.2),light:nI(Sce,.2),hcDark:null,hcLight:null},T("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),Q$=he("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ze.black,hcLight:"#0F4A85"},T("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),gor=he("badge.foreground",{dark:ze.white,light:"#333",hcDark:ze.white,hcLight:ze.white},T("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),mor=he("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},T("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),_P=he("scrollbarSlider.background",{dark:ze.fromHex("#797979").transparent(.4),light:ze.fromHex("#646464").transparent(.4),hcDark:Mn(ur,.6),hcLight:Mn(ur,.4)},T("scrollbarSliderBackground","Scrollbar slider background color.")),vP=he("scrollbarSlider.hoverBackground",{dark:ze.fromHex("#646464").transparent(.7),light:ze.fromHex("#646464").transparent(.7),hcDark:Mn(ur,.8),hcLight:Mn(ur,.8)},T("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),bP=he("scrollbarSlider.activeBackground",{dark:ze.fromHex("#BFBFBF").transparent(.4),light:ze.fromHex("#000000").transparent(.6),hcDark:ur,hcLight:ur},T("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),_or=he("progressBar.background",{dark:ze.fromHex("#0E70C0"),light:ze.fromHex("#0E70C0"),hcDark:ur,hcLight:ur},T("progressBarBackground","Background color of the progress bar that can show for long running operations."));he("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},T("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Pb=he("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},T("editorError.foreground","Foreground color of error squigglies in the editor.")),vor=he("editorError.border",{dark:null,light:null,hcDark:ze.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},T("errorBorder","If set, color of double underlines for errors in the editor."));he("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},T("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Ff=he("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},T("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),B3=he("editorWarning.border",{dark:null,light:null,hcDark:ze.fromHex("#FFCC00").transparent(.8),hcLight:ze.fromHex("#FFCC00").transparent(.8)},T("warningBorder","If set, color of double underlines for warnings in the editor."));he("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},T("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const lh=he("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},T("editorInfo.foreground","Foreground color of info squigglies in the editor.")),$3=he("editorInfo.border",{dark:null,light:null,hcDark:ze.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},T("infoBorder","If set, color of double underlines for infos in the editor.")),bor=he("editorHint.foreground",{dark:ze.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},T("editorHint.foreground","Foreground color of hint squigglies in the editor."));he("editorHint.border",{dark:null,light:null,hcDark:ze.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},T("hintBorder","If set, color of double underlines for hints in the editor."));he("sash.hoverBorder",{dark:Mf,light:Mf,hcDark:Mf,hcLight:Mf},T("sashActiveBorder","Border color of active sashes."));const Pl=he("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ze.black,hcLight:ze.white},T("editorBackground","Editor background color.")),vm=he("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ze.white,hcLight:Rt},T("editorForeground","Editor default foreground color."));he("editorStickyScroll.background",{light:Pl,dark:Pl,hcDark:Pl,hcLight:Pl},T("editorStickyScrollBackground","Sticky scroll background color for the editor"));he("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ze.fromHex("#0F4A85").transparent(.1)},T("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const ua=he("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ze.white},T("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Mb=he("editorWidget.foreground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Fb=he("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:ur,hcLight:ur},T("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),yor=he("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},T("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),TOe=he("quickInput.background",{dark:ua,light:ua,hcDark:ua,hcLight:ua},T("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Cor=he("quickInput.foreground",{dark:Mb,light:Mb,hcDark:Mb,hcLight:Mb},T("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),wor=he("quickInputTitle.background",{dark:new ze(new gr(255,255,255,.105)),light:new ze(new gr(0,0,0,.06)),hcDark:"#000000",hcLight:ze.white},T("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),eJe=he("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ze.white,hcLight:"#0F4A85"},T("pickerGroupForeground","Quick picker color for grouping labels.")),Sor=he("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ze.white,hcLight:"#0F4A85"},T("pickerGroupBorder","Quick picker color for grouping borders.")),Eor=he("keybindingLabel.background",{dark:new ze(new gr(128,128,128,.17)),light:new ze(new gr(221,221,221,.4)),hcDark:ze.transparent,hcLight:ze.transparent},T("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),xor=he("keybindingLabel.foreground",{dark:ze.fromHex("#CCCCCC"),light:ze.fromHex("#555555"),hcDark:ze.white,hcLight:Rt},T("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Tor=he("keybindingLabel.border",{dark:new ze(new gr(51,51,51,.6)),light:new ze(new gr(204,204,204,.4)),hcDark:new ze(new gr(111,195,223)),hcLight:ur},T("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),kor=he("keybindingLabel.bottomBorder",{dark:new ze(new gr(68,68,68,.6)),light:new ze(new gr(187,187,187,.4)),hcDark:new ze(new gr(111,195,223)),hcLight:Rt},T("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),nw=he("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},T("editorSelectionBackground","Color of the editor selection.")),Ior=he("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ze.white},T("editorSelectionForeground","Color of the selected text for high contrast.")),tJe=he("editor.inactiveSelectionBackground",{light:Mn(nw,.5),dark:Mn(nw,.5),hcDark:Mn(nw,.7),hcLight:Mn(nw,.5)},T("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),B0e=he("editor.selectionHighlightBackground",{light:ROe(nw,Pl,.3,.6),dark:ROe(nw,Pl,.3,.6),hcDark:null,hcLight:null},T("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);he("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:ys,hcLight:ys},T("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Lor=he("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},T("editorFindMatch","Color of the current search match.")),Bb=he("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},T("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Dor=he("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},T("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Aor=he("editor.findMatchBorder",{light:null,dark:null,hcDark:ys,hcLight:ys},T("editorFindMatchBorder","Border color of the current search match.")),iw=he("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:ys,hcLight:ys},T("findMatchHighlightBorder","Border color of the other search matches.")),Nor=he("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Mn(ys,.4),hcLight:Mn(ys,.4)},T("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);he("searchEditor.findMatchBackground",{light:Mn(Bb,.66),dark:Mn(Bb,.66),hcDark:Bb,hcLight:Bb},T("searchEditor.queryMatch","Color of the Search Editor query matches."));he("searchEditor.findMatchBorder",{light:Mn(iw,.66),dark:Mn(iw,.66),hcDark:iw,hcLight:iw},T("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));he("search.resultsInfoForeground",{light:Rt,dark:Mn(Rt,.65),hcDark:Rt,hcLight:Rt},T("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));he("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},T("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const uz=he("editorHoverWidget.background",{light:ua,dark:ua,hcDark:ua,hcLight:ua},T("hoverBackground","Background color of the editor hover."));he("editorHoverWidget.foreground",{light:Mb,dark:Mb,hcDark:Mb,hcLight:Mb},T("hoverForeground","Foreground color of the editor hover."));const Ror=he("editorHoverWidget.border",{light:Fb,dark:Fb,hcDark:Fb,hcLight:Fb},T("hoverBorder","Border color of the editor hover."));he("editorHoverWidget.statusBarBackground",{dark:hv(uz,.2),light:nI(uz,.05),hcDark:ua,hcLight:ua},T("statusBarBackground","Background color of the editor hover status bar."));const Oor=he("editorLink.activeForeground",{dark:"#4E94CE",light:ze.blue,hcDark:ze.cyan,hcLight:"#292929"},T("activeLinkForeground","Color of active links.")),$y=he("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ze.white,hcLight:ze.black},T("editorInlayHintForeground","Foreground color of inline hints")),Vy=he("editorInlayHint.background",{dark:Mn(Q$,.1),light:Mn(Q$,.1),hcDark:Mn(ze.white,.1),hcLight:Mn(Q$,.1)},T("editorInlayHintBackground","Background color of inline hints")),Por=he("editorInlayHint.typeForeground",{dark:$y,light:$y,hcDark:$y,hcLight:$y},T("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Mor=he("editorInlayHint.typeBackground",{dark:Vy,light:Vy,hcDark:Vy,hcLight:Vy},T("editorInlayHintBackgroundTypes","Background color of inline hints for types")),For=he("editorInlayHint.parameterForeground",{dark:$y,light:$y,hcDark:$y,hcLight:$y},T("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Bor=he("editorInlayHint.parameterBackground",{dark:Vy,light:Vy,hcDark:Vy,hcLight:Vy},T("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));he("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},T("editorLightBulbForeground","The color used for the lightbulb actions icon."));he("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const Ece=new ze(new gr(155,185,85,.2)),xce=new ze(new gr(255,0,0,.2)),$or=he("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},T("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Vor=he("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},T("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);he("diffEditor.insertedLineBackground",{dark:Ece,light:Ece,hcDark:null,hcLight:null},T("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);he("diffEditor.removedLineBackground",{dark:xce,light:xce,hcDark:null,hcLight:null},T("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);he("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));he("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const Hor=he("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Wor=he("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));he("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},T("diffEditorInsertedOutline","Outline color for the text that got inserted."));he("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},T("diffEditorRemovedOutline","Outline color for text that got removed."));he("diffEditor.border",{dark:null,light:null,hcDark:ur,hcLight:ur},T("diffEditorBorder","Border color between the two text editors."));he("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},T("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));he("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},T("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));he("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},T("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));he("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},T("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const zor=he("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Uor=he("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),jor=he("list.focusOutline",{dark:Mf,light:Mf,hcDark:ys,hcLight:ys},T("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),qor=he("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},T("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),Hy=he("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ze.fromHex("#0F4A85").transparent(.1)},T("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),$b=he("list.activeSelectionForeground",{dark:ze.white,light:ze.white,hcDark:null,hcLight:null},T("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),yP=he("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Kor=he("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ze.fromHex("#0F4A85").transparent(.1)},T("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Gor=he("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Yor=he("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Qor=he("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Xor=he("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},T("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),nJe=he("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ze.white.transparent(.1),hcLight:ze.fromHex("#0F4A85").transparent(.1)},T("listHoverBackground","List/Tree background when hovering over items using the mouse.")),iJe=he("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Zor=he("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},T("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),bm=he("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Mf,hcLight:Mf},T("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),O9=he("list.focusHighlightForeground",{dark:bm,light:Isr(Hy,bm,"#BBE7FF"),hcDark:bm,hcLight:bm},T("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));he("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},T("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));he("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},T("listErrorForeground","Foreground color of list items containing errors."));he("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},T("listWarningForeground","Foreground color of list items containing warnings."));const Jor=he("listFilterWidget.background",{light:nI(ua,0),dark:hv(ua,0),hcDark:ua,hcLight:ua},T("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),esr=he("listFilterWidget.outline",{dark:ze.transparent,light:ze.transparent,hcDark:"#f38518",hcLight:"#007ACC"},T("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),tsr=he("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:ur,hcLight:ur},T("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),nsr=he("listFilterWidget.shadow",{dark:Rb,light:Rb,hcDark:Rb,hcLight:Rb},T("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));he("list.filterMatchBackground",{dark:Bb,light:Bb,hcDark:null,hcLight:null},T("listFilterMatchHighlight","Background color of the filtered match."));he("list.filterMatchBorder",{dark:iw,light:iw,hcDark:ur,hcLight:ys},T("listFilterMatchHighlightBorder","Border color of the filtered match."));const CP=he("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},T("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),isr=he("tree.inactiveIndentGuidesStroke",{dark:Mn(CP,.4),light:Mn(CP,.4),hcDark:Mn(CP,.4),hcLight:Mn(CP,.4)},T("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),rsr=he("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},T("tableColumnsBorder","Table border color between columns.")),osr=he("tree.tableOddRowsBackground",{dark:Mn(Rt,.04),light:Mn(Rt,.04),hcDark:null,hcLight:null},T("tableOddRowsBackgroundColor","Background color for odd table rows."));he("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},T("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const ssr=he("checkbox.background",{dark:Ob,light:Ob,hcDark:Ob,hcLight:Ob},T("checkbox.background","Background color of checkbox widget."));he("checkbox.selectBackground",{dark:ua,light:ua,hcDark:ua,hcLight:ua},T("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const asr=he("checkbox.foreground",{dark:By,light:By,hcDark:By,hcLight:By},T("checkbox.foreground","Foreground color of checkbox widget.")),lsr=he("checkbox.border",{dark:cL,light:cL,hcDark:cL,hcLight:cL},T("checkbox.border","Border color of checkbox widget."));he("checkbox.selectBorder",{dark:tw,light:tw,hcDark:tw,hcLight:tw},T("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const kOe=he("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,T("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),Kx=he("quickInputList.focusForeground",{dark:$b,light:$b,hcDark:$b,hcLight:$b},T("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),uL=he("quickInputList.focusIconForeground",{dark:yP,light:yP,hcDark:yP,hcLight:yP},T("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),Gx=he("quickInputList.focusBackground",{dark:V3(kOe,Hy),light:V3(kOe,Hy),hcDark:null,hcLight:null},T("quickInput.listFocusBackground","Quick picker background color for the focused item.")),csr=he("menu.border",{dark:null,light:null,hcDark:ur,hcLight:ur},T("menuBorder","Border color of menus.")),usr=he("menu.foreground",{dark:By,light:By,hcDark:By,hcLight:By},T("menuForeground","Foreground color of menu items.")),dsr=he("menu.background",{dark:Ob,light:Ob,hcDark:Ob,hcLight:Ob},T("menuBackground","Background color of menu items.")),hsr=he("menu.selectionForeground",{dark:$b,light:$b,hcDark:$b,hcLight:$b},T("menuSelectionForeground","Foreground color of the selected menu item in menus.")),fsr=he("menu.selectionBackground",{dark:Hy,light:Hy,hcDark:Hy,hcLight:Hy},T("menuSelectionBackground","Background color of the selected menu item in menus.")),psr=he("menu.selectionBorder",{dark:null,light:null,hcDark:ys,hcLight:ys},T("menuSelectionBorder","Border color of the selected menu item in menus.")),gsr=he("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:ur,hcLight:ur},T("menuSeparatorBackground","Color of a separator menu item in menus.")),Tce=he("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},T("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));he("toolbar.hoverOutline",{dark:null,light:null,hcDark:ys,hcLight:ys},T("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));he("toolbar.activeBackground",{dark:hv(Tce,.1),light:nI(Tce,.1),hcDark:null,hcLight:null},T("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));he("editor.snippetTabstopHighlightBackground",{dark:new ze(new gr(124,124,124,.3)),light:new ze(new gr(10,50,100,.2)),hcDark:new ze(new gr(124,124,124,.3)),hcLight:new ze(new gr(10,50,100,.2))},T("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));he("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},T("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));he("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));he("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ze(new gr(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},T("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const msr=he("breadcrumb.foreground",{light:Mn(Rt,.8),dark:Mn(Rt,.8),hcDark:Mn(Rt,.8),hcLight:Mn(Rt,.8)},T("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),_sr=he("breadcrumb.background",{light:Pl,dark:Pl,hcDark:Pl,hcLight:Pl},T("breadcrumbsBackground","Background color of breadcrumb items.")),IOe=he("breadcrumb.focusForeground",{light:nI(Rt,.2),dark:hv(Rt,.1),hcDark:hv(Rt,.1),hcLight:hv(Rt,.1)},T("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),vsr=he("breadcrumb.activeSelectionForeground",{light:nI(Rt,.2),dark:hv(Rt,.1),hcDark:hv(Rt,.1),hcLight:hv(Rt,.1)},T("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));he("breadcrumbPicker.background",{light:ua,dark:ua,hcDark:ua,hcLight:ua},T("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const rJe=.5,LOe=ze.fromHex("#40C8AE").transparent(rJe),DOe=ze.fromHex("#40A6FF").transparent(rJe),AOe=ze.fromHex("#606060").transparent(.4),ym=.4,NA=1,dL=he("merge.currentHeaderBackground",{dark:LOe,light:LOe,hcDark:null,hcLight:null},T("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);he("merge.currentContentBackground",{dark:Mn(dL,ym),light:Mn(dL,ym),hcDark:Mn(dL,ym),hcLight:Mn(dL,ym)},T("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const hL=he("merge.incomingHeaderBackground",{dark:DOe,light:DOe,hcDark:null,hcLight:null},T("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);he("merge.incomingContentBackground",{dark:Mn(hL,ym),light:Mn(hL,ym),hcDark:Mn(hL,ym),hcLight:Mn(hL,ym)},T("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const fL=he("merge.commonHeaderBackground",{dark:AOe,light:AOe,hcDark:null,hcLight:null},T("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);he("merge.commonContentBackground",{dark:Mn(fL,ym),light:Mn(fL,ym),hcDark:Mn(fL,ym),hcLight:Mn(fL,ym)},T("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const RA=he("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},T("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));he("editorOverviewRuler.currentContentForeground",{dark:Mn(dL,NA),light:Mn(dL,NA),hcDark:RA,hcLight:RA},T("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));he("editorOverviewRuler.incomingContentForeground",{dark:Mn(hL,NA),light:Mn(hL,NA),hcDark:RA,hcLight:RA},T("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));he("editorOverviewRuler.commonContentForeground",{dark:Mn(fL,NA),light:Mn(fL,NA),hcDark:RA,hcLight:RA},T("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const $0e=he("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},T("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),wP=he("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},T("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),pL=he("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},T("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),DG=he("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},T("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),NOe=he("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},T("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),bsr=he("minimap.infoHighlight",{dark:lh,light:lh,hcDark:$3,hcLight:$3},T("minimapInfo","Minimap marker color for infos.")),ysr=he("minimap.warningHighlight",{dark:Ff,light:Ff,hcDark:B3,hcLight:B3},T("overviewRuleWarning","Minimap marker color for warnings.")),Csr=he("minimap.errorHighlight",{dark:new ze(new gr(255,18,18,.7)),light:new ze(new gr(255,18,18,.7)),hcDark:new ze(new gr(255,50,50,1)),hcLight:"#B5200D"},T("minimapError","Minimap marker color for errors.")),wsr=he("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},T("minimapBackground","Minimap background color.")),Ssr=he("minimap.foregroundOpacity",{dark:ze.fromHex("#000f"),light:ze.fromHex("#000f"),hcDark:ze.fromHex("#000f"),hcLight:ze.fromHex("#000f")},T("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));he("minimapSlider.background",{light:Mn(_P,.5),dark:Mn(_P,.5),hcDark:Mn(_P,.5),hcLight:Mn(_P,.5)},T("minimapSliderBackground","Minimap slider background color."));he("minimapSlider.hoverBackground",{light:Mn(vP,.5),dark:Mn(vP,.5),hcDark:Mn(vP,.5),hcLight:Mn(vP,.5)},T("minimapSliderHoverBackground","Minimap slider background color when hovering."));he("minimapSlider.activeBackground",{light:Mn(bP,.5),dark:Mn(bP,.5),hcDark:Mn(bP,.5),hcLight:Mn(bP,.5)},T("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Esr=he("problemsErrorIcon.foreground",{dark:Pb,light:Pb,hcDark:Pb,hcLight:Pb},T("problemsErrorIconForeground","The color used for the problems error icon.")),xsr=he("problemsWarningIcon.foreground",{dark:Ff,light:Ff,hcDark:Ff,hcLight:Ff},T("problemsWarningIconForeground","The color used for the problems warning icon.")),Tsr=he("problemsInfoIcon.foreground",{dark:lh,light:lh,hcDark:lh,hcLight:lh},T("problemsInfoIconForeground","The color used for the problems info icon."));he("charts.foreground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("chartsForeground","The foreground color used in charts."));he("charts.lines",{dark:Mn(Rt,.5),light:Mn(Rt,.5),hcDark:Mn(Rt,.5),hcLight:Mn(Rt,.5)},T("chartsLines","The color used for horizontal lines in charts."));he("charts.red",{dark:Pb,light:Pb,hcDark:Pb,hcLight:Pb},T("chartsRed","The red color used in chart visualizations."));he("charts.blue",{dark:lh,light:lh,hcDark:lh,hcLight:lh},T("chartsBlue","The blue color used in chart visualizations."));he("charts.yellow",{dark:Ff,light:Ff,hcDark:Ff,hcLight:Ff},T("chartsYellow","The yellow color used in chart visualizations."));he("charts.orange",{dark:pL,light:pL,hcDark:pL,hcLight:pL},T("chartsOrange","The orange color used in chart visualizations."));he("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},T("chartsGreen","The green color used in chart visualizations."));he("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("chartsPurple","The purple color used in chart visualizations."));function ksr(n,e){var t,i,r,o;switch(n.op){case 0:return(t=b_(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=b_(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(r=b_(n.value,e))===null||r===void 0?void 0:r.transparent(n.factor);case 3:{const s=b_(n.background,e);return s?(o=b_(n.value,e))===null||o===void 0?void 0:o.makeOpaque(s):b_(n.value,e)}case 4:for(const s of n.values){const a=b_(s,e);if(a)return a}return;case 6:return b_(e.defines(n.if)?n.then:n.else,e);case 5:{const s=b_(n.value,e);if(!s)return;const a=b_(n.background,e);return a?s.isDarkerThan(a)?ze.getLighterColor(s,a,n.factor).transparent(n.transparency):ze.getDarkerColor(s,a,n.factor).transparent(n.transparency):s.transparent(n.factor*n.transparency)}default:throw fG()}}function nI(n,e){return{op:0,value:n,factor:e}}function hv(n,e){return{op:1,value:n,factor:e}}function Mn(n,e){return{op:2,value:n,factor:e}}function V3(...n){return{op:4,values:n}}function Isr(n,e,t){return{op:6,if:n,then:e,else:t}}function ROe(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function b_(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?ze.fromHex(n):e.getColor(n);if(n instanceof ze)return n;if(typeof n=="object")return ksr(n,e)}}const oJe="vscode://schemas/workbench-colors",sJe=Hs.as(EG.JSONContribution);sJe.registerSchema(oJe,LG.getColorSchema());const OOe=new $o(()=>sJe.notifySchemaChanged(oJe),200);LG.onDidChangeSchema(()=>{OOe.isScheduled()||OOe.schedule()});class AG{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new aJe(this.x-window.scrollX,this.y-window.scrollY)}}class aJe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new AG(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Lsr{constructor(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r,this._editorPagePositionBrand=void 0}}class Dsr{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function V0e(n){const e=pl(n);return new Lsr(e.left,e.top,e.width,e.height)}function H0e(n,e,t){const i=e.width/n.offsetWidth,r=e.height/n.offsetHeight,o=(t.x-e.x)/i,s=(t.y-e.y)/r;return new Dsr(o,s)}class SS extends Zp{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new AG(this.posx,this.posy),this.editorPos=V0e(i),this.relativePos=H0e(i,this.editorPos,this.pos)}}class Asr{constructor(e){this._editorViewDomNode=e}_create(e){return new SS(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return tt(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return tt(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return tt(e,Yt.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return tt(e,Yt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return tt(e,Yt.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return tt(e,"mousemove",i=>t(this._create(i)))}}class Nsr{constructor(e){this._editorViewDomNode=e}_create(e){return new SS(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return tt(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return tt(e,Yt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return tt(e,Yt.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return tt(e,"pointermove",i=>t(this._create(i)))}}class Rsr extends Ue{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new sR),this._keydownListener=null}startMonitoring(e,t,i,r,o){this._keydownListener=$a(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,s=>{r(new SS(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),o(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class I6{constructor(e){this._editor=e,this._instanceId=++I6._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new $o(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const r=this._counter++;i=new Osr(t,`dyn-rule-${this._instanceId}-${r}`,XW(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}I6._idPool=0;class Osr{constructor(e,t,i,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElement=vg(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const r in t){const o=t[r];let s;typeof o=="object"?s=an(o.id):s=o;const a=Psr(r);i+=` ${a}: ${s};`}return i+=` }`,i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Psr(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class L6 extends Ue{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,r=e.length;i<r;i++){const o=e[i];switch(o.type){case 0:this.onCompositionStart(o)&&(t=!0);break;case 1:this.onCompositionEnd(o)&&(t=!0);break;case 2:this.onConfigurationChanged(o)&&(t=!0);break;case 3:this.onCursorStateChanged(o)&&(t=!0);break;case 4:this.onDecorationsChanged(o)&&(t=!0);break;case 5:this.onFlushed(o)&&(t=!0);break;case 6:this.onFocusChanged(o)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(o)&&(t=!0);break;case 8:this.onLineMappingChanged(o)&&(t=!0);break;case 9:this.onLinesChanged(o)&&(t=!0);break;case 10:this.onLinesDeleted(o)&&(t=!0);break;case 11:this.onLinesInserted(o)&&(t=!0);break;case 12:this.onRevealRangeRequest(o)&&(t=!0);break;case 13:this.onScrollChanged(o)&&(t=!0);break;case 15:this.onTokensChanged(o)&&(t=!0);break;case 14:this.onThemeChanged(o)&&(t=!0);break;case 16:this.onTokensColorsChanged(o)&&(t=!0);break;case 17:this.onZonesChanged(o)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(o)}}t&&(this._shouldRender=!0)}}class nf extends L6{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class d0{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let r=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[r++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(r);for(let s=0;s<r;s++)o[s]=i[r-s-1];return o}}class Msr{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class Fsr extends Msr{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class Bsr{constructor(e,t,i,r){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=r}}class NG{static from(e){const t=new Array(e.length);for(let i=0,r=e.length;i<r;i++){const o=e[i];t[i]=new NG(o.left,o.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class _T{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class $sr{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class POe{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class X${static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,r,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,r),s.getClientRects()}catch{return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(e.length===1)return e;e.sort(_T.compare);const t=[];let i=0,r=e[0];for(let o=1,s=e.length;o<s;o++){const a=e[o];r.left+r.width+.9>=a.left?r.width=Math.max(r.width,a.left+a.width-r.left):(t[i++]=r,r=a)}return t[i++]=r,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const r=[];for(let o=0,s=e.length;o<s;o++){const a=e[o];r[o]=new _T(Math.max(0,(a.left-t)/i),a.width/i)}return this._mergeAdjacentRanges(r)}static readHorizontalRanges(e,t,i,r,o,s){const l=e.children.length-1;if(0>l)return null;if(t=Math.min(l,Math.max(0,t)),r=Math.min(l,Math.max(0,r)),t===r&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==r&&r>0&&o===0&&(r--,o=1073741824);let c=e.children[t].firstChild,u=e.children[r].firstChild;if((!c||!u)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!u&&o===0&&r>0&&(u=e.children[r-1].firstChild,o=1073741824)),!c||!u)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(u.textContent.length,Math.max(0,o));const d=this._readClientRects(c,i,u,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var Jp;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Jp||(Jp={}));function fv(n){return n===Jp.HIGH_CONTRAST_DARK||n===Jp.HIGH_CONTRAST_LIGHT}function OA(n){return n===Jp.DARK||n===Jp.HIGH_CONTRAST_DARK}const Vsr=function(){return cv?!0:!(Zu||mg||C1)}();let oD=!0;class MOe{constructor(e,t){this.themeType=t;const i=e.options,r=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(98):this.renderWhitespace="none",this.renderControlCharacters=i.get(93),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class bb{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=io(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return fv(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,a=Vh.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(fv(s.themeType)||this._options.renderWhitespace==="selection"){const h=i.selections;for(const f of h){if(f.endLineNumber<e||f.startLineNumber>e)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,m=f.endLineNumber===e?f.endColumn:o.maxColumn;g<m&&(fv(s.themeType)&&a.push(new Vh(g,m,"inline-selected-text",0)),this._options.renderWhitespace==="selection"&&(l||(l=[]),l.push(new zZe(g-1,m-1))))}}const c=new fE(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,a,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Tf.OFF,l);if(this._renderedViewLine&&this._renderedViewLine.input.equals(c))return!1;r.appendString('<div style="top:'),r.appendString(String(t)),r.appendString("px;height:"),r.appendString(String(this._options.lineHeight)),r.appendString('px;" class="'),r.appendString(bb.CLASS_NAME),r.appendString('">');const u=T6(c,r);r.appendString("</div>");let d=null;return oD&&Vsr&&o.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new P9(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=cJe(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof P9:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof P9?this._renderedViewLine.monospaceAssumptionsAreValid():oD}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof P9&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new POe(!0,[new _T(this.getWidth(r),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,r);return s&&s.length>0?new POe(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}bb.CLASS_NAME="view-line";class P9{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let o=0;o<r;o++)this._keyColumnPixelOffsetCache[o]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){const t=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*t)}return this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||this._cachedWidth!==-1}monospaceAssumptionsAreValid(){if(!this.domNode)return oD;if(this.input.lineContent.length<300){const e=this.getWidth(null),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),oD=!1)}return oD}toSlowRenderedLine(){return cJe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,r){const o=this._getColumnPixelOffset(e,t,r),s=this._getColumnPixelOffset(e,i,r);return[new _T(o,s-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const r=Math.floor((t-1)/300)-1,o=(r+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[r],s===-1&&(s=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[r]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const r=this._characterMapping.getDomPosition(t),o=X$.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return W0e(this._characterMapping,e,t)}}class lJe{constructor(e,t,i,r,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,r);if(o===-1)return null;const s=this._readPixelOffset(this.domNode,e,i,r);return s===-1?null:[new _T(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,r)}_readVisibleRangesForRange(e,t,i,r,o){if(i===r){const s=this._readPixelOffset(e,t,i,o);return s===-1?null:[new _T(s,0)]}else return this._readRawVisibleRangesForRange(e,i,r,o)}_readPixelOffset(e,t,i,r){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);const o=this._getReadingTarget(e);return o.firstChild?(r.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const s=this._actualReadPixelOffset(e,t,i,r);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,r)}_actualReadPixelOffset(e,t,i,r){if(this._characterMapping.length===0){const l=X$.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);const o=this._characterMapping.getDomPosition(i),s=X$.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,r);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,r){if(t===1&&i===this._characterMapping.length)return[new _T(0,this.getWidth(r))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return X$.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,r)}getColumnOfNodeOffset(e,t){return W0e(this._characterMapping,e,t)}}class Hsr extends lJe{_readVisibleRangesForRange(e,t,i,r,o){const s=super._readVisibleRangesForRange(e,t,i,r,o);if(!s||s.length===0||i===r||i===1&&r===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,r,o);if(a!==-1){const l=s[s.length-1];l.left<a&&(l.width=a-l.left)}}return s}}const cJe=function(){return pT?Wsr:zsr}();function Wsr(n,e,t,i,r){return new Hsr(n,e,t,i,r)}function zsr(n,e,t,i,r){return new lJe(n,e,t,i,r)}function W0e(n,e,t){const i=e.textContent.length;let r=-1;for(;e;)e=e.previousSibling,r++;return n.getColumn(new UZe(r,t),i)}class yl{static _nextVisibleColumn(e,t,i){return e===9?yl.nextRenderTabStop(t,i):mS(e)||d0e(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const r=Math.min(t-1,e.length),o=e.substring(0,r),s=new YW(o);let a=0;for(;!s.eol();){const l=GW(o,r,s.offset);s.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const r=e.length,o=new YW(e);let s=0,a=1;for(;!o.eol();){const l=GW(e,r,o.offset);o.nextGraphemeLength();const c=this._nextVisibleColumn(l,s,i),u=o.offset+1;if(c>=t){const d=t-s;return c-t<d?u:a}s=c,a=u}return r+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}class H3{static whitespaceVisibleColumn(e,t,i){const r=e.length;let o=0,s=-1,a=-1;for(let l=0;l<r;l++){if(l===t)return[s,a,o];switch(o%i===0&&(s=l,a=o),e.charCodeAt(l)){case 32:o+=1;break;case 9:o=yl.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===r?[s,a,o]:[-1,-1,-1]}static atomicPosition(e,t,i,r){const o=e.length,[s,a,l]=H3.whitespaceVisibleColumn(e,t,i);if(l===-1)return-1;let c;switch(r){case 0:c=!0;break;case 1:c=!1;break;case 2:if(l%i===0)return t;c=l%i<=i/2;break}if(c){if(s===-1)return-1;let h=a;for(let f=s;f<o;++f){if(h===a+i)return s;switch(e.charCodeAt(f)){case 32:h+=1;break;case 9:h=yl.nextRenderTabStop(h,i);break;default:return-1}}return h===a+i?s:-1}const u=yl.nextRenderTabStop(l,i);let d=l;for(let h=t;h<o;h++){if(d===u)return h;switch(e.charCodeAt(h)){case 32:d+=1;break;case 9:d=yl.nextRenderTabStop(d,i);break;default:return-1}}return d===u?o:-1}}class _C{constructor(e=null){this.hitTarget=e,this.type=0}}class uJe{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var xx;(function(n){function e(t,i,r){const o=t.getPositionFromDOMInfo(i,r);return o?new uJe(o,i,null):new _C(i)}n.createFromDOMInfo=e})(xx||(xx={}));class Usr{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class $u{static _deduceRage(e,t=null){return!t&&e?new J(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,r,o,s){return{type:e,element:t,mouseColumn:i,position:r,range:o,detail:s}}static createViewZone(e,t,i,r,o){return{type:e,element:t,mouseColumn:i,position:r,range:this._deduceRage(r),detail:o}}static createContentText(e,t,i,r,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,r),detail:o}}static createContentEmpty(e,t,i,r){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:r}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,r){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:r}}static _typeToString(e){return e===1?"TEXTAREA":e===2?"GUTTER_GLYPH_MARGIN":e===3?"GUTTER_LINE_NUMBERS":e===4?"GUTTER_LINE_DECORATIONS":e===5?"GUTTER_VIEW_ZONE":e===6?"CONTENT_TEXT":e===7?"CONTENT_EMPTY":e===8?"CONTENT_VIEW_ZONE":e===9?"CONTENT_WIDGET":e===10?"OVERVIEW_RULER":e===11?"SCROLLBAR":e===12?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class ff{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===6}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class PA{constructor(e,t,i){this.viewModel=e.viewModel;const r=e.configuration.options;this.layoutInfo=r.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(66),this.stickyTabStops=r.get(115),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return PA.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const r=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s=null,a,l=null;return i.afterLineNumber!==o&&(l=new De(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(s=new De(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=s:s===null?a=l:t<r?a=s:a=l,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:s,positionAfter:l,position:a}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const r=this._context.viewModel.getLineCount(),o=this._context.viewModel.getLineMaxColumn(r);return{range:new J(r,o,r,o),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new J(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return PA._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class jsr{constructor(e,t,i,r){this.editorPos=t,this.pos=i,this.relativePos=r,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,$c._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class z0e extends jsr{constructor(e,t,i,r,o){super(e,t,i,r),this._ctx=e,o?(this.target=o,this.targetPath=d0.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?yl.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return $u.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return $u.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,r){return $u.createMargin(e,this.target,this._getMouseColumn(t),t,i,r)}fulfillViewZone(e,t,i){return $u.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return $u.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return $u.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return $u.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return $u.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return $u.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new z0e(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const FOe={isAfterLines:!0};function ste(n){return{isAfterLines:!1,horizontalDistanceToText:n}}class $c{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=d0.collect(t,this._viewHelper.viewDomNode);return!!(ff.isChildOfContentWidgets(i)||ff.isChildOfOverflowingContentWidgets(i)||ff.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,r,o){const s=new PA(this._context,this._viewHelper,e),a=new z0e(s,t,i,r,o);try{const l=$c._createMouseTarget(s,a,!1);if(l.type===6&&s.stickyTabStops&&l.position!==null){const c=$c._snapToSoftTabBoundary(l.position,s.viewModel),u=J.fromPositions(c,c).plusRange(l.range);return a.fulfillContentText(c,u,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfillUnknown();const s=$c._doHitTest(e,t);return s.type===1?$c.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}const r=t;let o=null;return!ff.isChildOfOverflowGuard(t.targetPath)&&!ff.isChildOfOverflowingContentWidgets(t.targetPath)&&(o=o||t.fulfillUnknown()),o=o||$c._hitTestContentWidget(e,r),o=o||$c._hitTestOverlayWidget(e,r),o=o||$c._hitTestMinimap(e,r),o=o||$c._hitTestScrollbarSlider(e,r),o=o||$c._hitTestViewZone(e,r),o=o||$c._hitTestMargin(e,r),o=o||$c._hitTestViewCursor(e,r),o=o||$c._hitTestTextArea(e,r),o=o||$c._hitTestViewLines(e,r,i),o=o||$c._hitTestScrollbar(e,r),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(ff.isChildOfContentWidgets(t.targetPath)||ff.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(ff.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const r of i)if(t.target===r.domNode)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,r=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(r<s.contentLeft||r>s.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=o&&o<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const r=t.isInContentArea?8:5;return t.fulfillViewZone(r,i.position,i)}return null}static _hitTestTextArea(e,t){return ff.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,r,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!ff.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new De(1,1),FOe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new De(o,s),FOe)}if(i){if(ff.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=ste(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new De(o,1),l)}const s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){const a=ste(t.mouseContentHorizontalOffset-s),l=new De(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const r=$c._doHitTest(e,t);return r.type===1?$c.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}static _hitTestMinimap(e,t){if(ff.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new De(i,r))}return null}static _hitTestScrollbarSlider(e,t){if(ff.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(r);return t.fulfillScrollbar(new De(r,o))}}return null}static _hitTestScrollbar(e,t){if(ff.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new De(i,r))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),r=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return $c._getMouseColumn(r,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,r,o){const s=r.lineNumber,a=r.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const _=ste(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,_)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(r);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:c.left,column:a}),a>1){const _=e.visibleRangeForPosition(s,a-1);_&&d.push({offset:_.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(a<h){const _=e.visibleRangeForPosition(s,a+1);_&&d.push({offset:_.left,column:a+1})}d.sort((_,b)=>_.offset-b.offset);const f=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),m=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let _=1;_<d.length;_++){const b=d[_-1],y=d[_];if(b.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=y.offset){v=new J(s,b.column,s,y.column);const C=Math.abs(b.offset-t.mouseContentHorizontalOffset),x=Math.abs(y.offset-t.mouseContentHorizontalOffset);r=C<x?new De(s,b.column):new De(s,y.column);break}}return t.fulfillContentText(r,v,{mightBeForeignElement:!m||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.getVerticalOffsetForLineNumber(i),o=r+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){const a=Math.floor((r+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new AG(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=JT(e.viewDomNode);let r;if(i?typeof i.caretRangeFromPoint>"u"?r=qsr(i,t.clientX,t.clientY):r=i.caretRangeFromPoint(t.clientX,t.clientY):r=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new _C;const o=r.startContainer;if(o.nodeType===o.TEXT_NODE){const s=o.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===bb.CLASS_NAME?xx.createFromDOMInfo(e,s,r.startOffset):new _C(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const s=o.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===bb.CLASS_NAME?xx.createFromDOMInfo(e,o,o.textContent.length):new _C(o)}return new _C}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const r=i.offsetNode.parentNode,o=r?r.parentNode:null,s=o?o.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===bb.CLASS_NAME?xx.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new _C(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const r=i.offsetNode.parentNode,o=r&&r.nodeType===r.ELEMENT_NODE?r.className:null,s=r?r.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(o===bb.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return xx.createFromDOMInfo(e,l,0)}else if(a===bb.CLASS_NAME)return xx.createFromDOMInfo(e,i.offsetNode,0)}return new _C(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),o=H3.atomicPosition(i,e.column-1,r,2);return o!==-1?new De(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new _C;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const r=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(r||!o.equals(i.position))&&(i=new uJe(o,i.spanNode,r))}return i}}function qsr(n,e,t){const i=document.createRange();let r=n.elementFromPoint(e,t);if(r!==null){for(;r&&r.firstChild&&r.firstChild.nodeType!==r.firstChild.TEXT_NODE&&r.lastChild&&r.lastChild.firstChild;)r=r.lastChild;const o=r.getBoundingClientRect(),s=window.getComputedStyle(r,null).getPropertyValue("font-style"),a=window.getComputedStyle(r,null).getPropertyValue("font-variant"),l=window.getComputedStyle(r,null).getPropertyValue("font-weight"),c=window.getComputedStyle(r,null).getPropertyValue("font-size"),u=window.getComputedStyle(r,null).getPropertyValue("line-height"),d=window.getComputedStyle(r,null).getPropertyValue("font-family"),h=`${s} ${a} ${l} ${c}/${u} ${d}`,f=r.innerText;let g=o.left,m=0,v;if(e>o.left+o.width)m=f.length;else{const _=Yx.getInstance();for(let b=0;b<f.length+1;b++){if(v=_.getCharWidth(f.charAt(b),h)/2,g+=v,e<g){m=b;break}g+=v}}i.setStart(r.firstChild,m),i.setEnd(r.firstChild,m)}return i}class Yx{static getInstance(){return Yx._INSTANCE||(Yx._INSTANCE=new Yx),Yx._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const r=this._canvas.getContext("2d");r.font=t;const s=r.measureText(e).width;return this._cache[i]=s,s}}Yx._INSTANCE=null;let Jm=class extends Ue{onclick(e,t){this._register(tt(e,Yt.CLICK,i=>t(new Zp(i))))}onmousedown(e,t){this._register(tt(e,Yt.MOUSE_DOWN,i=>t(new Zp(i))))}onmouseover(e,t){this._register(tt(e,Yt.MOUSE_OVER,i=>t(new Zp(i))))}onmouseleave(e,t){this._register(tt(e,Yt.MOUSE_LEAVE,i=>t(new Zp(i))))}onkeydown(e,t){this._register(tt(e,Yt.KEY_DOWN,i=>t(new hs(i))))}onkeyup(e,t){this._register(tt(e,Yt.KEY_UP,i=>t(new hs(i))))}oninput(e,t){this._register(tt(e,Yt.INPUT,t))}onblur(e,t){this._register(tt(e,Yt.BLUR,t))}onfocus(e,t){this._register(tt(e,Yt.FOCUS,t))}ignoreGesture(e){return Zo.ignoreTarget(e)}};const MA=11;class Ksr extends Jm{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Qn.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=MA+"px",this.domNode.style.height=MA+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new sR),this._register($a(this.bgDomNode,Yt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register($a(this.domNode,Yt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new S6),this._pointerdownScheduleRepeatTimer=this._register(new Zm)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Gsr extends Ue{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Zm)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Ysr=140;class dJe extends Jm{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Gsr(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new sR),this._shouldRender=!0,this.domNode=io(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(tt(this.domNode.domNode,Yt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Ksr(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,r){this.slider=io(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(tt(this.slider.domNode,Yt.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=pl(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const r=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const s=this._sliderOrthogonalPointerPosition(o),a=Math.abs(s-i);if(eu&&a>Ysr){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Qsr=20;class FA{constructor(e,t,i,r,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new FA(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,r,o){const s=Math.max(0,i-e),a=Math.max(0,s-2*t),l=r>0&&r>i;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(Qsr,Math.floor(i*a/r))),u=(a-c)/(r-i),d=o*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=FA._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class Xsr extends dJe{constructor(e,t,i){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new FA(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const s=(t.arrowSize-MA)/2,a=(t.horizontalScrollbarSize-MA)/2;this._createArrow({className:"scra",icon:Ht.scrollbarButtonLeft,top:a,left:s,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new ZT(null,1,0))}),this._createArrow({className:"scra",icon:Ht.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new ZT(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Zsr extends dJe{constructor(e,t,i){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new FA(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-MA)/2,a=(t.verticalScrollbarSize-MA)/2;this._createArrow({className:"scra",icon:Ht.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new ZT(null,0,1))}),this._createArrow({className:"scra",icon:Ht.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new ZT(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class dz{constructor(e,t,i,r,o,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,r=r|0,o=o|0,s=s|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,t<0&&(t=0),r+t>i&&(r=i-t),r<0&&(r=0),o<0&&(o=0),a+o>s&&(a=s-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=r,this.height=o,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new dz(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new dz(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:r,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class D6 extends Ue{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Le),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new dz(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let r;t?r=new W3(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=W3.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class BOe{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function ate(n,e){const t=e-n;return function(i){return n+t*tar(i)}}function Jsr(n,e,t){return function(i){return i<t?n(i/t):e((i-t)/(1-t))}}class W3{constructor(e,t,i,r){this.from=e,this.to=t,this.duration=r,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let o,s;return e<t?(o=e+.75*i,s=t-.75*i):(o=e-.75*i,s=t+.75*i),Jsr(ate(e,o),ate(s,t),.33)}return ate(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const i=this.scrollLeft(t),r=this.scrollTop(t);return new BOe(i,r,!1)}return new BOe(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return W3.start(e,t,i)}static start(e,t,i){i=i+10;const r=Date.now()-10;return new W3(e,t,r,i)}}function ear(n){return Math.pow(n,3)}function tar(n){return 1-ear(1-n)}const nar=500,$Oe=50;class iar{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class hz{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,r=this._rear;do{const o=r===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[r].score*o,r===this._front)break;r=(this._capacity+r-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){const t=window.devicePixelRatio/xer();eu||Zu?this.accept(Date.now(),e.deltaX/t,e.deltaY/t):this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){const r=new iar(e,t,i);r.score=this._computeScore(r),this._front===-1&&this._rear===-1?(this._memory[0]=r,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=r)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}hz.INSTANCE=new hz;class U0e extends Jm{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new Le),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Le),e.style.overflow="hidden",this._options=rar(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Zsr(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Xsr(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=io(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=io(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=io(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Zm),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=mo(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,mr&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ZT(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=mo(this._mouseWheelToDispose),e)){const i=r=>{this._onMouseWheel(new ZT(r))};this._mouseWheelToDispose.push(tt(this._listenOnDomNode,Yt.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=hz.INSTANCE;i.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!mr&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=$Oe*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=$Oe*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),r=!0)}let o=r;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,r=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),nar)}}class hJe extends U0e{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new D6({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>_g(r)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class j0e extends U0e{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class A6 extends U0e{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new D6({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>_g(r)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(r=>{r.scrollTopChanged&&(this._element.scrollTop=r.scrollTop),r.scrollLeftChanged&&(this._element.scrollLeft=r.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function rar(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,mr&&(e.className+=" mac"),e}class q0e extends L6{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new $c(this._context,i),this._mouseDownOperation=this._register(new oar(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const r=new Asr(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=tt(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new SS(a,!1,this.viewHelper.viewDomNode))}))})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let o=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{o=a})),this._register(tt(this.viewHelper.viewDomNode,Yt.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=hz.INSTANCE;let t=0,i=Hp.getZoomLevel(),r=!1,o=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new ZT(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=Hp.getZoomLevel(),d=c.deltaY>0?1:-1;Hp.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Hp.getZoomLevel(),r=a(l),o=0),t=Date.now(),o+=c.deltaY,r&&(Hp.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(tt(this.viewHelper.viewDomNode,Yt.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return mr?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const r=new aJe(e,t).toPageCoordinates(),o=V0e(this.viewHelper.viewDomNode);if(r.y<o.y||r.y>o.y+o.height||r.x<o.x||r.x>o.x+o.width)return null;const s=H0e(this.viewHelper.viewDomNode,o,r);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,r,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const r=JT(this.viewHelper.viewDomNode);r&&(i=r.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime)&&this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=new Date().getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),r=i.type===6||i.type===7,o=i.type===2||i.type===3||i.type===4,s=i.type===3,a=this._context.configuration.options.get(108),l=i.type===8||i.type===5,c=i.type===9;let u=e.leftButton||e.middleButton;mr&&e.leftButton&&e.ctrlKey&&(u=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(r||s&&a))d(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class oar extends Ue{constructor(e,t,i,r,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=r,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new Rsr(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new sar(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new RG,this._currentSelection=new kn(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);s&&s instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(r,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,s=>this._onMouseDownThenMove(s),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,r=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const a=t.y-e.posy,l=Math.max(r.getCurrentScrollTop()-a,0),c=PA.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return $u.createOutsideEditor(o,d,"above",a)}const u=r.getLineNumberAtVerticalOffset(l);return $u.createOutsideEditor(o,new De(u,1),"above",a)}if(e.posy>t.y+t.height){const a=e.posy-t.y-t.height,l=r.getCurrentScrollTop()+e.relativePos.y,c=PA.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return $u.createOutsideEditor(o,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return $u.createOutsideEditor(o,new De(u,i.getLineMaxColumn(u)),"below",a)}const s=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){const a=t.x-e.posx;return $u.createOutsideEditor(o,new De(s,1),"left",a)}if(e.posx>t.x+t.width){const a=e.posx-t.x-t.width;return $u.createOutsideEditor(o,new De(s,i.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){const s=this._helpPositionJumpOverViewZone(r.detail);if(s)return $u.createViewZone(r.type,r.element,r.mouseColumn,s,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new De(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,r=e.positionAfter;return i&&r?i.isBefore(t)?i:r:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class sar extends Ue{constructor(e,t,i,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new aar(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class aar extends Ue{constructor(e,t,i,r,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=r,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=_g(()=>this._execute())}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(66),t=this._context.configuration.options.get(143).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),i=this._tick(),r=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-r:r;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=V0e(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(143).horizontalScrollbarHeight,d=new AG(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=H0e(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=$u.createOutsideEditor(this._position.mouseColumn,new De(a,1),"above",this._position.outsideDistance):l=$u.createOutsideEditor(this._position.mouseColumn,new De(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=_g(()=>this._execute())}}class RG{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>RG.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}RG.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class ar{get event(){return this.emitter.event}constructor(e,t,i){const r=o=>this.emitter.fire(o);this.emitter=new Le({onWillAddFirstListener:()=>e.addEventListener(t,r,i),onDidRemoveLastListener:()=>e.removeEventListener(t,r,i)})}dispose(){this.emitter.dispose()}}var rw;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),i=Object.assign({},e),r=Object.assign({},e);let o=0;const s={keydown:0,input:0,render:0};function a(){_(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,v()}n.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}n.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){_()}n.onKeyUp=h;function f(){_()}n.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(m),v())}n.onRenderStart=g;function m(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(_)}function _(){s.keydown===2&&s.input===2&&s.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",r),o++,y())}function b(k,L){const D=performance.getEntriesByName(k)[0].duration;L.total+=D,L.min=Math.min(L.min,D),L.max=Math.max(L.max,D)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function C(){if(o===0)return;const k={keydown:x(e),input:x(t),render:x(i),total:x(r),sampleCount:o};return E(e),E(t),E(i),E(r),o=0,k}n.getAndClearMeasurements=C;function x(k){return{average:k.total/o,max:k.max,min:k.min}}function E(k){k.total=0,k.min=Number.MAX_VALUE,k.max=0}})(rw||(rw={}));class mc{constructor(e,t,i,r,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=r,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),r=e.getSelectionStart(),o=e.getSelectionEnd();let s;if(t){const a=i.substring(0,r),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new mc(i,r,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new mc(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,r,o,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(r=this.selection)===null||r===void 0?void 0:r.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,i){let r=0,o=-1;for(;(o=t.indexOf(` `,o+1))!==-1;)r++;return[e,i*t.length,r]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const r=Math.min(YT(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(KW(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-o);const s=t.value.substring(r,t.value.length-o),a=e.selectionStart-r,l=e.selectionEnd-r,c=t.selectionStart-r,u=t.selectionEnd-r;if(c===u){const h=e.selectionStart-r;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(YT(e.value,t.value),e.selectionEnd),r=Math.min(KW(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-r),s=t.value.substring(i,t.value.length-r);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-s.length}}}mc.EMPTY=new mc("",0,0,null,void 0);class gL{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,r=i+1,o=i+t;return new J(r,1,o+1,1)}static fromEditorSelection(e,t,i,r){const s=gL._getPageOfLine(t.startLineNumber,i),a=gL._getRangeForPage(s,i),l=gL._getPageOfLine(t.endLineNumber,i),c=gL._getRangeForPage(l,i);let u=a.intersectRanges(new J(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const _=e.modifyPosition(u.getEndPosition(),-500);u=J.fromPositions(_,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new J(t.endLineNumber,t.endColumn,h,f));if(r&&e.getValueLengthInRange(g,1)>500){const _=e.modifyPosition(g.getStartPosition(),500);g=J.fromPositions(g.getStartPosition(),_)}const m=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const _=a.intersectRanges(t),b=c.intersectRanges(t);v=e.getValueInRange(_,1)+String.fromCharCode(8230)+e.getValueInRange(b,1)}return r&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new mc(d+v+m,d.length,d.length+v.length,t,u.endLineNumber-u.startLineNumber)}}var fz;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(fz||(fz={}));const kce={forceCopyWithSyntaxHighlighting:!1};class z3{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}z3.INSTANCE=new z3;class lar{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class car extends Ue{get textAreaState(){return this._textAreaState}constructor(e,t,i,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=r,this._onFocus=this._register(new Le),this.onFocus=this._onFocus.event,this._onBlur=this._register(new Le),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new Le),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new Le),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new Le),this.onCut=this._onCut.event,this._onPaste=this._register(new Le),this.onPaste=this._onPaste.event,this._onType=this._register(new Le),this.onType=this._onType.event,this._onCompositionStart=this._register(new Le),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new Le),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new Le),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new Le),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new $o(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new $o(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=mc.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(s=>{const a=new hs(s);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),o=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(s=>{const a=new hs(s);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(s=>{const a=new lar;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===s.data&&(o.code==="ArrowRight"||o.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:s.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:s.data});return}this._onCompositionStart.fire({data:s.data})})),this._register(this._textArea.onCompositionUpdate(s=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=mc.readFromTextArea(this._textArea,this._textAreaState),u=mc.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionUpdate.fire(s);return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=mc.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(s)})),this._register(this._textArea.onCompositionEnd(s=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=mc.readFromTextArea(this._textArea,this._textAreaState),u=mc.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=mc.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=mc.readFromTextArea(this._textArea,this._textAreaState),l=mc.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(Rl(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(s=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(s),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(s=>{this._ensureClipboardGetsEditorSelection(s)})),this._register(this._textArea.onPaste(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),s.preventDefault(),!s.clipboardData)return;let[a,l]=Ice.getTextData(s.clipboardData);a&&(l=l||z3.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const s=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!s&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return tt(this._textArea.ownerDocument,"selectionchange",t=>{if(rw.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),r=i-e;if(e=i,r<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),f=new kn(u.lineNumber,u.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};z3.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,i),e.preventDefault(),e.clipboardData&&Ice.setTextData(e.clipboardData,t.text,t.html,i)}}const Ice={getTextData(n){const e=n.getData(Ta.text);let t=null;const i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(` `),null]:[e,t]},setTextData(n,e,t,i){n.setData(Ta.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class uar extends Ue{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ar(this._actual,"keydown")).event,this.onKeyUp=this._register(new ar(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ar(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ar(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ar(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ar(this._actual,"beforeinput")).event,this.onInput=this._register(new ar(this._actual,"input")).event,this.onCut=this._register(new ar(this._actual,"cut")).event,this.onCopy=this._register(new ar(this._actual,"copy")).event,this.onPaste=this._register(new ar(this._actual,"paste")).event,this.onFocus=this._register(new ar(this._actual,"focus")).event,this.onBlur=this._register(new ar(this._actual,"blur")).event,this._onSyntheticTap=this._register(new Le),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>rw.onKeyDown())),this._register(this.onBeforeInput(()=>rw.onBeforeInput())),this._register(this.onInput(()=>rw.onInput())),this._register(this.onKeyUp(()=>rw.onKeyUp())),this._register(tt(this._actual,fz.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=JT(this._actual);return e?e.activeElement===this._actual:v0e(this._actual)?this._actual.ownerDocument.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const r=this._actual;let o=null;const s=JT(r);s?o=s.activeElement:o=r.ownerDocument.activeElement;const a=o===r,l=r.selectionStart,c=r.selectionEnd;if(a&&l===t&&c===i){mg&&window.parent!==window&&r.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,i),mg&&window.parent!==window&&r.focus();return}try{const u=Wtr(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,i),ztr(r,u)}catch{}}}class dar extends q0e{constructor(e,t,i){super(e,t,i),this._register(Zo.addTarget(this.viewHelper.linesContentDomNode)),this._register(tt(this.viewHelper.linesContentDomNode,Jo.Tap,o=>this.onTap(o))),this._register(tt(this.viewHelper.linesContentDomNode,Jo.Change,o=>this.onChange(o))),this._register(tt(this.viewHelper.linesContentDomNode,Jo.Contextmenu,o=>this._onContextMenu(new SS(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(tt(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const s=o.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const r=new Nsr(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(o,s)=>this._onMouseDown(o,s)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new SS(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class har extends q0e{constructor(e,t,i){super(e,t,i),this._register(Zo.addTarget(this.viewHelper.linesContentDomNode)),this._register(tt(this.viewHelper.linesContentDomNode,Jo.Tap,r=>this.onTap(r))),this._register(tt(this.viewHelper.linesContentDomNode,Jo.Change,r=>this.onChange(r))),this._register(tt(this.viewHelper.linesContentDomNode,Jo.Contextmenu,r=>this._onContextMenu(new SS(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new SS(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(fz.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class far extends Ue{constructor(e,t,i){super(),vv&&_0e.pointerEvents?this.handler=this._register(new dar(e,t,i)):window.TouchEvent?this.handler=this._register(new har(e,t,i)):this.handler=this._register(new q0e(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class iI extends L6{}const Hl=or("themeService");function Gs(n){return{id:n}}function Lce(n){switch(n){case Jp.DARK:return"vs-dark";case Jp.HIGH_CONTRAST_DARK:return"hc-black";case Jp.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const fJe={ThemingContribution:"base.contributions.theming"};class par{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Le}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),mi(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const pJe=new par;Hs.add(fJe.ThemingContribution,pJe);function e_(n){return pJe.onColorThemeChange(n)}class gar extends Ue{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const gJe=he("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("lineHighlight","Background color for the highlight of line at the cursor position.")),VOe=he("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ur},T("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));he("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},T("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);he("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:ys,hcLight:ys},T("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);he("editor.symbolHighlightBackground",{dark:Bb,light:Bb,hcDark:null,hcLight:null},T("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);he("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:ys,hcLight:ys},T("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const mJe=he("editorCursor.foreground",{dark:"#AEAFAD",light:ze.black,hcDark:ze.white,hcLight:"#0F4A85"},T("caret","Color of the editor cursor.")),mar=he("editorCursor.background",null,T("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Wy=he("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},T("editorWhitespaces","Color of whitespace characters in the editor.")),_ar=he("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ze.white,hcLight:"#292929"},T("editorLineNumbers","Color of editor line numbers.")),M9=he("editorIndentGuide.background",{dark:Wy,light:Wy,hcDark:Wy,hcLight:Wy},T("editorIndentGuides","Color of the editor indentation guides."),!1,T("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),F9=he("editorIndentGuide.activeBackground",{dark:Wy,light:Wy,hcDark:Wy,hcLight:Wy},T("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,T("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),N6=he("editorIndentGuide.background1",{dark:M9,light:M9,hcDark:M9,hcLight:M9},T("editorIndentGuides1","Color of the editor indentation guides (1).")),bar=he("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides2","Color of the editor indentation guides (2).")),yar=he("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides3","Color of the editor indentation guides (3).")),Car=he("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides4","Color of the editor indentation guides (4).")),war=he("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides5","Color of the editor indentation guides (5).")),Sar=he("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides6","Color of the editor indentation guides (6).")),R6=he("editorIndentGuide.activeBackground1",{dark:F9,light:F9,hcDark:F9,hcLight:F9},T("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Ear=he("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),xar=he("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Tar=he("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),kar=he("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Iar=he("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),B9=he("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:ys,hcLight:ys},T("editorActiveLineNumber","Color of editor active line number"),!1,T("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));he("editorLineNumber.activeForeground",{dark:B9,light:B9,hcDark:B9,hcLight:B9},T("editorActiveLineNumber","Color of editor active line number"));const Lar=he("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));he("editorRuler.foreground",{dark:"#5A5A5A",light:ze.lightgrey,hcDark:ze.white,hcLight:"#292929"},T("editorRuler","Color of the editor rulers."));he("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},T("editorCodeLensForeground","Foreground color of editor CodeLens"));he("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},T("editorBracketMatchBackground","Background color behind matching brackets"));he("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ur,hcLight:ur},T("editorBracketMatchBorder","Color for matching brackets boxes"));const Dar=he("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},T("editorOverviewRulerBorder","Color of the overview ruler border.")),Aar=he("editorOverviewRuler.background",null,T("editorOverviewRulerBackground","Background color of the editor overview ruler."));he("editorGutter.background",{dark:Pl,light:Pl,hcDark:Pl,hcLight:Pl},T("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));he("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ze.fromHex("#fff").transparent(.8),hcLight:ur},T("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Nar=he("editorUnnecessaryCode.opacity",{dark:ze.fromHex("#000a"),light:ze.fromHex("#0007"),hcDark:null,hcLight:null},T("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));he("editorGhostText.border",{dark:null,light:null,hcDark:ze.fromHex("#fff").transparent(.8),hcLight:ze.fromHex("#292929").transparent(.8)},T("editorGhostTextBorder","Border color of ghost text in the editor."));he("editorGhostText.foreground",{dark:ze.fromHex("#ffffff56"),light:ze.fromHex("#0007"),hcDark:null,hcLight:null},T("editorGhostTextForeground","Foreground color of the ghost text in the editor."));he("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},T("editorGhostTextBackground","Background color of the ghost text in the editor."));const $9=new ze(new gr(0,122,204,.6)),_Je=he("editorOverviewRuler.rangeHighlightForeground",{dark:$9,light:$9,hcDark:$9,hcLight:$9},T("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Rar=he("editorOverviewRuler.errorForeground",{dark:new ze(new gr(255,18,18,.7)),light:new ze(new gr(255,18,18,.7)),hcDark:new ze(new gr(255,50,50,1)),hcLight:"#B5200D"},T("overviewRuleError","Overview ruler marker color for errors.")),Oar=he("editorOverviewRuler.warningForeground",{dark:Ff,light:Ff,hcDark:B3,hcLight:B3},T("overviewRuleWarning","Overview ruler marker color for warnings.")),Par=he("editorOverviewRuler.infoForeground",{dark:lh,light:lh,hcDark:$3,hcLight:$3},T("overviewRuleInfo","Overview ruler marker color for infos.")),vJe=he("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},T("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),bJe=he("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},T("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),yJe=he("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},T("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),CJe=he("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),wJe=he("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),SJe=he("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Mar=he("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ze(new gr(255,18,18,.8)),light:new ze(new gr(255,18,18,.8)),hcDark:new ze(new gr(255,50,50,1)),hcLight:""},T("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Far=he("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Bar=he("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),$ar=he("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Var=he("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Har=he("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),War=he("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),zar=he("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Uar=he("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),jar=he("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),qar=he("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Kar=he("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Gar=he("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));he("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},T("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));he("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},T("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));e_((n,e)=>{const t=n.getColor(Pl),i=n.getColor(gJe),r=i&&!i.isTransparent()?i:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});class O6 extends iI{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new De(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new De(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const r=Math.abs(this._lastCursorModelPosition.lineNumber-i);return r===0?'<span class="relative-current-line-number">'+i+"</span>":String(r)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Zu?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),s=[];for(let a=i;a<=r;a++){const l=a-i,c=this._getLineRenderLineNumber(a);if(!c){s[l]="";continue}let u="";if(a===o&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){s[l]="";continue}this._renderFinalNewline==="dimmed"&&(u=" dimmed-line-number")}a===this._activeLineNumber&&(u=" active-line-number"),s[l]=`<div class="${O6.CLASS_NAME}${t}${u}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${c}</div>`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}O6.CLASS_NAME="line-numbers";e_((n,e)=>{const t=n.getColor(_ar),i=n.getColor(Lar);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class ek extends nf{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=io(document.createElement("div")),this._domNode.setClassName(ek.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=io(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(ek.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}ek.CLASS_NAME="glyph-margin";ek.OUTER_CLASS_NAME="margin";const sD="monaco-mouse-cursor-text";class Yar{constructor(){this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const NM=new Yar,Qo=or("keybindingService");var Qar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xar=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Zar{constructor(e,t,i,r,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=r,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new De(this.modelLineNumber,this.distanceToModelLineStart+1),i=new De(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const lte=mg;let Dce=class extends nf{constructor(e,t,i,r){super(e),this._keybindingService=r,this._primaryCursorPosition=new De(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,s=o.get(143);this._setAccessibilityOptions(o),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=o.get(50),this._lineHeight=o.get(66),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new kn(1,1,1,1)],this._modelSelections=[new kn(1,1,1,1)],this._lastRenderPosition=null,this.textArea=io(document.createElement("textarea")),d0.write(this.textArea,6),this.textArea.setClassName(`inputarea ${sD}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",T("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=io(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:d=>this._context.viewModel.getLineMaxColumn(d),getValueInRange:(d,h)=>this._context.viewModel.getValueInRange(d,h),getValueLengthInRange:(d,h)=>this._context.viewModel.getValueLengthInRange(d,h),modifyPosition:(d,h)=>this._context.viewModel.modifyPosition(d,h)},c={getDataToCopy:()=>{const d=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,eu),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(d)?d:null,m=Array.isArray(d)?d.join(h):d;let v,_=null;if(kce.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&m.length<65536){const b=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(v=b.html,_=b.mode)}return{isFromEmptySelection:f,multicursorText:g,text:m,html:v,mode:_}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const d=this._selections[0];if(mr&&d.isEmpty()){const f=d.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new mc(g,g.length,g.length,J.fromPositions(f),0)}const h=500;if(mr&&!d.isEmpty()&&l.getValueLengthInRange(d,0)<h){const f=l.getValueInRange(d,0);return new mc(f,0,f.length,d,0)}if(C1&&!d.isEmpty()){const f="vscode-placeholder";return new mc(f,0,f.length,null,void 0)}return mc.EMPTY}if(gRe){const d=this._selections[0];if(d.isEmpty()){const h=d.getStartPosition(),[f,g]=this._getAndroidWordAtPosition(h);if(f.length>0)return new mc(f,g,g,J.fromPositions(h),0)}return mc.EMPTY}return gL.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(d,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(d,h,f)},u=this._register(new uar(this.textArea.domNode));this._textAreaInput=this._register(new car(c,u,Pf,{isAndroid:gRe,isChrome:f0e,isFirefox:mg,isSafari:C1})),this._register(this._textAreaInput.onKeyDown(d=>{this._viewController.emitKeyDown(d)})),this._register(this._textAreaInput.onKeyUp(d=>{this._viewController.emitKeyUp(d)})),this._register(this._textAreaInput.onPaste(d=>{let h=!1,f=null,g=null;d.metadata&&(h=this._emptySelectionClipboard&&!!d.metadata.isFromEmptySelection,f=typeof d.metadata.multicursorText<"u"?d.metadata.multicursorText:null,g=d.metadata.mode),this._viewController.paste(d.text,h,f,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(d=>{d.replacePrevCharCnt||d.replaceNextCharCnt||d.positionDelta?this._viewController.compositionType(d.text,d.replacePrevCharCnt,d.replaceNextCharCnt,d.positionDelta):this._viewController.type(d.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(d=>{this._viewController.setSelection(d)})),this._register(this._textAreaInput.onCompositionStart(d=>{const h=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:m}=(()=>{const _=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),b=_.lastIndexOf(` `),y=_.substring(b+1),C=y.lastIndexOf(" "),x=y.length-C-1,E=f.getStartPosition(),k=Math.min(E.column-1,x),L=E.column-1-k,D=y.substring(0,y.length-k),{tabSize:A}=this._context.viewModel.model.getOptions(),O=Jar(this.textArea.domNode.ownerDocument,D,this._fontInfo,A);return{distanceToModelLineStart:L,widthOfHiddenTextBefore:O}})(),{distanceToModelLineEnd:v}=(()=>{const _=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=_.indexOf(` `),y=b===-1?_:_.substring(0,b),C=y.indexOf(" "),x=C===-1?y.length:y.length-C-1,E=f.getEndPosition(),k=Math.min(this._context.viewModel.model.getLineMaxColumn(E.lineNumber)-E.column,x);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(E.lineNumber)-E.column-k}})();this._context.viewModel.revealRange("keyboard",!0,J.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Zar(this._context,f.startLineNumber,g,m,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${sD} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(d=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${sD}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(NM.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),r=bg(t);let o=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&s<=1&&(o=!1),o){const u=i.charCodeAt(s-2);r.get(u)!==0?o=!1:s--}if(a&&l>i.length&&(a=!1),a){const u=i.charCodeAt(l-1);r.get(u)!==0?a=!1:l++}c++}return[i.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=bg(this._context.configuration.options.get(129));let r=e.column,o=0;for(;r>1;){const s=t.charCodeAt(r-2);if(i.get(s)!==0||o>50)return t.substring(r-1,e.column-1);o++,r--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Rl(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,r;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(r=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||r===void 0?void 0:r.getAriaLabel(),c=T("accessibilityModeOff","The editor is not accessible at this time.");return s?T("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?T("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?T("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Lv.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const r=e.get(143).wrappingColumn;if(r!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(r*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=lte?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:r}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${r*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!NM.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new De(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const r=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&r&&o&&o.left>=this._scrollLeft&&r.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let u=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+r.left-this._scrollLeft,h=o.left-r.left+1;if(d<this._contentLeft){const b=this._contentLeft-d;d+=b,u+=b,h-=b}h>this._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),m=f.tokens.findTokenIndexAtOffset(a.column-1),v=g===m,_=this._visibleTextArea.definePresentation(v?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=u,this._doRender({lastRenderPosition:null,top:l,left:d,width:h,height:this._lineHeight,useCover:!1,color:(Ks.getColorMap()||[])[_.foreground],italic:_.italic,bold:_.bold,underline:_.underline,strikethrough:_.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(t<this._contentLeft||t>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(mr){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const r=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=r*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:lte?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` `,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:lte?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Zc(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ze.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const r=this._context.configuration.options;r.get(57)?i.setClassName("monaco-editor-background textAreaCover "+ek.OUTER_CLASS_NAME):r.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+O6.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};Dce=Qar([Xar(3,Qo)],Dce);function Jar(n,e,t,i){if(e.length===0)return 0;const r=n.createElement("div");r.style.position="absolute",r.style.top="-50000px",r.style.width="50000px";const o=n.createElement("span");Zc(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),r.appendChild(o),n.body.appendChild(r);const s=o.offsetWidth;return n.body.removeChild(r),s}function elr(n,e,t){let i=0;for(let o=0;o<n.length;o++)n.charAt(o)===" "?i=yl.nextIndentTabStop(i,e):i++;let r="";if(!t){const o=Math.floor(i/e);i=i%e;for(let s=0;s<o;s++)r+=" "}for(let o=0;o<i;o++)r+=" ";return r}function pz(n,e,t){let i=Yu(n);return i===-1&&(i=n.length),elr(n.substring(0,i),e,t)+n.substring(i)}const tlr=()=>!0,nlr=()=>!1,ilr=n=>n===" "||n===" ";class t2{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,r){var o;this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,a=s.get(143),l=s.get(50);this.readOnly=s.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(127),this.wordSeparators=s.get(129),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(76),this.multiCursorPaste=s.get(78),this.multiCursorLimit=s.get(79),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=u==null?void 0:u.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const r=yG(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return o?o.onElectricCharacter(e,r,i-r.firstCharOffset):null}normalizeIndentation(e){return pz(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return ilr;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return tlr;case"never":return nlr}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>i.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return yl.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const r=yl.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(r<o)return o;const s=e.getLineMaxColumn(t);return r>s?s:r}}let Dr=class EJe{static fromModelState(e){return new rlr(e)}static fromViewState(e){return new olr(e)}static fromModelSelection(e){const t=kn.liftSelection(e),i=new bc(J.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return EJe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,r=e.length;i<r;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}};class rlr{constructor(e){this.modelState=e,this.viewState=null}}class olr{constructor(e){this.modelState=null,this.viewState=e}}class bc{constructor(e,t,i,r,o){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=r,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=bc._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,r){return e?new bc(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new De(t,i),r):new bc(new J(t,i,t,i),0,r,new De(t,i),r)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?kn.fromPositions(e.getStartPosition(),t):kn.fromPositions(e.getEndPosition(),t)}}class Qd{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function vC(n){return n==="'"||n==='"'||n==="`"}class Tx{static columnSelect(e,t,i,r,o,s){const a=Math.abs(o-i)+1,l=i>o,c=r>s,u=r<s,d=[];for(let h=0;h<a;h++){const f=i+(l?-h:h),g=e.columnFromVisibleColumn(t,f,r),m=e.columnFromVisibleColumn(t,f,s),v=e.visibleColumnFromColumn(t,new De(f,g)),_=e.visibleColumnFromColumn(t,new De(f,m));u&&(v>s||_<r)||c&&(_>r||v<s)||d.push(new bc(new J(f,g,f,g),0,0,new De(f,m),0))}if(d.length===0)for(let h=0;h<a;h++){const f=i+(l?-h:h),g=t.getLineMaxColumn(f);d.push(new bc(new J(f,g,f,g),0,0,new De(f,g),0))}return{viewStates:d,reversed:l,fromLineNumber:i,fromVisualColumn:r,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let r=i.toViewVisualColumn;return r>0&&r--,Tx.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectRight(e,t,i){let r=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new De(l,c));r=Math.max(r,u)}let a=i.toViewVisualColumn;return a<r&&a++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,a)}static columnSelectUp(e,t,i,r){const o=r?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,r){const o=r?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}class Hc{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return kn.fromPositions(r.getEndPosition())}}class slr{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return kn.fromRange(r,0)}}class V9{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return kn.fromPositions(r.getStartPosition())}}class Z${constructor(e,t,i,r,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=r,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return kn.fromPositions(r.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class K0e{constructor(e,t,i,r=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=r,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class cte{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class lo{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-FXe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new De(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const r=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=H3.atomicPosition(o,t.column-1,i,0);if(s!==-1&&s+1>=r)return new De(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const r=e.stickyTabStops?lo.leftPositionAtomicSoftTabs(t,i,e.tabSize):lo.leftPosition(t,i);return new cte(r.lineNumber,r.column,0)}static moveLeft(e,t,i,r,o){let s,a;if(i.hasSelection()&&!r)s=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),c=t.normalizePosition(lo.clipPositionColumn(l,t),0),u=lo.left(e,t,c);s=u.lineNumber,a=u.column}return i.move(r,s,a,0)}static clipPositionColumn(e,t){return new De(e.lineNumber,lo.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i=i+u0e(e.getLineContent(t),i-1):t<e.getLineCount()&&(t=t+1,i=e.getLineMinColumn(t)),new De(t,i)}static rightPositionAtomicSoftTabs(e,t,i,r,o){if(i<e.getLineIndentColumn(t)){const s=e.getLineContent(t),a=H3.atomicPosition(s,i-1,r,1);if(a!==-1)return new De(t,a+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const r=e.stickyTabStops?lo.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):lo.rightPosition(t,i.lineNumber,i.column);return new cte(r.lineNumber,r.column,0)}static moveRight(e,t,i,r,o){let s,a;if(i.hasSelection()&&!r)s=i.selection.endLineNumber,a=i.selection.endColumn;else{const l=i.position.delta(void 0,o-1),c=t.normalizePosition(lo.clipPositionColumn(l,t),1),u=lo.right(e,t,c);s=u.lineNumber,a=u.column}return i.move(r,s,a,0)}static vertical(e,t,i,r,o,s,a,l){const c=yl.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize)+o,u=t.getLineCount(),d=i===1&&r===1,h=i===u&&r===t.getLineMaxColumn(i),f=s<i?d:h;if(i=s,i<1?(i=1,a?r=t.getLineMinColumn(i):r=Math.min(t.getLineMaxColumn(i),r)):i>u?(i=u,a?r=t.getLineMaxColumn(i):r=Math.min(t.getLineMaxColumn(i),r)):r=e.columnFromVisibleColumn(t,i,c),f?o=0:o=c-yl.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize),l!==void 0){const g=new De(i,r),m=t.normalizePosition(g,l);o=o+(r-m.column),i=m.lineNumber,r=m.column}return new cte(i,r,o)}static down(e,t,i,r,o,s,a){return this.vertical(e,t,i,r,o,i+s,a,4)}static moveDown(e,t,i,r,o){let s,a;i.hasSelection()&&!r?(s=i.selection.endLineNumber,a=i.selection.endColumn):(s=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=lo.down(e,t,s+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new De(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l<t.getLineCount());return i.move(r,c.lineNumber,c.column,c.leftoverVisibleColumns)}static translateDown(e,t,i){const r=i.selection,o=lo.down(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=lo.down(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new bc(new J(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new De(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,r,o,s,a){return this.vertical(e,t,i,r,o,i-s,a,3)}static moveUp(e,t,i,r,o){let s,a;i.hasSelection()&&!r?(s=i.selection.startLineNumber,a=i.selection.startColumn):(s=i.position.lineNumber,a=i.position.column);const l=lo.up(e,t,s,a,i.leftoverVisibleColumns,o,!0);return i.move(r,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateUp(e,t,i){const r=i.selection,o=lo.up(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=lo.up(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new bc(new J(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new De(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return e.getLineFirstNonWhitespaceColumn(t)===0}static moveToPrevBlankLine(e,t,i,r){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(r,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,r){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(r,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,r){const o=i.position.lineNumber,s=t.getLineMinColumn(o),a=t.getLineFirstNonWhitespaceColumn(o)||s;let l;return i.position.column===a?l=s:l=a,i.move(r,o,l,0)}static moveToEndOfLine(e,t,i,r,o){const s=i.position.lineNumber,a=t.getLineMaxColumn(s);return i.move(r,s,a,o?1073741824-a:0)}static moveToBeginningOfBuffer(e,t,i,r){return i.move(r,1,1,0)}static moveToEndOfBuffer(e,t,i,r){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(r,o,s,0)}}class tk{static deleteRight(e,t,i,r){const o=[];let s=e!==3;for(let a=0,l=r.length;a<l;a++){const c=r[a];let u=c;if(u.isEmpty()){const d=c.getPosition(),h=lo.right(t,i,d);u=new J(h.lineNumber,h.column,d.lineNumber,d.column)}if(u.isEmpty()){o[a]=null;continue}u.startLineNumber!==u.endLineNumber&&(s=!0),o[a]=new Hc(u,"")}return[s,o]}static isAutoClosingPairDelete(e,t,i,r,o,s,a){if(t==="never"&&i==="never"||e==="never")return!1;for(let l=0,c=s.length;l<c;l++){const u=s[l],d=u.getPosition();if(!u.isEmpty())return!1;const h=o.getLineContent(d.lineNumber);if(d.column<2||d.column>=h.length+1)return!1;const f=h.charAt(d.column-2),g=r.get(f);if(!g)return!1;if(vC(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=h.charAt(d.column-1);let v=!1;for(const _ of g)_.open===f&&_.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let _=!1;for(let b=0,y=a.length;b<y;b++){const C=a[b];if(d.lineNumber===C.startLineNumber&&d.column===C.startColumn){_=!0;break}}if(!_)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++){const a=i[o].getPosition(),l=new J(a.lineNumber,a.column-1,a.lineNumber,a.column+1);r[o]=new Hc(l,"")}return[!0,r]}static deleteLeft(e,t,i,r,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,r,o))return this._runAutoClosingPairDelete(t,i,r);const s=[];let a=e!==2;for(let l=0,c=r.length;l<c;l++){const u=tk.getDeleteRange(r[l],i,t);if(u.isEmpty()){s[l]=null;continue}u.startLineNumber!==u.endLineNumber&&(a=!0),s[l]=new Hc(u,"")}return[a,s]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const r=e.getPosition();if(i.useTabStops&&r.column>1){const o=t.getLineContent(r.lineNumber),s=Yu(o),a=s===-1?o.length+1:s+1;if(r.column<=a){const l=i.visibleColumnFromColumn(t,r),c=yl.prevIndentTabStop(l,i.indentSize),u=i.columnFromVisibleColumn(t,r.lineNumber,c);return new J(r.lineNumber,u,r.lineNumber,r.column)}}return J.fromPositions(tk.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=ber(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new De(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const r=[];let o=null;i.sort((s,a)=>De.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=i.length;s<a;s++){const l=i[s];if(l.isEmpty())if(e.emptySelectionClipboard){const c=l.getPosition();let u,d,h,f;c.lineNumber<t.getLineCount()?(u=c.lineNumber,d=1,h=c.lineNumber+1,f=1):c.lineNumber>1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new J(u,d,h,f);o=g,g.isEmpty()?r[s]=null:r[s]=new Hc(g,"")}else r[s]=null;else r[s]=new Hc(l,"")}return new Qd(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Zr{static _createWord(e,t,i,r,o){return{start:r,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const r=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(r,e,i)}static _doFindPreviousWordOnLine(e,t,i){let r=0;for(let o=i.column-2;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===0){if(r===2)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=1}else if(a===2){if(r===1)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=2}else if(a===1&&r!==0)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1))}return r!==0?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null}static _findEndOfWord(e,t,i,r){const o=e.length;for(let s=r;s<o;s++){const a=e.charCodeAt(s),l=t.get(a);if(l===1||i===1&&l===2||i===2&&l===0)return s}return o}static _findNextWordOnLine(e,t,i){const r=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(r,e,i)}static _doFindNextWordOnLine(e,t,i){let r=0;const o=e.length;for(let s=i.column-1;s<o;s++){const a=e.charCodeAt(s),l=t.get(a);if(l===0){if(r===2)return this._createWord(e,r,l,this._findStartOfWord(e,t,r,s-1),s);r=1}else if(l===2){if(r===1)return this._createWord(e,r,l,this._findStartOfWord(e,t,r,s-1),s);r=2}else if(l===1&&r!==0)return this._createWord(e,r,l,this._findStartOfWord(e,t,r,s-1),s)}return r!==0?this._createWord(e,r,1,this._findStartOfWord(e,t,r,o-1),o):null}static _findStartOfWord(e,t,i,r){for(let o=r;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,r){let o=i.lineNumber,s=i.column;s===1&&o>1&&(o=o-1,s=t.getLineMaxColumn(o));let a=Zr._findPreviousWordOnLine(e,t,new De(o,s));if(r===0)return new De(o,a?a.start+1:1);if(r===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Zr._findPreviousWordOnLine(e,t,new De(o,a.start+1))),new De(o,a?a.start+1:1);if(r===3){for(;a&&a.wordType===2;)a=Zr._findPreviousWordOnLine(e,t,new De(o,a.start+1));return new De(o,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Zr._findPreviousWordOnLine(e,t,new De(o,a.start+1))),new De(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,r=e.getLineMaxColumn(i);if(t.column===1)return i>1?new De(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let s=t.column-1;s>1;s--){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a===95&&l!==95)return new De(i,s);if(a===45&&l!==45)return new De(i,s);if((JC(a)||k9(a))&&sb(l))return new De(i,s);if(sb(a)&&sb(l)&&s+1<r){const c=o.charCodeAt(s);if(JC(c)||k9(c))return new De(i,s)}}return new De(i,1)}static moveWordRight(e,t,i,r){let o=i.lineNumber,s=i.column,a=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(a=!0,o=o+1,s=1);let l=Zr._findNextWordOnLine(e,t,new De(o,s));if(r===2)l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=Zr._findNextWordOnLine(e,t,new De(o,l.end+1))),l?s=l.end+1:s=t.getLineMaxColumn(o);else if(r===3){for(a&&(s=0);l&&(l.wordType===2||l.start+1<=s);)l=Zr._findNextWordOnLine(e,t,new De(o,l.end+1));l?s=l.start+1:s=t.getLineMaxColumn(o)}else l&&!a&&s>=l.start+1&&(l=Zr._findNextWordOnLine(e,t,new De(o,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(o);return new De(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,r=e.getLineMaxColumn(i);if(t.column===r)return i<e.getLineCount()?new De(i+1,1):t;const o=e.getLineContent(i);for(let s=t.column+1;s<r;s++){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a!==95&&l===95)return new De(i,s);if(a!==45&&l===45)return new De(i,s);if((JC(a)||k9(a))&&sb(l))return new De(i,s);if(sb(a)&&sb(l)&&s+1<r){const c=o.charCodeAt(s);if(JC(c)||k9(c))return new De(i,s)}}return new De(i,r)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=t.column-2,o=dv(i,r);return o+1<r?new J(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,r=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(tk.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const d=e.selection.getPosition();return new J(d.lineNumber,d.column-1,d.lineNumber,d.column+1)}const a=new De(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,c=a.column;if(l===1&&c===1)return null;if(s){const d=this._deleteWordLeftWhitespace(r,a);if(d)return d}let u=Zr._findPreviousWordOnLine(i,r,a);return t===0?u?c=u.start+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Zr._findPreviousWordOnLine(i,r,new De(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new J(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const r=new De(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,r);return o||this._deleteInsideWordDetermineDeleteRange(e,t,r)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=i.length;if(r===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<r&&this._charAtIsWhitespace(i,s+1);)s++;return new J(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const r=t.getLineContent(i.lineNumber),o=r.length;if(o===0)return i.lineNumber>1?new J(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new J(i.lineNumber,1,i.lineNumber+1,1):new J(i.lineNumber,1,i.lineNumber,1);const s=d=>d.start+1<=i.column&&i.column<=d.end+1,a=(d,h)=>(d=Math.min(d,i.column),h=Math.max(h,i.column),new J(i.lineNumber,d,i.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-1<o&&this._charAtIsWhitespace(r,f-1);)g=!0,f++;if(!g)for(;h>1&&this._charAtIsWhitespace(r,h-2);)h--;return a(h,f)},c=Zr._findPreviousWordOnLine(e,t,i);if(c&&s(c))return l(c);const u=Zr._findNextWordOnLine(e,t,i);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),r=Zr._moveWordPartLeft(e,i);return new J(i.lineNumber,i.column,r.lineNumber,r.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let r=t;r<i;r++){const o=e.charAt(r);if(o!==" "&&o!==" ")return r}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=t.column-1,o=this._findFirstNonWhitespaceChar(i,r);return r+1<o?new J(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,r=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const a=new De(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,c=a.column;const u=r.getLineCount(),d=r.getLineMaxColumn(l);if(l===u&&c===d)return null;if(s){const f=this._deleteWordRightWhitespace(r,a);if(f)return f}let h=Zr._findNextWordOnLine(i,r,a);return t===2?h?c=h.end+1:c<d||l===u?c=d:(l++,h=Zr._findNextWordOnLine(i,r,new De(l,1)),h?c=h.start+1:c=r.getLineMaxColumn(l)):(h&&c>=h.start+1&&(h=Zr._findNextWordOnLine(i,r,new De(l,h.end+1))),h?c=h.start+1:c<d||l===u?c=d:(l++,h=Zr._findNextWordOnLine(i,r,new De(l,1)),h?c=h.start+1:c=r.getLineMaxColumn(l))),new J(l,c,a.lineNumber,a.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),r=Zr._moveWordPartRight(e,i);return new J(i.lineNumber,i.column,r.lineNumber,r.column)}static _createWordAtPosition(e,t,i){const r=new J(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(r),startColumn:r.startColumn,endColumn:r.endColumn}}static getWordAtPosition(e,t,i){const r=bg(t),o=Zr._findPreviousWordOnLine(r,e,i);if(o&&o.wordType===1&&o.start<=i.column-1&&i.column-1<=o.end)return Zr._createWordAtPosition(e,i.lineNumber,o);const s=Zr._findNextWordOnLine(r,e,i);return s&&s.wordType===1&&s.start<=i.column-1&&i.column-1<=s.end?Zr._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,r,o){const s=bg(e.wordSeparators),a=Zr._findPreviousWordOnLine(s,t,o),l=Zr._findNextWordOnLine(s,t,o);if(!r){let f,g;return a&&a.wordType===1&&a.start<=o.column-1&&o.column-1<=a.end?(f=a.start+1,g=a.end+1):l&&l.wordType===1&&l.start<=o.column-1&&o.column-1<=l.end?(f=l.start+1,g=l.end+1):(a?f=a.end+1:f=1,l?g=l.start+1:g=t.getLineMaxColumn(o.lineNumber)),new bc(new J(o.lineNumber,f,o.lineNumber,g),1,0,new De(o.lineNumber,g),0)}let c,u;a&&a.wordType===1&&a.start<o.column-1&&o.column-1<a.end?(c=a.start+1,u=a.end+1):l&&l.wordType===1&&l.start<o.column-1&&o.column-1<l.end?(c=l.start+1,u=l.end+1):(c=o.column,u=o.column);const d=o.lineNumber;let h;if(i.selectionStart.containsPosition(o))h=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){h=c;const f=new De(d,h);i.selectionStart.containsPosition(f)&&(h=i.selectionStart.endColumn)}else{h=u;const f=new De(d,h);i.selectionStart.containsPosition(f)&&(h=i.selectionStart.startColumn)}return i.move(!0,d,h,0)}}class OG extends Zr{static deleteWordPartLeft(e){const t=H9([Zr.deleteWordLeft(e,0),Zr.deleteWordLeft(e,2),Zr._deleteWordPartLeft(e.model,e.selection)]);return t.sort(J.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=H9([Zr.deleteWordRight(e,0),Zr.deleteWordRight(e,2),Zr._deleteWordPartRight(e.model,e.selection)]);return t.sort(J.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const r=H9([Zr.moveWordLeft(e,t,i,0),Zr.moveWordLeft(e,t,i,2),Zr._moveWordPartLeft(t,i)]);return r.sort(De.compare),r[2]}static moveWordPartRight(e,t,i){const r=H9([Zr.moveWordRight(e,t,i,0),Zr.moveWordRight(e,t,i,2),Zr._moveWordPartRight(t,i)]);return r.sort(De.compare),r[0]}}function H9(n){return n.filter(e=>!!e)}class fc{static addCursorDown(e,t,i){const r=[];let o=0;for(let s=0,a=t.length;s<a;s++){const l=t[s];r[o++]=new Dr(l.modelState,l.viewState),i?r[o++]=Dr.fromModelState(lo.translateDown(e.cursorConfig,e.model,l.modelState)):r[o++]=Dr.fromViewState(lo.translateDown(e.cursorConfig,e,l.viewState))}return r}static addCursorUp(e,t,i){const r=[];let o=0;for(let s=0,a=t.length;s<a;s++){const l=t[s];r[o++]=new Dr(l.modelState,l.viewState),i?r[o++]=Dr.fromModelState(lo.translateUp(e.cursorConfig,e.model,l.modelState)):r[o++]=Dr.fromViewState(lo.translateUp(e.cursorConfig,e,l.viewState))}return r}static moveToBeginningOfLine(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o];r[o]=this._moveToLineStart(e,a,i)}return r}static _moveToLineStart(e,t,i){const r=t.viewState.position.column,o=t.modelState.position.column,s=r===o,a=t.viewState.position.lineNumber,l=e.getLineFirstNonWhitespaceColumn(a);return!s&&!(r===l)?this._moveToLineStartByView(e,t,i):this._moveToLineStartByModel(e,t,i)}static _moveToLineStartByView(e,t,i){return Dr.fromViewState(lo.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Dr.fromModelState(lo.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=this._moveToLineEnd(e,l,i,r)}return o}static _moveToLineEnd(e,t,i,r){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),a=o.column===s,l=t.modelState.position,c=e.model.getLineMaxColumn(l.lineNumber),u=s-o.column===c-l.column;return a||u?this._moveToLineEndByModel(e,t,i,r):this._moveToLineEndByView(e,t,i,r)}static _moveToLineEndByView(e,t,i,r){return Dr.fromViewState(lo.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,r))}static _moveToLineEndByModel(e,t,i,r){return Dr.fromModelState(lo.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,r))}static expandLineSelection(e,t){const i=[];for(let r=0,o=t.length;r<o;r++){const s=t[r],a=s.modelState.selection.startLineNumber,l=e.model.getLineCount();let c=s.modelState.selection.endLineNumber,u;c===l?u=e.model.getLineMaxColumn(l):(c++,u=1),i[r]=Dr.fromModelState(new bc(new J(a,1,a,1),0,0,new De(c,u),0))}return i}static moveToBeginningOfBuffer(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o];r[o]=Dr.fromModelState(lo.moveToBeginningOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return r}static moveToEndOfBuffer(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o];r[o]=Dr.fromModelState(lo.moveToEndOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return r}static selectAll(e,t){const i=e.model.getLineCount(),r=e.model.getLineMaxColumn(i);return Dr.fromModelState(new bc(new J(1,1,1,1),0,0,new De(i,r),0))}static line(e,t,i,r,o){const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new De(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i){const c=e.model.getLineCount();let u=s.lineNumber+1,d=1;return u>c&&(u=c,d=e.model.getLineMaxColumn(u)),Dr.fromModelState(new bc(new J(s.lineNumber,1,u,d),2,0,new De(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<l)return Dr.fromViewState(t.viewState.move(!0,a.lineNumber,1,0));if(s.lineNumber>l){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),Dr.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return Dr.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,r){const o=e.model.validatePosition(r);return Dr.fromModelState(Zr.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Dr(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,r=t.viewState.position.column;return Dr.fromViewState(new bc(new J(i,r,i,r),0,0,new De(i,r),0))}static moveTo(e,t,i,r,o){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,r);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,r,o)}const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new De(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Dr.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,r,o,s){switch(i){case 0:return s===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,o);case 1:return s===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,o);case 2:return s===2?this._moveUpByViewLines(e,t,r,o):this._moveUpByModelLines(e,t,r,o);case 3:return s===2?this._moveDownByViewLines(e,t,r,o):this._moveDownByModelLines(e,t,r,o);case 4:return s===2?t.map(a=>Dr.fromViewState(lo.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Dr.fromModelState(lo.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return s===2?t.map(a=>Dr.fromViewState(lo.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Dr.fromModelState(lo.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 6:return this._moveToViewMinColumn(e,t,r);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,r);case 8:return this._moveToViewCenterColumn(e,t,r);case 9:return this._moveToViewMaxColumn(e,t,r);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,r);default:return null}}static viewportMove(e,t,i,r,o){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;c<u;c++){const d=t[c];l[c]=this.findPositionInViewportIfOutside(e,d,s,r)}return l}default:return null}}static findPositionInViewportIfOutside(e,t,i,r){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new Dr(t.modelState,t.viewState);{let s;o>i.endLineNumber-1?s=i.endLineNumber-1:o<i.startLineNumber?s=i.startLineNumber:s=o;const a=lo.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return Dr.fromViewState(t.viewState.move(r,a.lineNumber,a.column,a.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let r=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(r)&&r++,Math.min(t.endLineNumber,r+i-1)}static _lastLineNumberInRange(e,t,i){let r=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(r)&&r++,Math.max(r,t.endLineNumber-i+1)}static _moveLeft(e,t,i,r){return t.map(o=>Dr.fromViewState(lo.moveLeft(e.cursorConfig,e,o.viewState,i,r)))}static _moveHalfLineLeft(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=Math.round(e.getLineContent(l).length/2);r[o]=Dr.fromViewState(lo.moveLeft(e.cursorConfig,e,a.viewState,i,c))}return r}static _moveRight(e,t,i,r){return t.map(o=>Dr.fromViewState(lo.moveRight(e.cursorConfig,e,o.viewState,i,r)))}static _moveHalfLineRight(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=Math.round(e.getLineContent(l).length/2);r[o]=Dr.fromViewState(lo.moveRight(e.cursorConfig,e,a.viewState,i,c))}return r}static _moveDownByViewLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=Dr.fromViewState(lo.moveDown(e.cursorConfig,e,l.viewState,i,r))}return o}static _moveDownByModelLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=Dr.fromModelState(lo.moveDown(e.cursorConfig,e.model,l.modelState,i,r))}return o}static _moveUpByViewLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=Dr.fromViewState(lo.moveUp(e.cursorConfig,e,l.viewState,i,r))}return o}static _moveUpByModelLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=Dr.fromModelState(lo.moveUp(e.cursorConfig,e.model,l.modelState,i,r))}return o}static _moveToViewPosition(e,t,i,r,o){return Dr.fromViewState(t.viewState.move(i,r,o,0))}static _moveToModelPosition(e,t,i,r,o){return Dr.fromModelState(t.modelState.move(i,r,o,0))}static _moveToViewMinColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineMinColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineFirstNonWhitespaceColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewCenterColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=Math.round((e.getLineMaxColumn(l)+e.getLineMinColumn(l))/2);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewMaxColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineMaxColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewLastNonWhitespaceColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineLastNonWhitespaceColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}}var gz;(function(n){const e=function(i){if(!kd(i))return!1;const r=i;return!(!Od(r.to)||!Bh(r.select)&&!oXe(r.select)||!Bh(r.by)&&!Od(r.by)||!Bh(r.value)&&!pS(r.value))};n.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:`Property-value pairs that can be passed through this argument: * 'to': A mandatory logical position value providing where to move the cursor. \`\`\` 'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine', 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter' 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter' 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside' \`\`\` * 'by': Unit to move. Default is computed based on 'to' value. \`\`\` 'line', 'wrappedLine', 'character', 'halfLine' \`\`\` * 'value': Number of units to move. Default is '1'. * 'select': If 'true' makes the selection. Default is 'false'. `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},n.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let r;switch(i.to){case n.RawDirection.Left:r=0;break;case n.RawDirection.Right:r=1;break;case n.RawDirection.Up:r=2;break;case n.RawDirection.Down:r=3;break;case n.RawDirection.PrevBlankLine:r=4;break;case n.RawDirection.NextBlankLine:r=5;break;case n.RawDirection.WrappedLineStart:r=6;break;case n.RawDirection.WrappedLineFirstNonWhitespaceCharacter:r=7;break;case n.RawDirection.WrappedLineColumnCenter:r=8;break;case n.RawDirection.WrappedLineEnd:r=9;break;case n.RawDirection.WrappedLineLastNonWhitespaceCharacter:r=10;break;case n.RawDirection.ViewPortTop:r=11;break;case n.RawDirection.ViewPortBottom:r=13;break;case n.RawDirection.ViewPortCenter:r=12;break;case n.RawDirection.ViewPortIfOutside:r=14;break;default:return null}let o=0;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Character:o=3;break;case n.RawUnit.HalfLine:o=4;break}return{direction:r,unit:o,select:!!i.select,value:i.value||1}}n.parse=t})(gz||(gz={}));function aD(n,e,t,i){const r=eD(e,t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(r.languageId);if(!o)return null;const s=r.getLineContent(),a=s.substr(0,t.startColumn-1-r.firstCharOffset);let l;t.isEmpty()?l=s.substr(t.startColumn-1-r.firstCharOffset):l=eD(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);let c="";if(t.startLineNumber>1&&r.firstCharOffset===0){const m=eD(e,t.startLineNumber-1);m.languageId===r.languageId&&(c=m.getLineContent())}const u=o.onEnter(n,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const f=u.removeText||0;h?d===Xa.Indent&&(h=" "+h):d===Xa.Indent||d===Xa.IndentOutdent?h=" ":h="";let g=NZe(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var alr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},llr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},J$;const ute=Object.create(null);function BE(n,e){if(e<=0)return"";ute[n]||(ute[n]=["",n]);const t=ute[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let zp=J$=class{static unshiftIndent(e,t,i,r,o){const s=yl.visibleColumnFromColumn(e,t,i);if(o){const a=BE(" ",r),c=yl.prevIndentTabStop(s,r)/r;return BE(a,c)}else{const a=" ",c=yl.prevRenderTabStop(s,i)/i;return BE(a,c)}}static shiftIndent(e,t,i,r,o){const s=yl.visibleColumnFromColumn(e,t,i);if(o){const a=BE(" ",r),c=yl.nextIndentTabStop(s,r)/r;return BE(a,c)}else{const a=" ",c=yl.nextRenderTabStop(s,i)/i;return BE(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let r=this._selection.endLineNumber;this._selection.endColumn===1&&i!==r&&(r=r-1);const{tabSize:o,indentSize:s,insertSpaces:a}=this._opts,l=i===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=i;d<=r;d++,c=u){u=0;const h=e.getLineContent(d);let f=Yu(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&yl.visibleColumnFromColumn(h,f+1,o)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const v=aD(this._opts.autoIndent,e,new J(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(v){if(u=c,v.appendText)for(let _=0,b=v.appendText.length;_<b&&u<s&&v.appendText.charCodeAt(_)===32;_++)u++;v.removeText&&(u=Math.max(0,u-v.removeText));for(let _=0;_<u&&!(f===0||h.charCodeAt(f-1)!==32);_++)f--}}if(this._opts.isUnshift&&f===0)continue;let g;this._opts.isUnshift?g=J$.unshiftIndent(h,f+1,o,s,a):g=J$.shiftIndent(h,f+1,o,s,a),this._addEditOperation(t,new J(d,1,d,f+1),g),d===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=f+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(i)===0&&(this._useLastEditRangeForCursorEndPosition=!0);const c=a?BE(" ",s):" ";for(let u=i;u<=r;u++){const d=e.getLineContent(u);let h=Yu(d);if(!(this._opts.isUnshift&&(d.length===0||h===0))&&!(!l&&!this._opts.isUnshift&&d.length===0)&&(h===-1&&(h=d.length),!(this._opts.isUnshift&&h===0)))if(this._opts.isUnshift){h=Math.min(h,s);for(let f=0;f<h;f++)if(d.charCodeAt(f)===9){h=f+1;break}this._addEditOperation(t,new J(u,1,u,h+1),"")}else this._addEditOperation(t,new J(u,1,u,1),c),u===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn===1)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const r=t.getInverseEditOperations()[0];return new kn(r.range.endLineNumber,r.range.endColumn,r.range.endLineNumber,r.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const r=this._selection.startColumn;return i.startColumn<=r?i:i.getDirection()===0?new kn(i.startLineNumber,r,i.endLineNumber,i.endColumn):new kn(i.endLineNumber,i.endColumn,i.startLineNumber,r)}return i}};zp=J$=alr([llr(2,rs)],zp);class clr{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new J(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new J(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const i=t.getInverseEditOperations(),r=i[0].range,o=i[1].range;return new kn(r.endLineNumber,r.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class ulr{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new J(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return new kn(r.endLineNumber,r.startColumn,r.endLineNumber,r.endColumn-this._charAfter.length)}}function dlr(n,e,t){const i=n.tokenization.getLanguageIdAtPosition(e,0);if(e>1){let r,o=-1;for(r=e-1;r>=1;r--){if(n.tokenization.getLanguageIdAtPosition(r,0)!==i)return o;const s=n.getLineContent(r);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){o=r;continue}return r}}return-1}function PG(n,e,t,i=!0,r){if(n<4)return null;const o=r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=dlr(e,t,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:Ko(a),action:Xa.Indent,line:s};if(o.shouldDecrease(a))return{indentation:Ko(a),action:null,line:s};{if(s===1)return{indentation:Ko(e.getLineContent(s)),action:null,line:s};const l=s-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!o.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:Ko(e.getLineContent(u+1)),action:null,line:u+1}}if(i)return{indentation:Ko(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(o.shouldIncrease(d))return{indentation:Ko(d),action:Xa.Indent,line:u};if(o.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:Ko(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:Ko(d),action:null,line:u}}return{indentation:Ko(e.getLineContent(1)),action:null,line:1}}}function RM(n,e,t,i,r,o){if(n<4)return null;const s=o.getLanguageConfiguration(t);if(!s)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=PG(n,e,i,void 0,o),c=e.getLineContent(i);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h<i-1;h++)if(!/^\s*$/.test(e.getLineContent(h))){d=!1;break}if(d){const h=s.onEnter(n,"",e.getLineContent(u),"");if(h){let f=Ko(e.getLineContent(u));return h.removeText&&(f=f.substring(0,f.length-h.removeText)),h.indentAction===Xa.Indent||h.indentAction===Xa.IndentOutdent?f=r.shiftIndent(f):h.indentAction===Xa.Outdent&&(f=r.unshiftIndent(f)),a.shouldDecrease(c)&&(f=r.unshiftIndent(f)),h.appendText&&(f+=h.appendText),Ko(f)}}}return a.shouldDecrease(c)?l.action===Xa.Indent?l.indentation:r.unshiftIndent(l.indentation):l.action===Xa.Indent?r.shiftIndent(l.indentation):l.indentation}return null}function hlr(n,e,t,i,r){if(n<4)return null;e.tokenization.forceTokenization(t.startLineNumber);const o=e.tokenization.getLineTokens(t.startLineNumber),s=yG(o,t.startColumn-1),a=s.getLineContent();let l=!1,c;s.firstCharOffset>0&&o.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=eD(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,f=Ko(c),g={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,y)=>e.getLanguageIdAtPosition(b,y)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},m=Ko(o.getLineContent()),v=PG(n,g,t.startLineNumber+1,void 0,r);if(!v){const b=l?m:f;return{beforeEnter:b,afterEnter:b}}let _=l?m:v.indentation;return v.action===Xa.Indent&&(_=i.shiftIndent(_)),d.shouldDecrease(u)&&(_=i.unshiftIndent(_)),{beforeEnter:l?m:f,afterEnter:_}}function flr(n,e,t,i,r,o){if(n<4)return null;const s=eD(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=eD(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+i+u)){const d=PG(n,e,t.startLineNumber,!1,o);if(!d)return null;let h=d.indentation;return d.action!==Xa.Indent&&(h=r.unshiftIndent(h)),h}return null}function xJe(n,e,t){const i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}class Ps{static indent(e,t,i){if(t===null||i===null)return[];const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=new zp(i[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return r}static outdent(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=new zp(i[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return r}static shiftIndent(e,t,i){return i=i||1,zp.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,zp.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,r){const o=[];for(let s=0,a=i.length;s<a;s++)o[s]=new Hc(i[s],r[s]);return new Qd(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,r,o){const s=[];for(let a=0,l=i.length;a<l;a++){const c=i[a],u=c.getPosition();if(o&&!c.isEmpty()&&(o=!1),o&&r.indexOf(` `)!==r.length-1&&(o=!1),o){const d=new J(u.lineNumber,1,u.lineNumber,1);s[a]=new K0e(d,r,c,!0)}else s[a]=new Hc(c,r)}return new Qd(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,r,o){if(r||t.length===1)return null;if(o&&o.length===t.length)return o;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));const s=l0(i);if(s.length===t.length)return s}return null}static paste(e,t,i,r,o,s){const a=this._distributePasteToCursors(e,i,r,o,s);return a?(i=i.sort(J.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,r,o)}static _goodIndentForLine(e,t,i){let r=null,o="";const s=PG(e.autoIndent,t,i,!1,e.languageConfigurationService);if(s)r=s.action,o=s.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const u=t.getLineContent(a);if(dv(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=aD(e.autoIndent,t,new J(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return r&&(r===Xa.Indent&&(o=Ps.shiftIndent(e,o)),r===Xa.Outdent&&(o=Ps.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,r){let o="";const s=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let u=0;u<c;u++)o+=" "}else o=" ";return new Hc(i,o,r)}static tab(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++){const a=i[o];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const u=e.normalizeIndentation(c);if(!l.startsWith(u)){r[o]=new Hc(new J(a.startLineNumber,1,a.startLineNumber,l.length+1),u,!0);continue}}r[o]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){r[o]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}r[o]=new zp(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return r}static compositionType(e,t,i,r,o,s,a,l){const c=r.map(u=>this._compositionType(i,u,o,s,a,l));return new Qd(4,c,{shouldPushStackElementBefore:W9(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,r,o,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-r),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),u=new J(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===i&&s===0?null:new Z$(u,i,0,s)}static _typeCommand(e,t,i){return i?new V9(e,t,!0):new Hc(e,t,!0)}static _enter(e,t,i,r){if(e.autoIndent===0)return Ps._typeCommand(r,` `,i);if(!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(r.startLineNumber),c=Ko(l).substring(0,r.startColumn-1);return Ps._typeCommand(r,` `+e.normalizeIndentation(c),i)}const o=aD(e.autoIndent,t,r,e.languageConfigurationService);if(o){if(o.indentAction===Xa.None)return Ps._typeCommand(r,` `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Xa.Indent)return Ps._typeCommand(r,` `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Xa.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),u=` `+c+` `+l;return i?new V9(r,u,!0):new Z$(r,u,-1,c.length-l.length,!0)}else if(o.indentAction===Xa.Outdent){const l=Ps.unshiftIndent(e,o.indentation);return Ps._typeCommand(r,` `+e.normalizeIndentation(l+o.appendText),i)}}const s=t.getLineContent(r.startLineNumber),a=Ko(s).substring(0,r.startColumn-1);if(e.autoIndent>=4){const l=hlr(e.autoIndent,t,r,{unshiftIndent:c=>Ps.unshiftIndent(e,c),shiftIndent:c=>Ps.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,r.getEndPosition());const u=r.endColumn,d=t.getLineContent(r.endLineNumber),h=Yu(d);if(h>=0?r=r.setEndPosition(r.endLineNumber,Math.max(r.endColumn,h+1)):r=r.setEndPosition(r.endLineNumber,t.getLineMaxColumn(r.endLineNumber)),i)return new V9(r,` `+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return u<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new Z$(r,` `+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Ps._typeCommand(r,` `+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let r=0,o=i.length;r<o;r++)if(!t.tokenization.isCheapToTokenize(i[r].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,r){const o=NZe(t,i.startLineNumber,i.startColumn),s=flr(e.autoIndent,t,i,r,{shiftIndent:a=>Ps.shiftIndent(e,a),unshiftIndent:a=>Ps.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Ps._typeCommand(new J(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+r,!1):Ps._typeCommand(new J(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+r,!1)}return null}static _isAutoClosingOvertype(e,t,i,r,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,a=i.length;s<a;s++){const l=i[s];if(!l.isEmpty())return!1;const c=l.getPosition(),u=t.getLineContent(c.lineNumber);if(u.charAt(c.column-1)!==o)return!1;const h=vC(o);if((c.column>2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,v=r.length;m<v;m++){const _=r[m];if(c.lineNumber===_.startLineNumber&&c.column===_.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,r,o){const s=[];for(let a=0,l=r.length;a<l;a++){const u=r[a].getPosition(),d=new J(u.lineNumber,u.column,u.lineNumber,u.column+1);s[a]=new Hc(d,o)}return new Qd(4,s,{shouldPushStackElementBefore:W9(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),r=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=r.some(l=>t.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,i,r){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!o)return null;let s=null;for(const a of o)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new J(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+r!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),r=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const s of r)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o}static _getAutoClosingPairClose(e,t,i,r,o){for(const g of i)if(!g.isEmpty())return null;const s=i.map(g=>{const m=g.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-r.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new De(g.lineNumber,g.beforeColumn)),r);if(!a)return null;let l,c;if(vC(r)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let f=!0;for(const g of s){const{lineNumber:m,beforeColumn:v,afterColumn:_}=g,b=t.getLineContent(m),y=b.substring(0,v-1),C=b.substring(_-1);if(C.startsWith(h)||(f=!1),C.length>0){const L=C.charAt(0);if(!Ps._isBeforeClosingBrace(e,C)&&!c(L))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const L=bg(e.wordSeparators);if(y.length>0){const D=y.charCodeAt(y.length-1);if(L.get(D)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const x=t.tokenization.getLineTokens(m),E=yG(x,v-1);if(!a.shouldAutoClose(E,v-E.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const L=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(L))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,r,o,s,a){const l=[];for(let c=0,u=r.length;c<u;c++){const d=r[c];l[c]=new TJe(d,o,!s,a)}return new Qd(4,l,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return vC(t)?e.autoSurround==="quotes"||e.autoSurround==="languageDefined":e.autoSurround==="brackets"||e.autoSurround==="languageDefined"}static _isSurroundSelectionType(e,t,i,r){if(!Ps._shouldSurroundChar(e,r)||!e.surroundingPairs.hasOwnProperty(r))return!1;const o=vC(r);for(const s of i){if(s.isEmpty())return!1;let a=!0;for(let l=s.startLineNumber;l<=s.endLineNumber;l++){const c=t.getLineContent(l),u=l===s.startLineNumber?s.startColumn-1:0,d=l===s.endLineNumber?s.endColumn-1:c.length,h=c.substring(u,d);if(/[^ \t]/.test(h)){a=!1;break}}if(a)return!1;if(o&&s.startLineNumber===s.endLineNumber&&s.startColumn+1===s.endColumn){const l=t.getValueInRange(s);if(vC(l))return!1}}return!0}static _runSurroundSelectionType(e,t,i,r,o){const s=[];for(let a=0,l=r.length;a<l;a++){const c=r[a],u=t.surroundingPairs[o];s[a]=new clr(c,o,u)}return new Qd(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!!(i.length===1&&t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,r,o){if(!t.electricChars.hasOwnProperty(o)||!r.isEmpty())return null;const s=r.getPosition();i.tokenization.forceTokenization(s.lineNumber);const a=i.tokenization.getLineTokens(s.lineNumber);let l;try{l=t.onElectricCharacter(o,a,s.column)}catch(c){return Oi(c),null}if(!l)return null;if(l.matchOpenBracket){const c=(a.getLineContent()+o).lastIndexOf(l.matchOpenBracket)+1,u=i.bracketPairs.findMatchingBracketUp(l.matchOpenBracket,{lineNumber:s.lineNumber,column:c},500);if(u){if(u.startLineNumber===s.lineNumber)return null;const d=i.getLineContent(u.startLineNumber),h=Ko(d),f=t.normalizeIndentation(h),g=i.getLineContent(s.lineNumber),m=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,v=g.substring(m-1,s.column-1),_=f+v+o,b=new J(s.lineNumber,1,s.lineNumber,s.column),y=new Hc(b,_);return new Qd(dte(_,e),[y],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,r,o,s){if(!r)return null;let a=null;for(const d of r)if(a===null)a=d.insertedText;else if(a!==d.insertedText)return null;if(!a||a.length!==1)return null;const l=a;let c=!1;for(const d of r)if(d.deletedText.length!==0){c=!0;break}if(c){if(!Ps._shouldSurroundChar(t,l)||!t.surroundingPairs.hasOwnProperty(l))return null;const d=vC(l);for(const g of r)if(g.deletedSelectionStart!==0||g.deletedSelectionEnd!==g.deletedText.length||/^[ \t]+$/.test(g.deletedText)||d&&vC(g.deletedText))return null;const h=[];for(const g of o){if(!g.isEmpty())return null;h.push(g.getPosition())}if(h.length!==r.length)return null;const f=[];for(let g=0,m=h.length;g<m;g++)f.push(new ulr(h[g],r[g].deletedText,t.surroundingPairs[l]));return new Qd(4,f,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,o,s,l)){const d=o.map(h=>new Hc(new J(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Qd(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,i,o,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,u):null}static typeWithInterceptors(e,t,i,r,o,s,a){if(!e&&a===` `){const u=[];for(let d=0,h=o.length;d<h;d++)u[d]=Ps._enter(i,r,!1,o[d]);return new Qd(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,r,o)){const u=[];let d=!1;for(let h=0,f=o.length;h<f;h++)if(u[h]=this._runAutoIndentType(i,r,o[h],a),!u[h]){d=!0;break}if(!d)return new Qd(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,r,o,s,a))return this._runAutoClosingOvertype(t,i,r,o,a);if(!e){const u=this._getAutoClosingPairClose(i,r,o,a,!1);if(u)return this._runAutoClosingOpenCharType(t,i,r,o,a,!1,u)}if(!e&&this._isSurroundSelectionType(i,r,o,a))return this._runSurroundSelectionType(t,i,r,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,r,o)){const u=this._typeInterceptorElectricChar(t,i,r,o[0],a);if(u)return u}const l=[];for(let u=0,d=o.length;u<d;u++)l[u]=new Hc(o[u],a);const c=dte(a,t);return new Qd(c,l,{shouldPushStackElementBefore:W9(t,c),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,r,o){const s=[];for(let l=0,c=r.length;l<c;l++)s[l]=new Hc(r[l],o);const a=dte(o,e);return new Qd(a,s,{shouldPushStackElementBefore:W9(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const r=[];for(let o=0,s=i.length;o<s;o++){let a=i[o].positionLineNumber;if(a===1)r[o]=new V9(new J(1,1,1,1),` `);else{a--;const l=t.getLineMaxColumn(a);r[o]=this._enter(e,t,!1,new J(a,l,a,l))}}return r}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const r=[];for(let o=0,s=i.length;o<s;o++){const a=i[o].positionLineNumber,l=t.getLineMaxColumn(a);r[o]=this._enter(e,t,!1,new J(a,l,a,l))}return r}static lineBreakInsert(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=this._enter(e,t,!0,i[o]);return r}}class TJe extends Z${constructor(e,t,i,r){super(e,(i?t:"")+r,0,-r.length),this._openCharacter=t,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new J(r.startLineNumber,r.endColumn-this._closeCharacter.length,r.endLineNumber,r.endColumn),this.enclosingRange=new J(r.startLineNumber,r.endColumn-this._openCharacter.length-this._closeCharacter.length,r.endLineNumber,r.endColumn),super.computeCursorState(e,t)}}class plr{constructor(e,t,i,r,o,s){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=r,this.insertedSelectionStart=o,this.insertedSelectionEnd=s}}function dte(n,e){return n===" "?e===5||e===6?6:5:4}function W9(n,e){return WOe(n)&&!WOe(e)?!0:n===5?!1:HOe(n)!==HOe(e)}function HOe(n){return n===6||n===5?"space":n}function WOe(n){return n===4||n===5||n===6}var de;(function(n){n.editorSimpleInput=new sn("editorSimpleInput",!1,!0),n.editorTextFocus=new sn("editorTextFocus",!1,T("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),n.focus=new sn("editorFocus",!1,T("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),n.textInputFocus=new sn("textInputFocus",!1,T("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),n.readOnly=new sn("editorReadonly",!1,T("editorReadonly","Whether the editor is read-only")),n.inDiffEditor=new sn("inDiffEditor",!1,T("inDiffEditor","Whether the context is a diff editor")),n.isEmbeddedDiffEditor=new sn("isEmbeddedDiffEditor",!1,T("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),n.comparingMovedCode=new sn("comparingMovedCode",!1,T("comparingMovedCode","Whether a moved code block is selected for comparison")),n.accessibleDiffViewerVisible=new sn("accessibleDiffViewerVisible",!1,T("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),n.diffEditorRenderSideBySideInlineBreakpointReached=new sn("diffEditorRenderSideBySideInlineBreakpointReached",!1,T("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),n.columnSelection=new sn("editorColumnSelection",!1,T("editorColumnSelection","Whether `editor.columnSelection` is enabled")),n.writable=n.readOnly.toNegated(),n.hasNonEmptySelection=new sn("editorHasSelection",!1,T("editorHasSelection","Whether the editor has text selected")),n.hasOnlyEmptySelection=n.hasNonEmptySelection.toNegated(),n.hasMultipleSelections=new sn("editorHasMultipleSelections",!1,T("editorHasMultipleSelections","Whether the editor has multiple selections")),n.hasSingleSelection=n.hasMultipleSelections.toNegated(),n.tabMovesFocus=new sn("editorTabMovesFocus",!1,T("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),n.tabDoesNotMoveFocus=n.tabMovesFocus.toNegated(),n.isInWalkThroughSnippet=new sn("isInEmbeddedEditor",!1,!0),n.canUndo=new sn("canUndo",!1,!0),n.canRedo=new sn("canRedo",!1,!0),n.hoverVisible=new sn("editorHoverVisible",!1,T("editorHoverVisible","Whether the editor hover is visible")),n.hoverFocused=new sn("editorHoverFocused",!1,T("editorHoverFocused","Whether the editor hover is focused")),n.stickyScrollFocused=new sn("stickyScrollFocused",!1,T("stickyScrollFocused","Whether the sticky scroll is focused")),n.stickyScrollVisible=new sn("stickyScrollVisible",!1,T("stickyScrollVisible","Whether the sticky scroll is visible")),n.standaloneColorPickerVisible=new sn("standaloneColorPickerVisible",!1,T("standaloneColorPickerVisible","Whether the standalone color picker is visible")),n.standaloneColorPickerFocused=new sn("standaloneColorPickerFocused",!1,T("standaloneColorPickerFocused","Whether the standalone color picker is focused")),n.inCompositeEditor=new sn("inCompositeEditor",void 0,T("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),n.notInCompositeEditor=n.inCompositeEditor.toNegated(),n.languageId=new sn("editorLangId","",T("editorLangId","The language identifier of the editor")),n.hasCompletionItemProvider=new sn("editorHasCompletionItemProvider",!1,T("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),n.hasCodeActionsProvider=new sn("editorHasCodeActionsProvider",!1,T("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),n.hasCodeLensProvider=new sn("editorHasCodeLensProvider",!1,T("editorHasCodeLensProvider","Whether the editor has a code lens provider")),n.hasDefinitionProvider=new sn("editorHasDefinitionProvider",!1,T("editorHasDefinitionProvider","Whether the editor has a definition provider")),n.hasDeclarationProvider=new sn("editorHasDeclarationProvider",!1,T("editorHasDeclarationProvider","Whether the editor has a declaration provider")),n.hasImplementationProvider=new sn("editorHasImplementationProvider",!1,T("editorHasImplementationProvider","Whether the editor has an implementation provider")),n.hasTypeDefinitionProvider=new sn("editorHasTypeDefinitionProvider",!1,T("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),n.hasHoverProvider=new sn("editorHasHoverProvider",!1,T("editorHasHoverProvider","Whether the editor has a hover provider")),n.hasDocumentHighlightProvider=new sn("editorHasDocumentHighlightProvider",!1,T("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),n.hasDocumentSymbolProvider=new sn("editorHasDocumentSymbolProvider",!1,T("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),n.hasReferenceProvider=new sn("editorHasReferenceProvider",!1,T("editorHasReferenceProvider","Whether the editor has a reference provider")),n.hasRenameProvider=new sn("editorHasRenameProvider",!1,T("editorHasRenameProvider","Whether the editor has a rename provider")),n.hasSignatureHelpProvider=new sn("editorHasSignatureHelpProvider",!1,T("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),n.hasInlayHintsProvider=new sn("editorHasInlayHintsProvider",!1,T("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),n.hasDocumentFormattingProvider=new sn("editorHasDocumentFormattingProvider",!1,T("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),n.hasDocumentSelectionFormattingProvider=new sn("editorHasDocumentSelectionFormattingProvider",!1,T("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),n.hasMultipleDocumentFormattingProvider=new sn("editorHasMultipleDocumentFormattingProvider",!1,T("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),n.hasMultipleDocumentSelectionFormattingProvider=new sn("editorHasMultipleDocumentSelectionFormattingProvider",!1,T("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(de||(de={}));const Gr=0;class sa extends ac{runEditorCommand(e,t,i){const r=t._getViewModel();r&&this.runCoreEditorCommand(r,i||{})}}var Bc;(function(n){const e=function(i){if(!kd(i))return!1;const r=i;return!(!Od(r.to)||!Bh(r.by)&&!Od(r.by)||!Bh(r.value)&&!pS(r.value)||!Bh(r.revealCursor)&&!oXe(r.revealCursor))};n.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},n.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"};function t(i){let r;switch(i.to){case n.RawDirection.Up:r=1;break;case n.RawDirection.Right:r=2;break;case n.RawDirection.Down:r=3;break;case n.RawDirection.Left:r=4;break;default:return null}let o;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Page:o=3;break;case n.RawUnit.HalfPage:o=4;break;case n.RawUnit.Editor:o=5;break;case n.RawUnit.Column:o=6;break;default:o=2}const s=Math.floor(i.value||1),a=!!i.revealCursor;return{direction:r,unit:o,value:s,revealCursor:a,select:!!i.select}}n.parse=t})(Bc||(Bc={}));var mL;(function(n){const e=function(t){if(!kd(t))return!1;const i=t;return!(!pS(i.lineNumber)&&!Od(i.lineNumber)||!Bh(i.at)&&!Od(i.at))};n.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n * 'lineNumber': A mandatory line number value.\n * 'at': Logical position at which line has to be revealed.\n ```\n 'top', 'center', 'bottom'\n ```\n ",constraint:e,schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},n.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}})(mL||(mL={}));class Ace{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(eo).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const r=Im();return r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0?(this.runDOMCommand(r),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const r=t.get(eo).getActiveCodeEditor();return r?(r.focus(),this._runEditorCommand(t,r,i)):!1})}_runEditorCommand(e,t,i){const r=this.runEditorCommand(e,t,i);return r||!0}}var Kl;(function(n){class e extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;b.model.pushStackElement(),b.setCursorStates(y.source,3,[fc.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0)}}n.MoveTo=zt(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=zt(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends sa{runCoreEditorCommand(b,y){b.model.pushStackElement();const C=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),y);C!==null&&(b.setCursorStates(y.source,3,C.viewStates.map(x=>Dr.fromViewState(x))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:C.fromLineNumber,fromViewVisualColumn:C.fromVisualColumn,toViewLineNumber:C.toLineNumber,toViewVisualColumn:C.toVisualColumn}),C.reversed?b.revealTopMostCursor(y.source):b.revealBottomMostCursor(y.source))}}n.ColumnSelect=zt(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(_,b,y,C){if(typeof C.position>"u"||typeof C.viewPosition>"u"||typeof C.mouseColumn>"u")return null;const x=_.model.validatePosition(C.position),E=_.coordinatesConverter.validateViewPosition(new De(C.viewPosition.lineNumber,C.viewPosition.column),x),k=C.doColumnSelect?y.fromViewLineNumber:E.lineNumber,L=C.doColumnSelect?y.fromViewVisualColumn:C.mouseColumn-1;return Tx.columnSelect(_.cursorConfig,_,k,L,E.lineNumber,C.mouseColumn-1)}}),n.CursorColumnSelectLeft=zt(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(_,b,y,C){return Tx.columnSelectLeft(_.cursorConfig,_,y)}}),n.CursorColumnSelectRight=zt(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(_,b,y,C){return Tx.columnSelectRight(_.cursorConfig,_,y)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,x){return Tx.columnSelectUp(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectUp=zt(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=zt(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,x){return Tx.columnSelectDown(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectDown=zt(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=zt(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends sa{constructor(){super({id:"cursorMove",precondition:void 0,description:gz.description})}runCoreEditorCommand(b,y){const C=gz.parse(y);C&&this._runCursorMove(b,y.source,C)}_runCursorMove(b,y,C){b.model.pushStackElement(),b.setCursorStates(y,3,o._move(b,b.getCursorStates(),C)),b.revealPrimaryCursor(y,!0)}static _move(b,y,C){const x=C.select,E=C.value;switch(C.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return fc.simpleMove(b,y,C.direction,x,E,C.unit);case 11:case 13:case 12:case 14:return fc.viewportMove(b,y,C.direction,x,E);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=zt(new o);class s extends sa{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,y){let C=this._staticArgs;this._staticArgs.value===-1&&(C={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(y.source,3,fc.simpleMove(b,b.getCursorStates(),C.direction,C.select,C.value,C.unit)),b.revealPrimaryCursor(y.source,!0)}}n.CursorLeft=zt(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=zt(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1039}})),n.CursorRight=zt(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=zt(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1041}})),n.CursorUp=zt(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=zt(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=zt(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:11}})),n.CursorPageUpSelect=zt(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1035}})),n.CursorDown=zt(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=zt(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=zt(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:12}})),n.CursorPageDownSelect=zt(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1036}})),n.CreateCursor=zt(new class extends sa{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(_,b){if(!b.position)return;let y;b.wholeLine?y=fc.line(_,_.getPrimaryCursorState(),!1,b.position,b.viewPosition):y=fc.moveTo(_,_.getPrimaryCursorState(),!1,b.position,b.viewPosition);const C=_.getCursorStates();if(C.length>1){const x=y.modelState?y.modelState.position:null,E=y.viewState?y.viewState.position:null;for(let k=0,L=C.length;k<L;k++){const D=C[k];if(!(x&&!D.modelState.selection.containsPosition(x))&&!(E&&!D.viewState.selection.containsPosition(E))){C.splice(k,1),_.model.pushStackElement(),_.setCursorStates(b.source,3,C);return}}}C.push(y),_.model.pushStackElement(),_.setCursorStates(b.source,3,C)}}),n.LastCursorMoveToSelect=zt(new class extends sa{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(_,b){if(!b.position)return;const y=_.getLastAddedCursorIndex(),C=_.getCursorStates(),x=C.slice(0);x[y]=fc.moveTo(_,C[y],!0,b.position,b.viewPosition),_.model.pushStackElement(),_.setCursorStates(b.source,3,x)}});class a extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,fc.moveToBeginningOfLine(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorHome=zt(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),n.CursorHomeSelect=zt(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,this._exec(b.getCursorStates())),b.revealPrimaryCursor(y.source,!0)}_exec(b){const y=[];for(let C=0,x=b.length;C<x;C++){const E=b[C],k=E.modelState.position.lineNumber;y[C]=Dr.fromModelState(E.modelState.move(this._inSelectionMode,k,1,0))}return y}}n.CursorLineStart=zt(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:0,mac:{primary:287}}})),n.CursorLineStartSelect=zt(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:0,mac:{primary:1311}}}));class c extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,fc.moveToEndOfLine(b,b.getCursorStates(),this._inSelectionMode,y.sticky||!1)),b.revealPrimaryCursor(y.source,!0)}}n.CursorEnd=zt(new c({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Gr,kbExpr:de.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:T("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),n.CursorEndSelect=zt(new c({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Gr,kbExpr:de.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:T("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class u extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,this._exec(b,b.getCursorStates())),b.revealPrimaryCursor(y.source,!0)}_exec(b,y){const C=[];for(let x=0,E=y.length;x<E;x++){const k=y[x],L=k.modelState.position.lineNumber,D=b.model.getLineMaxColumn(L);C[x]=Dr.fromModelState(k.modelState.move(this._inSelectionMode,L,D,0))}return C}}n.CursorLineEnd=zt(new u({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:0,mac:{primary:291}}})),n.CursorLineEndSelect=zt(new u({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:0,mac:{primary:1315}}}));class d extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,fc.moveToBeginningOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorTop=zt(new d({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:2062,mac:{primary:2064}}})),n.CursorTopSelect=zt(new d({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3086,mac:{primary:3088}}}));class h extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,fc.moveToEndOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorBottom=zt(new h({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:2061,mac:{primary:2066}}})),n.CursorBottomSelect=zt(new h({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:3085,mac:{primary:3090}}}));class f extends sa{constructor(){super({id:"editorScroll",precondition:void 0,description:Bc.description})}determineScrollMethod(b){const y=[6],C=[1,2,3,4,5,6],x=[4,2],E=[1,3];return y.includes(b.unit)&&x.includes(b.direction)?this._runHorizontalEditorScroll.bind(this):C.includes(b.unit)&&E.includes(b.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(b,y){const C=Bc.parse(y);if(!C)return;const x=this.determineScrollMethod(C);x&&x(b,y.source,C)}_runVerticalEditorScroll(b,y,C){const x=this._computeDesiredScrollTop(b,C);if(C.revealCursor){const E=b.getCompletelyVisibleViewRangeAtScrollTop(x);b.setCursorStates(y,3,[fc.findPositionInViewportIfOutside(b,b.getPrimaryCursorState(),E,C.select)])}b.viewLayout.setScrollPosition({scrollTop:x},0)}_computeDesiredScrollTop(b,y){if(y.unit===1){const E=b.viewLayout.getFutureViewport(),k=b.getCompletelyVisibleViewRangeAtScrollTop(E.top),L=b.coordinatesConverter.convertViewRangeToModelRange(k);let D;y.direction===1?D=Math.max(1,L.startLineNumber-y.value):D=Math.min(b.model.getLineCount(),L.startLineNumber+y.value);const A=b.coordinatesConverter.convertModelPositionToViewPosition(new De(D,1));return b.viewLayout.getVerticalOffsetForLineNumber(A.lineNumber)}if(y.unit===5){let E=0;return y.direction===3&&(E=b.model.getLineCount()-b.cursorConfig.pageSize),b.viewLayout.getVerticalOffsetForLineNumber(E)}let C;y.unit===3?C=b.cursorConfig.pageSize*y.value:y.unit===4?C=Math.round(b.cursorConfig.pageSize/2)*y.value:C=y.value;const x=(y.direction===1?-1:1)*C;return b.viewLayout.getCurrentScrollTop()+x*b.cursorConfig.lineHeight}_runHorizontalEditorScroll(b,y,C){const x=this._computeDesiredScrollLeft(b,C);b.viewLayout.setScrollPosition({scrollLeft:x},0)}_computeDesiredScrollLeft(b,y){const C=(y.direction===4?-1:1)*y.value;return b.viewLayout.getCurrentScrollLeft()+C*b.cursorConfig.typicalHalfwidthCharacterWidth}}n.EditorScrollImpl=f,n.EditorScroll=zt(new f),n.ScrollLineUp=zt(new class extends sa{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Up,by:Bc.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageUp=zt(new class extends sa{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Up,by:Bc.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorTop=zt(new class extends sa{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Up,by:Bc.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLineDown=zt(new class extends sa{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Down,by:Bc.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageDown=zt(new class extends sa{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Down,by:Bc.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorBottom=zt(new class extends sa{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Down,by:Bc.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLeft=zt(new class extends sa{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Left,by:Bc.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollRight=zt(new class extends sa{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Right,by:Bc.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}});class g extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[fc.word(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position)]),y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0))}}n.WordSelect=zt(new g({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),n.WordSelectDrag=zt(new g({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),n.LastCursorWordSelect=zt(new class extends sa{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(_,b){if(!b.position)return;const y=_.getLastAddedCursorIndex(),C=_.getCursorStates(),x=C.slice(0),E=C[y];x[y]=fc.word(_,E,E.modelState.hasSelection(),b.position),_.model.pushStackElement(),_.setCursorStates(b.source,3,x)}});class m extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[fc.line(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)]),y.revealType!==2&&b.revealPrimaryCursor(y.source,!1,!0))}}n.LineSelect=zt(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),n.LineSelectDrag=zt(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class v extends sa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;const C=b.getLastAddedCursorIndex(),x=b.getCursorStates(),E=x.slice(0);E[C]=fc.line(b,x[C],this._inSelectionMode,y.position,y.viewPosition),b.model.pushStackElement(),b.setCursorStates(y.source,3,E)}}n.LastCursorLineSelect=zt(new v({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),n.LastCursorLineSelectDrag=zt(new v({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),n.CancelSelection=zt(new class extends sa{constructor(){super({id:"cancelSelection",precondition:de.hasNonEmptySelection,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(_,b){_.model.pushStackElement(),_.setCursorStates(b.source,3,[fc.cancelSelection(_,_.getPrimaryCursorState())]),_.revealPrimaryCursor(b.source,!0)}}),n.RemoveSecondaryCursors=zt(new class extends sa{constructor(){super({id:"removeSecondaryCursors",precondition:de.hasMultipleSelections,kbOpts:{weight:Gr+1,kbExpr:de.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(_,b){_.model.pushStackElement(),_.setCursorStates(b.source,3,[_.getPrimaryCursorState()]),_.revealPrimaryCursor(b.source,!0),wS(T("removedCursor","Removed secondary cursors"))}}),n.RevealLine=zt(new class extends sa{constructor(){super({id:"revealLine",precondition:void 0,description:mL.description})}runCoreEditorCommand(_,b){const y=b,C=y.lineNumber||0;let x=typeof C=="number"?C+1:parseInt(C)+1;x<1&&(x=1);const E=_.model.getLineCount();x>E&&(x=E);const k=new J(x,1,x,_.model.getLineMaxColumn(x));let L=0;if(y.at)switch(y.at){case mL.RawAtArgument.Top:L=3;break;case mL.RawAtArgument.Center:L=1;break;case mL.RawAtArgument.Bottom:L=4;break}const D=_.coordinatesConverter.convertModelRangeToViewRange(k);_.revealRange(b.source,!1,D,L,0)}}),n.SelectAll=new class extends Ace{constructor(){super(Jtr)}runDOMCommand(_){mg&&(_.focus(),_.select()),_.ownerDocument.execCommand("selectAll")}runEditorCommand(_,b,y){const C=b._getViewModel();C&&this.runCoreEditorCommand(C,y)}runCoreEditorCommand(_,b){_.model.pushStackElement(),_.setCursorStates("keyboard",3,[fc.selectAll(_,_.getPrimaryCursorState())])}},n.SetSelection=zt(new class extends sa{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(_,b){b.selection&&(_.model.pushStackElement(),_.setCursorStates(b.source,3,[Dr.fromModelSelection(b.selection)]))}})})(Kl||(Kl={}));const glr=at.and(de.textInputFocus,de.columnSelection);function aR(n,e){hh.registerKeybindingRule({id:n,primary:e,when:glr,weight:Gr+1})}aR(Kl.CursorColumnSelectLeft.id,1039);aR(Kl.CursorColumnSelectRight.id,1041);aR(Kl.CursorColumnSelectUp.id,1040);aR(Kl.CursorColumnSelectPageUp.id,1035);aR(Kl.CursorColumnSelectDown.id,1042);aR(Kl.CursorColumnSelectPageDown.id,1036);function zOe(n){return n.register(),n}var lD;(function(n){class e extends ac{runEditorCommand(i,r,o){const s=r._getViewModel();s&&this.runCoreEditingCommand(r,s,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=zt(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:de.writable,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,Ps.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=zt(new class extends e{constructor(){super({id:"outdent",precondition:de.writable,kbOpts:{weight:Gr,kbExpr:at.and(de.editorTextFocus,de.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,Ps.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=zt(new class extends e{constructor(){super({id:"tab",precondition:de.writable,kbOpts:{weight:Gr,kbExpr:at.and(de.editorTextFocus,de.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,Ps.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=zt(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,r){const[o,s]=tk.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,s),i.setPrevEditOperationType(2)}}),n.DeleteRight=zt(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Gr,kbExpr:de.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,r){const[o,s]=tk.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,s),i.setPrevEditOperationType(3)}}),n.Undo=new class extends Ace{constructor(){super(mZe)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,r){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().undo()}},n.Redo=new class extends Ace{constructor(){super(_Ze)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,r){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(lD||(lD={}));class UOe extends mG{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(eo).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function rI(n,e){zOe(new UOe("default:"+n,n)),zOe(new UOe(n,n,e))}rI("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});rI("replacePreviousChar");rI("compositionType");rI("compositionStart");rI("compositionEnd");rI("paste");rI("cut");class mlr{constructor(e,t,i,r){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=r}paste(e,t,i,r){this.commandDelegate.paste(e,t,i,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,r){this.commandDelegate.compositionType(e,t,i,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Kl.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new De(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(77)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(77)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=Zu&&t.get(106),r=t.get(22);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):r?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Kl.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Kl.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Kl.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Kl.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Kl.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Kl.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Kl.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Kl.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Kl.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Kl.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Kl.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Kl.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Kl.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class MG{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return MG.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new De(e.afterLineNumber,1)).lineNumber}}}class kJe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Qa("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),r=this.getEndLineNumber();if(t<i){const l=t-e+1;return this._rendLineNumberStart-=l,null}if(e>r)return null;let o=0,s=0;for(let l=i;l<=r;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(o=c,s=1):s++)}if(e<i){let l=0;t<i?l=t-e+1:l=i-e,this._rendLineNumberStart-=l}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(this.getCount()===0)return!1;const r=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let a=e;a<=i;a++)a>=r&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,r=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let d=0;d<i;d++)s[d]=this._createLine();const a=e-this._rendLineNumberStart,l=this._lines.slice(0,a),c=this._lines.slice(a,this._lines.length-i),u=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=l.concat(s).concat(c),u}onTokensChanged(e){if(this.getCount()===0)return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let r=!1;for(let o=0,s=e.length;o<s;o++){const a=e[o];if(a.toLineNumber<t||a.fromLineNumber>i)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),r=!0}}return r}}class IJe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new kJe(()=>this._host.createVisibleLine())}_createDomNode(){const e=io(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,r=t.length;i<r;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,r=t.length;i<r;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new Ty(this.domNode.domNode,this._host,e),r={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(r,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class Ty{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,r){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let s=t;s<=i;s++)o.lines[s-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,r),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),r,t),o.rendLineNumberStart>t){const s=t,a=Math.min(i,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart<t){const s=Math.min(o.linesLength,t-o.rendLineNumberStart);s>0&&(this._removeLinesBefore(o,s),o.linesLength-=s)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const s=o.rendLineNumberStart+o.linesLength,a=i;s<=a&&(this._insertLinesAfter(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const s=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-s+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,r),o}_renderUntouchedLines(e,t,i,r,o){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=s+l;a[l].layoutLine(c,r[c-o])}}_insertLinesBefore(e,t,i,r,o){const s=[];let a=0;for(let l=t;l<=i;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const r=e.lines[i].getDomNode();r&&this.domNode.removeChild(r)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,r,o){const s=[];let a=0;for(let l=t;l<=i;l++)s[a++]=this.host.createVisibleLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let r=0;r<t;r++){const o=e.lines[i+r].getDomNode();o&&this.domNode.removeChild(o)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,r){Ty._ttPolicy&&(i=Ty._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this.domNode.lastChild;for(let a=e.linesLength-1;a>=0;a--){const l=e.lines[a];r[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const r=document.createElement("div");Ty._ttPolicy&&(t=Ty._ttPolicy.createHTML(t)),r.innerHTML=t;for(let o=0;o<e.linesLength;o++){const s=e.lines[o];if(i[o]){const a=r.firstChild,l=s.getDomNode();l.parentNode.replaceChild(a,l),s.setDomNode(a)}}}_finishRendering(e,t,i){const r=Ty._sb,o=e.linesLength,s=e.lines,a=e.rendLineNumberStart,l=[];{r.reset();let c=!1;for(let u=0;u<o;u++){const d=s[u];l[u]=!1,!(d.getDomNode()||!d.renderLine(u+a,i[u],this.viewportData,r))&&(l[u]=!0,c=!0)}c&&this._finishRenderingNewLines(e,t,r.build(),l)}{r.reset();let c=!1;const u=[];for(let d=0;d<o;d++){const h=s[d];u[d]=!1,!(l[d]||!h.renderLine(d+a,i[d],this.viewportData,r))&&(u[d]=!0,c=!0)}c&&this._finishRenderingInvalidLines(e,r.build(),u)}}}Ty._ttPolicy=R1("editorViewLayer",{createHTML:n=>n});Ty._sb=new rR(1e5);class LJe extends nf{constructor(e){super(e),this._visibleLines=new IJe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Zc(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new _lr(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onConfigurationChanged(e);const o=this._context.configuration.options.get(50);return Zc(this.domNode,o),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter(i=>i.shouldRender());for(let i=0,r=t.length;i<r;i++){const o=t[i];o.prepareRender(e),o.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class _lr{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(66),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=io(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(66)}renderLine(e,t,i,r){let o="";for(let s=0,a=this._dynamicOverlays.length;s<a;s++){const l=this._dynamicOverlays[s];o+=l.render(i.startLineNumber,e)}return this._renderedContent===o?!1:(this._renderedContent=o,r.appendString('<div style="position:absolute;top:'),r.appendString(String(t)),r.appendString("px;width:100%;height:"),r.appendString(String(this._lineHeight)),r.appendString('px;">'),r.appendString(o),r.appendString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class vlr extends LJe{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class blr extends LJe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Zc(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Zc(this.domNode,t.get(50));const i=t.get(143);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class ylr extends nf{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=io(document.createElement("div")),d0.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=io(document.createElement("div")),d0.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new Clr(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,r,o){this._widgets[e.getId()].setPosition(t,i,r,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const r=i.domNode.domNode;r.parentNode.removeChild(r),r.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class Clr{constructor(e,t,i){this._primaryAnchor=new DO(null,null),this._secondaryAnchor=new DO(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=io(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const r=this._context.configuration.options,o=r.get(143);this._fixedOverflowWidgets=r.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=r.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const i=t.get(143);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){this._affinity=e,this._primaryAnchor=r(t,this._context.viewModel,this._affinity),this._secondaryAnchor=r(i,this._context.viewModel,this._affinity);function r(o,s,a){if(!o)return new DO(null,null);const l=s.model.validatePosition(o);if(s.coordinatesConverter.modelPositionIsVisible(l)){const c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new DO(o,c)}return new DO(o,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,r){this._setPosition(r,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,r){const o=e.top,s=o,a=e.top+e.height,l=r.viewportHeight-a,c=o-i,u=s>=i,d=a,h=l>=i;let f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),f<r.scrollLeft&&(f=r.scrollLeft),{fitsAbove:u,aboveTop:c,fitsBelow:h,belowTop:d,left:f}}_layoutHorizontalSegmentInPage(e,t,i,r){var o;const l=Math.max(15,t.left-r),c=Math.min(t.left+t.width+r,e.width-15),d=this._viewDomNode.domNode.ownerDocument.defaultView;let h=t.left+i-((o=d==null?void 0:d.scrollX)!==null&&o!==void 0?o:0);if(h+r>c){const f=h-(c-r);h-=f,i-=f}if(h<l){const f=h-l;h-=f,i-=f}return[i,h]}_layoutBoxInPage(e,t,i,r){var o,s;const a=e.top-i,l=e.top+e.height,c=pl(this._viewDomNode.domNode),u=this._viewDomNode.domNode.ownerDocument,d=u.defaultView,h=c.top+a-((o=d==null?void 0:d.scrollY)!==null&&o!==void 0?o:0),f=c.top+l-((s=d==null?void 0:d.scrollY)!==null&&s!==void 0?s:0),g=nR(u.body),[m,v]=this._layoutHorizontalSegmentInPage(g,c,e.left-r.scrollLeft+this._contentLeft,t),_=22,b=22,y=h>=_,C=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,_),fitsBelow:C,belowTop:f,left:v}:{fitsAbove:y,aboveTop:a,fitsBelow:C,belowTop:l,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new AO(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const r=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(o,this._affinity,this._lineHeight);return{primary:r,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new jOe(f,h,u)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const r=this._context.configuration.options.get(50);let o=t.left;return o<e.left?o=Math.max(o,e.left-i+r.typicalFullwidthCharacterWidth):o=Math.min(o,e.left+i-r.typicalFullwidthCharacterWidth),new jOe(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||this._preference.length===0)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return null;if(this._cachedDomNodeOffsetWidth===-1||this._cachedDomNodeOffsetHeight===-1){let s=null;if(typeof this._actual.beforeRender=="function"&&(s=hte(this._actual.beforeRender,this._actual)),s)this._cachedDomNodeOffsetWidth=s.width,this._cachedDomNodeOffsetHeight=s.height;else{const l=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(l.width),this._cachedDomNodeOffsetHeight=Math.round(l.height)}}const r=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let o;this.allowEditorOverflow?o=this._layoutBoxInPage(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):o=this._layoutBoxInViewport(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let s=1;s<=2;s++)for(const a of this._preference)if(a===1){if(!o)return null;if(s===2||o.fitsAbove)return{coordinate:new AO(o.aboveTop,o.left),position:1}}else if(a===2){if(!o)return null;if(s===2||o.fitsBelow)return{coordinate:new AO(o.belowTop,o.left),position:2}}else return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new AO(r.top,r.left)),position:0}:{coordinate:new AO(r.top,r.left),position:0};return null}onBeforeRender(e){!this._primaryAnchor.viewPosition||!this._preference||this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&hte(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&hte(this._actual.afterRender,this._actual,this._renderData.position)}}class DO{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class AO{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class jOe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function hte(n,e,...t){try{return n.call(e,...t)}catch{return null}}class DJe extends iI{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new kn(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(r=>r.positionLineNumber);t.sort((r,o)=>r-o),Ia(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every(r=>r.isEmpty());return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const a=[];for(let l=i;l<=r;l++){const c=l-i;for(;s<o&&this._cursorLineNumbers[s]<l;)s++;s<o&&this._cursorLineNumbers[s]===l?a[c]=t:a[c]=""}this._renderData=a}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class wlr extends DJe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Slr extends DJe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}e_((n,e)=>{const t=n.getColor(gJe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(VOe)){const i=n.getColor(VOe);i&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),fv(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class Elr extends iI{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],r=0;for(let l=0,c=t.length;l<c;l++){const u=t[l];u.options.className&&(i[r++]=u)}i=i.sort((l,c)=>{if(l.options.zIndex<c.options.zIndex)return-1;if(l.options.zIndex>c.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return u<d?-1:u>d?1:J.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=s;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const r=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a<l;a++){const c=t[a];if(!c.options.isWholeLine)continue;const u='<div class="cdr '+c.options.className+'" style="left:0;width:100%;height:'+r+'px;"></div>',d=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,s);for(let f=d;f<=h;f++){const g=f-o;i[g]+=u}}}_renderNormalDecorations(e,t,i){var r;const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d<h;d++){const f=t[d];if(f.options.isWholeLine)continue;const g=f.options.className,m=!!f.options.showIfCollapsed;let v=f.range;if(m&&v.endColumn===1&&v.endLineNumber!==v.startLineNumber&&(v=new J(v.startLineNumber,v.startColumn,v.endLineNumber-1,this._context.viewModel.getLineMaxColumn(v.endLineNumber-1))),a===g&&l===m&&J.areIntersectingOrTouching(c,v)){c=J.plusRange(c,v);continue}a!==null&&this._renderNormalDecoration(e,c,a,u,l,o,s,i),a=g,l=m,c=v,u=(r=f.options.shouldFillLineOnLineBreak)!==null&&r!==void 0?r:!1}a!==null&&this._renderNormalDecoration(e,c,a,u,l,o,s,i)}_renderNormalDecoration(e,t,i,r,o,s,a,l){const c=e.linesVisibleRangesForRange(t,i==="findMatch");if(c)for(let u=0,d=c.length;u<d;u++){const h=c[u];if(h.outsideRenderedLine)continue;const f=h.lineNumber-a;if(o&&h.ranges.length===1){const g=h.ranges[0];if(g.width<this._typicalHalfwidthCharacterWidth){const m=Math.round(g.left+g.width/2),v=Math.max(0,Math.round(m-this._typicalHalfwidthCharacterWidth/2));h.ranges[0]=new NG(v,this._typicalHalfwidthCharacterWidth)}}for(let g=0,m=h.ranges.length;g<m;g++){const v=r&&h.continuesOnNextLine&&m===1,_=h.ranges[g],b='<div class="cdr '+i+'" style="left:'+String(_.left)+(v?"px;width:100%;height:":"px;width:"+String(_.width)+"px;height:")+s+'px;"></div>';l[f]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class xlr extends nf{constructor(e,t,i,r){super(e);const o=this._context.configuration.options,s=o.get(102),a=o.get(74),l=o.get(40),c=o.get(105),u={listenOnDomNode:i.domNode,className:"editor-scrollable "+Lce(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new j0e(t.domNode,u,this._context.viewLayout.getScrollable())),d0.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=io(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const m={};if(f){const v=h.scrollTop;v&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register(tt(i.domNode,"scroll",h=>d(i.domNode,!0,!0))),this._register(tt(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(tt(r.domNode,"scroll",h=>d(r.domNode,!0,!1))),this._register(tt(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(102),r=t.get(74),o=t.get(40),s=t.get(105),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:r,fastScrollSensitivity:o,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+Lce(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class AJe extends Ue{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function FG(n,e){let t=0,i=0;const r=n.length;for(;i<r;){const o=n.charCodeAt(i);if(o===32)t++;else if(o===9)t=t-t%e+e;else break;i++}return i===r?-1:t}var vT;(function(n){n[n.Disabled=0]="Disabled",n[n.EnabledForActive=1]="EnabledForActive",n[n.Enabled=2]="Enabled"})(vT||(vT={}));class Qx{constructor(e,t,i,r,o,s){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=r,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=s,e!==-1==(t!==-1))throw new Error}}class OM{constructor(e,t){this.top=e,this.endColumn=t}}class Tlr extends AJe{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return FG(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const r=this.textModel.getLineCount();if(e<1||e>r)throw new Qa("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide);let a=-2,l=-1,c=-2,u=-1;const d=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,l=-1;for(let L=k-2;L>=0;L--){const D=this._computeIndentLevel(L);if(D>=0){a=L,l=D;break}}}if(c===-2){c=-1,u=-1;for(let L=k;L<r;L++){const D=this._computeIndentLevel(L);if(D>=0){c=L,u=D;break}}}};let h=-2,f=-1,g=-2,m=-1;const v=k=>{if(h===-2){h=-1,f=-1;for(let L=k-2;L>=0;L--){const D=this._computeIndentLevel(L);if(D>=0){h=L,f=D;break}}}if(g!==-1&&(g===-2||g<k-1)){g=-1,m=-1;for(let L=k;L<r;L++){const D=this._computeIndentLevel(L);if(D>=0){g=L,m=D;break}}}};let _=0,b=!0,y=0,C=!0,x=0,E=0;for(let k=0;b||C;k++){const L=e-k,D=e+k;k>1&&(L<1||L<t)&&(b=!1),k>1&&(D>r||D>i)&&(C=!1),k>5e4&&(b=!1,C=!1);let A=-1;if(b&&L>=1){const P=this._computeIndentLevel(L-1);P>=0?(c=L-1,u=P,A=Math.ceil(P/this.textModel.getOptions().indentSize)):(d(L),A=this._getIndentLevelForWhitespaceLine(s,l,u))}let O=-1;if(C&&D<=r){const P=this._computeIndentLevel(D-1);P>=0?(h=D-1,f=P,O=Math.ceil(P/this.textModel.getOptions().indentSize)):(v(D),O=this._getIndentLevelForWhitespaceLine(s,f,m))}if(k===0){E=A;continue}if(k===1){if(D<=r&&O>=0&&E+1===O){b=!1,_=D,y=D,x=O;continue}if(L>=1&&A>=0&&A-1===E){C=!1,_=L,y=L,x=A;continue}if(_=e,y=e,x=E,x===0)return{startLineNumber:_,endLineNumber:y,indent:x}}b&&(A>=x?_=L:b=!1),C&&(O>=x?y=D:C=!1)}return{startLineNumber:_,endLineNumber:y,indent:x}}getLinesBracketGuides(e,t,i,r){var o;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new J(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(J.fromPositions(i)).toArray()).filter(f=>J.strictContainsPosition(f.range,i));c=(o=rz(h,f=>a))===null||o===void 0?void 0:o.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new NJe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!r.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(r.highlightActive&&f?" "+d.activeClassName:""),m=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),_=r.horizontalGuides===vT.Enabled||r.horizontalGuides===vT.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){_&&s[h.range.startLineNumber-e].push(new Qx(-1,h.openingBracketRange.getEndPosition().column,g,new OM(!1,v.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(v),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),C=Math.min(y,b,h.minVisibleColumnIndentation+1);let x=!1;Yu(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))<h.closingBracketRange.startColumn-1&&(x=!0);const L=Math.max(m.lineNumber,e),D=Math.min(v.lineNumber,t),A=x?1:0;for(let O=L;O<D+A;O++)s[O-e].push(new Qx(C,-1,g,null,O===m.lineNumber?m.column:-1,O===v.lineNumber?v.column:-1));_&&(m.lineNumber>=e&&y>C&&s[m.lineNumber-e].push(new Qx(C,-1,g,new OM(!1,m.column),-1,-1)),v.lineNumber<=t&&b>C&&s[v.lineNumber-e].push(new Qx(C,-1,g,new OM(!x,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return yl.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const r=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let m=h-2;m>=0;m--){const v=this._computeIndentLevel(m);if(v>=0){l=m,c=v;break}}}if(u!==-1&&(u===-2||u<h-1)){u=-1,d=-1;for(let m=h;m<i;m++){const v=this._computeIndentLevel(m);if(v>=0){u=m,d=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const r=this.textModel.getOptions();return t===-1||i===-1?0:t<i?1+Math.floor(t/r.indentSize):t===i||e?Math.ceil(i/r.indentSize):1+Math.floor(i/r.indentSize)}}class NJe{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}}class klr extends iI{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(144),r=t.get(50);this._lineHeight=t.get(66),this._spaceWidth=r.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(144),r=t.get(50);return this._lineHeight=t.get(66),this._spaceWidth=r.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var t;const r=e.selections[0].getPosition();return!((t=this._primaryPosition)===null||t===void 0)&&t.equals(r)?!1:(this._primaryPosition=r,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,r,o;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const s=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=e.scrollWidth,c=this._lineHeight,u=this._primaryPosition,d=this.getGuidesByLine(s,Math.min(a+1,this._context.viewModel.getLineCount()),u),h=[];for(let f=s;f<=a;f++){const g=f-s,m=d[g];let v="";const _=(i=(t=e.visibleRangeForPosition(new De(f,1)))===null||t===void 0?void 0:t.left)!==null&&i!==void 0?i:0;for(const b of m){const y=b.column===-1?_+(b.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new De(f,b.column)).left;if(y>l||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const C=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",x=b.horizontalLine?((o=(r=e.visibleRangeForPosition(new De(f,b.horizontalLine.endColumn)))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;v+=`<div class="core-guide ${b.className} ${C}" style="left:${y}px;height:${c}px;width:${x}px"></div>`}h[g]=v}this._renderResult=h}getGuidesByLine(e,t,i){const r=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?vT.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?vT.EnabledForActive:vT.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const d=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const f=r?r[d-e]:[],g=new y1(f),m=o?o[d-e]:0;for(let v=1;v<=m;v++){const _=(v-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&v===l;h.push(...g.takeWhile(C=>C.visibleColumn<_)||[]);const y=g.peek();(!y||y.visibleColumn!==_||y.horizontalLine)&&h.push(new Qx(_,-1,`core-guide-indent lvl-${(v-1)%30}`+(b?" indent-active":""),null,-1,-1))}h.push(...g.takeWhile(v=>!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function n2(n){if(!(n&&n.isTransparent()))return n}e_((n,e)=>{const t=[{bracketColor:vJe,guideColor:Far,guideColorActive:zar},{bracketColor:bJe,guideColor:Bar,guideColorActive:Uar},{bracketColor:yJe,guideColor:$ar,guideColorActive:jar},{bracketColor:CJe,guideColor:Var,guideColorActive:qar},{bracketColor:wJe,guideColor:Har,guideColorActive:Kar},{bracketColor:SJe,guideColor:War,guideColorActive:Gar}],i=new NJe,r=[{indentColor:N6,indentColorActive:R6},{indentColor:bar,indentColorActive:Ear},{indentColor:yar,indentColorActive:xar},{indentColor:Car,indentColorActive:Tar},{indentColor:war,indentColorActive:kar},{indentColor:Sar,indentColorActive:Iar}],o=t.map(a=>{var l,c;const u=n.getColor(a.bracketColor),d=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=n2((l=n2(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=n2((c=n2(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(m3),s=r.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),u=n2(l),d=n2(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(m3);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class fte{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class Ilr{constructor(){this._currentVisibleRange=new J(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Llr{constructor(e,t,i,r,o,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=r,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Dlr{constructor(e,t,i,r,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=r,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l<c;l++){const u=t[l];s=Math.min(s,u.startLineNumber),a=Math.max(a,u.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=a}}class BG extends nf{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new IJe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,r=this._context.configuration.options,o=r.get(50),s=r.get(144);this._lineHeight=r.get(66),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=r.get(99),this._cursorSurroundingLines=r.get(29),this._cursorSurroundingLinesStyle=r.get(30),this._canUseLayerHinting=!r.get(32),this._viewLineOptions=new MOe(i,this._context.theme.type),d0.write(this.domNode,7),this.domNode.setClassName(`view-lines ${sD}`),Zc(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new $o(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new $o(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Ilr,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(114).enabled,this._maxNumberStickyLines=r.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new bb(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),r=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Zc(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new MOe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=i;o<=r;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let r=!1;for(let o=t;o<=i;o++)r=this._visibleLines.getVisibleLine(o).onSelectionChanged()||r;return r}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let r=t;r<=i;r++)this._visibleLines.getVisibleLine(r).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Llr(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Dlr(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const r=this._getLineNumberFor(i);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new De(r,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(r<o||r>s)return null;let a=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(r);return a<l&&(a=l),new De(r,a)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===bb.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let r=t;r<=i;r++){const o=this._visibleLines.getVisibleLine(r);if(e===o.getDomNode())return r}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return-1;const r=new fte(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,r=J.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const o=[];let s=0;const a=new fte(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new De(r.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=r.startLineNumber;d<=r.endLineNumber;d++){if(d<c||d>u)continue;const h=d===r.startLineNumber?r.startColumn:1,f=d!==r.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):r.endColumn,m=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(m){if(t&&d<i){const v=l;l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new De(d+1,1)).lineNumber,v!==l&&(m.ranges[m.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new Bsr(m.outsideRenderedLine,d,NG.from(m.ranges),f)}}return this._updateLineWidthsSlowIfDomDidLayout(a),s===0?null:o}_visibleRangesForLineRange(e,t,i){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const r=new fte(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new $sr(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let r=1,o=!0;for(let s=t;s<=i;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){o=!1;continue}r=Math.max(r,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=i;o<=r;o++){const s=this._visibleLines.getVisibleLine(o);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=r;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const r=this._computeScrollLeftToReveal(i);r&&(this._isViewportWrapping||this._ensureMaxLineWidth(r.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:r.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Zu&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=i;o<=r;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,r,o,s){const a=e.top,l=e.height,c=a+l;let u,d,h;if(o&&o.length>0){let _=o[0].startLineNumber,b=o[0].endLineNumber;for(let y=1,C=o.length;y<C;y++){const x=o[y];_=Math.min(_,x.startLineNumber),b=Math.max(b,x.endLineNumber)}u=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(_),h=this._context.viewLayout.getVerticalOffsetForLineNumber(b)+this._lineHeight}else if(r)u=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber),h=this._context.viewLayout.getVerticalOffsetForLineNumber(r.endLineNumber)+this._lineHeight;else return-1;const f=(t==="mouse"||i)&&this._cursorSurroundingLinesStyle==="default";let g=0,m=0;if(f)i||(g=this._lineHeight);else{const _=Math.min(l/this._lineHeight/2,this._cursorSurroundingLines);this._stickyScrollEnabled?g=Math.max(_,this._maxNumberStickyLines)*this._lineHeight:g=_*this._lineHeight,m=Math.max(0,_-1)*this._lineHeight}i||(s===0||s===4)&&(m+=this._lineHeight),d-=g,h+=m;let v;if(h-d>l){if(!u)return-1;v=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)v=a;else{const _=Math.max(5*this._lineHeight,l*.2),b=d-_,y=h-l;v=Math.max(y,b)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)v=a;else{const _=(d+h)/2;v=Math.max(0,_-l/2)}else v=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),r=t.left,o=r+t.width-i.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-BG.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(r,o,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,r,o,s){e=e|0,t=t|0,i=i|0,r=r|0,o=!!o,s=!!s;const a=t-e;if(r-i<a){if(o)return i;if(s)return Math.max(0,r-a);if(i<e)return i;if(r>t)return Math.max(0,r-a)}else return i;return e}}BG.HORIZONTAL_EXTRA_PX=30;class Nce{constructor(e,t,i,r){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=r??0}}class Alr{constructor(e,t){this.className=e,this.zIndex=t}}class Nlr{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class RJe extends iI{_render(e,t,i){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new Nlr}if(i.length===0)return r;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.className<l.className?-1:1);let o=null,s=0;for(let a=0,l=i.length;a<l;a++){const c=i[a],u=c.className,d=c.zIndex;let h=Math.max(c.startLineNumber,e)-e;const f=Math.min(c.endLineNumber,t)-e;o===u?(h=Math.max(s+1,h),s=Math.max(s,f)):(o=u,s=f);for(let g=h;g<=s;g++)r[g].add(new Alr(u,d))}return r}}class Rlr extends nf{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(143);this.domNode=io(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(66),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){const t=io(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference.lane===t.lane&&i.preference.zIndex===t.zIndex&&J.equalsRange(i.preference.range,t.range)?!1:(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){var t;const i=e.getId();if(this._widgets[i]){const o=this._widgets[i].domNode.domNode;delete this._widgets[i],(t=o.parentNode)===null||t===void 0||t.removeChild(o),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){var i,r,o;const s=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=e.getDecorationsInViewport();for(const c of l){const u=c.options.glyphMarginClassName;if(!u)continue;const d=Math.max(c.range.startLineNumber,s),h=Math.min(c.range.endLineNumber,a),f=Math.min((r=(i=c.options.glyphMargin)===null||i===void 0?void 0:i.position)!==null&&r!==void 0?r:1,this._glyphMarginDecorationLaneCount),g=(o=c.options.zIndex)!==null&&o!==void 0?o:0;for(let m=d;m<=h;m++)t.push(new Olr(m,f,g,u))}}_collectWidgetBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(const o of Object.values(this._widgets)){const s=o.preference.range;if(s.endLineNumber<i||s.startLineNumber>r)continue;const a=Math.max(s.startLineNumber,i),l=Math.min(o.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new Plr(a,l,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,r)=>i.lineNumber===r.lineNumber?i.lane===r.lane?i.zIndex===r.zIndex?r.type===i.type?i.type===0&&r.type===0?i.className<r.className?-1:1:0:r.type-i.type:r.zIndex-i.zIndex:i.lane-r.lane:i.lineNumber-r.lineNumber),t}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(const r of Object.values(this._widgets))r.renderInfo=null;const t=new y1(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){const r=t.peek();if(!r)break;const o=t.takeWhile(a=>a.lineNumber===r.lineNumber&&a.lane===r.lane);if(!o||o.length===0)break;const s=o[0];if(s.type===0){const a=[];for(const l of o){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const r=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(r),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;i<this._decorationGlyphsToRender.length;i++){const r=this._decorationGlyphsToRender[i],o=e.viewportData.relativeVerticalOffset[r.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+(r.lane-1)*this._lineHeight;let a;i<this._managedDomNodes.length?a=this._managedDomNodes[i]:(a=io(document.createElement("div")),this._managedDomNodes.push(a),this.domNode.appendChild(a)),a.setClassName("cgmr codicon "+r.combinedClassName),a.setPosition("absolute"),a.setTop(o),a.setLeft(s),a.setWidth(t),a.setHeight(this._lineHeight)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class Olr{constructor(e,t,i,r){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=r,this.type=0}accept(e){return new Mlr(this.lineNumber,this.lane,e)}}class Plr{constructor(e,t,i,r){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=r,this.type=1}}class Mlr{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class Flr extends RJe{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(143);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let r=0;for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.options.linesDecorationsClassName,c=a.options.zIndex;l&&(i[r++]=new Nce(a.range.startLineNumber,a.range.endLineNumber,l,c));const u=a.options.firstLineDecorationClassName;u&&(i[r++]=new Nce(a.range.startLineNumber,a.range.startLineNumber,u,c))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=this._render(t,i,this._getDecorations(e)),o=this._decorationsLeft.toString(),s=this._decorationsWidth.toString(),a='" style="left:'+o+"px;width:"+s+'px;"></div>',l=[];for(let c=t;c<=i;c++){const u=c-t,d=r[u].getDecorations();let h="";for(const f of d)h+='<div class="cldr '+f.className+a;l[u]=h}this._renderResult=l}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Blr extends RJe{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let r=0;for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.options.marginClassName,c=a.options.zIndex;l&&(i[r++]=new Nce(a.range.startLineNumber,a.range.endLineNumber,l,c))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=this._render(t,i,this._getDecorations(e)),o=[];for(let s=t;s<=i;s++){const a=s-t,l=r[a].getDecorations();let c="";for(const u of l)c+='<div class="cmdr '+u.className+'" style=""></div>';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class eg{constructor(e,t,i,r){this._rgba8Brand=void 0,this.r=eg._clamp(e),this.g=eg._clamp(t),this.b=eg._clamp(i),this.a=eg._clamp(r)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}eg.Empty=new eg(0,0,0,0);class P6 extends Ue{static getInstance(){return this._INSTANCE||(this._INSTANCE=new P6),this._INSTANCE}constructor(){super(),this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ks.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Ks.getColorMap();if(!e){this._colors=[eg.Empty],this._backgroundIsLight=!0;return}this._colors=[eg.Empty];for(let i=1;i<e.length;i++){const r=e[i].rgba;this._colors[i]=new eg(r.r,r.g,r.b,Math.round(r.a*255))}const t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}P6._INSTANCE=null;const $lr=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),Vlr=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class U3{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=U3.soften(e,12/15),this.charDataLight=U3.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let r=0,o=e.length;r<o;r++)i[r]=tz(e[r]*t);return i}renderChar(e,t,i,r,o,s,a,l,c,u,d){const h=1*this.scale,f=2*this.scale,g=d?1:f;if(t+h>e.width||i+g>e.height){console.warn("bad render request outside image data");return}const m=u?this.charDataLight:this.charDataNormal,v=Vlr(r,c),_=e.width*4,b=a.r,y=a.g,C=a.b,x=o.r-b,E=o.g-y,k=o.b-C,L=Math.max(s,l),D=e.data;let A=v*h*f,O=i*_+t*4;for(let P=0;P<g;P++){let F=O;for(let B=0;B<h;B++){const M=m[A++]/255*(s/255);D[F++]=b+x*M,D[F++]=y+E*M,D[F++]=C+k*M,D[F++]=L}O+=_}}blockRenderChar(e,t,i,r,o,s,a,l){const c=1*this.scale,u=2*this.scale,d=l?1:u;if(t+c>e.width||i+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=s.r,m=s.g,v=s.b,_=r.r-g,b=r.g-m,y=r.b-v,C=g+_*f,x=m+b*f,E=v+y*f,k=Math.max(o,a),L=e.data;let D=i*h+t*4;for(let A=0;A<d;A++){let O=D;for(let P=0;P<c;P++)L[O++]=C,L[O++]=x,L[O++]=E,L[O++]=k;D+=h}}}const qOe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},KOe=n=>{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t<n.length;t+=2)e[t>>1]=qOe[n[t]]<<4|qOe[n[t+1]]&15;return e},GOe={1:gS(()=>KOe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:gS(()=>KOe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class PM{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return GOe[e]?i=new U3(GOe[e](),e):i=PM.createFromSampleData(PM.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let r=0;for(const o of $lr)i.fillText(String.fromCharCode(o),r,16/2),r+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const r=PM._downsample(e,t);return new U3(r,t)}static _downsampleChar(e,t,i,r,o){const s=1*o,a=2*o;let l=r,c=0;for(let u=0;u<a;u++){const d=u/a*16,h=(u+1)/a*16;for(let f=0;f<s;f++){const g=f/s*10,m=(f+1)/s*10;let v=0,_=0;for(let y=d;y<h;y++){const C=t+Math.floor(y)*3840,x=1-(y-Math.floor(y));for(let E=g;E<m;E++){const k=1-(E-Math.floor(E)),L=C+Math.floor(E)*4,D=k*x;_+=D,v+=e[L]*e[L+3]/255*D}}const b=v/_;c=Math.max(c,b),i[l++]=tz(b)}}return c}static _downsample(e,t){const i=2*t*1*t,r=i*96,o=new Uint8ClampedArray(r);let s=0,a=0,l=0;for(let c=0;c<96;c++)l=Math.max(l,this._downsampleChar(e,a,o,s,t)),s+=i,a+=10*4;if(l>0){const c=255/l;for(let u=0;u<r;u++)o[u]*=c}return o}}const Hlr=140,Wlr=2;class j3{constructor(e,t,i){const r=e.options,o=r.get(141),s=r.get(143),a=s.minimap,l=r.get(50),c=r.get(72);this.renderMinimap=a.renderMinimap,this.size=c.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=r.get(104),this.paddingTop=r.get(83).top,this.paddingBottom=r.get(83).bottom,this.showSlider=c.showSlider,this.autohide=c.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=r.get(66),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=s.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=gS(()=>PM.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=j3._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=j3._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(wsr);return i?new eg(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Ssr);return t?eg._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class MM{constructor(e,t,i,r,o,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=r,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,r,o,s,a,l,c,u,d){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let E=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(E+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/E)),L=Math.max(0,e.minimapHeight-k),D=L/(u-o),A=c*D,O=L>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),F=Math.floor(e.paddingTop/e.lineHeight);return new MM(c,u,O,D,A,k,F,1,Math.min(a,P))}let v;if(s&&i!==a){const E=i-t+1;v=Math.floor(E*f/h)}else{const E=o/m;v=Math.floor(E*f/h)}const _=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const E=o/m;b=Math.max(b,E-1)}let y;if(b>0){const E=o/m;y=(_+a+b-E-1)*f/h}else y=Math.max(0,(_+a)*f/h-v);y=Math.min(e.minimapHeight-v,y);const C=y/(u-o),x=c*C;if(g>=_+a+b){const E=y>0;return new MM(c,u,E,C,x,v,_,1,a)}else{let E;t>1?E=t+_:E=Math.max(1,c/m);let k,L=Math.max(1,Math.floor(E-x*h/f));L<_?(k=_-L+1,L=1):(k=0,L=Math.max(1,L-_)),d&&d.scrollHeight===u&&(d.scrollTop>c&&(L=Math.min(L,d.startLineNumber),k=Math.max(k,d.topPaddingLineCount)),d.scrollTop<c&&(L=Math.max(L,d.startLineNumber),k=Math.min(k,d.topPaddingLineCount)));const D=Math.min(a,L-k+g-1),A=(c-r)/m;let O;return c>=e.paddingTop?O=(t-L+k+A)*f/h:O=c/e.paddingTop*(k+A)*f/h,new MM(c,u,!0,C,O,v,k,L,D)}}}class mz{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}mz.INVALID=new mz(-1);class YOe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new kJe(()=>mz.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let r=0,o=i.length;r<o;r++)if(i[r].dy===-1)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class G0e{constructor(e,t,i,r){this._backgroundFillData=G0e._createBackgroundFillData(t,i,r),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const r=i.r,o=i.g,s=i.b,a=i.a,l=new Uint8ClampedArray(e*t*4);let c=0;for(let u=0;u<t;u++)for(let d=0;d<e;d++)l[c]=r,l[c+1]=o,l[c+2]=s,l[c+3]=a,c+=4;return l}}class q3{static compute(e,t,i){if(e.renderMinimap===0||!e.isSampling)return[null,[]];const{minimapLineCount:r}=YL.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=t/r,s=o/2;if(!i||i.minimapLines.length===0){const v=[];if(v[0]=1,r>1){for(let _=0,b=r-1;_<b;_++)v[_]=Math.round(_*o+s);v[r-1]=t}return[new q3(o,v),[]]}const a=i.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],m=null;for(let v=0;v<r;v++){const _=Math.max(h,Math.round(v*o)),b=Math.max(_,Math.round((v+1)*o));for(;u<l&&a[u]<_;){if(g.length<f){const C=u+1+d;m&&m.type==="deleted"&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:u,deleteFromLineNumber:C,deleteToLineNumber:C},g.push(m)),d--}u++}let y;if(u<l&&a[u]<=b)y=a[u],u++;else if(v===0?y=1:v+1===r?y=t:y=Math.round(v*o+s),g.length<f){const C=u+1+d;m&&m.type==="inserted"&&m._i===v-1?m.insertToLineNumber++:(m={type:"inserted",_i:v,insertFromLineNumber:C,insertToLineNumber:C},g.push(m)),d++}c[v]=y,h=y}if(g.length<f)for(;u<l;){const v=u+1+d;m&&m.type==="deleted"&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:u,deleteFromLineNumber:v,deleteToLineNumber:v},g.push(m)),d--,u++}else g=[{type:"flush"}];return[new q3(o,c),g]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1<this.minimapLines.length&&this.minimapLines[r+1]<=t;)r++;if(i===r){const o=this.minimapLines[i];if(o<e||o>t)return null}return[i+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===i&&(r===this.minimapLines.length?i>1&&i--:r++),[i,r]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,r=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),r=Math.max(r,o)):this.minimapLines[o]-=t;return[i,r]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class zlr extends nf{constructor(e){super(e),this.tokensColorTracker=P6.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new j3(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=q3.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new _z(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new j3(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return e.affectsMinimap?this._actual.onDecorationsChanged():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return t?this._actual.onLinesChanged(t[0],t[1]-t[0]+1):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}else return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const i of e.ranges){const r=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);r&&t.push({fromLineNumber:r[0],toLineNumber:r[1]})}return t.length?this._actual.onTokensChanged(t):!1}else return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const r={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=q3.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const r of i)switch(r.type){case"deleted":this._actual.onLinesDeleted(r.deleteFromLineNumber,r.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(r.insertFromLineNumber,r.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const r=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?r[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):r[o]=null;return r}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new kn(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const o=this._samplingState.minimapLines[e-1],s=this._samplingState.minimapLines[t-1];i=new J(o,1,s,this._context.viewModel.getLineMaxColumn(s))}else i=new J(e,1,t,this._context.viewModel.getLineMaxColumn(t));const r=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const o=[];for(const s of r){if(!s.options.minimap)continue;const a=s.range,l=this._samplingState.modelLineToMinimapLine(a.startLineNumber),c=this._samplingState.modelLineToMinimapLine(a.endLineNumber);o.push(new qZe(new J(l,a.startColumn,c,a.endColumn),s.options))}return o}return r}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new J(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class _z extends Ue{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(NOe),this._domNode=io(document.createElement("div")),d0.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=io(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=io(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=io(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=io(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=io(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=$a(this._domNode.domNode,Yt.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=pl(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(i,u,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(s/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new sR,this._sliderPointerDownListener=$a(this._slider.domNode,Yt.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Zo.addTarget(this._domNode.domNode),this._sliderTouchStartListener=tt(this._domNode.domNode,Jo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=tt(this._domNode.domNode,Jo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=$a(this._domNode.domNode,Jo.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const r=e.pageX;this._slider.toggleClassName("active",!0);const o=(s,a)=>{const l=pl(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(eu&&c>Hlr){this._model.setScrollTop(i.scrollTop);return}const u=s-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&o(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>o(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new G0e(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(NOe),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=MM.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(J.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:r,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,r,o);const u=new QOe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,i,u,e,s);const d=new QOe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,r),this._renderDecorationsHighlights(c,i,d,e,s,l,a,r)}}_renderSelectionLineHighlights(e,t,i,r,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=r.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let g=u;g<=d;g++)i.set(g,!0);const h=r.getYForLineNumber(u,o),f=r.getYForLineNumber(d,o);a>=h||(a>s&&e.fillRect(pC,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(pC,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,i,r,o){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==jh.Inline)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let m=d;m<=h;m++){if(i.has(m))continue;i.set(m,!0);const v=r.getYForLineNumber(d,o);e.fillRect(pC,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,r,o,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=r.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let f=d;f<=h;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,r,f,o,o,s,a,l)}}_renderDecorationsHighlights(e,t,i,r,o,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=r.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let m=h;m<=f;m++)switch(u.position){case jh.Inline:this.renderDecorationOnLine(e,i,c.range,g,r,m,o,o,s,a,l);continue;case jh.Gutter:{const v=r.getYForLineNumber(m,o),_=2;this.renderDecoration(e,g,_,v,Wlr,o);continue}}}}renderDecorationOnLine(e,t,i,r,o,s,a,l,c,u,d){const h=o.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=i,m=f===s?i.startColumn:1,v=g===s?i.endColumn:this._model.getLineMaxColumn(s),_=this.getXOffsetForPosition(t,s,m,c,u,d),b=this.getXOffsetForPosition(t,s,v,c,u,d);this.renderDecoration(e,r,_,h,b-_,a)}getXOffsetForPosition(e,t,i,r,o,s){if(i===1)return pC;if((i-1)*o>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[pC];let u=pC;for(let d=1;d<c.length+1;d++){const h=c.charCodeAt(d-1),f=h===9?r*o:mS(h)?2*o:o,g=u+f;if(g>=s){l[d]=s;break}l[d]=g,u=g}e.set(t,l)}return i-1<l.length?l[i-1]:s}renderDecoration(e,t,i,r,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,r,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,r=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const M=this._lastRenderData._get();return new YOe(e,M.imageData,M.lines)}const o=this._getBuffer();if(!o)return null;const[s,a,l]=_z._renderUntouchedLines(o,e.topPaddingLineCount,t,i,r,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),u=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,h=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),v=this._model.options.renderMinimap,_=this._model.options.charRenderer(),b=this._model.options.fontScale,y=this._model.options.minimapCharWidth,x=(v===1?2:2+1)*b,E=r>x?Math.floor((r-x)/2):0,k=h.a/255,L=new eg(Math.round((h.r-d.r)*k+d.r),Math.round((h.g-d.g)*k+d.g),Math.round((h.b-d.b)*k+d.b),255);let D=e.topPaddingLineCount*r;const A=[];for(let M=0,V=i-t+1;M<V;M++)l[M]&&_z._renderLine(o,L,h.a,m,v,y,g,f,_,D,E,u,c[M],b,r),A[M]=new mz(D),D+=r;const O=s===-1?0:s,F=(a===-1?o.height:a)-O;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,O,o.width,F),new YOe(e,o,A)}static _renderUntouchedLines(e,t,i,r,o,s){const a=[];if(!s){for(let D=0,A=r-i+1;D<A;D++)a[D]=!0;return[-1,-1,a]}const l=s._get(),c=l.imageData.data,u=l.rendLineNumberStart,d=l.lines,h=d.length,f=e.width,g=e.data,m=(r-i+1)*o*f*4;let v=-1,_=-1,b=-1,y=-1,C=-1,x=-1,E=t*o;for(let D=i;D<=r;D++){const A=D-i,O=D-u,P=O>=0&&O<h?d[O].dy:-1;if(P===-1){a[A]=!0,E+=o;continue}const F=P*f*4,B=(P+o)*f*4,M=E*f*4,V=(E+o)*f*4;y===F&&x===M?(y=B,x=V):(b!==-1&&(g.set(c.subarray(b,y),C),v===-1&&b===0&&b===C&&(v=y),_===-1&&y===m&&b===C&&(_=b)),b=F,y=B,C=M,x=V),a[A]=!1,E+=o}b!==-1&&(g.set(c.subarray(b,y),C),v===-1&&b===0&&b===C&&(v=y),_===-1&&y===m&&b===C&&(_=b));const k=v===-1?-1:v/(f*4),L=_===-1?-1:_/(f*4);return[k,L,a]}static _renderLine(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m){const v=f.content,_=f.tokens,b=e.width-s,y=m===1;let C=pC,x=0,E=0;for(let k=0,L=_.getCount();k<L;k++){const D=_.getEndOffset(k),A=_.getForeground(k),O=a.getColor(A);for(;x<D;x++){if(C>b)return;const P=v.charCodeAt(x);if(P===9){const F=h-(x+E)%h;E+=F-1,C+=F*s}else if(P===32)C+=s;else{const F=mS(P)?2:1;for(let B=0;B<F;B++)if(o===2?c.blockRenderChar(e,C,u+d,O,l,t,i,y):c.renderChar(e,C,u+d,P,O,l,t,i,g,r,y),C+=s,C>b)return}}}}}class QOe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let r=0,o=this._endLineNumber-this._startLineNumber+1;r<o;r++)this._values[r]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class Ulr extends nf{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=io(document.createElement("div")),d0.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=io(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const r=this._widgets[t].domNode.domNode;delete this._widgets[t],r.parentNode.removeChild(r),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const r=Object.keys(this._widgets);for(let o=0,s=r.length;o<s;o++){const a=r[o],c=(t=(e=this._widgets[a].widget).getMinContentWidthInPx)===null||t===void 0?void 0:t.call(e);typeof c<"u"&&(i=Math.max(i,c))}this._context.viewLayout.setOverlayWidgetsMinWidth(i)}_renderWidget(e){const t=e.domNode;if(e.preference===null){t.setTop("");return}if(e.preference===0)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(e.preference===1){const i=t.domNode.clientHeight;t.setTop(this._editorHeight-i-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else e.preference===2&&(t.setTop(0),t.domNode.style.right="50%")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,r=t.length;i<r;i++){const o=t[i];this._renderWidget(this._widgets[o])}}}class jlr{constructor(e,t){const i=e.options;this.lineHeight=i.get(66),this.pixelRatio=i.get(141),this.overviewRulerLanes=i.get(82),this.renderBorder=i.get(81);const r=t.getColor(Dar);this.borderColor=r?r.toString():null,this.hideCursor=i.get(59);const o=t.getColor(mJe);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const s=i.get(72),a=s.enabled,l=s.side,c=t.getColor(Aar),u=Ks.getDefaultBackground();c?this.backgroundColor=c:a&&l==="right"?this.backgroundColor=u:this.backgroundColor=null;const h=i.get(143).overviewRuler;this.top=h.top,this.right=h.right,this.domWidth=h.width,this.domHeight=h.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[f,g]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=f,this.w=g}_initLanes(e,t,i){const r=t-e;if(i>=3){const o=Math.floor(r/3),s=Math.floor(r/3),a=r-o-s,l=e,c=l+o,u=l+o+a;return[[0,l,c,l,u,l,c,l],[0,o,a,o+a,s,o+a+s,a+s,o+a+s]]}else if(i===2){const o=Math.floor(r/2),s=r-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,s,o+s,o+s,o+s]]}else{const o=e,s=r;return[[0,o,o,o,o,o,o,o],[0,s,s,s,s,s,s,s]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&ze.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class qlr extends nf{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=io(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Ks.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jlr(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(De.compare),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?ze.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(O3.compareByRenderingProps),this._actualShouldRender===1&&!O3.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!Ia(this._renderedCursorPositions,this._cursorPositions,(g,m)=>g.lineNumber===m.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,r=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=r/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=ze.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):(d.clearRect(0,0,i,r),d.fillStyle=ze.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):d.clearRect(0,0,i,r);const h=this._settings.x,f=this._settings.w;for(const g of t){const m=g.color,v=g.data;d.fillStyle=m;let _=0,b=0,y=0;for(let C=0,x=v.length/3;C<x;C++){const E=v[3*C],k=v[3*C+1],L=v[3*C+2];let D=s.getVerticalOffsetForLineNumber(k)*l|0,A=(s.getVerticalOffsetForLineNumber(L)+o)*l|0;if(A-D<c){let P=(D+A)/2|0;P<u?P=u:P+u>r&&(P=r-u),D=P-u,A=P+u}D>y+1||E!==_?(C!==0&&d.fillRect(h[_],b,f[_],y-b),_=E,b=D,y=A):A>y&&(y=A)}d.fillRect(h[_],b,f[_],y-b)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,m=g/2|0,v=this._settings.x[7],_=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let b=-100,y=-100;for(let C=0,x=this._cursorPositions.length;C<x;C++){const E=this._cursorPositions[C];let k=s.getVerticalOffsetForLineNumber(E.lineNumber)*l|0;k<m?k=m:k+m>r&&(k=r-m);const L=k-m,D=L+g;L>y+1?(C!==0&&d.fillRect(v,b,_,y-b),b=L,y=D):D>y&&(y=D)}d.fillRect(v,b,_,y-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,r),d.stroke(),d.moveTo(0,0),d.lineTo(i,0),d.stroke())}}class XOe{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class OJe{constructor(e,t,i,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=r,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class Klr{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(OJe.compare)}setLineHeight(e){return this._lineHeight===e?!1:(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth===e?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),r=Math.floor(this._outerHeight),o=i/r,s=Math.floor(4*this._pixelRatio/2),a=[];for(let l=0,c=this._zones.length;l<c;l++){const u=this._zones[l];if(!e){const C=u.getColorZones();if(C){a.push(C);continue}}const d=this._getVerticalOffsetForLine(u.startLineNumber),h=u.heightInLines===0?this._getVerticalOffsetForLine(u.endLineNumber)+t:d+u.heightInLines*t,f=Math.floor(o*d),g=Math.floor(o*h);let m=Math.floor((f+g)/2),v=g-m;v<s&&(v=s),m-v<0&&(m=v),m+v>i&&(m=i-v);const _=u.color;let b=this._color2Id[_];b||(b=++this._lastAssignedId,this._color2Id[_]=b,this._id2Color[b]=_);const y=new XOe(m-v,m+v,b);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(XOe.compare),a}}class Glr extends L6{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=io(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Klr(r=>this._context.viewLayout.getVerticalOffsetForLineNumber(r)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,r,e),!0}_renderOneLane(e,t,i,r){let o=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==o?(e.fillRect(0,s,r,a-s),o=c,e.fillStyle=i[o],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,r,a-s),s=u,a=d)}e.fillRect(0,s,r,a-s)}}class Ylr extends nf{constructor(e){super(e),this.domNode=io(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:r}=this._context.viewModel.model.getOptions(),o=r;let s=t-e;for(;s>0;){const a=io(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let i=e-t;for(;i>0;){const r=this._renderedRulers.pop();this.domNode.removeChild(r),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const r=this._renderedRulers[t],o=this._rulers[t];r.setBoxShadow(o.color?`1px 0 0 0 ${o.color} inset`:""),r.setHeight(Math.min(e.scrollHeight,1e6)),r.setLeft(o.column*this._typicalHalfwidthCharacterWidth)}}}class Qlr extends nf{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const i=this._context.configuration.options.get(102);this._useShadows=i.useShadows,this._domNode=io(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(143);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(102);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class Xlr{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Zlr{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Jlr(n){return new Xlr(n)}function ecr(n){return new Zlr(n.lineNumber,n.ranges.map(Jlr))}class Ca extends iI{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const r=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c<i.length;c++)i[c].lineNumber===a&&(o=i[c].ranges[0]);const l=t[t.length-1].lineNumber;if(l===e.endLineNumber)for(let c=i.length-1;!s&&c>=0;c--)i[c].lineNumber===l&&(s=i[c].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a<l;a++){const c=t[a].ranges[0],u=c.left,d=c.left+c.width,h={top:0,bottom:0},f={top:0,bottom:0};if(a>0){const g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;z9(u-g)<r?h.top=2:u>g&&(h.top=1),z9(d-m)<r?f.top=2:g<d&&d<m&&(f.top=1)}else o&&(h.top=o.startStyle.top,f.top=o.endStyle.top);if(a+1<l){const g=t[a+1].ranges[0].left,m=t[a+1].ranges[0].left+t[a+1].ranges[0].width;z9(u-g)<r?h.bottom=2:g<u&&u<m&&(h.bottom=1),z9(d-m)<r?f.bottom=2:d<m&&(f.bottom=1)}else s&&(h.bottom=s.startStyle.bottom,f.bottom=s.endStyle.bottom);c.startStyle=h,c.endStyle=f}}_getVisibleRangesWithStyle(e,t,i){const o=(t.linesVisibleRangesForRange(e,!0)||[]).map(ecr);return!this._visibleRangesHaveGaps(o)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,o,i),o}_createSelectionPiece(e,t,i,r,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+r.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,r){if(r.length===0)return;const o=!!r[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=r[0].lineNumber,c=r[r.length-1].lineNumber;for(let u=0,d=r.length;u<d;u++){const h=r[u],f=h.lineNumber,g=f-t,m=i&&(f===c||f===l)?a:s,v=i&&f===l?1:0;let _="",b="";for(let y=0,C=h.ranges.length;y<C;y++){const x=h.ranges[y];if(o){const k=x.startStyle,L=x.endStyle;if(k.top===1||k.bottom===1){_+=this._createSelectionPiece(v,m,Ca.SELECTION_CLASS_NAME,x.left-Ca.ROUNDED_PIECE_WIDTH,Ca.ROUNDED_PIECE_WIDTH);let D=Ca.EDITOR_BACKGROUND_CLASS_NAME;k.top===1&&(D+=" "+Ca.SELECTION_TOP_RIGHT),k.bottom===1&&(D+=" "+Ca.SELECTION_BOTTOM_RIGHT),_+=this._createSelectionPiece(v,m,D,x.left-Ca.ROUNDED_PIECE_WIDTH,Ca.ROUNDED_PIECE_WIDTH)}if(L.top===1||L.bottom===1){_+=this._createSelectionPiece(v,m,Ca.SELECTION_CLASS_NAME,x.left+x.width,Ca.ROUNDED_PIECE_WIDTH);let D=Ca.EDITOR_BACKGROUND_CLASS_NAME;L.top===1&&(D+=" "+Ca.SELECTION_TOP_LEFT),L.bottom===1&&(D+=" "+Ca.SELECTION_BOTTOM_LEFT),_+=this._createSelectionPiece(v,m,D,x.left+x.width,Ca.ROUNDED_PIECE_WIDTH)}}let E=Ca.SELECTION_CLASS_NAME;if(o){const k=x.startStyle,L=x.endStyle;k.top===0&&(E+=" "+Ca.SELECTION_TOP_LEFT),k.bottom===0&&(E+=" "+Ca.SELECTION_BOTTOM_LEFT),L.top===0&&(E+=" "+Ca.SELECTION_TOP_RIGHT),L.bottom===0&&(E+=" "+Ca.SELECTION_BOTTOM_RIGHT)}b+=this._createSelectionPiece(v,m,E,x.left,x.width)}e[g][0]+=_,e[g][1]+=b}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let s=i;s<=r;s++){const a=s-i;t[a]=["",""]}const o=[];for(let s=0,a=this._selections.length;s<a;s++){const l=this._selections[s];if(l.isEmpty()){o[s]=null;continue}const c=this._getVisibleRangesWithStyle(l,e,this._previousFrameVisibleRangesWithStyle[s]);o[s]=c,this._actualRenderOneSelection(t,i,this._selections.length>1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Ca.SELECTION_CLASS_NAME="selected-text";Ca.SELECTION_TOP_LEFT="top-left-radius";Ca.SELECTION_BOTTOM_LEFT="bottom-left-radius";Ca.SELECTION_TOP_RIGHT="top-right-radius";Ca.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Ca.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Ca.ROUNDED_PIECE_WIDTH=10;e_((n,e)=>{const t=n.getColor(Ior);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function z9(n){return n<0?-n:n}class ZOe{constructor(e,t,i,r,o,s,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=r,this.height=o,this.textContent=s,this.textContentClassName=a}}class JOe{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=io(document.createElement("div")),this._domNode.setClassName(`cursor ${sD}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Zc(this._domNode,i),this._domNode.setDisplay("none"),this._position=new De(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Zc(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[r,o]=fer(i,t-1);return[new De(e,r+1),i.substring(r,o)]}_prepareRender(e){let t="",i="";const[r,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Cc.Line||this._cursorStyle===Cc.LineThin){const h=e.visibleRangeForPosition(r);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===Cc.Line?(f=ARe(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(r))):f=ARe(1);let g=h.left,m=0;f>=2&&g>=1&&(m=1,g-=m);const v=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new ZOe(v,g,m,f,this._lineHeight,t,i)}const s=e.linesVisibleRangesForRange(new J(r.lineNumber,r.column,r.lineNumber,r.column+o.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Cc.Block&&(t=o,i=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Cc.Underline||this._cursorStyle===Cc.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new ZOe(u,l.left,0,c,d,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${sD} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class K3 extends nf{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new JOe(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=io(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Zm,this._cursorFlatBlinkInterval=new S6,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,r=this._secondaryCursors.length;i<r;i++)this._secondaryCursors[i].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const r=this._secondaryCursors.length!==t.length||this._cursorSmoothCaretAnimation==="explicit"&&i!==3;if(this._primaryCursor.onCursorPositionChanged(e,r),this._updateBlinking(),this._secondaryCursors.length<t.length){const o=t.length-this._secondaryCursors.length;for(let s=0;s<o;s++){const a=new JOe(this._context);this._domNode.domNode.insertBefore(a.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(a)}}else if(this._secondaryCursors.length>t.length){const o=this._secondaryCursors.length-t.length;for(let s=0;s<o;s++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let o=0;o<t.length;o++)this._secondaryCursors[o].onCursorPositionChanged(t[o],r)}onCursorStateChanged(e){const t=[];for(let r=0,o=e.selections.length;r<o;r++)t[r]=e.selections[r].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=i=>{for(let r=0,o=e.ranges.length;r<o;r++)if(e.ranges[r].fromLineNumber<=i.lineNumber&&i.lineNumber<=e.ranges[r].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const i of this._secondaryCursors)if(t(i.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=e===0,i=e===5;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!t&&!i&&(e===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},K3.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},K3.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Cc.Line:e+=" cursor-line-style";break;case Cc.Block:e+=" cursor-block-style";break;case Cc.Underline:e+=" cursor-underline-style";break;case Cc.LineThin:e+=" cursor-line-thin-style";break;case Cc.BlockOutline:e+=" cursor-block-outline-style";break;case Cc.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const r=this._primaryCursor.render(e);r&&(t[i++]=r);for(let o=0,s=this._secondaryCursors.length;o<s;o++){const a=this._secondaryCursors[o].render(e);a&&(t[i++]=a)}this._renderData=t}getLastRenderData(){return this._renderData}}K3.BLINK_INTERVAL=500;e_((n,e)=>{const t=n.getColor(mJe);if(t){let i=n.getColor(mar);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),fv(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const pte=()=>{throw new Error("Invalid change accessor")};class tcr extends nf{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=io(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=io(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const r of e)t.set(r.id,r);let i=!1;return this._context.viewModel.changeWhitespace(r=>{const o=Object.keys(this._zones);for(let s=0,a=o.length;s<a;s++){const l=o[s],c=this._zones[l],u=this._computeWhitespaceProps(c.delegate);c.isInHiddenArea=u.isInHiddenArea;const d=t.get(l);d&&(d.afterLineNumber!==u.afterViewLineNumber||d.height!==u.heightInPx)&&(r.changeOneWhitespace(l,u.afterViewLineNumber,u.heightInPx),this._safeCallOnComputedHeight(c.delegate,u.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(66)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){var t,i;return(i=(t=e.ordinal)!==null&&t!==void 0?t:e.afterColumn)!==null&&i!==void 0?i:1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t;if(typeof e.afterColumn<"u")t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const s=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new De(s,this._context.viewModel.model.getLineMaxColumn(s))}let i;t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?i=this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):i=this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),o=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:r.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{const r={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};ncr(e,r),r.addZone=pte,r.removeZone=pte,r.layoutZone=pte}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:io(t.domNode),marginDomNode:t.marginDomNode?io(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],r=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(i.delegate,r.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){Oi(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Oi(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let r=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(i[s.id]=s,r=!0);const o=Object.keys(this._zones);for(let s=0,a=o.length;s<a;s++){const l=o[s],c=this._zones[l];let u=0,d=0,h="none";i.hasOwnProperty(l)?(u=i[l].verticalOffset-e.bigNumbersDelta,d=i[l].height,h="block",c.isVisible||(c.domNode.setAttribute("monaco-visible-view-zone","true"),c.isVisible=!0),this._safeCallOnDomNodeTop(c.delegate,e.getScrolledTopFromAbsoluteTop(i[l].verticalOffset))):(c.isVisible&&(c.domNode.removeAttribute("monaco-visible-view-zone"),c.isVisible=!1),this._safeCallOnDomNodeTop(c.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),c.domNode.setTop(u),c.domNode.setHeight(d),c.domNode.setDisplay(h),c.marginDomNode&&(c.marginDomNode.setTop(u),c.marginDomNode.setHeight(d),c.marginDomNode.setDisplay(h))}r&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function ncr(n,e){try{return n(e)}catch(t){Oi(t)}}class icr{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class rcr{constructor(e,t,i){this.configuration=e,this.theme=new icr(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class ocr{constructor(e,t,i,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=i,this._model=r,this.visibleRange=new J(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class scr extends nf{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=io(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(143),r=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==r&&(this.contentWidth=r,e=!0);const o=i.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let i=0;const r=e.getDecorationsInViewport();for(const o of r){if(!o.options.blockClassName)continue;let s=this.blocks[i];s||(s=this.blocks[i]=io(document.createElement("div")),this.domNode.appendChild(s));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[c,u,d,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];s.setClassName("blockDecorations-block "+o.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+u),s.setTop(a-e.scrollTop-c),s.setHeight(l-a+c+d),i++}for(let o=i;o<this.blocks.length;o++)this.blocks[o].domNode.remove();this.blocks.length=i}}class acr extends iI{constructor(e){super(),this._context=e,this._options=new ePe(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new ePe(this._context.configuration);return this._options.equals(t)?e.hasChanged(143):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,this._options.renderWhitespace==="selection"}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if(this._options.renderWhitespace==="none"){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber-t+1,o=new Array(r);for(let a=0;a<r;a++)o[a]=!0;const s=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,o);this._renderResult=[];for(let a=e.viewportData.startLineNumber;a<=e.viewportData.endLineNumber;a++){const l=a-e.viewportData.startLineNumber,c=s.data[l];let u=null;if(this._options.renderWhitespace==="selection"){const d=this._selection;for(const h of d){if(h.endLineNumber<a||h.startLineNumber>a)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f<g&&(u||(u=[]),u.push(new zZe(f-1,g-1)))}}this._renderResult[l]=this._applyRenderWhitespace(e,a,u,c)}}_applyRenderWhitespace(e,t,i,r){if(this._options.renderWhitespace==="selection"&&!i||this._options.renderWhitespace==="trailing"&&r.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(Wy),s=this._options.renderWithSVG,a=r.content,l=this._options.stopRenderingLineAfter===-1?a.length:Math.min(this._options.stopRenderingLineAfter,a.length),c=r.continuesWithWrappedLine,u=r.minColumn-1,d=this._options.renderWhitespace==="boundary",h=this._options.renderWhitespace==="trailing",f=this._options.lineHeight,g=this._options.middotWidth,m=this._options.wsmiddotWidth,v=this._options.spaceWidth,_=Math.abs(m-v),b=Math.abs(g-v),y=_<b?11825:183,C=this._options.canUseHalfwidthRightwardsArrow;let x="",E=!1,k=Yu(a),L;k===-1?(E=!0,k=l,L=l):L=dv(a);let D=0,A=i&&i[D],O=0;for(let P=u;P<l;P++){const F=a.charCodeAt(P);if(A&&P>=A.endOffset&&(D++,A=i&&i[D]),F!==9&&F!==32||h&&!E&&P<=L)continue;if(d&&P>=k&&P<=L&&F===32){const M=P-1>=0?a.charCodeAt(P-1):0,V=P+1<l?a.charCodeAt(P+1):0;if(M!==32&&V!==32)continue}if(d&&c&&P===l-1){const M=P-1>=0?a.charCodeAt(P-1):0;if(F===32&&M!==32&&M!==9)continue}if(i&&(!A||A.startOffset>P||A.endOffset<=P))continue;const B=e.visibleRangeForPosition(new De(t,P+1));B&&(s?(O=Math.max(O,B.left),F===9?x+=this._renderArrow(f,v,B.left):x+=`<circle cx="${(B.left+v/2).toFixed(2)}" cy="${(f/2).toFixed(2)}" r="${(v/7).toFixed(2)}" />`):F===9?x+=`<div class="mwh" style="left:${B.left}px;height:${f}px;">${C?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:x+=`<div class="mwh" style="left:${B.left}px;height:${f}px;">${String.fromCharCode(y)}</div>`)}return s?(O=Math.round(O+v),`<svg style="position:absolute;width:${O}px;height:${f}px" viewBox="0 0 ${O} ${f}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+x+"</svg>"):x}_renderArrow(e,t,i){const r=t/7,o=t,s=e/2,a=i,l={x:0,y:r/2},c={x:100/125*o,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},m={x:u.x,y:-u.y},v={x:c.x,y:-c.y},_={x:l.x,y:-l.y};return`<path d="M ${[l,c,u,d,h,f,g,m,v,_].map(C=>`${(a+C.x).toFixed(2)} ${(s+C.y).toFixed(2)}`).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class ePe{constructor(e){const t=e.options,i=t.get(50),r=t.get(38);r==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):r==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var lcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ccr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Rce=class extends L6{constructor(e,t,i,r,o,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new kn(1,1,1,1)],this._renderAnimationFrame=null;const l=new mlr(t,r,o,e);this._context=new rcr(t,i,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Dce,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=io(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=io(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=io(document.createElement("div")),d0.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new xlr(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new BG(this._context,this._linesContent),this._viewZones=new tcr(this._context),this._viewParts.push(this._viewZones);const c=new qlr(this._context);this._viewParts.push(c);const u=new Qlr(this._context);this._viewParts.push(u);const d=new vlr(this._context);this._viewParts.push(d),d.addDynamicOverlay(new wlr(this._context)),d.addDynamicOverlay(new Ca(this._context)),d.addDynamicOverlay(new klr(this._context)),d.addDynamicOverlay(new Elr(this._context)),d.addDynamicOverlay(new acr(this._context));const h=new blr(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Slr(this._context)),h.addDynamicOverlay(new Blr(this._context)),h.addDynamicOverlay(new Flr(this._context)),h.addDynamicOverlay(new O6(this._context)),this._glyphMarginWidgets=new Rlr(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new ek(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new ylr(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new K3(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Ulr(this._context),this._viewParts.push(this._overlayWidgets);const g=new Ylr(this._context);this._viewParts.push(g);const m=new scr(this._context);this._viewParts.push(m);const v=new zlr(this._context);if(this._viewParts.push(v),c){const _=this._scrollbar.getOverviewRulerLayoutInfo();_.parent.insertBefore(c.getDomNode(),_.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new far(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),rw.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(o=>{var s,a;const l=(a=(s=o.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:nD.Left;return{range:o.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(o=>({range:e.validateRange(o.preference.range),lane:o.preference.lane}))),t.sort((o,s)=>J.compareRangesUsingStarts(o.range,s.range));let i=null,r=null;for(const o of t)if(o.lane===nD.Left&&(!i||J.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===nD.Right&&(!r||J.compareRangesUsingEnds(r,o.range)<0)&&(r=o.range),i&&r){if(i.endLineNumber<r.startLineNumber){i=null;continue}if(r.endLineNumber<i.startLineNumber){r=null;continue}return 2}return 1}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Usr(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new De(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+Lce(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=QW(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){ucr(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!v0e(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new ocr(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const r=new Fsr(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(r);for(const o of e)o.render(r),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new De(r.lineNumber,r.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?MG.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Glr(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,r,o,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(r=e.position)===null||r===void 0?void 0:r.secondaryPosition)!==null&&o!==void 0?o:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};Rce=lcr([ccr(6,di)],Rce);function ucr(n){try{return n()}catch(e){Oi(e)}}class PJe{constructor(e,t,i,r,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=r,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function ES(n){let e=0,t=0,i=0,r=0;for(let o=0,s=n.length;o<s;o++){const a=n.charCodeAt(o);a===13?(e===0&&(t=o),e++,o+1<s&&n.charCodeAt(o+1)===10?(r|=2,o++):r|=3,i=o+1):a===10&&(r|=1,e===0&&(t=o),e++,i=o+1)}return e===0&&(t=n.length),[e,t,n.length-i,r]}class tPe{constructor(e,t,i,r){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=r}}class dcr{constructor(e,t,i,r,o,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=r,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class hcr extends dcr{constructor(e,t,i,r,o,s,a){super(e,t,i,r,o,s),this.minVisibleColumnIndentation=a}}class G3{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}G3.zero=new G3(0,0);function fcr(n,e,t,i){return n!==t?Ra(t-n,i):Ra(0,i-e)}const Dd=0;function vz(n){return n===0}const Bf=Math.pow(2,26);function Ra(n,e){return n*Bf+e}function lg(n){const e=n,t=Math.floor(e/Bf),i=e-t*Bf;return new G3(t,i)}function pcr(n){return Math.floor(n/Bf)}function Ys(n,e){let t=n+e;return e>=Bf&&(t=t-n%Bf),t}function gcr(n,e){return n.reduce((t,i)=>Ys(t,e(i)),Dd)}function MJe(n,e){return n===e}function Y3(n,e){const t=n,i=e;if(i-t<=0)return Dd;const o=Math.floor(t/Bf),s=Math.floor(i/Bf),a=i-s*Bf;if(o===s){const l=t-o*Bf;return Ra(0,a-l)}else return Ra(s-o,a)}function cD(n,e){return n<e}function uD(n,e){return n<=e}function SP(n,e){return n>=e}function _L(n){return Ra(n.lineNumber-1,n.column-1)}function bT(n,e){const t=n,i=Math.floor(t/Bf),r=t-i*Bf,o=e,s=Math.floor(o/Bf),a=o-s*Bf;return new J(i+1,r+1,s+1,a+1)}function mcr(n){const e=l0(n);return Ra(e.length-1,e[e.length-1].length)}class zy{static fromModelContentChanges(e){return e.map(i=>{const r=J.lift(i.range);return new zy(_L(r.getStartPosition()),_L(r.getEndPosition()),mcr(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${lg(this.startOffset)}...${lg(this.endOffset)}) -> ${lg(this.newLength)}`}}class _cr{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>Y0e.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:Y3(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ra(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ra(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=lg(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ra(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ra(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(uD(i,e)){this.nextEditIdx++;const r=lg(i),o=lg(this.translateOldToCur(t.endOffsetBeforeObj)),s=r.lineCount-o.lineCount;this.deltaOldToNewLineCount+=s;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=r.columnCount-o.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class Y0e{static from(e){return new Y0e(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=lg(t),this.endOffsetAfterObj=lg(Ys(e,i)),this.offsetObj=lg(e)}}const eV=[];class dl{static create(e,t){if(e<=128&&t.length===0){let i=dl.cache[e];return i||(i=new dl(e,t),dl.cache[e]=i),i}return new dl(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let r=i>>5;if(r===0){const s=1<<i|this.items;return s===this.items?this:dl.create(s,this.additionalItems)}r--;const o=this.additionalItems.slice(0);for(;o.length<r;)o.push(0);return o[r]|=1<<(i&31),dl.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===eV&&e.additionalItems===eV)return t===this.items?this:t===e.items?e:dl.create(t,eV);const i=[];for(let r=0;r<Math.max(this.additionalItems.length,e.additionalItems.length);r++){const o=this.additionalItems[r]||0,s=e.additionalItems[r]||0;i.push(o|s)}return dl.create(t,i)}intersects(e){if(this.items&e.items)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(this.additionalItems[t]&e.additionalItems[t])return!0;return!1}}dl.cache=new Array(129);dl.empty=dl.create(0,eV);const nPe={getKey(n){return n}};class FJe{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class Q0e{get length(){return this._length}constructor(e){this._length=e}}class Q3 extends Q0e{static create(e,t,i){let r=e.length;return t&&(r=Ys(r,t.length)),i&&(r=Ys(r,i.length)),new Q3(r,e,t,i,t?t.missingOpeningBracketIds:dl.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,r,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=r,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new Q3(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Ys(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class h0 extends Q0e{static create23(e,t,i,r=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Ys(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Ys(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return r?new vcr(o,e.listHeight+1,e,t,i,s):new X3(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new bcr(Dd,0,[],dl.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){const i=t.childrenLength;if(i===0)throw new Qa;t=t.getChild(i-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let r=1;r<e;r++){const o=this.getChild(r);t=Ys(t,o.length),i=i.merge(o.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,r=e;for(let o=0;o<this.childrenLength;o++){const s=this.getChild(o);s&&(i=Math.min(i,s.computeMinIndentation(r,t)),r=Ys(r,s.length))}return this.cachedMinIndentation=i,i}}class X3 extends h0{get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,r,o,s){super(e,t,s),this._item1=i,this._item2=r,this._item3=o}deepClone(){return new X3(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class vcr extends X3{toMutable(){return new X3(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class bz extends h0{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,r){super(e,t,r),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new bz(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class bcr extends bz{toMutable(){return new bz(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const ycr=[];class X0e extends Q0e{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return ycr}deepClone(){return this}}class kx extends X0e{get kind(){return 0}get missingOpeningBracketIds(){return dl.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=lg(e),r=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,o=pcr(Ys(e,this.length))+1;let s=Number.MAX_SAFE_INTEGER;for(let a=r;a<=o;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const u=yl.visibleColumnFromColumn(c,l,t.getOptions().tabSize);s=Math.min(s,u)}return s}}class yz extends X0e{static create(e,t,i){return new yz(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return dl.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class Ccr extends X0e{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}let HC=class{constructor(e,t,i,r,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=r,this.astNode=o}};class BJe{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new wcr(this.textModel,this.bracketTokens),this._offset=Dd,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Ra(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Ys(this._offset,e);const t=lg(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Ys(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class wcr{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const o=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=o.length,o}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,s=o.getCount();let a=null;if(this.lineTokenOffset<s){const l=o.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<s&&l===o.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=Kc.getTokenType(l)===0,u=Kc.containsBalancedBrackets(l),d=o.getEndOffset(this.lineTokenOffset);if(u&&c&&this.lineCharOffset<d){const h=o.getLanguageId(this.lineTokenOffset),f=this.line.substring(this.lineCharOffset,d),g=this.bracketTokens.getSingleLanguageBracketTokens(h),m=g.regExpGlobal;if(m){m.lastIndex=0;const v=m.exec(f);v&&(a=g.getToken(v[0]),a&&(this.lineCharOffset+=v.index))}}if(i+=d-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=d}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3))break;if(i>1500)break}const r=fcr(e,t,this.lineIdx,this.lineCharOffset);return new HC(r,0,-1,dl.getEmpty(),new kx(r))}}class Scr{constructor(e,t){this.text=e,this._offset=Dd,this.idx=0;const i=t.getRegExpStr(),r=i?new RegExp(i+`| `,"gi"):null,o=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new HC(Ra(0,g),0,-1,dl.getEmpty(),new kx(Ra(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new HC(Ra(1,g),0,-1,dl.getEmpty(),new kx(Ra(1,g))));if(r)for(r.lastIndex=0;(s=r.exec(e))!==null;){const g=s.index,m=s[0];if(m===` `)a++,l=g+1;else{if(c!==g){let v;if(u===a){const _=g-c;if(_<d.length)v=d[_];else{const b=Ra(0,_);v=new HC(b,0,-1,dl.getEmpty(),new kx(b))}}else{const _=a-u,b=g-l;if(_===1&&b<h.length)v=h[b];else{const y=Ra(_,b);v=new HC(y,0,-1,dl.getEmpty(),new kx(y))}}o.push(v)}o.push(t.getToken(m)),c=g+m.length,u=a}}const f=e.length;if(c!==f){const g=u===a?Ra(0,f-c):Ra(a-u,f-l);o.push(new HC(g,0,-1,dl.getEmpty(),new kx(g)))}this.length=Ra(a,f-l),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new SJi}}class Z0e{static createFromLanguage(e,t){function i(o){return t.getKey(`${o.languageId}:::${o.bracketText}`)}const r=new Map;for(const o of e.bracketsNew.openingBrackets){const s=Ra(0,o.bracketText.length),a=i(o),l=dl.getEmpty().add(a,nPe);r.set(o.bracketText,new HC(s,1,a,l,yz.create(s,o,l)))}for(const o of e.bracketsNew.closingBrackets){const s=Ra(0,o.bracketText.length);let a=dl.getEmpty();const l=o.getOpeningBrackets();for(const c of l)a=a.add(i(c),nPe);r.set(o.bracketText,new HC(s,2,i(l[0]),a,yz.create(s,o,a)))}return new Z0e(r)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>Ecr(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Ecr(n){let e=tp(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class $Je{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=Z0e.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function xcr(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const s=e,a=n[s].listHeight;for(e++;e<n.length&&n[e].listHeight===a;)e++;return e-s>=2?VJe(s===0&&e===n.length?n:n.slice(s,e),!1):n[s]}let i=t(),r=t();if(!r)return i;for(let s=t();s;s=t())iPe(i,r)<=iPe(r,s)?(i=gte(i,r),r=s):r=gte(r,s);return gte(i,r)}function VJe(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let r=0;r<i;r++){const o=r<<1;n[r]=h0.create23(n[o],n[o+1],o+3===t?n[o+2]:null,e)}t=i}return h0.create23(n[0],n[1],t>=3?n[2]:null,e)}function iPe(n,e){return Math.abs(n.listHeight-e.listHeight)}function gte(n,e){return n.listHeight===e.listHeight?h0.create23(n,e,null,!1):n.listHeight>e.listHeight?Tcr(n,e):kcr(e,n)}function Tcr(n,e){n=n.toMutable();let t=n;const i=[];let r;for(;;){if(e.listHeight===t.listHeight){r=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const s=i[o];r?s.childrenLength>=3?r=h0.create23(s.unappendChild(),r,null,!1):(s.appendChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?h0.create23(n,r,null,!1):n}function kcr(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let r=e;for(let o=i.length-1;o>=0;o--){const s=i[o];r?s.childrenLength>=3?r=h0.create23(r,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?h0.create23(r,n,null,!1):n}class Icr{constructor(e){this.lastOffset=Dd,this.nextNodes=[e],this.offsets=[Dd],this.idxs=[]}readLongestNodeAt(e,t){if(cD(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=NO(this.nextNodes);if(!i)return;const r=NO(this.offsets);if(cD(e,r))return;if(cD(r,e))if(Ys(r,i.length)<=e)this.nextNodeAfterCurrent();else{const o=mte(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(r),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=mte(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(r),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=NO(this.offsets),t=NO(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=NO(this.nextNodes),r=mte(i,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(i.getChild(r)),this.offsets.push(Ys(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function mte(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function NO(n){return n.length>0?n[n.length-1]:void 0}function Oce(n,e,t,i){return new Lcr(n,e,t,i).parseDocument()}class Lcr{constructor(e,t,i,r){if(this.tokenizer=e,this.createImmutableLists=r,this._itemsConstructed=0,this._itemsFromCache=0,i&&r)throw new Error("Not supported");this.oldNodeReader=i?new Icr(i):void 0,this.positionMapper=new _cr(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(dl.getEmpty(),0);return e||(e=h0.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?xcr(i):VJe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!vz(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!cD(r.length,t)?!1:r.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new Ccr(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new kx(i.length);const r=e.merge(i.bracketIds),o=this.parseList(r,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===i.bracketId||s.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),Q3.create(i.astNode,o,s.astNode)):Q3.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function Cz(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new y1(rPe(n)),i=rPe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let r=t.dequeue();function o(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return r&&d.unshift(r),d}const u=[];for(;r&&!vz(c);){const[d,h]=r.splitAt(c);u.push(d),c=Y3(d.lengthAfter,c),r=h??t.dequeue()}return vz(c)||u.push(new ow(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&MJe(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new zy(h.startOffset,u,Ys(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=Dd;for(const c of i){const u=o(c.lengthBefore);if(c.modified){const d=gcr(u,f=>f.lengthBefore),h=Ys(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=Ys(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class ow{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Y3(e,this.lengthAfter);return MJe(t,Dd)?[this,void 0]:this.modified?[new ow(this.modified,this.lengthBefore,e),new ow(this.modified,Dd,t)]:[new ow(this.modified,e,e),new ow(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${lg(this.lengthBefore)} -> ${lg(this.lengthAfter)}`}}function rPe(n){const e=[];let t=Dd;for(const i of n){const r=Y3(t,i.startOffset);vz(r)||e.push(new ow(!1,r,r));const o=Y3(i.startOffset,i.endOffset);e.push(new ow(!0,o,i.newLength)),t=i.endOffset}return e}class Dcr extends Ue{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new Le,this.denseKeyProvider=new FJe,this.brackets=new $Je(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),r=new Scr(this.textModel.getValue(),i);this.initialAstWithoutTokens=Oce(r,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new zy(Ra(i.fromLineNumber-1,0),Ra(i.toLineNumber,0),Ra(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=zy.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=Cz(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=Cz(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const r=t,o=new BJe(this.textModel,this.brackets);return Oce(o,e,r,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ra(e.startLineNumber-1,e.startColumn-1),r=Ra(e.endLineNumber-1,e.endColumn-1);return new Gb(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens;Pce(s,Dd,s.length,i,r,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=_L(e.getStartPosition()),r=_L(e.getEndPosition());return new Gb(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Acr(o,t,this.textModel);Mce(s,Dd,s.length,i,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return WJe(t,Dd,t.length,_L(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return HJe(t,Dd,t.length,_L(e))}}function HJe(n,e,t,i){if(n.kind===4||n.kind===2){const r=[];for(const o of n.children)t=Ys(e,o.length),r.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=r.length-1;o>=0;o--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=r[o];if(cD(s,i)){const l=HJe(n.children[o],s,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const r=bT(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function WJe(n,e,t,i){if(n.kind===4||n.kind===2){for(const r of n.children){if(t=Ys(e,r.length),cD(i,t)){const o=WJe(r,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const r=bT(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function Pce(n,e,t,i,r,o,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(n.kind){case 4:{const d=n.childrenLength;for(let h=0;h<d;h++){const f=n.getChild(h);if(f){if(t=Ys(e,f.length),uD(e,r)&&SP(t,i)){if(SP(t,r)){n=f;continue e}if(!Pce(f,e,t,i,r,o,s,0,l,c))return!1}e=t}}return!0}case 2:{const d=!c||!n.closingBracket||n.closingBracket.bracketInfo.closesColorized(n.openingBracket.bracketInfo);let h=0;if(l){let g=l.get(n.openingBracket.text);g===void 0&&(g=0),h=g,d&&(g++,l.set(n.openingBracket.text,g))}const f=n.childrenLength;for(let g=0;g<f;g++){const m=n.getChild(g);if(m){if(t=Ys(e,m.length),uD(e,r)&&SP(t,i)){if(SP(t,r)&&m.kind!==1){n=m,d?(s++,a=h+1):a=h;continue e}if((d||m.kind!==1||!n.closingBracket)&&!Pce(m,e,t,i,r,o,d?s+1:s,d?h+1:h,l,c,!n.closingBracket))return!1}e=t}}return l==null||l.set(n.openingBracket.text,h),!0}case 3:{const d=bT(e,t);return o(new tPe(d,s-1,0,!0))}case 1:{const d=bT(e,t);return o(new tPe(d,s-1,a-1,u))}case 0:return!0}}class Acr{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function Mce(n,e,t,i,r,o,s,a){var l;if(s>200)return!0;let c=!0;if(n.kind===2){let u=0;if(a){let f=a.get(n.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(n.openingBracket.text,f)}const d=Ys(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new hcr(bT(e,t),bT(e,d),n.closingBracket?bT(Ys(d,((l=n.child)===null||l===void 0?void 0:l.length)||Dd),t):void 0,s,u,n,h)),e=d,c&&n.child){const f=n.child;if(t=Ys(e,f.length),uD(e,r)&&SP(t,i)&&(c=Mce(f,e,t,i,r,o,s+1,a),!c))return!1}a==null||a.set(n.openingBracket.text,u)}else{let u=e;for(const d of n.children){const h=u;if(u=Ys(u,d.length),uD(h,r)&&uD(i,u)&&(c=Mce(d,h,u,i,r,o,s,a),!c))return!1}}return c}class Ncr extends Ue{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Nc),this.onDidChangeEmitter=new Le,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var r;(!i.languageId||!((r=this.bracketPairsTree.value)===null||r===void 0)&&r.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new mt;this.bracketPairsTree.value=Rcr(e.add(new Dcr(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||Gb.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||Gb.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||Gb.empty}findMatchingBracketUp(e,t,i){const r=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(J.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?U9(this._findMatchingBracketUp(l,r,_te(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(J.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(sg(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,J.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=_te(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,r){const o=t.getCount(),s=t.getLanguageId(r);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=r-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(jv(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=r+1;c<o;c++){const u=t.getStartOffset(c);if(u>=l)break;if(jv(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,r=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),s=r.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(s)).brackets;if(a&&!jv(r.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,s),u=null;for(;;){const d=sm.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof vy)return null;u=f}}l=d.endColumn-1}if(u)return u}if(s>0&&r.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;if(c&&!jv(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),h=sm.findPrevBracketInRange(c.reversedRegex,i,o,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof vy?null:g}}}return null}_matchFoundBracket(e,t,i,r){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return o?o instanceof vy?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const r=e.languageId,o=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(i&&++a%100===0&&!i())return vy.INSTANCE;const f=sm.findPrevBracketInRange(o,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=d-1,g=h.length,m=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1);let v=!0;for(;f>=0;f--){const _=u.getLanguageId(f)===r&&!jv(u.getStandardTokenType(f));if(_)v?g=u.getStartOffset(f):(g=u.getStartOffset(f),m=u.getEndOffset(f));else if(v&&g!==m){const b=l(c,h,g,m);if(b)return b}v=_}if(v&&g!==m){const _=l(c,h,g,m);if(_)return _}}return null}_findMatchingBracketDown(e,t,i){const r=e.languageId,o=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(i&&++a%100===0&&!i())return vy.INSTANCE;const g=sm.findNextBracketInRange(o,u,d,h,f);if(!g)break;const m=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?s++:e.isClose(m)&&s--,s===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let g=0,m=0,v=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),m=t.column-1,v=t.column-1);let _=!0;for(;g<h;g++){const b=d.getLanguageId(g)===r&&!jv(d.getStandardTokenType(g));if(b)_||(m=d.getStartOffset(g)),v=d.getEndOffset(g);else if(_&&m!==v){const y=l(u,f,m,v);if(y)return y}_=b}if(_&&m!==v){const b=l(u,f,m,v);if(b)return b}}return null}findPrevBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketBefore(i))||null;let r=null,o=null,s=null;for(let a=i.lineNumber;a>=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,f=u.length;if(a===i.lineNumber){d=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,f=i.column-1;const m=l.getLanguageId(d);r!==m&&(r=m,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let g=!0;for(;d>=0;d--){const m=l.getLanguageId(d);if(r!==m){if(o&&s&&g&&h!==f){const _=sm.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(_)return this._toFoundBracket(s,_);g=!1}r=m,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const v=!!o&&!jv(l.getStandardTokenType(d));if(v)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&o&&g&&h!==f){const _=sm.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(_)return this._toFoundBracket(s,_)}g=v}if(s&&o&&g&&h!==f){const m=sm.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const r=this.textModel.getLineCount();let o=null,s=null,a=null;for(let l=i.lineNumber;l<=r;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;const v=c.getLanguageId(h);o!==v&&(o=v,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let m=!0;for(;h<u;h++){const v=c.getLanguageId(h);if(o!==v){if(a&&s&&m&&f!==g){const b=sm.findNextBracketInRange(s.forwardRegex,l,d,f,g);if(b)return this._toFoundBracket(a,b);m=!1}o=v,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const _=!!s&&!jv(c.getStandardTokenType(h));if(_)m||(f=c.getStartOffset(h)),g=c.getEndOffset(h);else if(a&&s&&m&&f!==g){const b=sm.findNextBracketInRange(s.forwardRegex,l,d,f,g);if(b)return this._toFoundBracket(a,b)}m=_}if(a&&s&&m&&f!==g){const v=sm.findNextBracketInRange(s.forwardRegex,l,d,f,g);if(v)return this._toFoundBracket(a,v)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const f=J.fromPositions(i),g=this.getBracketPairsInRange(J.fromPositions(i,i)).findLast(m=>m.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const r=_te(t),o=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const m=[];for(let v=0,_=g?g.brackets.length:0;v<_;v++)m[v]=0;s.set(f,m)}a=s.get(f)};let c=0;const u=(f,g,m,v,_)=>{for(;;){if(r&&++c%100===0&&!r())return vy.INSTANCE;const b=sm.findNextBracketInRange(f.forwardRegex,g,m,v,_);if(!b)break;const y=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),C=f.textIsBracket[y];if(C&&(C.isOpen(y)?a[C.index]++:C.isClose(y)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(b,C,!1,r);v=b.endColumn-1}return null};let d=null,h=null;for(let f=i.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),m=g.getCount(),v=this.textModel.getLineContent(f);let _=0,b=0,y=0;if(f===i.lineNumber){_=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,y=i.column-1;const x=g.getLanguageId(_);d!==x&&(d=x,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let C=!0;for(;_<m;_++){const x=g.getLanguageId(_);if(d!==x){if(h&&C&&b!==y){const k=u(h,f,v,b,y);if(k)return U9(k);C=!1}d=x,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h)}const E=!!h&&!jv(g.getStandardTokenType(_));if(E)C||(b=g.getStartOffset(_)),y=g.getEndOffset(_);else if(h&&C&&b!==y){const k=u(h,f,v,b,y);if(k)return U9(k)}C=E}if(h&&C&&b!==y){const x=u(h,f,v,b,y);if(x)return U9(x)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const r=e.getBracketInfo(i);return r?{range:t,bracketInfo:r}:null}}function Rcr(n,e){return{object:n,dispose:()=>e==null?void 0:e.dispose()}}function _te(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class vy{constructor(){this._searchCanceledBrand=void 0}}vy.INSTANCE=new vy;function U9(n){return n instanceof vy?null:n}class Ocr extends Ue{constructor(e){super(),this.textModel=e,this.colorProvider=new zJe,this.onDidChangeEmitter=new Le,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,r){return r?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new J(1,1,this.textModel.getLineCount(),1),e,t):[]}}class zJe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}e_((n,e)=>{const t=[vJe,bJe,yJe,CJe,wJe,SJe],i=new zJe;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(Mar)}; }`);const r=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const s=r[o%r.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${s}; }`)}});function j9(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Wc{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,r){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${j9(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${j9(this.oldText)}")`:`(replace@${this.oldPosition} "${j9(this.oldText)}" with "${j9(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const r=t.length;T_(e,r,i),i+=4;for(let o=0;o<r;o++)bnr(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=x_(e,t);return t+=4,Cnr(e,t,i)}writeSize(){return 4+4+Wc._writeStringSize(this.oldText)+Wc._writeStringSize(this.newText)}write(e,t){return T_(e,this.oldPosition,t),t+=4,T_(e,this.newPosition,t),t+=4,t=Wc._writeString(e,this.oldText,t),t=Wc._writeString(e,this.newText,t),t}static read(e,t,i){const r=x_(e,t);t+=4;const o=x_(e,t);t+=4;const s=Wc._readString(e,t);t+=Wc._writeStringSize(s);const a=Wc._readString(e,t);return t+=Wc._writeStringSize(a),i.push(new Wc(r,s,o,a)),t}}function Pcr(n,e){return n===null||n.length===0?e:new Xv(n,e).compress()}class Xv{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),r=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(i===null){this._acceptCurr(r),r=this._getCurr(++t);continue}if(r===null){this._acceptPrev(i),i=this._getPrev(++e);continue}if(r.oldEnd<=i.newPosition){this._acceptCurr(r),r=this._getCurr(++t);continue}if(i.newEnd<=r.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(r.oldPosition<i.newPosition){const[c,u]=Xv._splitCurr(r,i.newPosition-r.oldPosition);this._acceptCurr(c),r=u;continue}if(i.newPosition<r.oldPosition){const[c,u]=Xv._splitPrev(i,r.oldPosition-i.newPosition);this._acceptPrev(c),i=u;continue}let a,l;if(r.oldEnd===i.newEnd)a=i,l=r,i=this._getPrev(++e),r=this._getCurr(++t);else if(r.oldEnd<i.newEnd){const[c,u]=Xv._splitPrev(i,r.oldLength);a=c,l=r,i=u,r=this._getCurr(++t)}else{const[c,u]=Xv._splitCurr(r,i.newLength);a=i,l=c,i=this._getPrev(++e),r=u}this._result[this._resultLen++]=new Wc(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const o=Xv._merge(this._result);return Xv._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=Xv._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=Xv._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new Wc(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new Wc(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),r=e.newText.substr(t);return[new Wc(e.oldPosition,e.oldText,e.newPosition,i),new Wc(e.oldEnd,"",e.newPosition+t,r)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),r=e.oldText.substr(t);return[new Wc(e.oldPosition,i,e.newPosition,e.newText),new Wc(e.oldPosition+t,r,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;const t=[];let i=0,r=e[0];for(let o=1;o<e.length;o++){const s=e[o];r.oldEnd===s.oldPosition?r=new Wc(r.oldPosition,r.oldText+s.oldText,r.newPosition,r.newText+s.newText):(t[i++]=r,r=s)}return t[i++]=r,t}static _removeNoOps(e){if(e.length===0)return e;const t=[];let i=0;for(let r=0;r<e.length;r++){const o=e[r];o.oldText!==o.newText&&(t[i++]=o)}return t}}function sC(n){return n===47||n===92}function UJe(n){return n.replace(/[\\/]/g,hl.sep)}function Mcr(n){return n.indexOf("/")===-1&&(n=UJe(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function oPe(n,e=hl.sep){if(!n)return"";const t=n.length,i=n.charCodeAt(0);if(sC(i)){if(sC(n.charCodeAt(1))&&!sC(n.charCodeAt(2))){let o=3;const s=o;for(;o<t&&!sC(n.charCodeAt(o));o++);if(s!==o&&!sC(n.charCodeAt(o+1))){for(o+=1;o<t;o++)if(sC(n.charCodeAt(o)))return n.slice(0,o+1).replace(/[\\/]/g,e)}}return e}else if(jJe(i)&&n.charCodeAt(1)===58)return sC(n.charCodeAt(2))?n.slice(0,2)+e:n.slice(0,2);let r=n.indexOf("://");if(r!==-1){for(r+=3;r<t;r++)if(sC(n.charCodeAt(r)))return n.slice(0,r+1)}return""}function Fce(n,e,t,i=uv){if(n===e)return!0;if(!n||!e||e.length>n.length)return!1;if(t){if(!a0e(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,n.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function jJe(n){return n>=65&&n<=90||n>=97&&n<=122}function Fcr(n,e=eu){return e?jJe(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function qv(n){return zW(n,!0)}class Bcr{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:w3(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===Gi.file)return Fce(qv(e),qv(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(aPe(e.authority,t.authority))return Fce(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Yn.joinPath(e,...t)}basenameOrAuthority(e){return Cg(e)||e.authority}basename(e){return hl.basename(e.path)}extname(e){return hl.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Gi.file?t=Yn.file(kXe(qv(e))).path:(t=hl.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===Gi.file?t=Yn.file(TXe(qv(e))).path:t=hl.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!aPe(e.authority,t.authority))return;if(e.scheme===Gi.file){const o=UJi(qv(e),qv(t));return eu?UJe(o):o}let i=e.path||"/";const r=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const s=Math.min(i.length,r.length);o<s&&!(i.charCodeAt(o)!==r.charCodeAt(o)&&i.charAt(o).toLowerCase()!==r.charAt(o).toLowerCase());o++);i=r.substr(0,o)+i.substr(o)}return hl.relative(i,r)}resolvePath(e,t){if(e.scheme===Gi.file){const i=Yn.file(zJi(qv(e),t));return e.with({authority:i.authority,path:i.path})}return t=Mcr(t),e.with({path:hl.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&rL(e,t)}hasTrailingPathSeparator(e,t=uv){if(e.scheme===Gi.file){const i=qv(e);return i.length>oPe(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=uv){return lPe(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=uv){let i=!1;if(e.scheme===Gi.file){const r=qv(e);i=r!==void 0&&r.length===oPe(r).length&&r[r.length-1]===t}else{t="/";const r=e.path;i=r.length===1&&r.charCodeAt(r.length-1)===47}return!i&&!lPe(e,t)?e.with({path:e.path+"/"}):e}}const Cs=new Bcr(()=>!1),J0e=Cs.isEqual.bind(Cs);Cs.isEqualOrParent.bind(Cs);Cs.getComparisonKey.bind(Cs);const $cr=Cs.basenameOrAuthority.bind(Cs),Cg=Cs.basename.bind(Cs),Vcr=Cs.extname.bind(Cs),$G=Cs.dirname.bind(Cs),Hcr=Cs.joinPath.bind(Cs),Wcr=Cs.normalizePath.bind(Cs),zcr=Cs.relativePath.bind(Cs),sPe=Cs.resolvePath.bind(Cs);Cs.isAbsolutePath.bind(Cs);const aPe=Cs.isEqualAuthority.bind(Cs),lPe=Cs.hasTrailingPathSeparator.bind(Cs);Cs.removeTrailingPathSeparator.bind(Cs);Cs.addTrailingPathSeparator.bind(Cs);var xS;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(xS||(xS={}));function i2(n){return n.toString()}class Gl{static create(e,t){const i=e.getAlternativeVersionId(),r=Bce(e);return new Gl(i,i,r,r,t,t,[])}constructor(e,t,i,r,o,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=r,this.beforeCursorState=o,this.afterCursorState=s,this.changes=a}append(e,t,i,r,o){t.length>0&&(this.changes=Pcr(this.changes,t)),this.afterEOL=i,this.afterVersionId=r,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(T_(e,t?t.length:0,i),i+=4,t)for(const r of t)T_(e,r.selectionStartLineNumber,i),i+=4,T_(e,r.selectionStartColumn,i),i+=4,T_(e,r.positionLineNumber,i),i+=4,T_(e,r.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const r=x_(e,t);t+=4;for(let o=0;o<r;o++){const s=x_(e,t);t+=4;const a=x_(e,t);t+=4;const l=x_(e,t);t+=4;const c=x_(e,t);t+=4,i.push(new kn(s,a,l,c))}return t}serialize(){let e=10+Gl._writeSelectionsSize(this.beforeCursorState)+Gl._writeSelectionsSize(this.afterCursorState)+4;for(const r of this.changes)e+=r.writeSize();const t=new Uint8Array(e);let i=0;T_(t,this.beforeVersionId,i),i+=4,T_(t,this.afterVersionId,i),i+=4,$Re(t,this.beforeEOL,i),i+=1,$Re(t,this.afterEOL,i),i+=1,i=Gl._writeSelections(t,this.beforeCursorState,i),i=Gl._writeSelections(t,this.afterCursorState,i),T_(t,this.changes.length,i),i+=4;for(const r of this.changes)i=r.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const r=x_(t,i);i+=4;const o=x_(t,i);i+=4;const s=BRe(t,i);i+=1;const a=BRe(t,i);i+=1;const l=[];i=Gl._readSelections(t,i,l);const c=[];i=Gl._readSelections(t,i,c);const u=x_(t,i);i+=4;const d=[];for(let h=0;h<u;h++)i=Wc.read(t,i,d);return new Gl(r,o,s,a,l,c,d)}}class qJe{get type(){return 0}get resource(){return Yn.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,r){this.label=e,this.code=t,this.model=i,this._data=Gl.create(i,r)}toString(){return(this._data instanceof Gl?this._data:Gl.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(Yn.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Gl}append(e,t,i,r,o){this._data instanceof Gl&&this._data.append(e,t,i,r,o)}close(){this._data instanceof Gl&&(this._data=this._data.serialize())}open(){this._data instanceof Gl||(this._data=Gl.deserialize(this._data))}undo(){if(Yn.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Gl&&(this._data=this._data.serialize());const e=Gl.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Yn.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Gl&&(this._data=this._data.serialize());const e=Gl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Gl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Ucr{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const r of this._editStackElementsArr){const o=i2(r.resource);this._editStackElementsMap.set(o,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=i2(e);return this._editStackElementsMap.has(t)}setModel(e){const t=i2(Yn.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=i2(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,r,o){const s=i2(e.uri);this._editStackElementsMap.get(s).append(e,t,i,r,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=i2(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Cg(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Bce(n){return n.getEOL()===` `?0:1}function by(n){return n?n instanceof qJe||n instanceof Ucr:!1}class eye{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);by(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);by(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(by(i)&&i.canAppend(this._model))return i;const r=new qJe(T("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(r,t),r}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],Bce(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,r){const o=this._getOrCreateEditStackElement(e,r),s=this._model.applyEdits(t,!0),a=eye._computeCursorState(i,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),Bce(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Oi(i),null}}}class jcr{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function qcr(n,e,t,i,r){r.spacesDiff=0,r.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<i;o++){const h=n.charCodeAt(o),f=t.charCodeAt(o);if(h!==f)break}let s=0,a=0;for(let h=o;h<e;h++)n.charCodeAt(h)===32?s++:a++;let l=0,c=0;for(let h=o;h<i;h++)t.charCodeAt(h)===32?l++:c++;if(s>0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){r.spacesDiff=d,d>0&&0<=l-1&&l-1<n.length&&l<t.length&&t.charCodeAt(l)!==32&&n.charCodeAt(l-1)===32&&n.charCodeAt(n.length-1)===44&&(r.looksLikeAlignment=!0);return}if(d%u===0){r.spacesDiff=d/u;return}}function cPe(n,e,t){const i=Math.min(n.getLineCount(),1e4);let r=0,o=0,s="",a=0;const l=[2,4,6,8,3,5,7],c=8,u=[0,0,0,0,0,0,0,0,0],d=new jcr;for(let g=1;g<=i;g++){const m=n.getLineLength(g),v=n.getLineContent(g),_=m<=65536;let b=!1,y=0,C=0,x=0;for(let k=0,L=m;k<L;k++){const D=_?v.charCodeAt(k):n.getLineCharCode(g,k);if(D===9)x++;else if(D===32)C++;else{b=!0,y=k;break}}if(!b||(x>0?r++:C>1&&o++,qcr(s,a,v,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const E=d.spacesDiff;E<=c&&u[E]++,s=v,a=y}let h=t;r!==o&&(h=r<o);let f=e;if(h){let g=h?0:.1*i;l.forEach(m=>{const v=u[m];v>g&&(g=v,f=m)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function Xd(n){return(n.metadata&1)>>>0}function vs(n,e){n.metadata=n.metadata&254|e<<0}function Jc(n){return(n.metadata&2)>>>1===1}function us(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function KJe(n){return(n.metadata&4)>>>2===1}function uPe(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function GJe(n){return(n.metadata&64)>>>6===1}function dPe(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function Kcr(n){return(n.metadata&24)>>>3}function hPe(n,e){n.metadata=n.metadata&231|e<<3}function Gcr(n){return(n.metadata&32)>>>5===1}function fPe(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class YJe{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,vs(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,uPe(this,!1),dPe(this,!1),hPe(this,1),fPe(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,us(this,!1)}reset(e,t,i,r){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=r}setOptions(e){this.options=e;const t=this.options.className;uPe(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),dPe(this,this.options.glyphMarginClassName!==null),hPe(this,this.options.stickiness),fPe(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Ji=new YJe(null,0,0);Ji.parent=Ji;Ji.left=Ji;Ji.right=Ji;vs(Ji,0);class vte{constructor(){this.root=Ji,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,r,o,s){return this.root===Ji?[]:nur(this,e,t,i,r,o,s)}search(e,t,i,r){return this.root===Ji?[]:tur(this,e,t,i,r)}collectNodesFromOwner(e){return Jcr(this,e)}collectNodesPostOrder(){return eur(this)}insert(e){pPe(this,e),this._normalizeDeltaIfNecessary()}delete(e){gPe(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let r=0;for(;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;const o=i.start+r,s=i.end+r;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,r){const o=Xcr(this,e,e+t);for(let s=0,a=o.length;s<a;s++){const l=o[s];gPe(this,l)}this._normalizeDeltaIfNecessary(),Zcr(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,a=o.length;s<a;s++){const l=o[s];l.start=l.cachedAbsoluteStart,l.end=l.cachedAbsoluteEnd,Qcr(l,e,e+t,i,r),l.maxEnd=l.end,pPe(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,Ycr(this))}}function Ycr(n){let e=n.root,t=0;for(;e!==Ji;){if(e.left!==Ji&&!Jc(e.left)){e=e.left;continue}if(e.right!==Ji&&!Jc(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,TS(e),us(e,!0),us(e.left,!1),us(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}us(n.root,!1)}function r2(n,e,t,i){return n<t?!0:n>t||i===1?!1:i===2?!0:e}function Qcr(n,e,t,i,r){const o=Kcr(n),s=o===0||o===2,a=o===1||o===2,l=t-e,c=i,u=Math.min(l,c),d=n.start;let h=!1;const f=n.end;let g=!1;e<=d&&f<=t&&Gcr(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const v=r?1:l>0?2:0;!h&&r2(d,s,e,v)&&(h=!0),!g&&r2(f,a,e,v)&&(g=!0)}if(u>0&&!r){const v=l>c?2:0;!h&&r2(d,s,e+u,v)&&(h=!0),!g&&r2(f,a,e+u,v)&&(g=!0)}{const v=r?1:0;!h&&r2(d,s,t,v)&&(n.start=e+c,h=!0),!g&&r2(f,a,t,v)&&(n.end=e+c,g=!0)}const m=c-l;h||(n.start=Math.max(0,d+m)),g||(n.end=Math.max(0,f+m)),n.start>n.end&&(n.end=n.start)}function Xcr(n,e,t){let i=n.root,r=0,o=0,s=0,a=0;const l=[];let c=0;for(;i!==Ji;){if(Jc(i)){us(i.left,!1),us(i.right,!1),i===i.parent.right&&(r-=i.parent.delta),i=i.parent;continue}if(!Jc(i.left)){if(o=r+i.maxEnd,o<e){us(i,!0);continue}if(i.left!==Ji){i=i.left;continue}}if(s=r+i.start,s>t){us(i,!0);continue}if(a=r+i.end,a>=e&&(i.setCachedOffsets(s,a,0),l[c++]=i),us(i,!0),i.right!==Ji&&!Jc(i.right)){r+=i.delta,i=i.right;continue}}return us(n.root,!1),l}function Zcr(n,e,t,i){let r=n.root,o=0,s=0,a=0;const l=i-(t-e);for(;r!==Ji;){if(Jc(r)){us(r.left,!1),us(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),TS(r),r=r.parent;continue}if(!Jc(r.left)){if(s=o+r.maxEnd,s<e){us(r,!0);continue}if(r.left!==Ji){r=r.left;continue}}if(a=o+r.start,a>t){r.start+=l,r.end+=l,r.delta+=l,(r.delta<-1073741824||r.delta>1073741824)&&(n.requestNormalizeDelta=!0),us(r,!0);continue}if(us(r,!0),r.right!==Ji&&!Jc(r.right)){o+=r.delta,r=r.right;continue}}us(n.root,!1)}function Jcr(n,e){let t=n.root;const i=[];let r=0;for(;t!==Ji;){if(Jc(t)){us(t.left,!1),us(t.right,!1),t=t.parent;continue}if(t.left!==Ji&&!Jc(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[r++]=t),us(t,!0),t.right!==Ji&&!Jc(t.right)){t=t.right;continue}}return us(n.root,!1),i}function eur(n){let e=n.root;const t=[];let i=0;for(;e!==Ji;){if(Jc(e)){us(e.left,!1),us(e.right,!1),e=e.parent;continue}if(e.left!==Ji&&!Jc(e.left)){e=e.left;continue}if(e.right!==Ji&&!Jc(e.right)){e=e.right;continue}t[i++]=e,us(e,!0)}return us(n.root,!1),t}function tur(n,e,t,i,r){let o=n.root,s=0,a=0,l=0;const c=[];let u=0;for(;o!==Ji;){if(Jc(o)){us(o.left,!1),us(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==Ji&&!Jc(o.left)){o=o.left;continue}a=s+o.start,l=s+o.end,o.setCachedOffsets(a,l,i);let d=!0;if(e&&o.ownerId&&o.ownerId!==e&&(d=!1),t&&KJe(o)&&(d=!1),r&&!GJe(o)&&(d=!1),d&&(c[u++]=o),us(o,!0),o.right!==Ji&&!Jc(o.right)){s+=o.delta,o=o.right;continue}}return us(n.root,!1),c}function nur(n,e,t,i,r,o,s){let a=n.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==Ji;){if(Jc(a)){us(a.left,!1),us(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Jc(a.left)){if(c=l+a.maxEnd,c<e){us(a,!0);continue}if(a.left!==Ji){a=a.left;continue}}if(u=l+a.start,u>t){us(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,o);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),r&&KJe(a)&&(g=!1),s&&!GJe(a)&&(g=!1),g&&(h[f++]=a)}if(us(a,!0),a.right!==Ji&&!Jc(a.right)){l+=a.delta,a=a.right;continue}}return us(n.root,!1),h}function pPe(n,e){if(n.root===Ji)return e.parent=Ji,e.left=Ji,e.right=Ji,vs(e,0),n.root=e,n.root;iur(n,e),bC(e.parent);let t=e;for(;t!==n.root&&Xd(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Xd(i)===1?(vs(t.parent,0),vs(i,0),vs(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,FM(n,t)),vs(t.parent,0),vs(t.parent.parent,1),BM(n,t.parent.parent))}else{const i=t.parent.parent.left;Xd(i)===1?(vs(t.parent,0),vs(i,0),vs(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,BM(n,t)),vs(t.parent,0),vs(t.parent.parent,1),FM(n,t.parent.parent))}return vs(n.root,0),e}function iur(n,e){let t=0,i=n.root;const r=e.start,o=e.end;for(;;)if(our(r,o,i.start+t,i.end+t)<0)if(i.left===Ji){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Ji){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=Ji,e.right=Ji,vs(e,1)}function gPe(n,e){let t,i;if(e.left===Ji?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Ji?(t=e.left,i=e):(i=rur(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,vs(t,0),e.detach(),bte(),TS(t),n.root.parent=Ji;return}const r=Xd(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,vs(i,Xd(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ji&&(i.left.parent=i),i.right!==Ji&&(i.right.parent=i)),e.detach(),r){bC(t.parent),i!==e&&(bC(i),bC(i.parent)),bte();return}bC(t),bC(t.parent),i!==e&&(bC(i),bC(i.parent));let o;for(;t!==n.root&&Xd(t)===0;)t===t.parent.left?(o=t.parent.right,Xd(o)===1&&(vs(o,0),vs(t.parent,1),FM(n,t.parent),o=t.parent.right),Xd(o.left)===0&&Xd(o.right)===0?(vs(o,1),t=t.parent):(Xd(o.right)===0&&(vs(o.left,0),vs(o,1),BM(n,o),o=t.parent.right),vs(o,Xd(t.parent)),vs(t.parent,0),vs(o.right,0),FM(n,t.parent),t=n.root)):(o=t.parent.left,Xd(o)===1&&(vs(o,0),vs(t.parent,1),BM(n,t.parent),o=t.parent.left),Xd(o.left)===0&&Xd(o.right)===0?(vs(o,1),t=t.parent):(Xd(o.left)===0&&(vs(o.right,0),vs(o,1),FM(n,o),o=t.parent.left),vs(o,Xd(t.parent)),vs(t.parent,0),vs(o.left,0),BM(n,t.parent),t=n.root));vs(t,0),bte()}function rur(n){for(;n.left!==Ji;)n=n.left;return n}function bte(){Ji.parent=Ji,Ji.delta=0,Ji.start=0,Ji.end=0}function FM(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Ji&&(t.left.parent=e),t.parent=e.parent,e.parent===Ji?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,TS(e),TS(t)}function BM(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Ji&&(t.right.parent=e),t.parent=e.parent,e.parent===Ji?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,TS(e),TS(t)}function QJe(n){let e=n.end;if(n.left!==Ji){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==Ji){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function TS(n){n.maxEnd=QJe(n)}function bC(n){for(;n!==Ji;){const e=QJe(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function our(n,e,t,i){return n===t?e-i:n-t}class $ce{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Ai)return tye(this.right);let e=this;for(;e.parent!==Ai&&e.parent.left!==e;)e=e.parent;return e.parent===Ai?Ai:e.parent}prev(){if(this.left!==Ai)return XJe(this.left);let e=this;for(;e.parent!==Ai&&e.parent.right!==e;)e=e.parent;return e.parent===Ai?Ai:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Ai=new $ce(null,0);Ai.parent=Ai;Ai.left=Ai;Ai.right=Ai;Ai.color=0;function tye(n){for(;n.left!==Ai;)n=n.left;return n}function XJe(n){for(;n.right!==Ai;)n=n.right;return n}function nye(n){return n===Ai?0:n.size_left+n.piece.length+nye(n.right)}function iye(n){return n===Ai?0:n.lf_left+n.piece.lineFeedCnt+iye(n.right)}function yte(){Ai.parent=Ai}function $M(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Ai&&(t.left.parent=e),t.parent=e.parent,e.parent===Ai?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function VM(n,e){const t=e.left;e.left=t.right,t.right!==Ai&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Ai?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function q9(n,e){let t,i;if(e.left===Ai?(i=e,t=i.right):e.right===Ai?(i=e,t=i.left):(i=tye(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),yte(),n.root.parent=Ai;return}const r=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,EP(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,EP(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ai&&(i.left.parent=i),i.right!==Ai&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,EP(n,i)),e.detach(),t.parent.left===t){const s=nye(t),a=iye(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,ay(n,t.parent,l,c)}}if(EP(n,t.parent),r){yte();return}let o;for(;t!==n.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,$M(n,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,VM(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,$M(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,VM(n,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,$M(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,VM(n,t.parent),t=n.root));t.color=0,yte()}function mPe(n,e){for(EP(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,$M(n,e)),e.parent.color=0,e.parent.parent.color=1,VM(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,VM(n,e)),e.parent.color=0,e.parent.parent.color=1,$M(n,e.parent.parent))}n.root.color=0}function ay(n,e,t,i){for(;e!==n.root&&e!==Ai;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function EP(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=nye(e.left)-e.size_left,i=iye(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const X0=65535;function ZJe(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class sur{constructor(e,t,i,r,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=r,this.isBasicASCII=o}}function hy(n,e=!0){const t=[0];let i=1;for(let r=0,o=n.length;r<o;r++){const s=n.charCodeAt(r);s===13?r+1<o&&n.charCodeAt(r+1)===10?(t[i++]=r+2,r++):t[i++]=r+1:s===10&&(t[i++]=r+1)}return e?ZJe(t):t}function aur(n,e){n.length=0,n[0]=0;let t=1,i=0,r=0,o=0,s=!0;for(let l=0,c=e.length;l<c;l++){const u=e.charCodeAt(l);u===13?l+1<c&&e.charCodeAt(l+1)===10?(o++,n[t++]=l+2,l++):(i++,n[t++]=l+1):u===10?(r++,n[t++]=l+1):s&&u!==9&&(u<32||u>126)&&(s=!1)}const a=new sur(ZJe(n),i,r,o,s);return n.length=0,a}class Ih{constructor(e,t,i,r,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=r,this.length=o}}class Ix{constructor(e,t){this.buffer=e,this.lineStarts=t}}class lur{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ai&&e.iterate(e.root,i=>(i!==Ai&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class cur{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let r=0;r<i.length;r++){const o=i[r];if(o.node.parent===null||o.nodeStartOffset>=e){i[r]=null,t=!0;continue}}if(t){const r=[];for(const o of i)o!==null&&r.push(o);this._cache=r}}}class uur{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Ix("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ai,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let r=null;for(let o=0,s=e.length;o<s;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=hy(e[o].buffer));const a=new Ih(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),r=this.rbInsertRight(r,a)}this._searchCache=new cur(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=X0,i=t-Math.floor(t/3),r=i*2;let o="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=i||s+u<r)return o+=c,s+=u,!0;const d=o.replace(/\r\n|\r|\n/g,e);return a.push(new Ix(d,hy(d))),o=c,s=u,!0}),s>0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new Ix(l,hy(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new lur(this,e)}getOffsetAt(e,t){let i=0,r=this.root;for(;r!==Ai;)if(r.left!==Ai&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){i+=r.size_left;const o=this.getAccumulatedValue(r,e-r.lf_left-2);return i+=o+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,i+=r.size_left+r.piece.length,r=r.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const r=e;for(;t!==Ai;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const s=this.getOffsetAt(i+1,1),a=r-s;return new De(i+1,a+1)}return new De(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ai){const o=this.getOffsetAt(i+1,1),s=r-e-o;return new De(i+1,s+1)}else t=t.right;return new De(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,r);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const r=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=r.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Ai;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,i.piece.length);i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",r=!1;return this.iterate(this.root,o=>{if(o===Ai)return!0;const s=o.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(r&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",r=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(r=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=u+1;f<d;f++)i=this._EOLNormalized?l.substring(c[f],c[f+1]-this._EOLLength):l.substring(c[f],c[f+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return!this._EOLNormalized&&l.charCodeAt(c[d]+s.end.column-1)===13?(r=!0,s.end.column===0?t--:i=l.substr(c[d],s.end.column-1)):i=l.substr(c[d],s.end.column),!0}),r&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],r=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(r)}else{const t=this._buffers[e.node.piece.bufferIndex],r=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(r)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,r,o,s,a,l,c,u,d){const h=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),m=this.offsetInBuffer(e.piece.bufferIndex,s);let v;const _={line:0,column:0};let b,y;t._wordSeparators?(b=h.buffer.substring(g,m),y=C=>C+g,t.reset(0)):(b=h.buffer,y=C=>C,t.reset(g));do if(v=t.next(b),v){if(y(v.index)>=m)return u;this.positionInBuffer(e,y(v.index)-f,_);const C=this.getLineFeedCnt(e.piece.bufferIndex,o,_),x=_.line===o.line?_.column-o.column+r:_.column+1,E=x+v[0].length;if(d[u++]=wx(new J(i+C,x,i+C,E),v,l),y(v.index)+v[0].length>=m||u>=c)return u}while(v);return u}findMatchesLineByLine(e,t,i,r){const o=[];let s=0;const a=new aL(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let u=this.positionInBuffer(l.node,l.remainder);const d=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,u,d,t,i,r,s,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const m=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(m>=1){const _=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=_[u.line+m],C=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,C,u,this.positionInBuffer(f,y-b),t,i,r,s,o),s>=r)return o;h+=m}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const _=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,_,e.endLineNumber,v,s,o,i,r),o}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,o,i,r),s>=r)return o;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const m=h===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(h).substring(m,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,m,s,o,i,r),o}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,u,d,t,i,r,s,o),o}_findMatchesInLine(e,t,i,r,o,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=i.length;let m=-f;for(;(m=i.indexOf(h,m+f))!==-1;)if((!u||w0e(u,i,g,m,f))&&(a[s++]=new L3(new J(r,m+1+o,r,m+1+f+o),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(i),d&&(a[s++]=wx(new J(r,d.index+1+o,r,d.index+1+d[0].length+o),d,l),s>=c))return s;while(d);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ai){const{node:r,remainder:o,nodeStartOffset:s}=this.nodeAt(e),a=r.piece,l=a.bufferIndex,c=this.positionInBuffer(r,o);if(r.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.length<X0){this.appendToNode(r,t),this.computeBufferMetadata();return}if(s===e)this.insertContentToNodeLeft(t,r),this._searchCache.validate(e);else if(s+r.piece.length>e){const u=[];let d=new Ih(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(r,o)===10){const m={line:d.start.line+1,column:0};d=new Ih(d.bufferIndex,m,d.end,this.getLineFeedCnt(d.bufferIndex,m,d.end),d.length-1),t+=` `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(r,o-1)===13){const m=this.positionInBuffer(r,o-1);this.deleteNodeTail(r,m),t="\r"+t,r.piece.length===0&&u.push(r)}else this.deleteNodeTail(r,c);else this.deleteNodeTail(r,c);const h=this.createNewPieces(t);d.length>0&&this.rbInsertRight(r,d);let f=r;for(let g=0;g<h.length;g++)f=this.rbInsertRight(f,h[g]);this.deleteNodes(u)}else this.insertContentToNodeRight(t,r)}else{const r=this.createNewPieces(t);let o=this.rbInsertLeft(null,r[0]);for(let s=1;s<r.length;s++)o=this.rbInsertRight(o,r[s])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===Ai)return;const i=this.nodeAt(e),r=this.nodeAt(e+t),o=i.node,s=r.node;if(o===s){const h=this.positionInBuffer(o,i.remainder),f=this.positionInBuffer(o,r.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const g=o.next();q9(this,o),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(o,f),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),this.computeBufferMetadata();return}if(i.nodeStartOffset+o.piece.length===e+t){this.deleteNodeTail(o,h),this.validateCRLFWithNextNode(o),this.computeBufferMetadata();return}this.shrinkNode(o,h,f),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,l),this._searchCache.validate(e),o.piece.length===0&&a.push(o);const c=this.positionInBuffer(s,r.remainder);this.deleteNodeHead(s,c),s.piece.length===0&&a.push(s);const u=o.next();for(let h=u;h!==Ai&&h!==s;h=h.next())a.push(h);const d=o.piece.length===0?o.prev():o;this.deleteNodes(a),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const s=t.piece,a={line:s.start.line+1,column:0},l=new Ih(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),s.length-1);t.piece=l,e+=` `,ay(this,t,-1,-1),t.piece.length===0&&i.push(t)}const r=this.createNewPieces(e);let o=this.rbInsertLeft(t,r[r.length-1]);for(let s=r.length-2;s>=0;s--)o=this.rbInsertLeft(o,r[s]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` `);const i=this.createNewPieces(e),r=this.rbInsertRight(t,i[0]);let o=r;for(let s=1;s<i.length;s++)o=this.rbInsertRight(o,i[s]);this.validateCRLFWithPrevNode(r)}positionInBuffer(e,t,i){const r=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,l=s[r.start.line]+r.start.column+t;let c=r.start.line,u=r.end.line,d=0,h=0,f=0;for(;c<=u&&(d=c+(u-c)/2|0,f=s[d],d!==u);)if(h=s[d+1],l<f)u=d-1;else if(l>=h)c=d+1;else break;return i?(i.line=d,i.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const r=this._buffers[e].lineStarts;if(i.line===r.length-1)return i.line-t.line;const o=r[i.line+1],s=r[i.line]+i.column;if(o>s+1)return i.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)q9(this,e[t])}createNewPieces(e){if(e.length>X0){const u=[];for(;e.length>X0;){const h=e.charCodeAt(X0-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,X0-1),e=e.substring(X0-1)):(f=e.substring(0,X0),e=e.substring(X0));const g=hy(f);u.push(new Ih(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new Ix(f,g))}const d=hy(e);return u.push(new Ih(this._buffers.length,{line:0,column:0},{line:d.length-1,column:e.length-d[d.length-1]},d.length-1,e.length)),this._buffers.push(new Ix(e,d)),u}let t=this._buffers[0].buffer.length;const i=hy(e,!1);let r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let u=0;u<i.length;u++)i[u]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let u=0;u<i.length;u++)i[u]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,a=o-this._buffers[0].lineStarts[s],l={line:s,column:a},c=new Ih(0,r,l,this.getLineFeedCnt(0,r,l),o-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,r="";const o=this._searchCache.get2(e);if(o){i=o.node;const s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt===e)r=a.substring(l+s,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return a.substring(l+s,l+c-t)}}else{let s=0;const a=e;for(;i!==Ai;)if(i.left!==Ai&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),u=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-i.lf_left)}),u.substring(d+l,d+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,u=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);r=c.substring(u+l,u+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Ai;){const s=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=s.substring(l,l+a-t),r}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);r+=s.substr(a,i.piece.length)}i=i.next()}return r}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Ai;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,r=this.positionInBuffer(e,t),o=r.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,i.start,r);if(s!==o)return{index:s,remainder:0}}return{index:o,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,r=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?r[i.end.line]+i.end.column-r[i.start.line]-i.start.column:r[o]-r[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,r=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,a=this.offsetInBuffer(i.bufferIndex,s),l=this.getLineFeedCnt(i.bufferIndex,i.start,s),c=l-r,u=a-o,d=i.length+u;e.piece=new Ih(i.bufferIndex,i.start,s,l,d),ay(this,e,u,c)}deleteNodeHead(e,t){const i=e.piece,r=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,a=this.getLineFeedCnt(i.bufferIndex,s,i.end),l=this.offsetInBuffer(i.bufferIndex,s),c=a-r,u=o-l,d=i.length+u;e.piece=new Ih(i.bufferIndex,s,i.end,a,d),ay(this,e,u,c)}shrinkNode(e,t,i){const r=e.piece,o=r.start,s=r.end,a=r.length,l=r.lineFeedCnt,c=t,u=this.getLineFeedCnt(r.bufferIndex,r.start,c),d=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,o);e.piece=new Ih(r.bufferIndex,r.start,c,u,d),ay(this,e,d-a,u-l);const h=new Ih(r.bufferIndex,i,s,this.getLineFeedCnt(r.bufferIndex,i,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,i)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` `);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=hy(t,!1);for(let f=0;f<o.length;f++)o[f]+=r;if(i){const f=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-f}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[s],l={line:s,column:a},c=e.piece.length+t.length,u=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,l),h=d-u;e.piece=new Ih(e.piece.bufferIndex,e.piece.start,l,d,c),this._lastChangeBufferPos=l,ay(this,e,t.length,h)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let r=0;for(;t!==Ai;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,r=0;for(;i!==Ai;)if(i.left!==Ai&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return r+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:r}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:r};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Ai;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:s}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(r)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` `)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Ai||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,o=i[r]+t.start.column;return r===i.length-1||i[r+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Ai||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],r=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Ih(e.piece.bufferIndex,e.piece.start,o,a,s),ay(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,u=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Ih(t.piece.bufferIndex,l,t.piece.end,u,c),ay(this,t,-1,-1),t.piece.length===0&&i.push(t);const d=this.createNewPieces(`\r `);this.rbInsertRight(e,d[0]);for(let h=0;h<i.length;h++)q9(this,i[h])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=` `,i.piece.length===1)q9(this,i);else{const r=i.piece,o={line:r.start.line+1,column:0},s=r.length-1,a=this.getLineFeedCnt(r.bufferIndex,o,r.end);i.piece=new Ih(r.bufferIndex,o,r.end,a,s),ay(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===Ai)return t(Ai);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===Ai)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,r=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(r,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),r=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,r)}rbInsertRight(e,t){const i=new $ce(t,1);if(i.left=Ai,i.right=Ai,i.parent=Ai,i.size_left=0,i.lf_left=0,this.root===Ai)this.root=i,i.color=0;else if(e.right===Ai)e.right=i,i.parent=e;else{const o=tye(e.right);o.left=i,i.parent=o}return mPe(this,i),i}rbInsertLeft(e,t){const i=new $ce(t,1);if(i.left=Ai,i.right=Ai,i.parent=Ai,i.size_left=0,i.lf_left=0,this.root===Ai)this.root=i,i.color=0;else if(e.left===Ai)e.left=i,i.parent=e;else{const r=XJe(e.left);r.right=i,i.parent=r}return mPe(this,i),i}}class dD extends Ue{constructor(e,t,i,r,o,s,a){super(),this._onDidChangeContent=this._register(new Le),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._pieceTree=new uur(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,r=this.getPositionAt(e),o=this.getPositionAt(i);return new J(r.lineNumber,r.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),r=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const s=this._getEndOfLine(t),a=this.getEOL();if(s.length!==a.length){const l=s.length-a.length,c=e.endLineNumber-e.startLineNumber;o=l*c}return r-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const r=e.startLineNumber,o=e.endLineNumber;for(let s=r;s<=o;s++){const a=this.getLineContent(s),l=s===r?e.startColumn-1:0,c=s===o?e.endColumn-1:a.length;for(let u=l;u<c;u++)Rl(a.charCodeAt(u))?(i=i+1,u=u+1):i=i+1}return i+=this._getEndOfLine(t).length*(o-r),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=Yu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=dv(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return` `;case 2:return`\r `;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let r=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const v=e[m];a&&v._isTracked&&(a=!1);const _=v.range;if(v.text){let E=!0;s||(E=!C6(v.text),s=E),!r&&E&&(r=SA(v.text)),!o&&E&&(o=$Xe(v.text))}let b="",y=0,C=0,x=0;if(v.text){let E;[y,C,x,E]=ES(v.text);const k=this.getEOL();E===0||E===(k===`\r `?2:1)?b=v.text:b=v.text.replace(/\r\n|\r|\n/g,k)}l[m]={sortIndex:m,identifier:v.identifier||null,range:_,rangeOffset:this.getOffsetAt(_.startLineNumber,_.startColumn),rangeLength:this.getValueLengthInRange(_),text:b,eolCount:y,firstLineLength:C,lastLineLength:x,forceMoveMarkers:!!v.forceMoveMarkers,isAutoWhitespaceEdit:v.isAutoWhitespaceEdit||!1}}l.sort(dD._sortOpsAscending);let c=!1;for(let m=0,v=l.length-1;m<v;m++){const _=l[m].range.getEndPosition(),b=l[m+1].range.getStartPosition();if(b.isBeforeOrEqual(_)){if(b.isBefore(_))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const u=i||t?dD._getInverseEditRanges(l):[],d=[];if(t)for(let m=0;m<l.length;m++){const v=l[m],_=u[m];if(v.isAutoWhitespaceEdit&&v.range.isEmpty())for(let b=_.startLineNumber;b<=_.endLineNumber;b++){let y="";b===_.startLineNumber&&(y=this.getLineContent(v.range.startLineNumber),Yu(y)!==-1)||d.push({lineNumber:b,oldContent:y})}}let h=null;if(i){let m=0;h=[];for(let v=0;v<l.length;v++){const _=l[v],b=u[v],y=this.getValueInRange(_.range),C=_.rangeOffset+m;m+=_.text.length-y.length,h[v]={sortIndex:_.sortIndex,identifier:_.identifier,range:b,text:y,textChange:new Wc(_.rangeOffset,y,C,_.text)}}c||h.sort((v,_)=>v.sortIndex-_.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((m,v)=>v.lineNumber-m.lineNumber),g=[];for(let m=0,v=d.length;m<v;m++){const _=d[m].lineNumber;if(m>0&&d[m-1].lineNumber===_)continue;const b=d[m].oldContent,y=this.getLineContent(_);y.length===0||y===b||Yu(y)!==-1||g.push(_)}}return this._onDidChangeContent.fire(),new gir(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,r=e[e.length-1].range,o=new J(i.startLineNumber,i.startColumn,r.endLineNumber,r.endColumn);let s=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f<g;f++){const m=e[f],v=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new J(s,a,v.startLineNumber,v.startColumn))),m.text.length>0&&l.push(m.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[u,d,h]=ES(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(dD._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const r=e[i],o=r.range.startLineNumber,s=r.range.startColumn,a=r.range.endLineNumber,l=r.range.endColumn;if(o===a&&s===l&&r.text.length===0)continue;r.text?(this._pieceTree.delete(r.rangeOffset,r.rangeLength),this._pieceTree.insert(r.rangeOffset,r.text,!0)):this._pieceTree.delete(r.rangeOffset,r.rangeLength);const c=new J(o,s,a,l);t.push({range:c,rangeLength:r.rangeLength,text:r.text,rangeOffset:r.rangeOffset,forceMoveMarkers:r.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,r){return this._pieceTree.findMatchesLineByLine(e,t,i,r)}static _getInverseEditRanges(e){const t=[];let i=0,r=0,o=null;for(let s=0,a=e.length;s<a;s++){const l=e[s];let c,u;o?o.range.endLineNumber===l.range.startLineNumber?(c=i,u=r+(l.range.startColumn-o.range.endColumn)):(c=i+(l.range.startLineNumber-o.range.endLineNumber),u=l.range.startColumn):(c=l.range.startLineNumber,u=l.range.startColumn);let d;if(l.text.length>0){const h=l.eolCount+1;h===1?d=new J(c,u,c,u+l.firstLineLength):d=new J(c,u,c+h-1,l.lastLineLength+1)}else d=new J(c,u,c,u);i=d.endLineNumber,r=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const i=J.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=J.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class dur{constructor(e,t,i,r,o,s,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=r,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` `:`\r `:i>t/2?`\r `:` `}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` `&&(this._cr>0||this._crlf>0)))for(let o=0,s=i.length;o<s;o++){const a=i[o].buffer.replace(/\r\n|\r|\n/g,t),l=hy(a);i[o]=new Ix(a,l)}const r=new dD(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:r,disposable:r}}}class JJe{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&h0e(e)&&(this.BOM=mer,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=aur(this._tmpLineStarts,e);this.chunks.push(new Ix(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=SA(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=$Xe(e)))}finish(e=!0){return this._finish(),new dur(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=hy(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class hur{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const r=this._store.slice(0,e),o=this._store.slice(e+t),s=fur(i,this._default);this._store=r.concat(s,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let r=0;r<t;r++)i[r]=this._default;this._store=eG(this._store,e,i)}}function fur(n,e){const t=[];for(let i=0;i<n;i++)t[i]=e;return t}class pur{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class Vce{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new pur(e,[t]))}finalize(){return this._tokens}}class gur{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new Hce(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class mur extends gur{constructor(e,t,i,r){super(e,t),this._textModel=i,this._languageIdCodec=r}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const r=this.getFirstInvalidLine();if(!r||r.lineNumber>t)break;const o=this._textModel.getLineContent(r.lineNumber),s=RO(this._languageIdCodec,i,this.tokenizationSupport,o,!0,r.startState);e.add(r.lineNumber,s.tokens),this.store.setEndState(r.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const r=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=RO(this._languageIdCodec,r,this.tokenizationSupport,s,!0,i),l=new Ol(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const r=e.lineNumber,o=e.column,s=this.getStartState(r);if(!s)return null;const a=this._textModel.getLineContent(r),l=a.substring(0,o-1)+i+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(r,0),u=RO(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new Ol(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t||e===t&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,t,i){if(i<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,i),{heuristicTokens:!1};let r=this.guessStartState(t);const o=this._textModel.getLanguageId();for(let s=t;s<=i;s++){const a=this._textModel.getLineContent(s),l=RO(this._languageIdCodec,o,this.tokenizationSupport,a,!0,r);e.add(s,l.tokens),r=l.endState}return{heuristicTokens:!0}}guessStartState(e){let t=this._textModel.getLineFirstNonWhitespaceColumn(e);const i=[];let r=null;for(let a=e-1;t>1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l<t&&(i.push(this._textModel.getLineContent(a)),t=l,r=this.getStartState(a),r))break}r||(r=this.tokenizationSupport.getInitialState()),i.reverse();const o=this._textModel.getLanguageId();let s=r;for(const a of i)s=RO(this._languageIdCodec,o,this.tokenizationSupport,a,!1,s).endState;return s}}class Hce{constructor(e){this.lineCount=e,this._tokenizationStateStore=new _ur,this._invalidEndStatesLineNumbers=new vur,this._invalidEndStatesLineNumbers.addRange(new rr(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new Qa("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);const i=this._tokenizationStateStore.setEndState(e,t);return i&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new rr(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new rr(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[i]=ES(t.text);this.acceptChange(new cr(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new rr(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return this._invalidEndStatesLineNumbers.min===null}getStartState(e,t){return e===1?t:this.getEndState(e-1)}getFirstInvalidLine(e){const t=this.getFirstInvalidEndStateLineNumber();if(t===null)return null;const i=this.getStartState(t,e);if(!i)throw new Qa("Start state must be defined");return{lineNumber:t,startState:i}}}class _ur{constructor(){this._lineEndStates=new hur(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){const i=this._lineEndStates.get(e);return i&&i.equals(t)?!1:(this._lineEndStates.set(e,t),!0)}acceptChange(e,t){let i=e.length;t>0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class vur{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new rr(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new rr(i.start,e):this._ranges.splice(t,1,new rr(i.start,e),new rr(e+1,i.endExclusive))}}addRange(e){rr.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let r=i;for(;!(r>=this._ranges.length||e.endExclusive<this._ranges[r].start);)r++;const o=t-e.length;for(let s=r;s<this._ranges.length;s++)this._ranges[s]=this._ranges[s].delta(o);if(i===r){const s=new rr(e.start,e.start+t);s.isEmpty||this._ranges.splice(i,0,s)}else{const s=Math.min(e.start,this._ranges[i].start),a=Math.max(e.endExclusive,this._ranges[r-1].endExclusive),l=new rr(s,a+o);l.isEmpty?this._ranges.splice(i,r-i):this._ranges.splice(i,r-i,l)}}toString(){return this._ranges.map(e=>e.toString()).join(" + ")}}function RO(n,e,t,i,r,o){let s=null;if(t)try{s=t.tokenizeEncoded(i,r,o.clone())}catch(a){Oi(a)}return s||(s=kG(n.encodeLanguageId(e),o)),Ol.convertToEndOffset(s.tokens,i.length),s}class bur{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,My(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?uXe(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new Vce,i=Eu.create(!1);do if(i.elapsed()>1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new cr(e,t))}}const fy=new Uint32Array(0).buffer;class Jv{static deleteBeginning(e,t){return e===null||e===fy?e:Jv.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===fy)return e;const i=ky(e),r=i[i.length-2];return Jv.delete(e,t,r)}static delete(e,t,i){if(e===null||e===fy||t===i)return e;const r=ky(e),o=r.length>>>1;if(t===0&&r[r.length-2]===i)return fy;const s=Ol.findIndexInTokensArray(r,t),a=s>0?r[s-1<<1]:0,l=r[s<<1];if(i<l){const f=i-t;for(let g=s;g<o;g++)r[g<<1]-=f;return e}let c,u;a!==t?(r[s<<1]=t,c=s+1<<1,u=t):(c=s<<1,u=a);const d=i-t;for(let f=s+1;f<o;f++){const g=r[f<<1]-d;g>u&&(r[c++]=g,r[c++]=r[(f<<1)+1],u=g)}if(c===r.length)return e;const h=new Uint32Array(c);return h.set(r.subarray(0,c),0),h.buffer}static append(e,t){if(t===fy)return e;if(e===fy)return t;if(e===null)return e;if(t===null)return null;const i=ky(e),r=ky(t),o=r.length>>>1,s=new Uint32Array(i.length+r.length);s.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c<o;c++)s[a++]=r[c<<1]+l,s[a++]=r[(c<<1)+1];return s.buffer}static insert(e,t,i){if(e===null||e===fy)return e;const r=ky(e),o=r.length>>>1;let s=Ol.findIndexInTokensArray(r,t);s>0&&r[s-1<<1]===t&&s--;for(let a=s;a<o;a++)r[a<<1]+=i;return e}}function ky(n){return n instanceof Uint32Array?n:new Uint32Array(n)}class Z3{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let r=null;if(t<this._len&&(r=this._lineTokens[t]),r!==null&&r!==fy)return new Ol(ky(r),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=_Pe(this._languageIdCodec.encodeLanguageId(e)),new Ol(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const r=i?ky(i):null;if(t===0){let o=!1;if(r&&r.length>1&&(o=Kc.getLanguageId(r[1])!==e),!o)return fy}if(!r||r.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=_Pe(e),o.buffer}return r[r.length-2]=t,r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let r=0;r<t;r++)i[r]=null;this._lineTokens=eG(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,r,o){const s=Z3._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,r);this._ensureLine(t);const a=this._lineTokens[t];return this._lineTokens[t]=s,o?!Z3._equals(a,s):!1}static _equals(e,t){if(!e||!t)return!e&&!t;const i=ky(e),r=ky(t);if(i.length!==r.length)return!1;for(let o=0,s=i.length;o<s;o++)if(i[o]!==r[o])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new De(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Jv.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Jv.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let r=null;i<this._len&&(r=Jv.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=Jv.append(this._lineTokens[t],r),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(t===0&&i===0)return;const r=e.lineNumber-1;if(!(r>=this._len)){if(t===0){this._lineTokens[r]=Jv.insert(this._lineTokens[r],e.column-1,i);return}this._lineTokens[r]=Jv.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=Jv.insert(this._lineTokens[r],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let r=0,o=e.length;r<o;r++){const s=e[r];let a=0,l=0,c=!1;for(let u=s.startLineNumber;u<=s.endLineNumber;u++)c?(this.setTokens(t.getLanguageId(),u-1,t.getLineLength(u),s.getLineTokens(u),!1),l=u):this.setTokens(t.getLanguageId(),u-1,t.getLineLength(u),s.getLineTokens(u),!0)&&(c=!0,a=u,l=u);c&&i.push({fromLineNumber:a,toLineNumber:l})}return{changes:i}}}function _Pe(n){return(n<<0|0|0|32768|2<<24|1024)>>>0}class rye{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),s=t[t.length-1].getRange();if(!o||!s)return e;i=e.plusRange(o).plusRange(s)}let r=null;for(let o=0,s=this._pieces.length;o<s;o++){const a=this._pieces[o];if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){r=r||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){r=r||{index:o};continue}const[l,c]=a.split(i);if(l.isEmpty()){r=r||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,s++,r=r||{index:o})}return r=r||{index:this._pieces.length},t.length>0&&(this._pieces=eG(this._pieces,r.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const r=rye._findFirstPieceWithLine(i,e),o=i[r].getLineTokens(e);if(!o)return t;const s=t.getCount(),a=o.getCount();let l=0;const c=[];let u=0,d=0;const h=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f<a;f++){const g=o.getStartCharacter(f),m=o.getEndCharacter(f),v=o.getMetadata(f),_=((v&1?2048:0)|(v&2?4096:0)|(v&4?8192:0)|(v&8?16384:0)|(v&16?16744448:0)|(v&32?4278190080:0))>>>0,b=~_>>>0;for(;l<s&&t.getEndOffset(l)<=g;)h(t.getEndOffset(l),t.getMetadata(l)),l++;for(l<s&&t.getStartOffset(l)<g&&h(g,t.getMetadata(l));l<s&&t.getEndOffset(l)<m;)h(t.getEndOffset(l),t.getMetadata(l)&b|v&_),l++;if(l<s)h(m,t.getMetadata(l)&b|v&_),t.getEndOffset(l)===m&&l++;else{const y=Math.min(Math.max(0,l-1),s-1);h(m,t.getMetadata(y)&b|v&_)}}for(;l<s;)h(t.getEndOffset(l),t.getMetadata(l)),l++;return new Ol(new Uint32Array(c),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,r=e.length-1;for(;i<r;){let o=i+Math.floor((r-i)/2);if(e[o].endLineNumber<t)i=o+1;else if(e[o].startLineNumber>t)r=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,r,o){for(const s of this._pieces)s.acceptEdit(e,t,i,r,o)}}class wz extends AJe{constructor(e,t,i,r,o,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=r,this._languageId=o,this._attachedViews=s,this._semanticTokens=new rye(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new Le),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new Le),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new Le),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new yur(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,r,o]=ES(t.text);this._semanticTokens.acceptEdit(t.range,i,r,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Qa("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),r=this.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1),[s,a]=wz._findLanguageBoundaries(r,o),l=v3(t.column,this.getLanguageConfiguration(r.getLanguageId(o)).getWordDefinition(),i.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&s===t.column-1){const[c,u]=wz._findLanguageBoundaries(r,o-1),d=v3(t.column,this.getLanguageConfiguration(r.getLanguageId(o-1)).getWordDefinition(),i.substring(c,u),c);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn)return d}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let r=0;for(let s=t;s>=0&&e.getLanguageId(s)===i;s--)r=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,a=e.getCount();s<a&&e.getLanguageId(s)===i;s++)o=e.getEndOffset(s);return[r,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new De(e,t)),r=this.getLineTokens(i.lineNumber);return r.getLanguageId(r.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._bracketPairsTextModelPart.handleDidChangeLanguage(i),this.grammarTokens.resetTokenization(),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}}class yur extends Ue{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t,i,r){super(),this._languageIdCodec=e,this._textModel=t,this.getLanguageId=i,this._tokenizer=null,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new Nc),this._tokens=new Z3(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new Nc),this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new Le),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new Le),this.onDidChangeTokens=this._onDidChangeTokens.event,this._attachedViewStates=this._register(new e0e),this._register(Ks.onDidChange(o=>{const s=this.getLanguageId();o.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:o,state:s})=>{if(s){let a=this._attachedViewStates.get(o);a||(a=new Cur(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Hce(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=Ks.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return Oi(l),[null,null]}return[s,a]},[r,o]=i();if(r&&o?this._tokenizer=new mur(this._textModel.getLineCount(),r,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};r&&r.createBackgroundTokenizer&&!r.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,s)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new bur(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),r!=null&&r.backgroundTokenizerShouldOnlyVerifyTokens&&r.createBackgroundTokenizer?(this._debugBackgroundTokens=new Z3(this._languageIdCodec),this._debugBackgroundStates=new Hce(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[s,a]=ES(o.text);this._tokens.acceptEdit(o.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,s,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=cr.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,r;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new Vce,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(s)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.checkFinished()}forceTokenization(e){var t,i;const r=new Vce;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(r,e),this.setTokens(r.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),r=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!r.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return r}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const r=this._textModel.validatePosition(new De(e,t));return this.forceTokenization(r.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(r,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const r=this._textModel.validatePosition(e);return this.forceTokenization(r.lineNumber),this._tokenizer.tokenizeLineWithEdit(r,t,i)}get hasTokens(){return this._tokens.hasTokens}}class Cur extends Ue{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new $o(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ia(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class wur{constructor(){this.changeType=1}}class yv{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",r=0;for(const o of t)i+=e.substring(r,o.column-1),r=o.column-1,i+=o.options.content;return i+=e.substring(r),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new yv(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new yv(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,r)=>i.lineNumber===r.lineNumber?i.column===r.column?i.order-r.order:i.column-r.column:i.lineNumber-r.lineNumber),t}constructor(e,t,i,r,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=r,this.order=o}}class vPe{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Sur{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Eur{constructor(e,t,i,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class xur{constructor(){this.changeType=5}}class hD{constructor(e,t,i,r){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=r,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),r=t.versionId,o=e.isUndoing||t.isUndoing,s=e.isRedoing||t.isRedoing;return new hD(i,r,o,s)}}class eet{constructor(e){this.changes=e}}class yT{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=hD.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=yT._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new yT(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),r=t.eol,o=t.versionId,s=e.isUndoing||t.isUndoing,a=e.isRedoing||t.isRedoing,l=e.isFlush||t.isFlush,c=e.isEolChange&&t.isEolChange;return{changes:i,eol:r,isEolChange:c,versionId:o,isUndoing:s,isRedoing:a,isFlush:l}}}const VG=or("undoRedoService");class tet{constructor(e,t){this.resource=e,this.elements=t}}class BA{constructor(){this.id=BA._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}BA._ID=0;BA.None=new BA;class yb{constructor(){this.id=yb._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}yb._ID=0;yb.None=new yb;var Tur=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lx;function kur(n){const e=new JJe;return e.acceptChunk(n),e.finish()}function Iur(n){const e=new JJe;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function bPe(n,e){let t;return typeof n=="string"?t=kur(n):fir(n)?t=Iur(n):t=n,t.create(e)}let K9=0;const Lur=999,Dur=1e4;class Aur{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const r=this._source.read();if(r===null)return this._eos=!0,t===0?null:e.join("");if(r.length>0&&(e[t++]=r,i+=r.length),i>=64*1024)return e.join("")}while(!0)}}const OO=()=>{throw new Error("Invalid change accessor")};let f0=lx=class extends Ue{static resolveOptions(e,t){if(t.detectIndentation){const i=cPe(e,t.tabSize,t.insertSpaces);return new q$({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new q$(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return km(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,r=null,o,s,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new Le),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Mur(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new Le),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new Le),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new Le),this._eventEmitter=this._register(new Fur),this._languageSelectionListener=this._register(new Nc),this._deltaDecorationCallCnt=0,this._attachedViews=new Bur,K9++,this.id="$model"+K9,this.isForSimpleWidget=i.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=Yn.parse("inmemory://model/"+K9):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=bPe(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=lx.resolveOptions(this._buffer,i);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Ncr(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Tlr(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Ocr(this)),this._tokenizationTextModelPart=new wz(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new J(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>lx.LARGE_FILE_SIZE_THRESHOLD||d>lx.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>lx.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>lx._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=VXe(K9),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new yPe,this._commandManager=new eye(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new dD([],"",` `,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Ue.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new yT(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw ag();const{textBuffer:t,disposable:i}=bPe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,r,o,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:r}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),r=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new yPe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new hD([new wur],this._versionId,!1,!1),this._createContentChanged2(new J(1,1,o,s),0,r,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` `;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),r=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new hD([new xur],this._versionId,!1,!1),this._createContentChanged2(new J(1,1,o,s),0,r,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,r=t.length;i<r;i++){const o=t[i],s=o.range,a=o.cachedAbsoluteStart-o.start,l=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),c=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);o.cachedAbsoluteStart=l,o.cachedAbsoluteEnd=c,o.cachedVersionId=e,o.start=l-a,o.end=c-a,TS(o)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let r=1;r<=i;r++){const o=this._buffer.getLineLength(r);o>=Dur?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,r=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new q$({tabSize:t,indentSize:i,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=cPe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),pz(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(BXe.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Qa("Operation would exceed heap memory limits");const i=this.getFullModelRange(),r=this.getValueInRange(i,e);return t?this._buffer.getBOM()+r:r}createSnapshot(e=!1){return new Aur(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),r=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+r:r}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qa("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qa("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Qa("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` `?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qa("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qa("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Qa("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,r=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),s=Math.floor(typeof r=="number"&&!isNaN(r)?r:1);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const d=this.getLineMaxColumn(o);s>=d&&(s=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,u=1;else if(c>t)c=t,u=this.getLineMaxColumn(c);else if(u<=1)u=1;else{const d=this.getLineMaxColumn(c);u>=d&&(u=d)}return i===o&&r===s&&a===c&&l===u&&e instanceof J&&!(e instanceof kn)?e:new J(o,s,c,u)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const r=this._buffer.getLineCount();if(e>r)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const s=this._buffer.getLineCharCode(e,t-2);if(Rl(s))return!1}return!0}_validatePosition(e,t,i){const r=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(r<1)return new De(1,1);if(r>s)return new De(s,this.getLineMaxColumn(s));if(o<=1)return new De(r,1);const a=this.getLineMaxColumn(r);if(o>=a)return new De(r,a);if(i===1){const l=this._buffer.getLineCharCode(r,o-2);if(Rl(l))return new De(r,o-1)}return new De(r,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof De&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,r,0)||!this._isValidPosition(o,s,0))return!1;if(t===1){const a=r>1?this._buffer.getLineCharCode(i,r-2):0,l=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,c=Rl(a),u=Rl(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof J&&!(e instanceof kn)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),r=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,s=i.column,a=r.lineNumber,l=r.column;{const c=s>1?this._buffer.getLineCharCode(o,s-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=Rl(c),h=Rl(u);return!d&&!h?new J(o,s,a,l):o===a&&s===l?new J(o,s-1,a,l-1):d&&h?new J(o,s-1,a,l+1):d?new J(o,s-1,a,l):new J(o,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new J(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,r){return this._buffer.findMatchesLineByLine(e,t,i,r)}findMatches(e,t,i,r,o,s,a=Lur){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>J.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,h)=>d.startLineNumber-h.startLineNumber||d.startColumn-h.startColumn);const c=[];c.push(l.reduce((d,h)=>J.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!i&&e.indexOf(` `)<0){const h=new ax(e,i,r,o).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>N9.findMatches(this,new ax(e,i,r,o),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,i,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` `)<0){const c=new ax(e,i,r,o).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new J(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return N9.findNextMatch(this,new ax(e,i,r,o),a,s),h.length>0||(d=new J(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return N9.findNextMatch(this,new ax(e,i,r,o),a,s)}findPreviousMatch(e,t,i,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);return N9.findPreviousMatch(this,new ax(e,i,r,o),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` `?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof tte?e:new tte(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,r=e.length;i<r;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,r){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,r)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,r){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const o=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let s=!0;if(e)for(let a=0,l=e.length;a<l;a++){const c=e[a];let u=!1;for(let d=0,h=o.length;d<h;d++){const f=o[d].range,g=f.startLineNumber>c.endLineNumber,m=c.startLineNumber>f.endLineNumber;if(!g&&!m){u=!0;break}}if(!u){s=!1;break}}if(s)for(let a=0,l=this._trimAutoWhitespaceLines.length;a<l;a++){const c=this._trimAutoWhitespaceLines[a],u=this.getLineMaxColumn(c);let d=!0;for(let h=0,f=o.length;h<f;h++){const g=o[h].range,m=o[h].text;if(!(c<g.startLineNumber||c>g.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===u&&g.isEmpty()&&m&&m.length>0&&m.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===` `)){d=!1;break}}if(d){const h=new J(c,1,c,u);t.push(new tte(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,r)}_applyUndo(e,t,i,r){const o=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new J(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,r)}_applyRedo(e,t,i,r){const o=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new J(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,r)}_applyUndoRedoEdits(e,t,i,r,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=r,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),r=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c<u;c++){const d=s[c];this._decorationsTree.acceptReplace(d.rangeOffset,d.rangeLength,d.text.length,d.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let c=0,u=s.length;c<u;c++){const d=s[c],[h]=ES(d.text);this._onDidChangeDecorations.fire();const f=d.range.startLineNumber,g=d.range.endLineNumber,m=g-f,v=h,_=Math.min(m,v),b=v-m,y=o-l-b+f,C=y,x=y+v,E=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new De(C,1)),this.getOffsetAt(new De(x,this.getLineMaxColumn(x))),0),k=yv.fromDecorations(E),L=new y1(k);for(let D=_;D>=0;D--){const A=f+D,O=y+D;L.takeFromEndWhile(F=>F.lineNumber>O);const P=L.takeFromEndWhile(F=>F.lineNumber===O);a.push(new vPe(A,this.getLineContent(O),P))}if(_<m){const D=f+_;a.push(new Sur(D+1,g))}if(_<v){const D=new y1(k),A=f+_,O=v-_,P=o-l-O+A+1,F=[],B=[];for(let M=0;M<O;M++){const V=P+M;B[M]=this.getLineContent(V),D.takeWhile(U=>U.lineNumber<V),F[M]=D.takeWhile(U=>U.lineNumber===V)}a.push(new Eur(A+1,f+v,B,F))}l+=b}this._emitContentChangedEvent(new hD(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return r.reverseEdits===null?void 0:r.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(r=>new vPe(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new eet(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,s)=>this._deltaDecorationsImpl(e,[],[{range:o,options:s}])[0],changeDecoration:(o,s)=>{this._changeDecorationImpl(o,s)},changeDecorationOptions:(o,s)=>{this._changeDecorationOptionsImpl(o,wPe(s))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,s)=>o.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,o,s)};let r=null;try{r=t(i)}catch(o){Oi(o)}return i.addDecoration=OO,i.changeDecoration=OO,i.changeDecorationOptions=OO,i.removeDecoration=OO,i.deltaDecorations=OO,r}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),Oi(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const r=e?this._decorations[e]:null;if(!r)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:CPe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),s,a,o),r.setOptions(CPe[i]),this._decorationsTree.insert(r),r.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,r=t.length;i<r;i++){const o=t[i];this._decorationsTree.delete(o),delete this._decorations[o.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,r=!1,o=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new J(a,1,l,c),d=this._getDecorationsInRange(u,i,r,o);return ele(d,this._decorationProvider.getDecorationsInRange(u,i,r)),d}getDecorationsInRange(e,t=0,i=!1,r=!1,o=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,i,o);return ele(a,this._decorationProvider.getDecorationsInRange(s,t,i,r)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),r=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return yv.fromDecorations(r).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,r){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,s,t,i,r)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),s=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,s,r),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const r=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const s=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber)}if(i.options.before||t.before){const s=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}r!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,r=!1){const o=this.getVersionId(),s=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);for(;a<s||c<l;){let d=null;if(a<s){do d=this._decorations[t[a++]];while(!d&&a<s);if(d){if(d.options.after){const h=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(h.endLineNumber)}if(d.options.before){const h=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(h.startLineNumber)}this._decorationsTree.delete(d),r||this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(c<l){if(!d){const _=++this._lastDecorationId,b=`${this._instanceId};${_}`;d=new YJe(b,0,0),this._decorations[b]=d}const h=i[c],f=this._validateRangeRelaxedNoAllocations(h.range),g=wPe(h.options),m=this._buffer.getOffsetAt(f.startLineNumber,f.startColumn),v=this._buffer.getOffsetAt(f.endLineNumber,f.endColumn);d.ownerId=e,d.reset(o,m,v,f),d.setOptions(g),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.startLineNumber),r||this._onDidChangeDecorations.checkAffectedAndFire(g),this._decorationsTree.insert(d),u[c]=d.id,c++}else d&&delete this._decorations[d.id]}return u}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){typeof e=="string"?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange(()=>this._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return Nur(this.getLineContent(e))+1}};f0._MODEL_SYNC_LIMIT=50*1024*1024;f0.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;f0.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;f0.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;f0.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:gu.tabSize,indentSize:gu.indentSize,insertSpaces:gu.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:gu.trimAutoWhitespace,largeFileOptimizations:gu.largeFileOptimizations,bracketPairColorizationOptions:gu.bracketPairColorizationOptions};f0=lx=Tur([Cte(4,VG),Cte(5,xs),Cte(6,rs)],f0);function Nur(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function wte(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function Ste(n){return!!n.options.after||!!n.options.before}class yPe{constructor(){this._decorationsTree0=new vte,this._decorationsTree1=new vte,this._injectedTextDecorationsTree=new vte}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,r,o,s){const a=e.getVersionId(),l=this._intervalSearch(t,i,r,o,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,r,o,s){const a=this._decorationsTree0.intervalSearch(e,t,i,r,o,s),l=this._decorationsTree1.intervalSearch(e,t,i,r,o,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,r,o,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,r){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,r,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),r=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,r).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,r,o){const s=e.getVersionId(),a=this._search(t,i,r,s,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,r,o){if(i)return this._decorationsTree1.search(e,t,r,o);{const s=this._decorationsTree0.search(e,t,r,o),a=this._decorationsTree1.search(e,t,r,o),l=this._injectedTextDecorationsTree.search(e,t,r,o);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),r=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(r)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){Ste(e)?this._injectedTextDecorationsTree.insert(e):wte(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Ste(e)?this._injectedTextDecorationsTree.delete(e):wte(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){Ste(e)?this._injectedTextDecorationsTree.resolveNode(e,t):wte(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,r){this._decorationsTree0.acceptReplace(e,t,i,r),this._decorationsTree1.acceptReplace(e,t,i,r),this._injectedTextDecorationsTree.acceptReplace(e,t,i,r)}}function Z0(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class net{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Rur extends net{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:np.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class Our{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:nD.Left}}class Pur extends net{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?ze.fromHex(e):t.getColor(e.id)}}class kS{static from(e){return e instanceof kS?e:new kS(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Ri{static register(e){return new Ri(e)}static createDynamic(e){return new Ri(e)}constructor(e){var t,i,r,o,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Z0(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(r=e.blockPadding)!==null&&r!==void 0?r:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Z0(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Rur(e.overviewRuler):null,this.minimap=e.minimap?new Pur(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Our(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Z0(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Z0(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Z0(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Z0(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Z0(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Z0(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Z0(e.afterContentClassName):null,this.after=e.after?kS.from(e.after):null,this.before=e.before?kS.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Ri.EMPTY=Ri.register({description:"empty"});const CPe=[Ri.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Ri.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Ri.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Ri.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function wPe(n){return n instanceof Ri?n:Ri.createDynamic(n)}class Mur extends Ue{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new Le),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Fur extends Ue{constructor(){super(),this._fastEmitter=this._register(new Le),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new Le),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class Bur{constructor(){this._onDidChangeVisibleRanges=new Le,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new $ur(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class $ur{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(r=>new cr(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class Sz{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new bc(new J(1,1,1,1),0,0,new De(1,1),0),new bc(new J(1,1,1,1),0,0,new De(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Dr(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?kn.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):kn.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,r){return t.equals(i)?r:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,r=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,r,i,s),l=this._validatePositionWithCache(e,o,r,a);return i.equals(s)&&r.equals(a)&&o.equals(l)?t:new bc(J.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-a.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=Sz._validateViewState(e.viewModel,i)),t){const r=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(r)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new bc(r,t.selectionStartKind,o,s,a)}else{if(!i)return;const r=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new bc(r,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const r=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new bc(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new De(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new De(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new J(r.lineNumber,r.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new bc(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class SPe{constructor(e){this.context=e,this.cursors=[new Sz(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return xir(this.cursors,sg(e=>e.viewState.position,De.compare)).viewState.position}getBottomMostViewPosition(){return Eir(this.cursors,sg(e=>e.viewState.position,De.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(Dr.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const r=i-t;for(let o=0;o<r;o++)this._addSecondaryCursor()}else if(t>i){const r=t-i;for(let o=0;o<r;o++)this._removeSecondaryCursor(this.cursors.length-2)}for(let r=0;r<i;r++)this.cursors[r+1].setState(this.context,e[r].modelState,e[r].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new Sz(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return this.cursors.length===1||this.lastAddedCursorIndex===0?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,r=e.length;i<r;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(sg(i=>i.selection,J.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const r=t[i],o=t[i+1],s=r.selection,a=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let l;if(a.isEmpty()||s.isEmpty()?l=a.getStartPosition().isBeforeOrEqual(s.getEndPosition()):l=a.getStartPosition().isBefore(s.getEndPosition()),l){const c=r.index<o.index?i:i+1,u=r.index<o.index?i+1:i,d=t[u].index,h=t[c].index,f=t[u].selection,g=t[c].selection;if(!f.equalsSelection(g)){const m=f.plusRange(g),v=f.selectionStartLineNumber===f.startLineNumber&&f.selectionStartColumn===f.startColumn,_=g.selectionStartLineNumber===g.startLineNumber&&g.selectionStartColumn===g.startColumn;let b;d===this.lastAddedCursorIndex?(b=v,this.lastAddedCursorIndex=h):b=_;let y;b?y=new kn(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):y=new kn(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn),t[c].selection=y;const C=Dr.fromModelSelection(y);e[h].setState(this.context,C.modelState,C.viewState)}for(const m of t)m.index>d&&m.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),i--}}}}class EPe{constructor(e,t,i,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=r}}class Vur{constructor(){this.type=0}}class Hur{constructor(){this.type=1}}class Wur{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class zur{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class o2{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class G9{constructor(){this.type=5}}class Uur{constructor(e){this.type=6,this.isFocused=e}}class jur{constructor(){this.type=7}}class Y9{constructor(){this.type=8}}class iet{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class Wce{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class zce{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class tV{constructor(e,t,i,r,o,s,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=r,this.verticalType=o,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class qur{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Kur{constructor(e){this.theme=e,this.type=14}}class Gur{constructor(e){this.type=15,this.ranges=e}}class Yur{constructor(){this.type=16}}let Qur=class{constructor(){this.type=17}};class Xur extends Ue{constructor(){super(),this._onEvent=this._register(new Le),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){const r=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(r){this._outgoingEvents[t]=r;return}}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,this._collectorCnt===1&&(this._collector=new Zur),this._collector}endEmitViewEvents(){if(this._collectorCnt--,this._collectorCnt===0){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const i of e)this._addOutgoingEvent(i);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Zur{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class oye{constructor(e,t,i,r){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=r,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new oye(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class sye{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new sye(this.oldHasFocus,e.hasFocus)}}class aye{constructor(e,t,i,r,o,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=r,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new aye(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Jur{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class edr{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Ez{constructor(e,t,i,r,o,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=r,this.source=o,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,r=t.length;if(i!==r)return!1;for(let o=0;o<i;o++)if(!e[o].equalsSelection(t[o]))return!1;return!0}isNoOp(){return Ez._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new Ez(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class tdr{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class ndr{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class idr{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class rdr{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class odr{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class sdr{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class adr{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class ldr extends Ue{constructor(e,t,i,r){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new EPe(this._model,this._viewModel,this._coordinatesConverter,r),this._cursors=new SPe(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=mo(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new EPe(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,r){let o=!1;const s=this.context.cursorConfig.multiCursorLimit;r!==null&&r.length>s&&(r=r.slice(0,s),o=!0);const a=HM.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,r,o,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=J.fromPositions(a[0],a[0]),e.emitViewEvent(new tV(t,i,l,c,r,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,r=t.length;i<r;i++){const o=t[i];e.push({inSelectionMode:!o.isEmpty(),selectionStart:{lineNumber:o.selectionStartLineNumber,column:o.selectionStartColumn},position:{lineNumber:o.positionLineNumber,column:o.positionColumn}})}return e}restoreState(e,t){const i=[];for(let r=0,o=t.length;r<o;r++){const s=t[r];let a=1,l=1;s.position&&s.position.lineNumber&&(a=s.position.lineNumber),s.position&&s.position.column&&(l=s.position.column);let c=a,u=l;s.selectionStart&&s.selectionStart.lineNumber&&(c=s.selectionStart.lineNumber),s.selectionStart&&s.selectionStart.column&&(u=s.selectionStart.column),i.push({selectionStartLineNumber:c,selectionStartColumn:u,positionLineNumber:a,positionColumn:l})}this.setStates(e,"restoreState",0,Dr.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof eet){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const r=i.containsEvent(1);if(this._prevEditOperationType=0,r)this._cursors.dispose(),this._cursors=new SPe(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const o=Dr.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Dr.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,r){this.setStates(e,t,r,Dr.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],r=[];for(let a=0,l=e.length;a<l;a++)i.push({range:e[a],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),r.push({range:t[a],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],r);this._autoClosedActions.push(new xPe(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=cdr.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],r=[];for(let o=0;o<e.commands.length;o++){const s=e.commands[o];s instanceof TJe&&s.enclosingRange&&s.closeCharacterRange&&(i.push(s.closeCharacterRange),r.push(s.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,r),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,r,o){const s=HM.from(this._model,this);if(s.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new zur(l,a,i)),!r||r.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(r.cursorState[u].modelState))){const c=r?r.cursorState.map(d=>d.modelState.selection):null,u=r?r.modelVersionId:0;e.emitOutgoingEvent(new Ez(c,a,u,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.text||o.text.indexOf(` `)>=0)return null;const s=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=o.text.length-s[2].length-1,d=o.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,i,r){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let d=0,h=o.length;d<h;d++){const[f,g]=o[d],m=c[d],v=m.range.startLineNumber,_=m.range.startColumn-1+f,b=m.range.startColumn-1+g;s.push(new J(v,b+1,v,b+2)),a.push(new J(v,_+1,v,b+2))}const u=r(c);return u&&(this._isHandling=!0),u});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),s.length>0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,i,r=0){if(this.context.cursorConfig.readOnly)return;const o=HM.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){Oi(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,r,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return xPe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new WM(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Ps.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const r=t.length;let o=0;for(;o<r;){const s=u0e(t,o),a=t.substr(o,s);this._executeEditOperation(Ps.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=s}}else this._executeEditOperation(Ps.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,r,o,s){if(t.length===0&&i===0&&r===0){if(o!==0){const a=this.getSelections().map(l=>{const c=l.getPosition();return new kn(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Ps.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,r,o))},e,s)}paste(e,t,i,r,o){this._executeEdit(()=>{this._executeEditOperation(Ps.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,r||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(tk.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Qd(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Qd(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class HM{static from(e,t){return new HM(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class xPe{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let i=0;i<this._autoClosedEnclosingDecorations.length;i++){const r=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);if(r&&(t.push(r),r.startLineNumber!==r.endLineNumber))return!1}t.sort(J.compareRangesUsingStarts),e.sort(J.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class cdr{static executeCommands(e,t,i){const r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(r,i);for(let s=0,a=r.trackedRanges.length;s<a;s++)r.model._setTrackedRange(r.trackedRanges[s],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(i.operations.length===0)return null;const r=i.operations,o=this._getLoserCursorMap(r);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const s=[];for(let c=0,u=r.length;c<u;c++)o.hasOwnProperty(r[c].identifier.major.toString())||s.push(r[c]);i.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let f=0;f<e.selectionsBefore.length;f++)u[f]=[];for(const f of c)f.identifier&&u[f.identifier.major].push(f);const d=(f,g)=>f.identifier.minor-g.identifier.minor,h=[];for(let f=0;f<e.selectionsBefore.length;f++)u[f].length>0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const m=parseInt(g,10),v=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new kn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new kn(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],r=!1;for(let o=0,s=t.length;o<s;o++){const a=t[o];if(a){const l=this._getEditOperationsFromCommand(e,o,a);i=i.concat(l.operations),r=r||l.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:r}}static _getEditOperationsFromCommand(e,t,i){const r=[];let o=0;const s=(d,h,f=!1)=>{J.isEmpty(d)&&h===""||r.push({identifier:{major:t,minor:o++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=kn.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const _=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===_?g=2:g=3}else g=1;const m=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[m]=v,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,u)}catch(d){return Oi(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,r)=>-J.compareRangesUsingEnds(i.range,r.range));const t={};for(let i=1;i<e.length;i++){const r=e[i-1],o=e[i];if(J.getStartPosition(r.range).isBefore(J.getEndPosition(o.range))){let s;r.identifier.major>o.identifier.major?s=r.identifier.major:s=o.identifier.major,t[s.toString()]=!0;for(let a=0;a<e.length;a++)e[a].identifier.major===s&&(e.splice(a,1),a<i&&i--,a--);i>0&&i--}}return t}}class udr{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class WM{static _capture(e,t){const i=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;i.push(new udr(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return i}constructor(e,t){this._original=WM._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=WM._capture(e,t);if(!i||this._original.length!==i.length)return null;const r=[];for(let o=0,s=this._original.length;o<s;o++)r.push(WM._deduceOutcome(this._original[o],i[o]));return r}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,YT(e.text,t.text)),r=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,KW(e.text,t.text)),o=e.text.substring(i,e.text.length-r),s=t.text.substring(i,t.text.length-r);return new plr(o,e.startSelection-i,e.endSelection-i,s,t.startSelection-i,t.endSelection-i)}}var ddr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const TPe={getInitialState:()=>DA,tokenizeEncoded:(n,e,t)=>kG(0,t)};function hdr(n,e,t){return ddr(this,void 0,void 0,function*(){if(!t)return kPe(e,n.languageIdCodec,TPe);const i=yield Ks.getOrCreate(t);return kPe(e,n.languageIdCodec,i||TPe)})}function fdr(n,e,t,i,r,o,s){let a="<div>",l=i,c=0,u=!0;for(let d=0,h=e.getCount();d<h;d++){const f=e.getEndOffset(d);if(f<=i)continue;let g="";for(;l<f&&l<r;l++){const m=n.charCodeAt(l);switch(m){case 9:{let v=o-(l+c)%o;for(c+=v-1;v>0;)s&&u?(g+=" ",u=!1):(g+=" ",u=!0),v--;break}case 60:g+="<",u=!1;break;case 62:g+=">",u=!1;break;case 38:g+="&",u=!1;break;case 0:g+="�",u=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",u=!1;break;case 13:g+="​",u=!1;break;case 32:s&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(m),u=!1}}if(a+=`<span style="${e.getInlineStyle(d,t)}">${g}</span>`,f>r||l>=r)break}return a+="</div>",a}function kPe(n,e,t){let i='<div class="monaco-tokenized-source">';const r=l0(n);let o=t.getInitialState();for(let s=0,a=r.length;s<a;s++){const l=r[s];s>0&&(i+="<br/>");const c=t.tokenizeEncoded(l,!0,o);Ol.convertToEndOffset(c.tokens,l.length);const d=new Ol(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f<g;f++){const m=d.getClassName(f),v=d.getEndOffset(f);i+=`<span class="${m}">${qW(l.substring(h,v))}</span>`,h=v}o=c.endState}return i+="</div>",i}class pdr{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,r=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,r)}}class gdr{constructor(e,t,i,r,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=r,this.minWidth=o,this.prefixSum=0}}let ret=class Uce{constructor(e,t,i,r){this._instanceId=VXe(++Uce.INSTANCE_COUNT),this._pendingChanges=new pdr,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=r}static findInsertionIndex(e,t,i){let r=0,o=e.length;for(;r<o;){const s=r+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:r=s+1:t<e[s].afterLineNumber?o=s:r=s+1}return r}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(r,o,s,a)=>{t=!0,r=r|0,o=o|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new gdr(l,r,o,s,a)),l},changeOneWhitespace:(r,o,s)=>{t=!0,o=o|0,s=s|0,this._pendingChanges.change({id:r,newAfterLineNumber:o,newHeight:s})},removeWhitespace:r=>{t=!0,this._pendingChanges.remove({id:r})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const r=new Set;for(const l of i)r.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!r.has(u.id)){if(o.has(u.id)){const d=o.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=Uce.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,r=t.length;i<r;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const r=this._findWhitespaceIndex(e);if(r!==-1&&(this._arr[r].height!==i&&(this._arr[r].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,r-1)),this._arr[r].afterLineNumber!==t)){const o=this._arr[r];this._removeWhitespace(r),o.afterLineNumber=t,this._insertWhitespace(o)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount-=t-e+1;for(let i=0,r=this._arr.length;i<r;i++){const o=this._arr[i].afterLineNumber;e<=o&&o<=t?this._arr[i].afterLineNumber=e-1:o>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,r=this._arr.length;i<r;i++){const o=this._arr[i].afterLineNumber;e<=o&&(this._arr[i].afterLineNumber+=t-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),this._arr.length===0?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e=e|0;let t=Math.max(0,this._prefixSumValidIndex+1);t===0&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){this._checkPendingChanges();const e=this._lineHeight*this._lineCount,t=this.getWhitespacesTotalHeight();return e+t+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e=e|0;const t=this._findLastWhitespaceBeforeLineNumber(e);return t===-1?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e=e|0;const t=this._arr;let i=0,r=t.length-1;for(;i<=r;){const s=(r-i|0)/2|0,a=i+s|0;if(t[a].afterLineNumber<e){if(a+1>=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else r=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i<this._arr.length?i:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e=e|0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;let i;e>1?i=this._lineHeight*(e-1):i=0;const r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+r+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+r+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>t}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(this._paddingBottom===0)return!1;this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let r=1,o=t;for(;r<o;){const s=(r+o)/2|0,a=this.getVerticalOffsetForLineNumber(s)|0;if(e>=a+i)r=s+1;else{if(e>=a)return s;o=s}}return r>t?t:r}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,r=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(r)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(r)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=o,h=d;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,h-=g);const m=[],v=e+(t-e)/2;let _=-1;for(let x=r;x<=s;x++){if(_===-1){const E=d,k=d+i;(E<=v&&v<k||E>v)&&(_=x)}for(d+=i,m[x-r]=h,h+=i;u===x;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=x;break}}_===-1&&(_=s);const b=this.getVerticalOffsetForLineNumber(s)|0;let y=r,C=s;return y<C&&o<e&&y++,y<C&&b+i>t&&C--,{bigNumbersDelta:g,startLineNumber:r,endLineNumber:s,relativeVerticalOffset:m,centeredLineNumber:_,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:C}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let r;return e>0?r=this.getWhitespacesAccumulatedHeight(e-1):r=0,i+r+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const r=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=r+o)return-1;for(;t<i;){const s=Math.floor((t+i)/2),a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(e>=a+l)t=s+1;else{if(e>=a)return s;i=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const r=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,verticalOffset:i,height:r}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let s=i;s<=r;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};ret.INSTANCE_COUNT=0;const mdr=125;class xP{constructor(e,t,i,r){e=e|0,t=t|0,i=i|0,r=r|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),r<0&&(r=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=r,this.scrollHeight=Math.max(i,r)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class _dr extends Ue{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new Le),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new xP(0,0,0,0),this._scrollable=this._register(new D6({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,r=t.contentHeight!==e.contentHeight;(i||r)&&this._onDidContentSizeChange.fire(new oye(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class vdr extends Ue{constructor(e,t,i){super(),this._configuration=e;const r=this._configuration.options,o=r.get(143),s=r.get(83);this._linesLayout=new ret(t,r.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new _dr(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new xP(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(113)?mdr:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const i=t.get(83);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(143)){const i=t.get(143),r=i.contentWidth,o=i.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new xP(r,s.contentWidth,o,this._getContentHeight(r,o,a)))}else this._updateHeight();e.hasChanged(113)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const r=this._configuration.options.get(102);return r.horizontal===2||e>=t?0:r.horizontalScrollbarSize}_getContentHeight(e,t,i){const r=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return r.get(104)?o+=Math.max(0,t-r.get(66)-r.get(83).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new xP(t,e.contentWidth,i,this._getContentHeight(t,i,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new yOe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new yOe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),r=e.get(50),o=e.get(143);if(i.isViewportWrapping){const s=e.get(72);return t>o.contentWidth+r.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+o.verticalScrollbarWidth:t}else{const s=e.get(103)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new xP(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),r=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-r,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class bdr{constructor(e,t,i,r,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=r,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const r=e.range,o=e.options;let s;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new De(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new De(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);s=new J(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(r,1);i=new qZe(s,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const r=new J(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(r,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const r=this._linesCollection.getDecorationsInRange(e,this.editorId,$W(this.configuration.options),t,i),o=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=o;u<=s;u++)c[u-o]=[];for(let u=0,d=r.length;u<d;u++){const h=r[u],f=h.options;if(!lye(this.model,h))continue;const g=this._getOrCreateViewModelDecoration(h),m=g.range;if(a[l++]=g,f.inlineClassName){const v=new DM(m,f.inlineClassName,f.inlineClassNameAffectsLetterSpacing?3:0),_=Math.max(o,m.startLineNumber),b=Math.min(s,m.endLineNumber);for(let y=_;y<=b;y++)c[y-o].push(v)}if(f.beforeContentClassName&&o<=m.startLineNumber&&m.startLineNumber<=s){const v=new DM(new J(m.startLineNumber,m.startColumn,m.startLineNumber,m.startColumn),f.beforeContentClassName,1);c[m.startLineNumber-o].push(v)}if(f.afterContentClassName&&o<=m.endLineNumber&&m.endLineNumber<=s){const v=new DM(new J(m.endLineNumber,m.endColumn,m.endLineNumber,m.endColumn),f.afterContentClassName,2);c[m.endLineNumber-o].push(v)}}return{decorations:a,inlineDecorations:c}}}function lye(n,e){return!(e.options.hideInCommentTokens&&cye(n,e)||e.options.hideInStringTokens&&uye(n,e))}function cye(n,e){return oet(n,e.range,t=>t===1)}function uye(n,e){return oet(n,e.range,t=>t===2)}function oet(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const r=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,s=i===e.endLineNumber;let a=o?r.findTokenIndexAtOffset(e.startColumn-1):0;for(;a<r.getCount()&&!(s&&r.getStartOffset(a)>e.endColumn-1);){if(!t(r.getStandardTokenType(a)))return!1;a++}}return!0}function Ete(n,e){return n===null?e?xz.INSTANCE:Tz.INSTANCE:new ydr(n,e)}class ydr{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const r=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new yv(0,0,c+1,this._projectionData.injectionOptions[u],0));s=yv.applyInjectedText(e.getLineContent(t),a).substring(r,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=IPe(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const r=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],r),r[0]}getViewLinesData(e,t,i,r,o,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let f=0,g=0;for(let m=0;m<l.getOutputLineCount();m++){const v=new Array;d[m]=v;const _=m>0?l.breakOffsets[m-1]:0,b=l.breakOffsets[m];for(;g<c.length;){const y=u[g].content.length,C=c[g]+f,x=C+y;if(C>b)break;if(_<x){const E=u[g];if(E.inlineClassName){const k=m>0?l.wrappedTextIndentLength:0,L=k+Math.max(C-_,0),D=k+Math.min(x-_,b-_);L!==D&&v.push(new Err(L,D,E.inlineClassName,E.inlineClassNameAffectsLetterSpacing))}}if(x<=b)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:Ol.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=i;f<i+r;f++){const g=o+f-i;if(!s[g]){a[g]=null;continue}a[g]=this._getViewLineData(h,d?d[f]:null,f)}}_getViewLineData(e,t,i){this._assertVisible();const r=this._projectionData,o=i>0?r.wrappedTextIndentLength:0,s=i>0?r.breakOffsets[i-1]:0,a=r.breakOffsets[i],l=e.sliceAndInflate(s,a,o);let c=l.getLineContent();i>0&&(c=IPe(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(i)+1,d=c.length+1,h=i+1<this.getViewLineCount(),f=i===0?0:r.breakOffsetsVisibleColumn[i-1];return new A0e(c,h,u,d,f,l,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){this._assertVisible();const i=this._projectionData.translateToOutputPosition(t-1);return e+i.outputLineIndex}normalizePosition(e,t,i){const r=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(r)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class xz{constructor(){}isVisible(){return!0}setVisible(e){return e?this:Tz.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const r=e.tokenization.getLineTokens(t),o=r.getLineContent();return new A0e(o,!1,1,o.length+1,0,r.inflate(),null)}getViewLinesData(e,t,i,r,o,s,a){if(!s[o]){a[o]=null;return}a[o]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new De(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}xz.INSTANCE=new xz;class Tz{constructor(){}isVisible(){return!1}setVisible(e){return e?xz.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,r,o,s,a){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}Tz.INSTANCE=new Tz;const xte=[""];function IPe(n){if(n>=xte.length)for(let e=1;e<=n;e++)xte[e]=Cdr(e);return xte[n]}function Cdr(n){return new Array(n+1).join(" ")}class wdr{constructor(e,t,i,r,o,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new Edr(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),r=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),a=new y1(yv.fromDecorations(r));for(let m=0;m<o;m++){const v=a.takeWhile(_=>_.lineNumber===m+1);s.addRequest(i[m],v,t?t[m]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(J.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1<u.length?h+1:o+2;for(let m=0;m<o;m++){const v=m+1;v===g&&(f++,d=u[f].startLineNumber,h=u[f].endLineNumber,g=f+1<u.length?h+1:o+2);const _=v>=d&&v<=h,b=Ete(l[m],!_);c[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new rir(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=Sdr(t),r=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(J.compareRangesUsingStarts);if(i.length===r.length){let h=!1;for(let f=0;f<i.length;f++)if(!i[f].equalsRange(r[f])){h=!0;break}if(!h)return!1}const o=i.map(h=>({range:h,options:Ri.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=i;let a=1,l=0,c=-1,u=c+1<s.length?l+1:this.modelLineProjections.length+2,d=!1;for(let h=0;h<this.modelLineProjections.length;h++){const f=h+1;f===u&&(c++,a=s[c].startLineNumber,l=s[c].endLineNumber,u=c+1<s.length?l+1:this.modelLineProjections.length+2);let g=!1;if(f>=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const m=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,m)}}return d||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,r,o){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===r,u=this.wordBreak===o;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=r,this.wordBreak=o;let h=null;if(d){h=[];for(let f=0,g=this.modelLineProjections.length;f<g;f++)h[f]=this.modelLineProjections[f].getProjectionData()}return this._constructLines(!1,h),!0}createLineBreaksComputer(){return(this.wrappingStrategy==="advanced"?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new Wce(r,o)}onModelLinesInserted(e,t,i,r){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=r.length;u<d;u++){const h=Ete(r[u],!o);l.push(h);const f=h.getViewLineCount();a+=f,c[u]=f}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(l).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,c),new zce(s,s+a-1)}onModelLineChanged(e,t,i){if(e!==null&&e<=this._validModelVersionId)return[!1,null,null,null];const r=t-1,o=this.modelLineProjections[r].getViewLineCount(),s=this.modelLineProjections[r].isVisible(),a=Ete(i,s);this.modelLineProjections[r]=a;const l=this.modelLineProjections[r].getViewLineCount();let c=!1,u=0,d=-1,h=0,f=-1,g=0,m=-1;o>l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,m=g+(o-l)-1,c=!0):o<l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+o-1,h=d+1,f=h+(l-o)-1,c=!0):(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1),this.projectedModelLineLineCounts.setValue(r,l);const v=u<=d?new iet(u,d-u+1):null,_=h<=f?new zce(h,f):null,b=g<=m?new Wce(g,m):null;return[c,v,_,b]}acceptVersionId(e){this._validModelVersionId=e,this.modelLineProjections.length===1&&!this.modelLineProjections[0].isVisible()&&this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(r.lineNumber,o.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,r=t.remainder;return new LPe(i+1,r)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new De(e.modelLineNumber,r)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new De(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),r=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=r.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,d=l===r.modelLineNumber?r.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h<d;h++)a.push(new LPe(l,h))}if(!c.isVisible()&&s){const u=new De(l-1,this.model.getLineMaxColumn(l-1)+1),d=J.fromPositions(s,u);o.push(new DPe(d,a)),a=[],s=null}else c.isVisible()&&!s&&(s=new De(l,1))}if(s){const l=J.fromPositions(s,this.getModelEndPositionOfViewLine(r));o.push(new DPe(l,a))}return o}getViewLinesBracketGuides(e,t,i,r){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const a of this.getViewLineInfosGroupedByModelRanges(e,t)){const l=a.modelRange.startLineNumber,c=this.model.guides.getLinesBracketGuides(l,a.modelRange.endLineNumber,o,r);for(const u of a.viewLines){const h=c[u.modelLineNumber-l].map(f=>{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumber<u.modelLineWrappedLineIdx)return;if(!f.horizontalLine)return f;let g=-1;if(f.column!==-1){const _=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.column);if(_.lineNumber===u.modelLineWrappedLineIdx)g=_.column;else if(_.lineNumber<u.modelLineWrappedLineIdx)g=this.getMinColumnOfViewLine(u);else if(_.lineNumber>u.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===u.modelLineWrappedLineIdx?new Qx(f.visibleColumn,g,f.className,new OM(f.horizontalLine.top,m.column),-1,-1):v.lineNumber<u.modelLineWrappedLineIdx||f.visibleColumn!==-1?void 0:new Qx(f.visibleColumn,g,f.className,new OM(f.horizontalLine.top,this.getMaxColumnOfViewLine(u)),-1,-1)});s.push(h.filter(f=>!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],a=[],l=i.lineNumber-1,c=r.lineNumber-1;let u=null;for(let g=l;g<=c;g++){const m=this.modelLineProjections[g];if(m.isVisible()){const v=m.getViewLineNumberOfModelPosition(0,g===l?i.column:1),_=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=_-v+1;let y=0;b>1&&m.getViewLineMinColumn(this.model,g+1,_)===1&&(y=v===0?1:2),s.push(b),a.push(y),u===null&&(u=new De(g+1,0))}else u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,r.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let f=0;for(let g=0,m=o.length;g<m;g++){let v=o[g];const _=Math.min(d-f,s[g]),b=a[g];let y;b===2?y=0:b===1?y=1:y=_;for(let C=0;C<_;C++)C===y&&(v=0),h[f++]=v}return h}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const r=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const s=r.index,a=r.remainder,l=[];for(let c=s,u=this.model.getLineCount();c<u;c++){const d=this.modelLineProjections[c];if(!d.isVisible())continue;const h=c===s?a:0;let f=d.getViewLineCount()-h,g=!1;if(o+f>t&&(g=!0,f=t-o+1),d.getViewLinesData(this.model,c+1,h,f,o-e,i,l),o+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const r=this.projectedModelLineLineCounts.getIndexOf(e-1),o=r.index,s=r.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,s),c=a.getViewLineMaxColumn(this.model,o+1,s);t<l&&(t=l),t>c&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new De(o+1,u)).equals(i)?new De(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new J(i.lineNumber,i.column,r.lineNumber,r.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),r=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new De(i.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new J(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,r=!1,o=!1){const s=this.model.validatePosition(new De(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(o)for(;c<this.modelLineProjections.length&&!this.modelLineProjections[c].isVisible();)c++,u=!0;else for(;c>0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new De(r?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,i):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return J.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new J(i.lineNumber,i.column,r.lineNumber,r.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const r=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(r,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,r,o){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new J(s.lineNumber,1,a.lineNumber,a.column),t,i,r,o);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let m=c;m<=u;m++)if(this.modelLineProjections[m].isVisible())d===null&&(d=new De(m+1,m===c?s.column:1));else if(d!==null){const _=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new J(d.lineNumber,d.column,m,_),t,i,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new J(d.lineNumber,d.column,a.lineNumber,a.column),t,i,r)),d=null),l.sort((m,v)=>{const _=J.compareRangesUsingStarts(m.range,v.range);return _===0?m.id<v.id?-1:m.id>v.id?1:0:_});const h=[];let f=0,g=null;for(const m of l){const v=m.id;g!==v&&(g=v,h[f++]=m)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Sdr(n){if(n.length===0)return[];const e=n.slice();e.sort(J.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,r=e[0].endLineNumber;for(let o=1,s=e.length;o<s;o++){const a=e[o];a.startLineNumber>r+1?(t.push(new J(i,1,r,1)),i=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new J(i,1,r,1)),t}class LPe{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class DPe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class Edr{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,r){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,r)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class xdr{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Tdr(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,r){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,r)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Wce(t,i)}onModelLinesInserted(e,t,i,r){return new zce(t,i)}onModelLineChanged(e,t,i){return[!1,new iet(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,r=new Array(i);for(let o=0;o<i;o++)r[o]=0;return r}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new A0e(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const r=this.model.getLineCount();e=Math.min(Math.max(1,e),r),t=Math.min(Math.max(1,t),r);const o=[];for(let s=e;s<=t;s++){const a=s-e;o[a]=i[a]?this.getViewLineData(s):null}return o}getDecorationsInRange(e,t,i,r,o){return this.model.getDecorationsInRange(e,t,i,r,o)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class Tdr{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}let kdr=class extends Ue{constructor(e,t,i,r,o,s,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new Ldr,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new Xur,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new $o(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=dye.create(this.model),this.model.isTooLargeForTokenization())this._lines=new xdr(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(137),f=u.get(144),g=u.get(136),m=u.get(128);this._lines=new wdr(this._editorId,this.model,r,o,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new ldr(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new vdr(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new qur(u)),this._eventDispatcher.emitOutgoingEvent(new aye(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new bdr(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(P6.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Yur)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Kur(u))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new J(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Uur(e)),this._eventDispatcher.emitOutgoingEvent(new sye(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Vur)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Hur)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new De(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new NPe(t,this._viewportStart.startLineDelta)}return new NPe(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),r=this._configuration.options,o=r.get(50),s=r.get(137),a=r.get(144),l=r.get(136),c=r.get(128);this._lines.setWrappingSettings(o,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new G9),e.emitViewEvent(new Y9),e.emitViewEvent(new o2(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new o2(null))),e.emitViewEvent(new Wur(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),t2.shouldRecreate(t)&&(this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let r=!1,o=!1;const s=e instanceof yT?e.rawContentChangedEvent.changes:e.changes,a=e instanceof yT?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h<d.detail.length;h++){const f=d.detail[h];let g=d.injectedTexts[h];g&&(g=g.filter(m=>!m.ownerId||m.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new y1(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new G9),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),r=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),r=!0;break}case 4:{const h=u.takeCount(d.detail.length),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 2:{const h=u.dequeue(),[f,g,m,v]=this._lines.onModelLineChanged(a,d.lineNumber,h);o=f,g&&i.emitViewEvent(g),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),v&&(i.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&o&&(i.emitViewEvent(new Y9),i.emitViewEvent(new o2(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const r=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof yT&&i.emitOutgoingEvent(new odr(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,r=e.ranges.length;i<r;i++){const o=e.ranges[i],s=this.coordinatesConverter.convertModelPositionToViewPosition(new De(o.fromLineNumber,1)).lineNumber,a=this.coordinatesConverter.convertModelPositionToViewPosition(new De(o.toLineNumber,this.model.getLineMaxColumn(o.toLineNumber))).lineNumber;t[i]={fromLineNumber:s,toLineNumber:a}}this._eventDispatcher.emitSingleViewEvent(new Gur(t)),this._eventDispatcher.emitOutgoingEvent(new adr(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new jur),this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new rdr(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new idr(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new G9),t.emitViewEvent(new Y9),t.emitViewEvent(new o2(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new sdr(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new o2(e)),this._eventDispatcher.emitOutgoingEvent(new ndr(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const r=this._captureStableViewport();let o=!1;try{const s=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(s.emitViewEvent(new G9),s.emitViewEvent(new Y9),s.emitViewEvent(new o2(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),r.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new edr)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),o=Math.max(1,r.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new J(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const r=[];let o=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=i.length;u<d;u++){const h=i[u].startLineNumber,f=i[u].endLineNumber;f<s||h>l||(s<h&&(r[o++]=new J(s,a,h-1,this.model.getLineMaxColumn(h-1))),s=f+1,a=1)}return(s<l||s===l&&a<c)&&(r[o++]=new J(s,a,l,c)),r}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new J(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,r=t.completelyVisibleEndLineNumber;return new J(i,this.getLineMinColumn(i),r,this.getLineMaxColumn(r))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),r=this.coordinatesConverter.convertViewPositionToModelPosition(new De(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:r,firstPositionDeltaTop:o}}reduceRestoreState(e){if(typeof e.firstPosition>"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),r=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:r}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,r){return this._lines.getViewLinesBracketGuides(e,t,i,r)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Yu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=dv(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const r=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,r)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new ip(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,i,r,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const r=this._lines.getViewLinesData(e,t,i);return new Srr(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,$W(this._configuration.options)),i=new Idr;for(const r of t){const o=r.options,s=o.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber,r.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber,r.range.endColumn);i.accept(l,o.zIndex,c,u,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const r=t.options.minimap;r==null||r.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const s=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,i){const r=i?`\r `:this.model.getEOL();e=e.slice(0),e.sort(J.compareRangesUsingStarts);let o=!1,s=!1;for(const l of e)l.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u<l.length;u++)u>0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+r);return c}if(o&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,i?2:0)),c=d}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===qf||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new J(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const o=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Uh.fontFamily;let c;return l?c=Uh.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Uh.fontFamily}`),{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${c};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(r,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===i?r-1:0,f=c===o?s-1:d.length;d===""?l+="<br>":l+=fdr(d,u.inflate(),t,h,f,a,eu)}return l}_getColorMap(){const e=Ks.getColorMap(),t=["#000000"];if(e)for(let i=1,r=e.length;i<r;i++)t[i]=ze.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(r=>this._cursor.setStates(r,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(r=>this._cursor.setSelections(r,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new tdr);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(r=>this._cursor.executeEdits(r,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,r,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,i,r,o))}paste(e,t,i,r){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,r))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(r=>this._cursor.revealPrimary(r,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new J(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new tV(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new J(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new tV(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,r,o){this._withViewEventsCollector(s=>s.emitViewEvent(new tV(e,!1,i,null,r,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Qur),this._eventDispatcher.emitOutgoingEvent(new Jur))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class dye{static create(e){const t=e._setTrackedRange(null,new J(1,1,1,1),1);return new dye(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,r,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=r,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new De(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new J(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class Idr{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,r,o){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=i){r>c&&(a[a.length-1]=r);return}a.push(o,i,r)}else{const a=new O3(e,t,[o,i,r]);this._asMap[e]=a,this.asArray.push(a)}}}class Ldr{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&APe(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>Ddr(t,i),[]);return APe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Ddr(n,e){const t=[];let i=0,r=0;for(;i<n.length&&r<e.length;){const o=n[i],s=e[r];if(o.endLineNumber<s.startLineNumber-1)t.push(n[i++]);else if(s.endLineNumber<o.startLineNumber-1)t.push(e[r++]);else{const a=Math.min(o.startLineNumber,s.startLineNumber),l=Math.max(o.endLineNumber,s.endLineNumber);t.push(new J(a,1,l,1)),i++,r++}}for(;i<n.length;)t.push(n[i++]);for(;r<e.length;)t.push(e[r++]);return t}function APe(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].equalsRange(e[t]))return!1;return!0}class NPe{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),r=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:r+this.startLineDelta},1)}}class HG{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var J3;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(J3||(J3={}));(function(n){const e="error",t="warning",i="warn",r="info",o="ignore";function s(l){return l?rL(e,l)?n.Error:rL(t,l)||rL(i,l)?n.Warning:rL(r,l)?n.Info:n.Ignore:n.Ignore}n.fromValue=s;function a(l){switch(l){case n.Error:return e;case n.Warning:return t;case n.Info:return r;default:return o}}n.toString=a})(J3||(J3={}));const Sa=J3;var WG=Sa;const za=or("notificationService");class Adr{}class zM{constructor(e,t,i,r,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=r,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let r=this.breakOffsets[e]-t;return e>0&&(r+=this.wrappedTextIndentLength),r}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let r=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;o<this.injectionOffsets.length&&r>this.injectionOffsets[o];o++)r<this.injectionOffsets[o]+this.injectionOptions[o].content.length?r=this.injectionOffsets[o]:r-=this.injectionOptions[o].content.length;return r}translateToOutputPosition(e,t=2){let i=e;if(this.injectionOffsets!==null)for(let r=0;r<this.injectionOffsets.length&&!(e<this.injectionOffsets[r]||t!==1&&e===this.injectionOffsets[r]);r++)i+=this.injectionOptions[r].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,r=this.breakOffsets.length-1,o=0,s=0;for(;i<=r;){o=i+(r-i)/2|0;const l=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,t===0)if(e<=s)r=o-1;else if(e>l)i=o+1;else break;else if(e<s)r=o-1;else if(e>=l)i=o+1;else break}let a=e-s;return o>0&&(a+=this.wrappedTextIndentLength),new Q9(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const r=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,i);if(o!==r)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new Q9(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const r=this.getOutputLineCount()-1;if(e<r&&t===this.getMaxOutputOffset(e))return new Q9(e+1,this.getMinOutputOffset(e+1))}return new Q9(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&RPe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let r=i.offsetInInputWithInjections;if(OPe(this.injectionOptions[i.injectedTextIndex].cursorStops))return r;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(RPe(this.injectionOptions[o].cursorStops)||(r-=this.injectionOptions[o].content.length,OPe(this.injectionOptions[o].cursorStops)));)o--;return r}}else if(t===1||t===4){let r=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1<this.injectionOffsets.length&&this.injectionOffsets[o+1]===this.injectionOffsets[o];)r+=this.injectionOptions[o+1].content.length,o++;return r}else if(t===0||t===3){let r=i.offsetInInputWithInjections,o=i.injectedTextIndex;for(;o-1>=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)r-=this.injectionOptions[o-1].content.length,o--;return r}fG()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.getInjectedTextAtOffset(i);return r?{options:this.injectionOptions[r.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let r=0;for(let o=0;o<t.length;o++){const s=i[o].content.length,a=t[o]+r,l=t[o]+r+s;if(a>e)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:s};r+=s}}}}function RPe(n){return n==null?!0:n===tv.Right||n===tv.Both}function OPe(n){return n==null?!0:n===tv.Left||n===tv.Both}class Q9{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new De(e+this.outputLineIndex,this.outputOffset+1)}}class hye{static create(e){return new hye(e.get(132),e.get(131))}constructor(e,t){this.classifier=new Ndr(e,t)}createLineBreaksComputer(e,t,i,r,o){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d<h;d++){const f=a[d],g=l[d];g&&!g.injectionOptions&&!f?u[d]=Rdr(this.classifier,g,s[d],t,i,c,r,o):u[d]=Odr(this.classifier,s[d],f,t,i,c,r,o)}return jce.length=0,qce.length=0,u}}}}class Ndr extends oR{constructor(e,t){super(0);for(let i=0;i<e.length;i++)this.set(e.charCodeAt(i),1);for(let i=0;i<t.length;i++)this.set(t.charCodeAt(i),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let jce=[],qce=[];function Rdr(n,e,t,i,r,o,s,a){if(r===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=set(t,i,r,o,s),f=r-h,g=jce,m=qce;let v=0,_=0,b=0,y=r;const C=u.length;let x=0;if(x>=0){let E=Math.abs(d[x]-y);for(;x+1<C;){const k=Math.abs(d[x+1]-y);if(k>=E)break;E=k,x++}}for(;x<C;){let E=x<0?0:u[x],k=x<0?0:d[x];_>E&&(E=_,k=b);let L=0,D=0,A=0,O=0;if(k<=y){let F=k,B=E===0?0:t.charCodeAt(E-1),M=E===0?0:n.get(B),V=!0;for(let U=E;U<l;U++){const W=U,q=t.charCodeAt(U);let H,ie;if(Rl(q)?(U++,H=0,ie=2):(H=n.get(q),ie=UM(q,F,i,o)),W>_&&Kce(B,M,q,H,c)&&(L=W,D=F),F+=ie,F>y){W>_?(A=W,O=F-ie):(A=U+1,O=F),F-D>f&&(L=0),V=!1;break}B=q,M=H}if(V){v>0&&(g[v]=u[u.length-1],m[v]=d[u.length-1],v++);break}}if(L===0){let F=k,B=t.charCodeAt(E),M=n.get(B),V=!1;for(let U=E-1;U>=_;U--){const W=U+1,q=t.charCodeAt(U);if(q===9){V=!0;break}let H,ie;if(QT(q)?(U--,H=0,ie=2):(H=n.get(q),ie=mS(q)?o:1),F<=y){if(A===0&&(A=W,O=F),F<=y-f)break;if(Kce(q,H,B,M,c)){L=W,D=F;break}}F-=ie,B=q,M=H}if(L!==0){const U=f-(O-D);if(U<=i){const W=t.charCodeAt(A);let q;Rl(W)?q=2:q=UM(W,O,i,o),U-q<0&&(L=0)}}if(V){x--;continue}}if(L===0&&(L=A,D=O),L<=_){const F=t.charCodeAt(_);Rl(F)?(L=_+2,D=b+2):(L=_+1,D=b+UM(F,b,i,o))}for(_=L,g[v]=L,b=D,m[v]=D,v++,y=D+f;x<0||x<C&&d[x]<D;)x++;let P=Math.abs(d[x]-y);for(;x+1<C;){const F=Math.abs(d[x+1]-y);if(F>=P)break;P=F,x++}}return v===0?null:(g.length=v,m.length=v,jce=e.breakOffsets,qce=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=h,e)}function Odr(n,e,t,i,r,o,s,a){const l=yv.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(D=>D.options),u=t.map(D=>D.column-1)):(c=null,u=null),r===-1)return c?new zM(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new zM(u,c,[l.length],[],0):null;const h=a==="keepAll",f=set(l,i,r,o,s),g=r-f,m=[],v=[];let _=0,b=0,y=0,C=r,x=l.charCodeAt(0),E=n.get(x),k=UM(x,0,i,o),L=1;Rl(x)&&(k+=1,x=l.charCodeAt(1),E=n.get(x),L++);for(let D=L;D<d;D++){const A=D,O=l.charCodeAt(D);let P,F;Rl(O)?(D++,P=0,F=2):(P=n.get(O),F=UM(O,k,i,o)),Kce(x,E,O,P,h)&&(b=A,y=k),k+=F,k>C&&((b===0||k-y>g)&&(b=A,y=k-F),m[_]=b,v[_]=y,_++,C=y+g,b=0),x=O,E=P}return _===0&&(!t||t.length===0)?null:(m[_]=d,v[_]=k,new zM(u,c,m,v,f))}function UM(n,e,t,i){return n===9?t-e%t:mS(n)||n<32?i:1}function PPe(n,e){return e-n%e}function Kce(n,e,t,i,r){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!r&&e===3&&i!==2||!r&&i===3&&e!==1)}function set(n,e,t,i,r){let o=0;if(r!==0){const s=Yu(n);if(s!==-1){for(let l=0;l<s;l++){const c=n.charCodeAt(l)===9?PPe(o,e):1;o+=c}const a=r===3?2:r===2?1:0;for(let l=0;l<a;l++){const c=PPe(o,e);o+=c}o+i>t&&(o=0)}}return o}const Tte=R1("domLineBreaksComputer",{createHTML:n=>n});class fye{static create(){return new fye}constructor(){}createLineBreaksComputer(e,t,i,r,o){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>Pdr(s,e,t,i,r,o,a)}}}function Pdr(n,e,t,i,r,o,s){var a;function l(D){const A=s[D];if(A){const O=yv.applyInjectedText(n[D],A),P=A.map(B=>B.options),F=A.map(B=>B.column-1);return new zM(F,P,[O.length],[],0)}else return null}if(i===-1){const D=[];for(let A=0,O=n.length;A<O;A++)D[A]=l(A);return D}const c=Math.round(i*e.typicalHalfwidthCharacterWidth),d=Math.round(t*(r===3?2:r===2?1:0)),h=Math.ceil(e.spaceWidth*d),f=document.createElement("div");Zc(f,e);const g=new rR(1e4),m=[],v=[],_=[],b=[],y=[];for(let D=0;D<n.length;D++){const A=yv.applyInjectedText(n[D],s[D]);let O=0,P=0,F=c;if(r!==0)if(O=Yu(A),O===-1)O=0;else{for(let U=0;U<O;U++){const W=A.charCodeAt(U)===9?t-P%t:1;P+=W}const V=Math.ceil(e.spaceWidth*P);V+e.typicalFullwidthCharacterWidth>c?(O=0,P=0):F=c-V}const B=A.substr(O),M=Mdr(B,P,t,F,g,h);m[D]=O,v[D]=P,_[D]=B,b[D]=M[0],y[D]=M[1]}const C=g.build(),x=(a=Tte==null?void 0:Tte.createHTML(C))!==null&&a!==void 0?a:C;f.innerHTML=x,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const E=document.createRange(),k=Array.prototype.slice.call(f.children,0),L=[];for(let D=0;D<n.length;D++){const A=k[D],O=Fdr(E,A,_[D],b[D]);if(O===null){L[D]=l(D);continue}const P=m[D],F=v[D]+d,B=y[D],M=[];for(let q=0,H=O.length;q<H;q++)M[q]=B[O[q]];if(P!==0)for(let q=0,H=O.length;q<H;q++)O[q]+=P;let V,U;const W=s[D];W?(V=W.map(q=>q.options),U=W.map(q=>q.column-1)):(V=null,U=null),L[D]=new zM(U,V,O,M,F)}return document.body.removeChild(f),L}function Mdr(n,e,t,i,r,o){if(o!==0){const h=String(o);r.appendString('<div style="text-indent: -'),r.appendString(h),r.appendString("px; padding-left: "),r.appendString(h),r.appendString("px; box-sizing: border-box; width:")}else r.appendString('<div style="width:');r.appendString(String(i)),r.appendString('px;">');const s=n.length;let a=e,l=0;const c=[],u=[];let d=0<s?n.charCodeAt(0):0;r.appendString("<span>");for(let h=0;h<s;h++){h!==0&&h%16384===0&&r.appendString("</span><span>"),c[h]=l,u[h]=a;const f=d;d=h+1<s?n.charCodeAt(h+1):0;let g=1,m=1;switch(f){case 9:g=t-a%t,m=g;for(let v=1;v<=g;v++)v<g?r.appendCharCode(160):r.appendASCIICharCode(32);break;case 32:d===32?r.appendCharCode(160):r.appendASCIICharCode(32);break;case 60:r.appendString("<");break;case 62:r.appendString(">");break;case 38:r.appendString("&");break;case 0:r.appendString("�");break;case 65279:case 8232:case 8233:case 133:r.appendCharCode(65533);break;default:mS(f)&&m++,f<32?r.appendCharCode(9216+f):r.appendCharCode(f)}l+=g,a+=m}return r.appendString("</span>"),c[n.length]=l,u[n.length]=a,r.appendString("</div>"),[c,u]}function Fdr(n,e,t,i){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),o=[];try{Gce(n,r,i,0,null,t.length-1,null,o)}catch(s){return console.log(s),null}return o.length===0?null:(o.push(t.length),o)}function Gce(n,e,t,i,r,o,s,a){if(i===o||(r=r||kte(n,e,t[i],t[i+1]),s=s||kte(n,e,t[o],t[o+1]),Math.abs(r[0].top-s[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=kte(n,e,t[l],t[l+1]);Gce(n,e,t,i,r,l,c,a),Gce(n,e,t,l,c,o,s,a)}function kte(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class Bdr extends Ue{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new e0e),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const r of t){if(this._pending.has(r.id)){Oi(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(My(()=>{this._instantiateSome(1)})),this._register(My(()=>{this._instantiateSome(2)})),this._register(My(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(My(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){Oi(i)}}}}var $dr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},J0=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Vdr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},cx;let Hdr=0,Wdr=class{constructor(e,t,i,r,o,s){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=r,this.listenersToRemove=o,this.attachedView=s}dispose(){mo(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},$A=cx=class extends Ue{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,r,o,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=DJi(),this._contributions=this._register(new Bdr),this._onDidDispose=this._register(new Le),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Du(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new MPe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new MPe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Du(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Du(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Du(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Du(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Du(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Du(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Du(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Du(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Du(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Du(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new Le({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Hdr,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(_=>{this._onDidChangeConfiguration.fire(_);const b=this._configuration.options;if(_.hasChanged(143)){const y=b.get(143);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=s,this._themeService=l,this._register(new zdr(this,this._contextKeyService)),this._register(new Udr(this,this._contextKeyService,h)),this._instantiationService=r.createChild(new HG([vi,this._contextKeyService])),this._modelData=null,this._focusTracker=new jdr(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let m;Array.isArray(i.contributions)?m=i.contributions:m=JL.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const _ of JL.getEditorActions()){if(this._actions.has(_.id)){Oi(new Error(`Cannot have two actions with the same id ${_.id}`));continue}const b=new PJe(_.id,_.label,_.alias,(f=_.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(_.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(b.id,b)}const v=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new Ytr(this._domElement,{onDragEnter:()=>{},onDragOver:_=>{if(!v())return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b!=null&&b.position&&this.showDropIndicatorAt(b.position)},onDrop:_=>Vdr(this,void 0,void 0,function*(){if(!v()||(this.removeDropIndicator(),!_.dataTransfer))return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b!=null&&b.position&&this._onDropIntoEditor.fire({position:b.position,event:_})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new wce(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return x6.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Zr.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` `?i=1:e&&e.lineEnding&&e.lineEnding===`\r `&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),r=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:r?r.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(r),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,r){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?cx._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?cx._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,r=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,r)}getBottomForLineNumber(e,t=!1){return this._modelData?cx._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(r=>J.lift(r)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return yl.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!De.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,r){if(!this._modelData)return;if(!J.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,r)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new J(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,r){if(!De.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new J(e.lineNumber,e.column,e.lineNumber,e.column),t,i,r)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=kn.isISelection(e),r=J.isIRange(e);if(!i&&!r)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(r){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new kn(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,r){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new J(e,1,t,1),i,!1,r)}revealRange(e,t=0,i=!1,r=!0){this._revealRange(e,i?1:0,r,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,r){if(!J.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(J.lift(e),t,i,r)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let r=0,o=e.length;r<o;r++)if(!kn.isISelection(e[r]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return this._modelData?this._modelData.viewModel.viewLayout.hasPendingScrollAnimation():!1}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState(),t=this._modelData.viewModel.saveCursorState(),i=this._modelData.viewModel.saveState();return{cursorState:t,viewState:i,contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const i=t.cursorState;Array.isArray(i)?i.length>0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const r=this.getAction(t);if(r){Promise.resolve(r.run(i)).then(void 0,Oi);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,r,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,r,o,e)}_paste(e,t,i,r,o){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,i,r,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new J(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const r=JL.getEditorCommand(t);return r?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(r.runEditorCommand(o,this,i)).then(void 0,Oi)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(90))return!1;let r;return i?Array.isArray(i)?r=()=>i:r=i:r=()=>null,this._modelData.viewModel.executeEdits(e,t,r),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new qdr(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,$W(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,$W(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,r=i.get(143),o=cx._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft();return{top:o,left:s,height:i.get(66)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Zc(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),r=new kdr(this._id,this._configuration,e,fye.create(),hye.create(this._configuration.options),a=>_g(a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(r.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const d=this.getOption(79),h=T("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",d);this._notificationService.prompt(WG.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:T("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d<h;d++)l[d]=a.selections[d].getPosition();const c={position:l[0],secondaryPositions:l.slice(1),reason:a.reason,source:a.source};this._onDidChangeCursorPosition.fire(c);const u={selection:a.selections[0],secondarySelections:a.selections.slice(1),modelVersionId:a.modelVersionId,oldSelections:a.oldSelections,oldModelVersionId:a.oldModelVersionId,source:a.source,reason:a.reason};this._onDidChangeCursorSelection.fire(u);break}case 7:this._onDidChangeModelDecorations.fire(a.event);break;case 8:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(a.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(a.event);break;case 10:this._onDidChangeModelContent.fire(a.event);break;case 11:this._onDidChangeModelOptions.fire(a.event);break;case 12:this._onDidChangeModelTokens.fire(a.event);break}}));const[o,s]=this._createView(r);if(s){this._domElement.appendChild(o.domNode.domNode);let a=Object.keys(this._contentWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];o.addContentWidget(this._contentWidgets[u])}a=Object.keys(this._overlayWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];o.addOverlayWidget(this._overlayWidgets[u])}a=Object.keys(this._glyphMarginWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];o.addGlyphMarginWidget(this._glyphMarginWidgets[u])}o.render(!1,!0),o.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new Wdr(e,r,o,s,t,i)}_createView(e){let t;this.isSimpleWidget?t={paste:(o,s,a,l)=>{this._paste("keyboard",o,s,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,s,a,l)=>{this._compositionType("keyboard",o,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,s,a,l)=>{const c={text:o,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const s={text:o};this._commandService.executeCommand("type",s)},compositionType:(o,s,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new MG(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new Rce(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new J(e.lineNumber,e.column,e.lineNumber,e.column),options:cx.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};$A.dropIntoEditorDecorationOptions=Ri.register({description:"workbench-dnd-target",className:"dnd-target"});$A=cx=$dr([J0(3,di),J0(4,eo),J0(5,_a),J0(6,vi),J0(7,Hl),J0(8,za),J0(9,O1),J0(10,rs),J0(11,bn)],$A);class MPe extends Ue{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new Le(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new Le(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Du extends Le{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class zdr extends Ue{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=de.editorSimpleInput.bindTo(t),this._editorFocus=de.focus.bindTo(t),this._textInputFocus=de.textInputFocus.bindTo(t),this._editorTextFocus=de.editorTextFocus.bindTo(t),this._tabMovesFocus=de.tabMovesFocus.bindTo(t),this._editorReadonly=de.readOnly.bindTo(t),this._inDiffEditor=de.inDiffEditor.bindTo(t),this._editorColumnSelection=de.columnSelection.bindTo(t),this._hasMultipleSelections=de.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=de.hasNonEmptySelection.bindTo(t),this._canUndo=de.canUndo.bindTo(t),this._canRedo=de.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(AA.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(AA.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Udr extends Ue{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=de.languageId.bindTo(t),this._hasCompletionItemProvider=de.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=de.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=de.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=de.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=de.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=de.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=de.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=de.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=de.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=de.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=de.hasReferenceProvider.bindTo(t),this._hasRenameProvider=de.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=de.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=de.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=de.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=de.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=de.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=de.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=de.isInWalkThroughSnippet.bindTo(t);const r=()=>this._update();this._register(e.onDidChangeModel(r)),this._register(e.onDidChangeModelLanguage(r)),this._register(i.completionProvider.onDidChange(r)),this._register(i.codeActionProvider.onDidChange(r)),this._register(i.codeLensProvider.onDidChange(r)),this._register(i.definitionProvider.onDidChange(r)),this._register(i.declarationProvider.onDidChange(r)),this._register(i.implementationProvider.onDidChange(r)),this._register(i.typeDefinitionProvider.onDidChange(r)),this._register(i.hoverProvider.onDidChange(r)),this._register(i.documentHighlightProvider.onDidChange(r)),this._register(i.documentSymbolProvider.onDidChange(r)),this._register(i.referenceProvider.onDidChange(r)),this._register(i.renameProvider.onDidChange(r)),this._register(i.documentFormattingEditProvider.onDidChange(r)),this._register(i.documentRangeFormattingEditProvider.onDidChange(r)),this._register(i.signatureHelpProvider.onDidChange(r)),this._register(i.inlayHintsProvider.onDidChange(r)),r()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===Gi.walkThroughSnippet)})}}class jdr extends Ue{constructor(e){super(),this._onChange=this._register(new Le),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(c0(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class qdr{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(r=>{this._isChangingDecorations||e.call(t,r)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const r=e.getDecorationRange(i);r&&t.push(r)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const Kdr=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),Gdr=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function Ite(n){return Kdr+encodeURIComponent(n.toString())+Gdr}const Ydr=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),Qdr=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function Xdr(n){return Ydr+encodeURIComponent(n.toString())+Qdr}e_((n,e)=>{const t=n.getColor(Pb);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Ite(t)}") repeat-x bottom left; }`);const i=n.getColor(Ff);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Ite(i)}") repeat-x bottom left; }`);const r=n.getColor(lh);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Ite(r)}") repeat-x bottom left; }`);const o=n.getColor(bor);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Xdr(o)}") no-repeat bottom left; }`);const s=n.getColor(Nar);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var Zdr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jdr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ehr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let Yce=class extends Ue{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new Le),this._onCodeEditorAdd=this._register(new Le),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new Le),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new Le),this._onDiffEditorAdd=this._register(new Le),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new Le),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Id,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const r=e.toString();let o;this._modelProperties.has(r)?o=this._modelProperties.get(r):(o=new Map,this._modelProperties.set(r,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return ehr(this,void 0,void 0,function*(){for(const r of this._codeEditorOpenHandlers){const o=yield r(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return mi(t)}};Yce=Zdr([Jdr(0,Hl)],Yce);var thr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},FPe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},nhr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let kz=class extends Yce{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((i,r,o)=>nhr(this,void 0,void 0,function*(){return r?this.doOpenEditor(r,i):null})))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===Gi.http||o===Gi.https)return hZe(t.resource.toString()),e}return null}const r=t.options?t.options.selection:null;if(r)if(typeof r.endLineNumber=="number"&&typeof r.endColumn=="number")e.setSelection(r),e.revealRangeInCenter(r,1);else{const o={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};kz=thr([FPe(0,vi),FPe(1,Hl)],kz);vr(eo,kz,0);const lR=or("layoutService");var aet=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cet=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Iz=class{get dimension(){return this._dimension||(this._dimension=nR(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=nn.None,this.offset={top:0,quickPickTop:0}}};Iz=aet([cet(0,eo)],Iz);let Qce=class extends Iz{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};Qce=aet([cet(1,eo)],Qce);vr(lR,Iz,1);const M6=or("dialogService");var ihr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},BPe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},X9=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Z9(n){return n.scheme===Gi.file?n.fsPath:n.path}let uet=0;class J9{constructor(e,t,i,r,o,s,a){this.id=++uet,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class $Pe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class VPe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,r]of this.elements)(r.reason===0?e:t).push(r.resourceLabel);const i=[];return e.length>0&&i.push(T({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(T({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` `)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class rhr{constructor(e,t,i,r,o,s,a){this.id=++uet,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new VPe),this.removedResources.has(t)||this.removedResources.set(t,new $Pe(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new VPe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new $Pe(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class det{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` `)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,r=this._past.length;i<r;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new tet(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,r=0,o=-1;for(let a=0,l=this._past.length;a<l;a++,r++){const c=this._past[a];i&&(r>=t||c.id!==e.elements[r])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,r++){const l=this._future[a];i&&(r>=t||l.id!==e.elements[r])&&(i=!1,s=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class Lte{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const het=new det("","");het.locked=!0;let Xce=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(` `))}pushElement(e,t=BA.None,i=yb.None){if(e.type===0){const r=Z9(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new J9(e,r,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const r=new Set,o=[],s=[];for(const a of e.resources){const l=Z9(a),c=this.getUriComparisonKey(a);r.has(c)||(r.add(c),o.push(l),s.push(c))}o.length===1?this._pushElement(new J9(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new rhr(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const r=e.resourceLabels[t],o=e.strResources[t];let s;this._editStacks.has(o)?s=this._editStacks.get(o):(s=new det(r,o),this._editStacks.set(o,s)),s.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const r=i.getClosestPastElement();return r?r.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),r=new Map;for(const o of i){const s=Z9(o.resource),a=this.getUriComparisonKey(o.resource),l=new J9(o,s,a,0,0,0,0);r.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,r)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),r=new Map;for(const o of i){const s=Z9(o.resource),a=this.getUriComparisonKey(o.resource),l=new J9(o,s,a,0,0,0,0);r.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitFutureWorkspaceElement(e,r)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const r=this.getUriComparisonKey(e);this._editStacks.has(r)&&this._editStacks.get(r).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new tet(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=r)}return[t,i]}canUndo(e){if(e instanceof yb){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Oi(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,r,o){const s=this._acquireLocks(i);let a;try{a=t()}catch(l){return s(),r.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),r.dispose(),o()),l=>(s(),r.dispose(),this._onError(l,e))):(s(),r.dispose(),o())}_invokeWorkspacePrepare(e){return X9(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return Ue.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Ue.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Ue.None);const i=e.actual.prepareUndoRedo();return i?Jbe(i)?t(i):i.then(r=>t(r)):t(Ue.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||het);return new Lte(t)}_tryToSplitAndUndo(e,t,i,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(r),new e7(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new e7}_checkWorkspaceUndo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,T({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(r&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,T({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,T({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of i.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,T({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,T({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const r=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,r,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,r,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const r=t.getSecondClosestPastElement();if(r&&r.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,r){return X9(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(u){u[u.All=0]="All",u[u.This=1]="This",u[u.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:Sa.Info,message:T("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:T({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:T({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;r=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,r))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const r=T({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(r);return}return this._invokeResourcePrepare(t,r=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new Lte([e]),r,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=r)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof yb){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const r=this._editStacks.get(e),o=r.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(r,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return X9(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:T("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:T({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:T("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=r)}return[t,i]}canRedo(e){if(e instanceof yb){const[,i]=this._findClosestRedoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasFutureElements():!1}_tryToSplitAndRedo(e,t,i,r){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(r),new e7(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new e7}_checkWorkspaceRedo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,T({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(r&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,T({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestFutureElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,T({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of i.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,T({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,T({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),r=this._checkWorkspaceRedo(e,t,i,!1);return r?r.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return X9(this,void 0,void 0,function*(){let r;try{r=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return r.dispose(),o.returnValue;for(const s of i.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,r,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=T({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new Lte([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,i=r)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);if(t)return this._redo(t)}redo(e){if(e instanceof yb){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return typeof e=="string"?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[r,o]=this._findClosestRedoElementInGroup(i.groupId);if(i!==r&&o)return this._redo(o)}try{return i.type===1?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};Xce=ihr([BPe(0,M6),BPe(1,za)],Xce);class e7{constructor(e){this.returnValue=e}}vr(VG,Xce,1);function Nh(n,e,t){return Math.min(Math.max(n,e),t)}class fet{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class ohr{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}const pye=or("environmentService"),rf=or("openerService");function gye(n,e){return Yn.isUri(n)?rL(n.scheme,e):a0e(n,e+":")}function HPe(n,...e){return e.some(t=>gye(n,t))}function shr(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var ahr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WPe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Og=or("ILanguageFeatureDebounceService");var Lz;(function(n){const e=new WeakMap;let t=0;function i(r){let o=e.get(r);return o===void 0&&(o=++t,e.set(r,o)),o}n.of=i})(Lz||(Lz={}));class lhr{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class chr{constructor(e,t,i,r,o,s){this._logService=e,this._name=t,this._registry=i,this._default=r,this._min=o,this._max=s,this._cache=new hE(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>xG(Lz.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Nh(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let r=this._cache.get(i);r||(r=new ohr(6),this._cache.set(i,r));const o=Nh(r.update(t),this._min,this._max);return gye(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new fet;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Nh(e,this._min,this._max)}}let Zce=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var r,o,s;const a=(r=i==null?void 0:i.min)!==null&&r!==void 0?r:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:Math.pow(a,2),c=(s=i==null?void 0:i.key)!==null&&s!==void 0?s:void 0,u=`${Lz.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new chr(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new lhr(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new fet;for(const t of this._data.values())e.update(t.default());return e.value}};Zce=ahr([WPe(0,hp),WPe(1,pye)],Zce);vr(Og,Zce,1);class jM{static create(e,t){return new jM(e,new Dz(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new J(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[r,o,s]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new jM(this._startLineNumber,r),new jM(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,r,o]=ES(t);this.acceptEdit(e,i,r,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,r,o){this._acceptDeleteRange(e),this._acceptInsertText(new De(e.startLineNumber,e.startColumn),t,i,r,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const r=this._tokens.getMaxDeltaLine();if(!(t>=r+1)){if(t<0&&i>=r+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,r,o){if(t===0&&i===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,i,r,o)}}class Dz{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return e===0?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(e===0)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),r=this._getEndCharacter(e-1);return new J(0,t+1,i,r+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return this._getTokenCount()===0}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const r=t+Math.floor((i-t)/2),o=this._getDeltaLine(r);if(o<e)t=r+1;else if(o>e)i=r-1;else{let s=r;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=r;for(;a<i&&this._getDeltaLine(a+1)===e;)a++;return new zPe(this._tokens.subarray(4*s,4*a+4))}}return this._getDeltaLine(t)===e?new zPe(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,r){const o=this._tokens,s=this._tokenCount;let a=0,l=!1,c=0;for(let u=0;u<s;u++){const d=4*u,h=o[d],f=o[d+1],g=o[d+2],m=o[d+3];if((h>e||h===e&&g>=t)&&(h<i||h===i&&f<=r))l=!0;else{if(a===0&&(c=h),l){const v=4*a;o[v]=h-c,o[v+1]=f,o[v+2]=g,o[v+3]=m}a++}}return this._tokenCount=a,c}split(e,t,i,r){const o=this._tokens,s=this._tokenCount,a=[],l=[];let c=a,u=0,d=0;for(let h=0;h<s;h++){const f=4*h,g=o[f],m=o[f+1],v=o[f+2],_=o[f+3];if(g>e||g===e&&v>=t){if(g<i||g===i&&m<=r)continue;c!==l&&(c=l,u=0,d=g)}c[u++]=g-d,c[u++]=m,c[u++]=v,c[u++]=_}return[new Dz(new Uint32Array(a)),new Dz(new Uint32Array(l)),d]}acceptDeleteRange(e,t,i,r,o){const s=this._tokens,a=this._tokenCount,l=r-t;let c=0,u=!1;for(let d=0;d<a;d++){const h=4*d;let f=s[h],g=s[h+1],m=s[h+2];const v=s[h+3];if(f<t||f===t&&m<=i){c++;continue}else if(f===t&&g<i)f===r&&m>o?m-=o-i:m=i;else if(f===t&&g===i)if(f===r&&m>o)m-=o-i;else{u=!0;continue}else if(f<r||f===r&&g<o)if(f===r&&m>o)f=t,g=i,m=g+(m-o);else{u=!0;continue}else if(f>r){if(l===0&&!u){c=a;break}f-=l}else if(f===r&&g>=o)e&&f===0&&(g+=e,m+=e),f-=l,g-=o-i,m-=o-i;else throw new Error("Not possible!");const _=4*c;s[_]=f,s[_+1]=g,s[_+2]=m,s[_+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,i,r,o,s){const a=i===0&&r===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u<c;u++){const d=4*u;let h=l[d],f=l[d+1],g=l[d+2];if(!(h<e||h===e&&g<t)){if(h===e&&g===t)if(a)g+=1;else continue;else if(h===e&&f<t&&t<g)i===0?g+=r:g=t;else{if(h===e&&f===t&&a)continue;if(h===e)if(h+=i,i===0)f+=r,g+=r;else{const m=g-f;f=o+(f-t),g=f+m}else h+=i}l[d]=h,l[d+1]=f,l[d+2]=g}}}}class zPe{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var uhr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Dte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Jce=class{constructor(e,t,i,r){this._legend=e,this._themeService=t,this._languageService=i,this._logService=r,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new yy}getMetadata(e,t,i){const r=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,r);let s;if(o)s=o.metadata,this._logService.getLevel()===qc.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Kc.getForeground(s)}, fontStyle ${Kc.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d<this._legend.tokenModifiers.length;d++)c&1&&l.push(this._legend.tokenModifiers[d]),c=c>>1;c>0&&this._logService.getLevel()===qc.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof u>"u")s=2147483647;else{if(s=0,typeof u.italic<"u"){const d=(u.italic?1:0)<<11;s|=d|1}if(typeof u.bold<"u"){const d=(u.bold?2:0)<<11;s|=d|2}if(typeof u.underline<"u"){const d=(u.underline?4:0)<<11;s|=d|4}if(typeof u.strikethrough<"u"){const d=(u.strikethrough?8:0)<<11;s|=d|8}if(u.foreground){const d=u.foreground<<15;s|=d|16}s===0&&(s=2147483647)}}else this._logService.getLevel()===qc.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,r,s),this._logService.getLevel()===qc.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${Kc.getForeground(s)}, fontStyle ${Kc.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,r,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${r} is outside the previous data (length ${o}).`))}};Jce=uhr([Dte(1,Hl),Dte(2,xs),Dte(3,hp)],Jce);function pet(n,e,t){const i=n.data,r=n.data.length/5|0,o=Math.max(Math.ceil(r/1024),400),s=[];let a=0,l=1,c=0;for(;a<r;){const u=a;let d=Math.min(u+o,r);if(d<r){let b=d;for(;b-1>u&&i[5*b]===0;)b--;if(b-1===u){let y=d;for(;y+1<r&&i[5*y]===0;)y++;d=y}else d=b}let h=new Uint32Array((d-u)*4),f=0,g=0,m=0,v=0;for(;a<d;){const b=5*a,y=i[b],C=i[b+1],x=l+y|0,E=y===0?c+C|0:C,k=i[b+2],L=E+k|0,D=i[b+3],A=i[b+4];if(L<=E)e.warnInvalidLengthSemanticTokens(x,E+1);else if(m===x&&v>E)e.warnOverlappingSemanticTokens(x,E+1);else{const O=e.getMetadata(D,A,t);O!==2147483647&&(g===0&&(g=x),h[f]=x-g,h[f+1]=E,h[f+2]=L,h[f+3]=O,f+=4,m=x,v=L)}l=x,c=E,a++}f!==h.length&&(h=h.subarray(0,f));const _=jM.create(g,h);s.push(_)}return s}class dhr{constructor(e,t,i,r){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=r,this.next=null}}class yy{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=yy._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<yy._SIZES.length?2/3*this._currentLength:0),this._elements=[],yy._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const r=this._hashFunc(e,t,i);let o=this._elements[r];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,r){if(this._elementsCount++,this._growCount!==0&&this._elementsCount>=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=yy._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<yy._SIZES.length?2/3*this._currentLength:0),this._elements=[],yy._nullOutEntries(this._elements,this._currentLength);for(const s of o){let a=s;for(;a;){const l=a.next;a.next=null,this._add(a),a=l}}}this._add(new dhr(e,t,i,r))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}yy._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];const zG=or("semanticTokensStylingService");var hhr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ate=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let eue=class extends Ue{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new Jce(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};eue=hhr([Ate(0,Hl),Ate(1,hp),Ate(2,xs)],eue);vr(zG,eue,1);var UPe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const t7="**",jPe="/",nV="[/\\\\]",iV="[^/\\\\]",fhr=/\//g;function qPe(n,e){switch(n){case 0:return"";case 1:return`${iV}*?`;default:return`(?:${nV}|${iV}+${nV}${e?`|${nV}${iV}+`:""})*?`}}function KPe(n,e){if(!n)return[];const t=[];let i=!1,r=!1,o="";for(const s of n){switch(s){case e:if(!i&&!r){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":r=!0;break;case"]":r=!1;break}o+=s}return o&&t.push(o),t}function get(n){if(!n)return"";let e="";const t=KPe(n,jPe);if(t.every(i=>i===t7))e=".*";else{let i=!1;t.forEach((r,o)=>{if(r===t7){if(i)return;e+=qPe(2,o===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===jPe?d="":d=tp(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${KPe(a,",").map(f=>get(f)).join("|")})`;e+=h,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=iV;continue;case"*":e+=qPe(1);continue;default:e+=tp(u)}}o<t.length-1&&(t[o+1]!==t7||o+2<t.length)&&(e+=nV)}i=r===t7})}return e}const phr=/^\*\*\/\*\.[\w\.-]+$/,ghr=/^\*\*\/([\w\.-]+)\/?$/,mhr=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,_hr=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,vhr=/^\*\*((\/[\w\.-]+)+)\/?$/,bhr=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,GPe=new hE(1e4),YPe=function(){return!1},Xb=function(){return null};function mye(n,e){if(!n)return Xb;let t;typeof n!="string"?t=n.pattern:t=n,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let r=GPe.get(i);if(r)return QPe(r,n);let o;return phr.test(t)?r=yhr(t.substr(4),t):(o=ghr.exec(Nte(t,e)))?r=Chr(o[1],t):(e.trimForExclusions?_hr:mhr).test(t)?r=whr(t,e):(o=vhr.exec(Nte(t,e)))?r=XPe(o[1].substr(1),t,!0):(o=bhr.exec(Nte(t,e)))?r=XPe(o[1],t,!1):r=Shr(t),GPe.set(i,r),QPe(r,n)}function QPe(n,e){if(typeof e=="string")return n;const t=function(i,r){return Fce(i,e.base,!Zu)?n(b6(i.substr(e.base.length),uv),r):null};return t.allBasenames=n.allBasenames,t.allPaths=n.allPaths,t.basenames=n.basenames,t.patterns=n.patterns,t}function Nte(n,e){return e.trimForExclusions&&n.endsWith("/**")?n.substr(0,n.length-2):n}function yhr(n,e){return function(t,i){return typeof t=="string"&&t.endsWith(n)?e:null}}function Chr(n,e){const t=`/${n}`,i=`\\${n}`,r=function(s,a){return typeof s!="string"?null:a?a===n?e:null:s===n||s.endsWith(t)||s.endsWith(i)?e:null},o=[n];return r.basenames=o,r.patterns=[e],r.allBasenames=o,r}function whr(n,e){const t=_et(n.slice(1,-1).split(",").map(a=>mye(a,e)).filter(a=>a!==Xb),n),i=t.length;if(!i)return Xb;if(i===1)return t[0];const r=function(a,l){for(let c=0,u=t.length;c<u;c++)if(t[c](a,l))return n;return null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function XPe(n,e,t){const i=uv===hl.sep,r=i?n:n.replace(fhr,uv),o=uv+r,s=hl.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(o)||!i&&(l===n||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function Shr(n){try{const e=new RegExp(`^${get(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Xb}}function Ehr(n,e,t){return!n||typeof e!="string"?!1:met(n)(e,void 0,t)}function met(n,e={}){if(!n)return YPe;if(typeof n=="string"||xhr(n)){const t=mye(n,e);if(t===Xb)return YPe;const i=function(r,o){return!!t(r,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Thr(n,e)}function xhr(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Thr(n,e){const t=_et(Object.getOwnPropertyNames(n).map(a=>khr(a,n[a],e)).filter(a=>a!==Xb)),i=t.length;if(!i)return Xb;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;f<g;f++){const m=t[f](u,d);if(typeof m=="string")return m;sce(m)&&(h||(h=[]),h.push(m))}return h?(()=>UPe(this,void 0,void 0,function*(){for(const f of h){const g=yield f;if(typeof g=="string")return g}return null}))():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const r=function(a,l,c){let u,d;for(let h=0,f=t.length;h<f;h++){const g=t[h];g.requiresSiblings&&c&&(l||(l=Pw(a)),u||(u=l.substr(0,l.length-jJi(a).length)));const m=g(a,l,u,c);if(typeof m=="string")return m;sce(m)&&(d||(d=[]),d.push(m))}return d?(()=>UPe(this,void 0,void 0,function*(){for(const h of d){const f=yield h;if(typeof f=="string")return f}return null}))():null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function khr(n,e,t){if(e===!1)return Xb;const i=mye(n,t);if(i===Xb)return Xb;if(typeof e=="boolean")return i;if(e){const r=e.when;if(typeof r=="string"){const o=(s,a,l,c)=>{if(!c||!i(s,a))return null;const u=r.replace("$(basename)",()=>l),d=c(u);return sce(d)?d.then(h=>h?n:null):d?n:null};return o.requiresSiblings=!0,o}}return i}function _et(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let r;if(e){r=[];for(let a=0,l=i.length;a<l;a++)r.push(e)}else r=t.reduce((a,l)=>{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=i.indexOf(l);return c!==-1?r[c]:null};o.basenames=i,o.patterns=r,o.allBasenames=i;const s=n.filter(a=>!a.basenames);return s.push(o),s}function vet(n,e,t,i,r,o){if(Array.isArray(n)){let s=0;for(const a of n){const l=vet(a,e,t,i,r,o);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=n;if(!i&&!c)return 0;u&&r&&(e=r);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===o)d=10;else if(u==="*"&&o!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:TXe(a.base)}),h===e.fsPath||Ehr(h,e.fsPath))d=10;else return 0}return d}else return 0}}function bet(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(bet):!!n.exclusive}class ZPe{constructor(e,t,i,r){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=r}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class aa{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new Le,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),mi(()=>{if(i){const r=this._entries.indexOf(i);r>=0&&(this._entries.splice(r,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,r;return this._orderedForEach(e,o=>{i&&r===o._score?i.push(o.provider):(r=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const r=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=r?new ZPe(e.uri,e.getLanguageId(),r.uri,r.type):new ZPe(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const s of this._entries)if(s._score=vet(s.selector,o.uri,o.languageId,mir(e),o.notebookUri,o.notebookType),bet(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(aa._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:TP(e.selector)&&!TP(t.selector)?1:!TP(e.selector)&&TP(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function TP(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(TP):!!n.isBuiltin}class Ihr{constructor(){this.referenceProvider=new aa(this._score.bind(this)),this.renameProvider=new aa(this._score.bind(this)),this.codeActionProvider=new aa(this._score.bind(this)),this.definitionProvider=new aa(this._score.bind(this)),this.typeDefinitionProvider=new aa(this._score.bind(this)),this.declarationProvider=new aa(this._score.bind(this)),this.implementationProvider=new aa(this._score.bind(this)),this.documentSymbolProvider=new aa(this._score.bind(this)),this.inlayHintsProvider=new aa(this._score.bind(this)),this.colorProvider=new aa(this._score.bind(this)),this.codeLensProvider=new aa(this._score.bind(this)),this.documentFormattingEditProvider=new aa(this._score.bind(this)),this.documentRangeFormattingEditProvider=new aa(this._score.bind(this)),this.onTypeFormattingEditProvider=new aa(this._score.bind(this)),this.signatureHelpProvider=new aa(this._score.bind(this)),this.hoverProvider=new aa(this._score.bind(this)),this.documentHighlightProvider=new aa(this._score.bind(this)),this.selectionRangeProvider=new aa(this._score.bind(this)),this.foldingRangeProvider=new aa(this._score.bind(this)),this.linkProvider=new aa(this._score.bind(this)),this.inlineCompletionsProvider=new aa(this._score.bind(this)),this.completionProvider=new aa(this._score.bind(this)),this.linkedEditingRangeProvider=new aa(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new aa(this._score.bind(this)),this.documentSemanticTokensProvider=new aa(this._score.bind(this)),this.documentOnDropEditProvider=new aa(this._score.bind(this)),this.documentPasteEditProvider=new aa(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}vr(bn,Ihr,1);const F6=or("IWorkspaceEditService");class _ye{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Jy.is(t))return Jy.lift(t);if(fD.is(t))return fD.lift(t);throw new Error("Unsupported edit")})}}class Jy extends _ye{static is(e){return e instanceof Jy?!0:kd(e)&&Yn.isUri(e.resource)&&kd(e.textEdit)}static lift(e){return e instanceof Jy?e:new Jy(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,r){super(r),this.resource=e,this.textEdit=t,this.versionId=i}}class fD extends _ye{static is(e){return e instanceof fD?!0:kd(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof fD?e:new fD(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},r){super(r),this.oldResource=e,this.newResource=t,this.options=i}}const Au={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},UG=Object.freeze({id:"editor",order:5,type:"object",title:T("editorConfigurationTitle","Editor"),scope:5}),Az=Object.assign(Object.assign({},UG),{properties:{"editor.tabSize":{type:"number",default:gu.tabSize,minimum:1,markdownDescription:T("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:T("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:gu.insertSpaces,markdownDescription:T("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:gu.detectIndentation,markdownDescription:T("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:gu.trimAutoWhitespace,description:T("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:gu.largeFileOptimizations,description:T("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:T("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[T("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),T("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),T("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:T("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[T("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),T("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),T("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:T("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:T("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:T("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:T("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:T("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:T("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:T("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:T("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:T("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:T("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:T("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:T("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Au.maxComputationTime,description:T("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Au.maxFileSize,description:T("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Au.renderSideBySide,description:T("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Au.renderSideBySideInlineBreakpoint,description:T("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Au.useInlineViewWhenSpaceIsLimited,description:T("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Au.renderMarginRevertIcon,description:T("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Au.ignoreTrimWhitespace,description:T("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Au.renderIndicators,description:T("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Au.diffCodeLens,description:T("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Au.diffWordWrap,markdownEnumDescriptions:[T("wordWrap.off","Lines will never wrap."),T("wordWrap.on","Lines will wrap at the viewport width."),T("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Au.diffAlgorithm,markdownEnumDescriptions:[T("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),T("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Au.hideUnchangedRegions.enabled,markdownDescription:T("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Au.hideUnchangedRegions.revealLineCount,markdownDescription:T("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Au.hideUnchangedRegions.minimumLineCount,markdownDescription:T("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Au.hideUnchangedRegions.contextLineCount,markdownDescription:T("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Au.experimental.showMoves,markdownDescription:T("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Au.experimental.showEmptyDecorations,description:T("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function Lhr(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of iL){const e=n.schema;if(typeof e<"u")if(Lhr(e))Az.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(Az.properties[t]=e[t])}let n7=null;function yet(){return n7===null&&(n7=Object.create(null),Object.keys(Az.properties).forEach(n=>{n7[n]=!0})),n7}function Dhr(n){return yet()[`editor.${n}`]||!1}function Ahr(n){return yet()[`diffEditor.${n}`]||!1}const Nhr=Hs.as(Nv.Configuration);Nhr.registerConfiguration(Az);class Is{static insert(e,t){return{range:new J(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function Rte(n){return Object.isFrozen(n)?n:mZi(n)}class fu{constructor(e={},t=[],i=[],r){this._contents=e,this._keys=t,this._overrides=i,this.raw=r,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof fu)return i;const r=new Rhr("");return r.parseRaw(i),r.configurationModel});this._rawConfiguration=t.reduce((i,r)=>r===i?r:i.merge(r),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?VRe(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e),r=t?this.rawConfiguration.getOverrideValue(e,t):void 0,o=t?this.rawConfiguration.override(t).getValue(e):i;return{value:i,override:r,merged:o}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?VRe(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const r=_y(this.contents),o=_y(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(r,l.contents);for(const c of l.overrides){const[u]=o.filter(d=>Ia(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=fS(u.keys)):o.push(_y(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new fu(r,s,o,a.every(l=>l instanceof fu)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const r of fS([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[r];const s=t[r];s&&(typeof o=="object"&&typeof s=="object"?(o=_y(o),this.mergeContents(o,s)):o=s),i[r]=o}return new fu(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&kd(e[i])&&kd(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=_y(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const r=o=>{o&&(i?this.mergeContents(i,o):i=_y(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&r(o.contents);return r(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Nnr(this.contents,e),yS.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ia(i.identifiers,ez(e))),1))}updateValue(e,t,i){kZe(this.contents,e,t,r=>console.error(r)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),yS.test(e)&&this.overrides.push({identifiers:ez(e),keys:Object.keys(this.contents[e]),contents:cce(this.contents[e],r=>console.error(r))})}}class Rhr{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new fu}parseRaw(e,t){this._raw=e;const{contents:i,keys:r,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new fu(i,r,o,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=Hs.as(Nv.Configuration).getConfigurationProperties(),r=this.filter(e,i,!0,t);e=r.raw;const o=cce(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:s,overrides:a,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,r){var o,s,a;let l=!1;if(!(r!=null&&r.scopes)&&!(r!=null&&r.skipRestricted)&&!(!((o=r==null?void 0:r.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(yS.test(d)&&i){const h=this.filter(e[d],t,!1,r);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=r.exclude)===null||s===void 0)&&s.includes(d))&&(!((a=r.include)===null||a===void 0)&&a.includes(d)||(f===void 0||r.scopes===void 0||r.scopes.includes(f))&&!(r.skipRestricted&&(h!=null&&h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const r of Object.keys(e))if(yS.test(r)){const o={};for(const s in e[r])o[s]=e[r][s];i.push({identifiers:ez(r),keys:Object.keys(o),contents:cce(o,t)})}return i}}class Ohr{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=r,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,i){const r=e.inspect(t,i);return{get value(){return Rte(r.value)},get override(){return Rte(r.override)},get merged(){return Rte(r.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class jG{constructor(e,t,i,r,o=new fu,s=new fu,a=new mu,l=new fu,c=new mu){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=r,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new mu,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let r;i.resource?(r=this._memoryConfigurationByResource.get(i.resource),r||(r=new fu,this._memoryConfigurationByResource.set(i.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const r=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of r.overrides)for(const c of l.identifiers)r.getOverrideValue(e,c)!==void 0&&a.add(c);return new Ohr(e,t,r.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let r=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(r=r.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(r=r.merge(this._policyConfiguration)),r}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const r=t.getFolder(e);r&&(i=this.getFolderConsolidatedConfiguration(r.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=i.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:r,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:r,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),r=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Yn.revive(c[0]),this.parseConfigurationModel(c[1])),l),new mu);return new jG(t,i,r,o,new fu,s,a,new fu,new mu)}static parseConfigurationModel(e){return new fu(e.contents,e.keys,e.overrides)}}class Phr{constructor(e,t,i,r){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=r,this._marker=` `,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const s of o)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=jG.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const r=this._marker+e,o=this._affectsConfigStr.indexOf(r);if(o<0)return!1;const s=o+r.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!jf(l,c)}return!0}}const Nz={kind:0},Mhr={kind:1};function Fhr(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class qM{constructor(e,t,i){var r;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const s=o.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=qM.handleRemovals([].concat(e).concat(t));for(let o=0,s=this._keybindings.length;o<s;o++){const a=this._keybindings[o];if(a.chords.length===0)continue;const l=(r=a.when)===null||r===void 0?void 0:r.substituteConstants();l&&l.type===0||this._addKeyPress(a.chords[0],a)}}static _isTargetedForRemoval(e,t,i){if(t){for(let r=0;r<t.length;r++)if(t[r]!==e.chords[r])return!1}return!(i&&i.type!==1&&(!e.when||!Uer(i,e.when)))}static handleRemovals(e){const t=new Map;for(let r=0,o=e.length;r<o;r++){const s=e[r];if(s.command&&s.command.charAt(0)==="-"){const a=s.command.substring(1);t.has(a)?t.get(a).push(s):t.set(a,[s])}}if(t.size===0)return e;const i=[];for(let r=0,o=e.length;r<o;r++){const s=e[r];if(!s.command||s.command.length===0){i.push(s);continue}if(s.command.charAt(0)==="-")continue;const a=t.get(s.command);if(!a||!s.isDefault){i.push(s);continue}let l=!1;for(const c of a){const u=c.when;if(this._isTargetedForRemoval(s,c.chords,u)){l=!0;break}}if(!l){i.push(s);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let r=i.length-1;r>=0;r--){const o=i[r];if(o.command===t.command)continue;let s=!0;for(let a=1;a<o.chords.length&&a<t.chords.length;a++)if(o.chords[a]!==t.chords[a]){s=!1;break}s&&qM.whenIsEntirelyIncluded(o.when,t.when)&&this._removeFromLookupMap(o)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,r=t.length;i<r;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:tce(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let r=i.length-1;r>=0;r--){const o=i[r];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const r=[...t,i];this._log(`| Resolving ${r}`);const o=this._map.get(r[0]);if(o===void 0)return this._log("\\ No keybinding entries."),Nz;let s=null;if(r.length<2)s=o;else{s=[];for(let l=0,c=o.length;l<c;l++){const u=o[l];if(r.length>u.chords.length)continue;let d=!0;for(let h=1;h<r.length;h++)if(u.chords[h]!==r[h]){d=!1;break}d&&s.push(u)}}const a=this._findCommand(e,s);return a?r.length<a.chords.length?(this._log(`\\ From ${s.length} keybinding entries, awaiting ${a.chords.length-r.length} more chord(s), when: ${JPe(a.when)}, source: ${eMe(a)}.`),Mhr):(this._log(`\\ From ${s.length} keybinding entries, matched ${a.command}, when: ${JPe(a.when)}, source: ${eMe(a)}.`),Fhr(a.command,a.commandArgs,a.bubble)):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),Nz)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const r=t[i];if(qM._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function JPe(n){return n?`${n.serialize()}`:"no when condition"}function eMe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const Bhr=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class $hr extends Ue{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:nn.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,r,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=r,this._logService=o,this._onDidUpdateKeybindings=this._register(new Le),this._currentChords=[],this._currentChordChecker=new S6,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=vL.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Zm,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),Nz;const[r]=i.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),Nz;const o=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,s,r)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Zbe("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(T("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:r})=>r).join(", ");this._currentChordStatusMessage=this._notificationService.status(T("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),NM.enabled&&NM.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],NM.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[r]=i.getSingleModifierDispatchChords();if(r)return this._ignoreSingleModifiers.has(r)?(this._log(`+ Ignoring single modifier ${r} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=vL.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=vL.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${r}.`),this._currentSingleModifier=r,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):r===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${r} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new vL(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var r;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(i){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(T("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(T("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d)),Bhr.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(r=e.getUserSettingsLabel())!==null&&r!==void 0?r:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class vL{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}vL.EMPTY=new vL(null);class tMe{constructor(e,t,i,r,o,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?tue(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=tue(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=r,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=a}}function tue(n){const e=[];for(let t=0,i=n.length;t<i;t++){const r=n[t];if(!r)return[];e.push(r)}return e}class qG{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(t.length===0)return null;const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=i(a);if(l===null)return null;r[o]=zhr(a,l,this.modifierLabels[e])}return r.join(" ")}}const vye=new qG({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:T({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:T({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:T({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:T({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),Vhr=new qG({ctrlKey:T({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:T({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"optKey.long",comment:["This is the long form for the Alt/Option key on the keyboard"]},"Option"),metaKey:T({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:T({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:T({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:T({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:T({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),Hhr=new qG({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),Whr=new qG({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});function zhr(n,e,t){if(e===null)return"";const i=[];return n.ctrlKey&&i.push(t.ctrlKey),n.shiftKey&&i.push(t.shiftKey),n.altKey&&i.push(t.altKey),n.metaKey&&i.push(t.metaKey),e!==""&&i.push(e),i.join(t.separator)}class Uhr extends qer{constructor(e,t){if(super(),t.length===0)throw ag("chords");this._os=e,this._chords=t}getLabel(){return vye.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return Vhr.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Hhr.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Whr.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new jer(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class e5 extends Uhr{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Sy.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Sy.toString(e.keyCode)}_getElectronAccelerator(e){return Sy.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Sy.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return e5.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Sy.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=r0e[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof w1)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new w1(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=tue(e.chords.map(r=>this._toKeyCodeChord(r)));return i.length>0?[new e5(i,t)]:[]}}const VA=or("labelService"),Cet=or("progressService");class e1{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}e1.None=Object.freeze({report(){}});const gE=or("editorProgressService");class jhr{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class qhr{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?s0e(e,this._value,0,e.length,this._from,this._to):y6(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Khr{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(t===47||this._splitOnBackslash&&t===92)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?s0e(e,this._value,0,e.length,this._from,this._to):y6(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Ghr{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new Khr(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return Yle(e,this._value.scheme);if(this._states[this._stateIdx]===2)return Yle(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return w3(e,this._value.query);if(this._states[this._stateIdx]===5)return w3(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}class i7{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,t;return(t=(e=this.left)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}get heightRight(){var e,t;return(t=(e=this.right)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}}class pD{static forUris(e=()=>!1,t=()=>!1){return new pD(new Ghr(e,t))}static forStrings(){return new pD(new jhr)}static forConfigKeys(){return new pD(new qhr)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let r;this._root||(this._root=new i7,this._root.segment=i.value());const o=[];for(r=this._root;;){const a=i.cmp(r.segment);if(a>0)r.left||(r.left=new i7,r.left.segment=i.value()),o.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new i7,r.right.segment=i.value()),o.push([1,r]),r=r.right;else if(i.hasNext())i.next(),r.mid||(r.mid=new i7,r.mid.segment=i.value()),o.push([0,r]),r=r.mid;else break}const s=r.value;r.value=t,r.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=o[a][0],d=o[a+1][0];if(u===1&&d===1)o[a][1]=l.rotateLeft();else if(u===-1&&d===-1)o[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const r=this._iter.reset(e),o=[];let s=this._root;for(;s;){const a=r.cmp(s.segment);if(a>0)o.push([-1,s]),s=s.left;else if(a<0)o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),o.push([0,s]),s=s.mid;else break}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(i=s.left)!==null&&i!==void 0?i:s.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,r;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),r=i.value||r,i=i.mid;else break}return i&&i.value||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let r=this._root;for(;r;){const o=i.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(i.hasNext())i.next(),r=r.mid;else return r.mid?this._entries(r.mid):t?r.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const nk=or("contextService");function nue(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&Yn.isUri(e.uri)}function Yhr(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!nue(n)&&!Jhr(n)}const Qhr={id:"ext-dev"},Xhr={id:"empty-window"};function Zhr(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:Pw(n)}:e?Qhr:Xhr;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function Jhr(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&Yn.isUri(e.configPath)}class efr{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const iue="code-workspace";T("codeWorkspace","Code Workspace");const wet="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function tfr(n){return n.id===wet}var rue;(function(n){n.inspectTokensAction=T("inspectTokens","Developer: Inspect Tokens")})(rue||(rue={}));var Rz;(function(n){n.gotoLineActionLabel=T("gotoLineActionLabel","Go to Line/Column...")})(Rz||(Rz={}));var oue;(function(n){n.helpQuickAccessActionLabel=T("helpQuickAccess","Show all Quick Access Providers")})(oue||(oue={}));var Oz;(function(n){n.quickCommandActionLabel=T("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=T("quickCommandActionHelp","Show And Run Commands")})(Oz||(Oz={}));var t5;(function(n){n.quickOutlineActionLabel=T("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=T("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(t5||(t5={}));var Pz;(function(n){n.editorViewAccessibleLabel=T("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=T("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(Pz||(Pz={}));var sue;(function(n){n.toggleHighContrast=T("toggleHighContrast","Toggle High Contrast Theme")})(sue||(sue={}));var aue;(function(n){n.bulkEditServiceSummary=T("bulkEditServiceSummary","Made {0} edits in {1} files")})(aue||(aue={}));const Eet=or("workspaceTrustManagementService"),P1=or("contextViewService"),t_=or("contextMenuService");var cu;(function(n){function e(o,s){if(o.start>=s.end||s.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,s.start),l=Math.min(o.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,s){return!t(e(o,s))}n.intersects=i;function r(o,s){const a=[],l={start:o.start,end:Math.min(s.start,o.end)},c={start:Math.max(s.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=r})(cu||(cu={}));function nfr(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var sw;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(sw||(sw={}));function bL(n,e,t){const i=t.mode===sw.ALIGN?t.offset:t.offset+t.size,r=t.mode===sw.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=r?r-e:Math.max(n-e,0):e<=r?r-e:e<=n-i?i:0}class HA extends Ue{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Ue.None,this.toDisposeOnSetContainer=Ue.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=kt(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,bd(this.view),this.setContainer(e,t),this._register(mi(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=kt(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=ifr,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(kt("slot"))}else this.container.appendChild(this.view);const r=new mt;HA.BUBBLE_UP_EVENTS.forEach(o=>{r.add($a(this.container,o,s=>{this.onDOMEvent(s,!1)}))}),HA.BUBBLE_DOWN_EVENTS.forEach(o=>{r.add($a(this.container,o,s=>{this.onDOMEvent(s,!0)},!0))}),this.toDisposeOnSetContainer=r}}show(e){var t,i;this.isVisible()&&this.hide(),Ic(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Mh(this.view),this.toDisposeOnClean=e.render(this.view)||Ue.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)===null||i===void 0||i.call(t)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(vv&&_0e.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(b0e(e)){const d=pl(e),h=Ftr(e);t={top:d.top*h,left:d.left*h,width:d.width*h,height:d.height*h}}else nfr(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=th(this.view),r=jx(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const d={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},h={offset:t.left,size:t.width,position:s===0?0:1,mode:sw.ALIGN};l=bL(window.innerHeight,r,d)+window.pageYOffset,cu.intersects({start:l,end:l+r},{start:d.offset,end:d.offset+d.size})&&(h.mode=sw.AVOID),c=bL(window.innerWidth,i,h)}else{const d={offset:t.left,size:t.width,position:s===0?0:1},h={offset:t.top,size:t.height,position:o===0?0:1,mode:sw.ALIGN};c=bL(window.innerWidth,i,d),cu.intersects({start:c,end:c+i},{start:d.offset,end:d.offset+d.size})&&(h.mode=sw.AVOID),l=bL(window.innerHeight,r,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=pl(this.container);this.view.style.top=`${l-(this.useFixedPosition?pl(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?pl(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),bd(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Qc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}HA.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];HA.BUBBLE_DOWN_EVENTS=["click"];const ifr=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } .codicon[class*='codicon-'] { font: normal normal normal 16px/1 codicon; display: inline-block; text-decoration: none; text-rendering: auto; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none; -ms-user-select: none; } :host { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } `;var rfr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ofr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let lue=class extends Ue{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Ue.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new HA(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const r=mi(()=>{this.currentViewDisposable===r&&this.hideContextView()});return this.currentViewDisposable=r,r}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};lue=rfr([ofr(0,lR)],lue);let WA=[],bye=[],xet=[];function r7(n,e=!1){sfr(n,!1,e)}function sfr(n,e,t){const i=afr(n,e);WA.push(i),i.userConfigured?xet.push(i):bye.push(i),t&&!i.userConfigured&&WA.forEach(r=>{r.mime===i.mime||r.userConfigured||(i.extension&&r.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&r.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&r.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&r.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function afr(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?met(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(hl.sep)>=0:!1}}function lfr(){WA=WA.filter(n=>n.userConfigured),bye=[]}function cfr(n,e){return ufr(n,e).map(t=>t.id)}function ufr(n,e){let t;if(n)switch(n.scheme){case Gi.file:t=n.fsPath;break;case Gi.data:{t=xS.parseMetaData(n).get(xS.META_DATA_LABEL);break}case Gi.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Ta.unknown}];t=t.toLowerCase();const i=Pw(t),r=nMe(t,i,xet);if(r)return[r,{id:qf,mime:Ta.text}];const o=nMe(t,i,bye);if(o)return[o,{id:qf,mime:Ta.text}];if(e){const s=dfr(e);if(s)return[s,{id:qf,mime:Ta.text}]}return[{id:"unknown",mime:Ta.unknown}]}function nMe(n,e,t){var i;let r,o,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){r=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(r)return r;if(o)return o;if(s)return s}function dfr(n){if(h0e(n)&&(n=n.substr(1)),n.length>0)for(let e=WA.length-1;e>=0;e--){const t=WA[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const o7=Object.prototype.hasOwnProperty,iMe="vs.editor.nullLanguage";class hfr{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(iMe,0),this._register(qf,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||iMe}}class n5 extends Ue{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,n5.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new hfr,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(IA.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){n5.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},lfr();const e=[].concat(IA.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(r=>{this._lowercaseNameMap[r.toLowerCase()]=i.identifier}),i.mimetypes.forEach(r=>{this._mimeTypesMap[r]=i.identifier})}),Hs.as(Nv.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;o7.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let r=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),r=t.mimetypes[0]),r||(r=`text/x-${i}`,e.mimetypes.push(r)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)r7({id:i,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)r7({id:i,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)r7({id:i,mime:r,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);der(l)||r7({id:i,mime:r,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const s=o!==null&&o.length>0;if(!(s&&o[0]===null)){const a=(s?o[0]:null)||i;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?o7.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return o7.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&o7.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:cfr(e,t)}}n5.instanceCount=0;class i5 extends Ue{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new Le),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new Le),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new Le({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,i5.instanceCount++,this._registry=this._register(new n5(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){i5.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return nXe(i,null)}createById(e){return new rMe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new rMe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=qf),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),Ks.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}i5.instanceCount=0;class rMe{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new Le({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const r5={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Ta.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function yye(...n){return function(e,t){for(let i=0,r=n.length;i<r;i++){const o=n[i](e,t);if(o)return o}return null}}Tet.bind(void 0,!1);const o5=Tet.bind(void 0,!0);function Tet(n,e,t){if(!t||t.length<e.length)return null;let i;return n?i=a0e(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function ket(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function Iet(n,e){return cue(n.toLowerCase(),e.toLowerCase(),0,0)}function cue(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let r=null;return(r=cue(n,e,t+1,i+1))?Sye({start:i,end:i+1},r):null}return cue(n,e,t,i+1)}function Cye(n){return 97<=n&&n<=122}function KG(n){return 65<=n&&n<=90}function wye(n){return 48<=n&&n<=57}function Let(n){return n===32||n===9||n===10||n===13}const Det=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>Det.add(n.charCodeAt(0)));function Mz(n){return Let(n)||Det.has(n)}function ffr(n,e){return n===e||Mz(n)&&Mz(e)}function Aet(n){return Cye(n)||KG(n)||wye(n)}function Sye(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function Net(n,e){for(let t=e;t<n.length;t++){const i=n.charCodeAt(t);if(KG(i)||wye(i)||t>0&&!Aet(n.charCodeAt(t-1)))return t}return n.length}function uue(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let r=null,o=i+1;for(r=uue(n,e,t+1,i+1);!r&&(o=Net(e,o))<e.length;)r=uue(n,e,t+1,o),o++;return r===null?null:Sye({start:i,end:i+1},r)}}function pfr(n){let e=0,t=0,i=0,r=0,o=0;for(let u=0;u<n.length;u++)o=n.charCodeAt(u),KG(o)&&e++,Cye(o)&&t++,Aet(o)&&i++,wye(o)&&r++;const s=e/n.length,a=t/n.length,l=i/n.length,c=r/n.length;return{upperPercent:s,lowerPercent:a,alphaPercent:l,numericPercent:c}}function gfr(n){const{upperPercent:e,lowerPercent:t}=n;return t===0&&e>.6}function mfr(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:r}=n;return t>.2&&e<.8&&i>.6&&r<.2}function _fr(n){let e=0,t=0,i=0,r=0;for(let o=0;o<n.length;o++)i=n.charCodeAt(o),KG(i)&&e++,Cye(i)&&t++,Let(i)&&r++;return(e===0||t===0)&&r===0?n.length<=30:e<=5}function Ret(n,e){if(!e||(e=e.trim(),e.length===0)||!_fr(n)||e.length>60)return null;const t=pfr(e);if(!mfr(t)){if(!gfr(t))return null;e=e.toLowerCase()}let i=null,r=0;for(n=n.toLowerCase();r<e.length&&(i=uue(n,e,0,r))===null;)r=Net(e,r+1);return i}function vfr(n,e,t=!1){if(!e||e.length===0)return null;let i=null,r=0;for(n=n.toLowerCase(),e=e.toLowerCase();r<e.length&&(i=due(n,e,0,r,t))===null;)r=Oet(e,r+1);return i}function due(n,e,t,i,r){if(t===n.length)return[];if(i===e.length)return null;if(ffr(n.charCodeAt(t),e.charCodeAt(i))){let o=null,s=i+1;if(o=due(n,e,t+1,i+1,r),!r)for(;!o&&(s=Oet(e,s))<e.length;)o=due(n,e,t+1,s,r),s++;return o?n.charCodeAt(t)!==e.charCodeAt(i)?o:Sye({start:i,end:i+1},o):null}else return null}function Oet(n,e){for(let t=e;t<n.length;t++)if(Mz(n.charCodeAt(t))||t>0&&Mz(n.charCodeAt(t-1)))return t;return n.length}const bfr=yye(o5,Ret,ket),yfr=yye(o5,Ret,Iet),oMe=new hE(1e4);function sMe(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=oMe.get(n);i||(i=new RegExp(cer(n),"i"),oMe.set(n,i));const r=i.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?yfr(n,e):bfr(n,e)}function Cfr(n,e){const t=ik(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?B6(t):null}function wfr(n,e,t,i,r,o){const s=Math.min(13,n.length);for(;t<s;t++){const a=ik(n,e,t,i,r,o,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(a)return a}return[0,o]}function B6(n){if(typeof n>"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const r=n[i]+t,o=e[e.length-1];o&&o.end===r?o.end=r+1:e.push({start:r,end:r+1})}return e}const aw=128;function Eye(){const n=[],e=[];for(let t=0;t<=aw;t++)e[t]=0;for(let t=0;t<=aw;t++)n.push(e.slice(0));return n}function Pet(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const Met=Pet(2*aw),hue=Pet(2*aw),ey=Eye(),$E=Eye(),s7=Eye();function a7(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!d0e(t)}}function aMe(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function rV(n,e,t){return e[n]!==t[n]}function Sfr(n,e,t,i,r,o,s=!1){for(;e<t&&r<o;)n[e]===i[r]&&(s&&(Met[e]=r),e+=1),r+=1;return e===t}var pv;(function(n){n.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}n.isDefault=e})(pv||(pv={}));class GG{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}GG.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};function ik(n,e,t,i,r,o,s=GG.default){const a=n.length>aw?aw:n.length,l=i.length>aw?aw:i.length;if(t>=a||o>=l||a-t>l-o||!Sfr(e,t,a,r,o,l,!0))return;Efr(a,l,t,o,e,r);let c=1,u=1,d=t,h=o;const f=[!1];for(c=1,d=t;d<a;c++,d++){const b=Met[d],y=hue[d],C=d+1<a?hue[d+1]:l;for(u=b-o+1,h=b;h<C;u++,h++){let x=Number.MIN_SAFE_INTEGER,E=!1;h<=y&&(x=xfr(n,e,d,t,i,r,h,l,o,ey[c-1][u-1]===0,f));let k=0;x!==Number.MAX_SAFE_INTEGER&&(E=!0,k=x+$E[c-1][u-1]);const L=h>b,D=L?$E[c][u-1]+(ey[c][u-1]>0?-5:0):0,A=h>b+1&&ey[c][u-1]>0,O=A?$E[c][u-2]+(ey[c][u-2]>0?-5:0):0;if(A&&(!L||O>=D)&&(!E||O>=k))$E[c][u]=O,s7[c][u]=3,ey[c][u]=0;else if(L&&(!E||D>=k))$E[c][u]=D,s7[c][u]=2,ey[c][u]=0;else if(E)$E[c][u]=k,s7[c][u]=1,ey[c][u]=ey[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[$E[c][u],o];let m=0,v=0;for(;c>=1;){let b=u;do{const y=s7[c][b];if(y===3)b=b-2;else if(y===2)b=b-1;else break}while(b>=1);m>1&&e[t+c-1]===r[o+u-1]&&!rV(b+o-1,i,r)&&m+1>ey[c][b]&&(b=u),b===u?m++:m=1,v||(v=b),c--,u=b-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const _=v-a;return g[0]-=_,g}function Efr(n,e,t,i,r,o){let s=n-1,a=e-1;for(;s>=t&&a>=i;)r[s]===o[a]&&(hue[s]=a,s--),a--}function xfr(n,e,t,i,r,o,s,a,l,c,u){if(e[t]!==o[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-i?d=n[t]===r[s]?7:5:rV(s,r,o)&&(s===0||!rV(s-1,r,o))?(d=n[t]===r[s]?7:5,h=!0):a7(o,s)&&(s===0||!a7(o,s-1))?d=5:(a7(o,s-1)||aMe(o,s-1))&&(d=5,h=!0),d>1&&t===i&&(u[0]=!0),h||(h=rV(s,r,o)||a7(o,s-1)||aMe(o,s-1)),t===i?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function Tfr(n,e,t,i,r,o,s){return kfr(n,e,t,i,r,o,!0,s)}function kfr(n,e,t,i,r,o,s,a){let l=ik(n,e,t,i,r,o,a);if(l&&!s)return l;if(n.length>=3){const c=Math.min(7,n.length-1);for(let u=t+1;u<c;u++){const d=Ifr(n,u);if(d){const h=ik(d,d.toLowerCase(),t,i,r,o,a);h&&(h[0]-=3,(!l||h[0]>l[0])&&(l=h))}}}return l}function Ifr(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const Lfr="$(",xye=new RegExp(`\\$\\(${Qn.iconNameExpression}(?:${Qn.iconModifierExpression})?\\)`,"g"),Dfr=new RegExp(`(\\\\)?${xye.source}`,"g");function Afr(n){return n.replace(Dfr,(e,t)=>t?e:`\\${e}`)}const Nfr=new RegExp(`\\\\${xye.source}`,"g");function Rfr(n){return n.replace(Nfr,e=>`\\${e}`)}const Ofr=new RegExp(`(\\s)?(\\\\)?${xye.source}(\\s)?`,"g");function Tye(n){return n.indexOf(Lfr)===-1?n:n.replace(Ofr,(e,t,i,r)=>i?e:t||r||"")}function Pfr(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const Ote=new RegExp(`\\$\\(${Qn.iconNameCharacter}+\\)`,"g");function kP(n){Ote.lastIndex=0;let e="";const t=[];let i=0;for(;;){const r=Ote.lastIndex,o=Ote.exec(n),s=n.substring(r,o==null?void 0:o.index);if(s.length>0){e+=s;for(let a=0;a<s.length;a++)t.push(i)}if(!o)break;i+=o[0].length}return{text:e,iconOffsets:t}}function Pte(n,e,t=!1){const{text:i,iconOffsets:r}=e;if(!r||r.length===0)return sMe(n,i,t);const o=b6(i," "),s=i.length-o.length,a=sMe(n,o,t);if(a)for(const l of a){const c=r[l.start+s]+s;l.start+=c,l.end+=c}return a}class Gc{constructor(e="",t=!1){var i,r,o;if(this.value=e,typeof this.value!="string")throw ag("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=(i=t.isTrusted)!==null&&i!==void 0?i:void 0,this.supportThemeIcons=(r=t.supportThemeIcons)!==null&&r!==void 0?r:!1,this.supportHtml=(o=t.supportHtml)!==null&&o!==void 0?o:!1)}appendText(e,t=0){return this.value+=Ffr(this.supportThemeIcons?Afr(e):e).replace(/([ \t]+)/g,(i,r)=>" ".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=` `,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(tp(t),"g");return e.replace(i,(r,o)=>e.charAt(o-1)!=="\\"?`\\${r}`:r)}}function zA(n){return Vw(n)?!n.value:Array.isArray(n)?n.every(zA):!0}function Vw(n){return n instanceof Gc?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function Mfr(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&J0e(Yn.from(n.baseUri),Yn.from(e.baseUri)))}function Ffr(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function l7(n){return n.replace(/"/g,""")}function Mte(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Bfr(n){const e=[],t=n.split("|").map(r=>r.trim());n=t[0];const i=t[1];if(i){const r=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),s=r?r[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&e.push(`width="${a}"`),c&&e.push(`height="${s}"`)}return{href:n,dimensions:e}}var fue=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function $fr(n,e){Od(e)?n.title=Tye(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class Vfr{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var r;return fue(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Od(e)||e instanceof HTMLElement)o=e;else if(!_3(e.markdown))o=(r=e.markdown)!==null&&r!==void 0?r:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(T("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Va;const s=this._cancellationTokenSource.token;if(o=yield e.markdown(s),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const r=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!r},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}r==null||r.dispose()}hasContent(e){return e?Vw(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function Fet(n,e,t,i){let r,o;const s=(d,h)=>{var f;const g=o!==void 0;d&&(o==null||o.dispose(),o=void 0),h&&(r==null||r.dispose(),r=void 0),g&&((f=n.onDidHideHover)===null||f===void 0||f.call(n))},a=(d,h,f)=>new Zm(()=>fue(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new Vfr(n,f||e,d>0),yield o.update(t,h,i))}),d),l=()=>{if(r)return;const d=new mt,h=m=>s(!1,m.fromElement===e);d.add(tt(e,Yt.MOUSE_LEAVE,h,!0));const f=()=>s(!0,!0);d.add(tt(e,Yt.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const m=v=>{g.x=v.x+10,v.target instanceof HTMLElement&&v.target.classList.contains("action-label")&&s(!0,!0)};d.add(tt(e,Yt.MOUSE_MOVE,m,!0))}d.add(a(n.delay,!1,g)),r=d},c=tt(e,Yt.MOUSE_OVER,l,!0);return{show:d=>{s(!1,!0),a(0,d)},hide:()=>{s(!0,!0)},update:(d,h)=>fue(this,void 0,void 0,function*(){t=d,yield o==null?void 0:o.update(t,void 0,h)}),dispose:()=>{c.dispose(),s(!0,!0)}}}function Hfr(n,e={}){const t=kye(e);return t.textContent=n,t}function Wfr(n,e={}){const t=kye(e);return Bet(t,Ufr(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function kye(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class zfr{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function Bet(n,e,t,i){let r;if(e.type===2)r=document.createTextNode(e.content||"");else if(e.type===3)r=document.createElement("b");else if(e.type===4)r=document.createElement("i");else if(e.type===7&&i)r=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add($a(o,"click",s=>{t.callback(String(e.index),s)})),r=o}else e.type===8?r=document.createElement("br"):e.type===1&&(r=n);r&&n!==r&&n.appendChild(r),r&&Array.isArray(e.children)&&e.children.forEach(o=>{Bet(r,o,t,i)})}function Ufr(n,e){const t={type:1,children:[]};let i=0,r=t;const o=[],s=new zfr(n);for(;!s.eos();){let a=s.next();const l=a==="\\"&&pue(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&jfr(a,e)&&a===s.peek()){s.advance(),r.type===2&&(r=o.pop());const c=pue(a,e);if(r.type===c||r.type===5&&c===6)r=o.pop();else{const u={type:c,children:[]};c===5&&(u.index=i,i++),r.children.push(u),o.push(r),r=u}}else if(a===` `)r.type===2&&(r=o.pop()),r.children.push({type:8});else if(r.type!==2){const c={type:2,content:a};r.children.push(c),o.push(r),r=c}else r.content+=a}return r.type===2&&(r=o.pop()),t}function jfr(n,e){return pue(n,e)!==0}function pue(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const qfr=new RegExp(`(\\\\)?\\$\\((${Qn.iconNameExpression}(?:${Qn.iconModifierExpression})?)\\)`,"g");function Hw(n){const e=new Array;let t,i=0,r=0;for(;(t=qfr.exec(n))!==null;){r=t.index||0,i<r&&e.push(n.substring(i,r)),i=(t.index||0)+t[0].length;const[,o,s]=t;e.push(o?`$(${s})`:gue({id:s}))}return i<n.length&&e.push(n.substring(i)),e}function gue(n){const e=kt("span");return e.classList.add(...Qn.asClassNameArray(n)),e}class Iye{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const mue=new Iye("id#");let Vd={};(function(){function n(e,t){t(Vd)}n.amd=!0,function(e,t){typeof n=="function"&&n.amd?n(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(we,Se){for(var re=0;re<Se.length;re++){var Y=Se[re];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(we,Y.key,Y)}}function i(we,Se,re){return Se&&t(we.prototype,Se),re&&t(we,re),Object.defineProperty(we,"prototype",{writable:!1}),we}function r(we,Se){if(we){if(typeof we=="string")return o(we,Se);var re=Object.prototype.toString.call(we).slice(8,-1);if(re==="Object"&&we.constructor&&(re=we.constructor.name),re==="Map"||re==="Set")return Array.from(we);if(re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(re))return o(we,Se)}}function o(we,Se){(Se==null||Se>we.length)&&(Se=we.length);for(var re=0,Y=new Array(Se);re<Se;re++)Y[re]=we[re];return Y}function s(we,Se){var re=typeof Symbol<"u"&&we[Symbol.iterator]||we["@@iterator"];if(re)return(re=re.call(we)).next.bind(re);if(Array.isArray(we)||(re=r(we))||Se&&we&&typeof we.length=="number"){re&&(we=re);var Y=0;return function(){return Y>=we.length?{done:!0}:{done:!1,value:we[Y++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(we){e.defaults=we}var c=/[&<>"']/,u=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(Se){return f[Se]};function m(we,Se){if(Se){if(c.test(we))return we.replace(u,g)}else if(d.test(we))return we.replace(h,g);return we}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _(we){return we.replace(v,function(Se,re){return re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""})}var b=/(^|[^\[])\^/g;function y(we,Se){we=typeof we=="string"?we:we.source,Se=Se||"";var re={replace:function(Z,le){return le=le.source||le,le=le.replace(b,"$1"),we=we.replace(Z,le),re},getRegex:function(){return new RegExp(we,Se)}};return re}var C=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(we,Se,re){if(we){var Y;try{Y=decodeURIComponent(_(re)).replace(C,"").toLowerCase()}catch{return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}Se&&!x.test(re)&&(re=O(Se,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch{return null}return re}var k={},L=/^[^:]+:\/*[^/]*$/,D=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(we,Se){k[" "+we]||(L.test(we)?k[" "+we]=we+"/":k[" "+we]=M(we,"/",!0)),we=k[" "+we];var re=we.indexOf(":")===-1;return Se.substring(0,2)==="//"?re?Se:we.replace(D,"$1")+Se:Se.charAt(0)==="/"?re?Se:we.replace(A,"$1")+Se:we+Se}var P={exec:function(){}};function F(we){for(var Se=1,re,Y;Se<arguments.length;Se++){re=arguments[Se];for(Y in re)Object.prototype.hasOwnProperty.call(re,Y)&&(we[Y]=re[Y])}return we}function B(we,Se){var re=we.replace(/\|/g,function(le,te,me){for(var Oe=!1,et=te;--et>=0&&me[et]==="\\";)Oe=!Oe;return Oe?"|":" |"}),Y=re.split(/ \|/),Z=0;if(Y[0].trim()||Y.shift(),Y.length>0&&!Y[Y.length-1].trim()&&Y.pop(),Y.length>Se)Y.splice(Se);else for(;Y.length<Se;)Y.push("");for(;Z<Y.length;Z++)Y[Z]=Y[Z].trim().replace(/\\\|/g,"|");return Y}function M(we,Se,re){var Y=we.length;if(Y===0)return"";for(var Z=0;Z<Y;){var le=we.charAt(Y-Z-1);if(le===Se&&!re)Z++;else if(le!==Se&&re)Z++;else break}return we.slice(0,Y-Z)}function V(we,Se){if(we.indexOf(Se[1])===-1)return-1;for(var re=we.length,Y=0,Z=0;Z<re;Z++)if(we[Z]==="\\")Z++;else if(we[Z]===Se[0])Y++;else if(we[Z]===Se[1]&&(Y--,Y<0))return Z;return-1}function U(we){we&&we.sanitize&&!we.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function W(we,Se){if(Se<1)return"";for(var re="";Se>1;)Se&1&&(re+=we),Se>>=1,we+=we;return re+we}function q(we,Se,re,Y){var Z=Se.href,le=Se.title?m(Se.title):null,te=we[1].replace(/\\([\[\]])/g,"$1");if(we[0].charAt(0)!=="!"){Y.state.inLink=!0;var me={type:"link",raw:re,href:Z,title:le,text:te,tokens:Y.inlineTokens(te)};return Y.state.inLink=!1,me}return{type:"image",raw:re,href:Z,title:le,text:m(te)}}function H(we,Se){var re=we.match(/^(\s+)(?:```)/);if(re===null)return Se;var Y=re[1];return Se.split(` `).map(function(Z){var le=Z.match(/^\s+/);if(le===null)return Z;var te=le[0];return te.length>=Y.length?Z.slice(Y.length):Z}).join(` `)}var ie=function(){function we(re){this.options=re||e.defaults}var Se=we.prototype;return Se.space=function(Y){var Z=this.rules.block.newline.exec(Y);if(Z&&Z[0].length>0)return{type:"space",raw:Z[0]}},Se.code=function(Y){var Z=this.rules.block.code.exec(Y);if(Z){var le=Z[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:Z[0],codeBlockStyle:"indented",text:this.options.pedantic?le:M(le,` `)}}},Se.fences=function(Y){var Z=this.rules.block.fences.exec(Y);if(Z){var le=Z[0],te=H(le,Z[3]||"");return{type:"code",raw:le,lang:Z[2]?Z[2].trim():Z[2],text:te}}},Se.heading=function(Y){var Z=this.rules.block.heading.exec(Y);if(Z){var le=Z[2].trim();if(/#$/.test(le)){var te=M(le,"#");(this.options.pedantic||!te||/ $/.test(te))&&(le=te.trim())}return{type:"heading",raw:Z[0],depth:Z[1].length,text:le,tokens:this.lexer.inline(le)}}},Se.hr=function(Y){var Z=this.rules.block.hr.exec(Y);if(Z)return{type:"hr",raw:Z[0]}},Se.blockquote=function(Y){var Z=this.rules.block.blockquote.exec(Y);if(Z){var le=Z[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:Z[0],tokens:this.lexer.blockTokens(le,[]),text:le}}},Se.list=function(Y){var Z=this.rules.block.list.exec(Y);if(Z){var le,te,me,Oe,et,Et,Qe,At,Ut,fe,Re,Je,Ot=Z[1].trim(),Ft=Ot.length>1,jt={type:"list",raw:"",ordered:Ft,start:Ft?+Ot.slice(0,-1):"",loose:!1,items:[]};Ot=Ft?"\\d{1,9}\\"+Ot.slice(-1):"\\"+Ot,this.options.pedantic&&(Ot=Ft?Ot:"[*+-]");for(var Jt=new RegExp("^( {0,3}"+Ot+")((?:[ ][^\\n]*)?(?:\\n|$))");Y&&(Je=!1,!(!(Z=Jt.exec(Y))||this.rules.block.hr.test(Y)));){if(le=Z[0],Y=Y.substring(le.length),At=Z[2].split(` `,1)[0],Ut=Y.split(` `,1)[0],this.options.pedantic?(Oe=2,Re=At.trimLeft()):(Oe=Z[2].search(/[^ ]/),Oe=Oe>4?1:Oe,Re=At.slice(Oe),Oe+=Z[1].length),Et=!1,!At&&/^ *$/.test(Ut)&&(le+=Ut+` `,Y=Y.substring(Ut.length+1),Je=!0),!Je)for(var ei=new RegExp("^ {0,"+Math.min(3,Oe-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),sr=new RegExp("^ {0,"+Math.min(3,Oe-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),zn=new RegExp("^ {0,"+Math.min(3,Oe-1)+"}(?:```|~~~)"),Tn=new RegExp("^ {0,"+Math.min(3,Oe-1)+"}#");Y&&(fe=Y.split(` `,1)[0],At=fe,this.options.pedantic&&(At=At.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(zn.test(At)||Tn.test(At)||ei.test(At)||sr.test(Y)));){if(At.search(/[^ ]/)>=Oe||!At.trim())Re+=` `+At.slice(Oe);else if(!Et)Re+=` `+At;else break;!Et&&!At.trim()&&(Et=!0),le+=fe+` `,Y=Y.substring(fe.length+1)}jt.loose||(Qe?jt.loose=!0:/\n *\n *$/.test(le)&&(Qe=!0)),this.options.gfm&&(te=/^\[[ xX]\] /.exec(Re),te&&(me=te[0]!=="[ ] ",Re=Re.replace(/^\[[ xX]\] +/,""))),jt.items.push({type:"list_item",raw:le,task:!!te,checked:me,loose:!1,text:Re}),jt.raw+=le}jt.items[jt.items.length-1].raw=le.trimRight(),jt.items[jt.items.length-1].text=Re.trimRight(),jt.raw=jt.raw.trimRight();var pi=jt.items.length;for(et=0;et<pi;et++){this.lexer.state.top=!1,jt.items[et].tokens=this.lexer.blockTokens(jt.items[et].text,[]);var Ei=jt.items[et].tokens.filter(function(Pr){return Pr.type==="space"}),$i=Ei.every(function(Pr){for(var ro=Pr.raw.split(""),Vo=0,oo=s(ro),ta;!(ta=oo()).done;){var Mr=ta.value;if(Mr===` `&&(Vo+=1),Vo>1)return!0}return!1});!jt.loose&&Ei.length&&$i&&(jt.loose=!0,jt.items[et].loose=!0)}return jt}},Se.html=function(Y){var Z=this.rules.block.html.exec(Y);if(Z){var le={type:"html",raw:Z[0],pre:!this.options.sanitizer&&(Z[1]==="pre"||Z[1]==="script"||Z[1]==="style"),text:Z[0]};if(this.options.sanitize){var te=this.options.sanitizer?this.options.sanitizer(Z[0]):m(Z[0]);le.type="paragraph",le.text=te,le.tokens=this.lexer.inline(te)}return le}},Se.def=function(Y){var Z=this.rules.block.def.exec(Y);if(Z){Z[3]&&(Z[3]=Z[3].substring(1,Z[3].length-1));var le=Z[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:le,raw:Z[0],href:Z[2],title:Z[3]}}},Se.table=function(Y){var Z=this.rules.block.table.exec(Y);if(Z){var le={type:"table",header:B(Z[1]).map(function(Qe){return{text:Qe}}),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:Z[3]&&Z[3].trim()?Z[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(le.header.length===le.align.length){le.raw=Z[0];var te=le.align.length,me,Oe,et,Et;for(me=0;me<te;me++)/^ *-+: *$/.test(le.align[me])?le.align[me]="right":/^ *:-+: *$/.test(le.align[me])?le.align[me]="center":/^ *:-+ *$/.test(le.align[me])?le.align[me]="left":le.align[me]=null;for(te=le.rows.length,me=0;me<te;me++)le.rows[me]=B(le.rows[me],le.header.length).map(function(Qe){return{text:Qe}});for(te=le.header.length,Oe=0;Oe<te;Oe++)le.header[Oe].tokens=this.lexer.inline(le.header[Oe].text);for(te=le.rows.length,Oe=0;Oe<te;Oe++)for(Et=le.rows[Oe],et=0;et<Et.length;et++)Et[et].tokens=this.lexer.inline(Et[et].text);return le}}},Se.lheading=function(Y){var Z=this.rules.block.lheading.exec(Y);if(Z)return{type:"heading",raw:Z[0],depth:Z[2].charAt(0)==="="?1:2,text:Z[1],tokens:this.lexer.inline(Z[1])}},Se.paragraph=function(Y){var Z=this.rules.block.paragraph.exec(Y);if(Z){var le=Z[1].charAt(Z[1].length-1)===` `?Z[1].slice(0,-1):Z[1];return{type:"paragraph",raw:Z[0],text:le,tokens:this.lexer.inline(le)}}},Se.text=function(Y){var Z=this.rules.block.text.exec(Y);if(Z)return{type:"text",raw:Z[0],text:Z[0],tokens:this.lexer.inline(Z[0])}},Se.escape=function(Y){var Z=this.rules.inline.escape.exec(Y);if(Z)return{type:"escape",raw:Z[0],text:m(Z[1])}},Se.tag=function(Y){var Z=this.rules.inline.tag.exec(Y);if(Z)return!this.lexer.state.inLink&&/^<a /i.test(Z[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(Z[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(Z[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Z[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:Z[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):m(Z[0]):Z[0]}},Se.link=function(Y){var Z=this.rules.inline.link.exec(Y);if(Z){var le=Z[2].trim();if(!this.options.pedantic&&/^</.test(le)){if(!/>$/.test(le))return;var te=M(le.slice(0,-1),"\\");if((le.length-te.length)%2===0)return}else{var me=V(Z[2],"()");if(me>-1){var Oe=Z[0].indexOf("!")===0?5:4,et=Oe+Z[1].length+me;Z[2]=Z[2].substring(0,me),Z[0]=Z[0].substring(0,et).trim(),Z[3]=""}}var Et=Z[2],Qe="";if(this.options.pedantic){var At=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Et);At&&(Et=At[1],Qe=At[3])}else Qe=Z[3]?Z[3].slice(1,-1):"";return Et=Et.trim(),/^</.test(Et)&&(this.options.pedantic&&!/>$/.test(le)?Et=Et.slice(1):Et=Et.slice(1,-1)),q(Z,{href:Et&&Et.replace(this.rules.inline._escapes,"$1"),title:Qe&&Qe.replace(this.rules.inline._escapes,"$1")},Z[0],this.lexer)}},Se.reflink=function(Y,Z){var le;if((le=this.rules.inline.reflink.exec(Y))||(le=this.rules.inline.nolink.exec(Y))){var te=(le[2]||le[1]).replace(/\s+/g," ");if(te=Z[te.toLowerCase()],!te||!te.href){var me=le[0].charAt(0);return{type:"text",raw:me,text:me}}return q(le,te,le[0],this.lexer)}},Se.emStrong=function(Y,Z,le){le===void 0&&(le="");var te=this.rules.inline.emStrong.lDelim.exec(Y);if(te&&!(te[3]&&le.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var me=te[1]||te[2]||"";if(!me||me&&(le===""||this.rules.inline.punctuation.exec(le))){var Oe=te[0].length-1,et,Et,Qe=Oe,At=0,Ut=te[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Ut.lastIndex=0,Z=Z.slice(-1*Y.length+Oe);(te=Ut.exec(Z))!=null;)if(et=te[1]||te[2]||te[3]||te[4]||te[5]||te[6],!!et){if(Et=et.length,te[3]||te[4]){Qe+=Et;continue}else if((te[5]||te[6])&&Oe%3&&!((Oe+Et)%3)){At+=Et;continue}if(Qe-=Et,!(Qe>0)){if(Et=Math.min(Et,Et+Qe+At),Math.min(Oe,Et)%2){var fe=Y.slice(1,Oe+te.index+Et);return{type:"em",raw:Y.slice(0,Oe+te.index+Et+1),text:fe,tokens:this.lexer.inlineTokens(fe)}}var Re=Y.slice(2,Oe+te.index+Et-1);return{type:"strong",raw:Y.slice(0,Oe+te.index+Et+1),text:Re,tokens:this.lexer.inlineTokens(Re)}}}}}},Se.codespan=function(Y){var Z=this.rules.inline.code.exec(Y);if(Z){var le=Z[2].replace(/\n/g," "),te=/[^ ]/.test(le),me=/^ /.test(le)&&/ $/.test(le);return te&&me&&(le=le.substring(1,le.length-1)),le=m(le,!0),{type:"codespan",raw:Z[0],text:le}}},Se.br=function(Y){var Z=this.rules.inline.br.exec(Y);if(Z)return{type:"br",raw:Z[0]}},Se.del=function(Y){var Z=this.rules.inline.del.exec(Y);if(Z)return{type:"del",raw:Z[0],text:Z[2],tokens:this.lexer.inlineTokens(Z[2])}},Se.autolink=function(Y,Z){var le=this.rules.inline.autolink.exec(Y);if(le){var te,me;return le[2]==="@"?(te=m(this.options.mangle?Z(le[1]):le[1]),me="mailto:"+te):(te=m(le[1]),me=te),{type:"link",raw:le[0],text:te,href:me,tokens:[{type:"text",raw:te,text:te}]}}},Se.url=function(Y,Z){var le;if(le=this.rules.inline.url.exec(Y)){var te,me;if(le[2]==="@")te=m(this.options.mangle?Z(le[0]):le[0]),me="mailto:"+te;else{var Oe;do Oe=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(Oe!==le[0]);te=m(le[0]),le[1]==="www."?me="http://"+te:me=te}return{type:"link",raw:le[0],text:te,href:me,tokens:[{type:"text",raw:te,text:te}]}}},Se.inlineText=function(Y,Z){var le=this.rules.inline.text.exec(Y);if(le){var te;return this.lexer.state.inRawBlock?te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):m(le[0]):le[0]:te=m(this.options.smartypants?Z(le[0]):le[0]),{type:"text",raw:le[0],text:te}}},we}(),se={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:P,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=y(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.listItemStart=y(/^( *)(bull) */).replace("bull",se.bullet).getRegex(),se.list=y(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",se._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,se.html=y(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=y(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex(),se.blockquote=y(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=F({},se),se.gfm=F({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),se.gfm.table=y(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex(),se.gfm.paragraph=y(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex(),se.pedantic=F({},se.normal,{html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,paragraph:y(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:P,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Q.punctuation=y(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex(),Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Q.escapedEmSt=/\\\*|\\_/g,Q._comment=y(se._comment).replace("(?:-->|$)","-->").getRegex(),Q.emStrong.lDelim=y(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex(),Q.emStrong.rDelimAst=y(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex(),Q.emStrong.rDelimUnd=y(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex(),Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Q.autolink=y(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex(),Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Q.tag=y(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex(),Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Q.link=y(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex(),Q.reflink=y(Q.reflink).replace("label",Q._label).replace("ref",se._label).getRegex(),Q.nolink=y(Q.nolink).replace("ref",se._label).getRegex(),Q.reflinkSearch=y(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex(),Q.normal=F({},Q),Q.pedantic=F({},Q.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()}),Q.gfm=F({},Q.normal,{escape:y(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Q.gfm.url=y(Q.gfm.url,"i").replace("email",Q.gfm._extended_email).getRegex(),Q.breaks=F({},Q.gfm,{br:y(Q.br).replace("{2,}","*").getRegex(),text:y(Q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function Ee(we){return we.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Fe(we){var Se="",re,Y,Z=we.length;for(re=0;re<Z;re++)Y=we.charCodeAt(re),Math.random()>.5&&(Y="x"+Y.toString(16)),Se+="&#"+Y+";";return Se}var He=function(){function we(re){this.tokens=[],this.tokens.links=Object.create(null),this.options=re||e.defaults,this.options.tokenizer=this.options.tokenizer||new ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var Y={block:se.normal,inline:Q.normal};this.options.pedantic?(Y.block=se.pedantic,Y.inline=Q.pedantic):this.options.gfm&&(Y.block=se.gfm,this.options.breaks?Y.inline=Q.breaks:Y.inline=Q.gfm),this.tokenizer.rules=Y}we.lex=function(Y,Z){var le=new we(Z);return le.lex(Y)},we.lexInline=function(Y,Z){var le=new we(Z);return le.inlineTokens(Y)};var Se=we.prototype;return Se.lex=function(Y){Y=Y.replace(/\r\n|\r/g,` `),this.blockTokens(Y,this.tokens);for(var Z;Z=this.inlineQueue.shift();)this.inlineTokens(Z.src,Z.tokens);return this.tokens},Se.blockTokens=function(Y,Z){var le=this;Z===void 0&&(Z=[]),this.options.pedantic?Y=Y.replace(/\t/g," ").replace(/^ +$/gm,""):Y=Y.replace(/^( *)(\t+)/gm,function(Qe,At,Ut){return At+" ".repeat(Ut.length)});for(var te,me,Oe,et;Y;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Qe){return(te=Qe.call({lexer:le},Y,Z))?(Y=Y.substring(te.raw.length),Z.push(te),!0):!1}))){if(te=this.tokenizer.space(Y)){Y=Y.substring(te.raw.length),te.raw.length===1&&Z.length>0?Z[Z.length-1].raw+=` `:Z.push(te);continue}if(te=this.tokenizer.code(Y)){Y=Y.substring(te.raw.length),me=Z[Z.length-1],me&&(me.type==="paragraph"||me.type==="text")?(me.raw+=` `+te.raw,me.text+=` `+te.text,this.inlineQueue[this.inlineQueue.length-1].src=me.text):Z.push(te);continue}if(te=this.tokenizer.fences(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.heading(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.hr(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.blockquote(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.list(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.html(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.def(Y)){Y=Y.substring(te.raw.length),me=Z[Z.length-1],me&&(me.type==="paragraph"||me.type==="text")?(me.raw+=` `+te.raw,me.text+=` `+te.raw,this.inlineQueue[this.inlineQueue.length-1].src=me.text):this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.lheading(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(Oe=Y,this.options.extensions&&this.options.extensions.startBlock&&function(){var Qe=1/0,At=Y.slice(1),Ut=void 0;le.options.extensions.startBlock.forEach(function(fe){Ut=fe.call({lexer:this},At),typeof Ut=="number"&&Ut>=0&&(Qe=Math.min(Qe,Ut))}),Qe<1/0&&Qe>=0&&(Oe=Y.substring(0,Qe+1))}(),this.state.top&&(te=this.tokenizer.paragraph(Oe))){me=Z[Z.length-1],et&&me.type==="paragraph"?(me.raw+=` `+te.raw,me.text+=` `+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=me.text):Z.push(te),et=Oe.length!==Y.length,Y=Y.substring(te.raw.length);continue}if(te=this.tokenizer.text(Y)){Y=Y.substring(te.raw.length),me=Z[Z.length-1],me&&me.type==="text"?(me.raw+=` `+te.raw,me.text+=` `+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=me.text):Z.push(te);continue}if(Y){var Et="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return this.state.top=!0,Z},Se.inline=function(Y,Z){return Z===void 0&&(Z=[]),this.inlineQueue.push({src:Y,tokens:Z}),Z},Se.inlineTokens=function(Y,Z){var le=this;Z===void 0&&(Z=[]);var te,me,Oe,et=Y,Et,Qe,At;if(this.tokens.links){var Ut=Object.keys(this.tokens.links);if(Ut.length>0)for(;(Et=this.tokenizer.rules.inline.reflinkSearch.exec(et))!=null;)Ut.includes(Et[0].slice(Et[0].lastIndexOf("[")+1,-1))&&(et=et.slice(0,Et.index)+"["+W("a",Et[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Et=this.tokenizer.rules.inline.blockSkip.exec(et))!=null;)et=et.slice(0,Et.index)+"["+W("a",Et[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Et=this.tokenizer.rules.inline.escapedEmSt.exec(et))!=null;)et=et.slice(0,Et.index)+"++"+et.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;Y;)if(Qe||(At=""),Qe=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Re){return(te=Re.call({lexer:le},Y,Z))?(Y=Y.substring(te.raw.length),Z.push(te),!0):!1}))){if(te=this.tokenizer.escape(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.tag(Y)){Y=Y.substring(te.raw.length),me=Z[Z.length-1],me&&te.type==="text"&&me.type==="text"?(me.raw+=te.raw,me.text+=te.text):Z.push(te);continue}if(te=this.tokenizer.link(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(te.raw.length),me=Z[Z.length-1],me&&te.type==="text"&&me.type==="text"?(me.raw+=te.raw,me.text+=te.text):Z.push(te);continue}if(te=this.tokenizer.emStrong(Y,et,At)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.codespan(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.br(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.del(Y)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(te=this.tokenizer.autolink(Y,Fe)){Y=Y.substring(te.raw.length),Z.push(te);continue}if(!this.state.inLink&&(te=this.tokenizer.url(Y,Fe))){Y=Y.substring(te.raw.length),Z.push(te);continue}if(Oe=Y,this.options.extensions&&this.options.extensions.startInline&&function(){var Re=1/0,Je=Y.slice(1),Ot=void 0;le.options.extensions.startInline.forEach(function(Ft){Ot=Ft.call({lexer:this},Je),typeof Ot=="number"&&Ot>=0&&(Re=Math.min(Re,Ot))}),Re<1/0&&Re>=0&&(Oe=Y.substring(0,Re+1))}(),te=this.tokenizer.inlineText(Oe,Ee)){Y=Y.substring(te.raw.length),te.raw.slice(-1)!=="_"&&(At=te.raw.slice(-1)),Qe=!0,me=Z[Z.length-1],me&&me.type==="text"?(me.raw+=te.raw,me.text+=te.text):Z.push(te);continue}if(Y){var fe="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(fe);break}else throw new Error(fe)}}return Z},i(we,null,[{key:"rules",get:function(){return{block:se,inline:Q}}}]),we}(),ke=function(){function we(re){this.options=re||e.defaults}var Se=we.prototype;return Se.code=function(Y,Z,le){var te=(Z||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(Y,te);me!=null&&me!==Y&&(le=!0,Y=me)}return Y=Y.replace(/\n$/,"")+` `,te?'<pre><code class="'+this.options.langPrefix+m(te,!0)+'">'+(le?Y:m(Y,!0))+`</code></pre> `:"<pre><code>"+(le?Y:m(Y,!0))+`</code></pre> `},Se.blockquote=function(Y){return`<blockquote> `+Y+`</blockquote> `},Se.html=function(Y){return Y},Se.heading=function(Y,Z,le,te){if(this.options.headerIds){var me=this.options.headerPrefix+te.slug(le);return"<h"+Z+' id="'+me+'">'+Y+"</h"+Z+`> `}return"<h"+Z+">"+Y+"</h"+Z+`> `},Se.hr=function(){return this.options.xhtml?`<hr/> `:`<hr> `},Se.list=function(Y,Z,le){var te=Z?"ol":"ul",me=Z&&le!==1?' start="'+le+'"':"";return"<"+te+me+`> `+Y+"</"+te+`> `},Se.listitem=function(Y){return"<li>"+Y+`</li> `},Se.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Se.paragraph=function(Y){return"<p>"+Y+`</p> `},Se.table=function(Y,Z){return Z&&(Z="<tbody>"+Z+"</tbody>"),`<table> <thead> `+Y+`</thead> `+Z+`</table> `},Se.tablerow=function(Y){return`<tr> `+Y+`</tr> `},Se.tablecell=function(Y,Z){var le=Z.header?"th":"td",te=Z.align?"<"+le+' align="'+Z.align+'">':"<"+le+">";return te+Y+("</"+le+`> `)},Se.strong=function(Y){return"<strong>"+Y+"</strong>"},Se.em=function(Y){return"<em>"+Y+"</em>"},Se.codespan=function(Y){return"<code>"+Y+"</code>"},Se.br=function(){return this.options.xhtml?"<br/>":"<br>"},Se.del=function(Y){return"<del>"+Y+"</del>"},Se.link=function(Y,Z,le){if(Y=E(this.options.sanitize,this.options.baseUrl,Y),Y===null)return le;var te='<a href="'+m(Y)+'"';return Z&&(te+=' title="'+Z+'"'),te+=">"+le+"</a>",te},Se.image=function(Y,Z,le){if(Y=E(this.options.sanitize,this.options.baseUrl,Y),Y===null)return le;var te='<img src="'+Y+'" alt="'+le+'"';return Z&&(te+=' title="'+Z+'"'),te+=this.options.xhtml?"/>":">",te},Se.text=function(Y){return Y},we}(),Me=function(){function we(){}var Se=we.prototype;return Se.strong=function(Y){return Y},Se.em=function(Y){return Y},Se.codespan=function(Y){return Y},Se.del=function(Y){return Y},Se.html=function(Y){return Y},Se.text=function(Y){return Y},Se.link=function(Y,Z,le){return""+le},Se.image=function(Y,Z,le){return""+le},Se.br=function(){return""},we}(),je=function(){function we(){this.seen={}}var Se=we.prototype;return Se.serialize=function(Y){return Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Se.getNextSafeSlug=function(Y,Z){var le=Y,te=0;if(this.seen.hasOwnProperty(le)){te=this.seen[Y];do te++,le=Y+"-"+te;while(this.seen.hasOwnProperty(le))}return Z||(this.seen[Y]=te,this.seen[le]=0),le},Se.slug=function(Y,Z){Z===void 0&&(Z={});var le=this.serialize(Y);return this.getNextSafeSlug(le,Z.dryrun)},we}(),qe=function(){function we(re){this.options=re||e.defaults,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Me,this.slugger=new je}we.parse=function(Y,Z){var le=new we(Z);return le.parse(Y)},we.parseInline=function(Y,Z){var le=new we(Z);return le.parseInline(Y)};var Se=we.prototype;return Se.parse=function(Y,Z){Z===void 0&&(Z=!0);var le="",te,me,Oe,et,Et,Qe,At,Ut,fe,Re,Je,Ot,Ft,jt,Jt,ei,sr,zn,Tn,pi=Y.length;for(te=0;te<pi;te++){if(Re=Y[te],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Re.type]&&(Tn=this.options.extensions.renderers[Re.type].call({parser:this},Re),Tn!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Re.type))){le+=Tn||"";continue}switch(Re.type){case"space":continue;case"hr":{le+=this.renderer.hr();continue}case"heading":{le+=this.renderer.heading(this.parseInline(Re.tokens),Re.depth,_(this.parseInline(Re.tokens,this.textRenderer)),this.slugger);continue}case"code":{le+=this.renderer.code(Re.text,Re.lang,Re.escaped);continue}case"table":{for(Ut="",At="",et=Re.header.length,me=0;me<et;me++)At+=this.renderer.tablecell(this.parseInline(Re.header[me].tokens),{header:!0,align:Re.align[me]});for(Ut+=this.renderer.tablerow(At),fe="",et=Re.rows.length,me=0;me<et;me++){for(Qe=Re.rows[me],At="",Et=Qe.length,Oe=0;Oe<Et;Oe++)At+=this.renderer.tablecell(this.parseInline(Qe[Oe].tokens),{header:!1,align:Re.align[Oe]});fe+=this.renderer.tablerow(At)}le+=this.renderer.table(Ut,fe);continue}case"blockquote":{fe=this.parse(Re.tokens),le+=this.renderer.blockquote(fe);continue}case"list":{for(Je=Re.ordered,Ot=Re.start,Ft=Re.loose,et=Re.items.length,fe="",me=0;me<et;me++)Jt=Re.items[me],ei=Jt.checked,sr=Jt.task,jt="",Jt.task&&(zn=this.renderer.checkbox(ei),Ft?Jt.tokens.length>0&&Jt.tokens[0].type==="paragraph"?(Jt.tokens[0].text=zn+" "+Jt.tokens[0].text,Jt.tokens[0].tokens&&Jt.tokens[0].tokens.length>0&&Jt.tokens[0].tokens[0].type==="text"&&(Jt.tokens[0].tokens[0].text=zn+" "+Jt.tokens[0].tokens[0].text)):Jt.tokens.unshift({type:"text",text:zn}):jt+=zn),jt+=this.parse(Jt.tokens,Ft),fe+=this.renderer.listitem(jt,sr,ei);le+=this.renderer.list(fe,Je,Ot);continue}case"html":{le+=this.renderer.html(Re.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(Re.tokens));continue}case"text":{for(fe=Re.tokens?this.parseInline(Re.tokens):Re.text;te+1<pi&&Y[te+1].type==="text";)Re=Y[++te],fe+=` `+(Re.tokens?this.parseInline(Re.tokens):Re.text);le+=Z?this.renderer.paragraph(fe):fe;continue}default:{var Ei='Token with "'+Re.type+'" type was not found.';if(this.options.silent){console.error(Ei);return}else throw new Error(Ei)}}}return le},Se.parseInline=function(Y,Z){Z=Z||this.renderer;var le="",te,me,Oe,et=Y.length;for(te=0;te<et;te++){if(me=Y[te],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[me.type]&&(Oe=this.options.extensions.renderers[me.type].call({parser:this},me),Oe!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(me.type))){le+=Oe||"";continue}switch(me.type){case"escape":{le+=Z.text(me.text);break}case"html":{le+=Z.html(me.text);break}case"link":{le+=Z.link(me.href,me.title,this.parseInline(me.tokens,Z));break}case"image":{le+=Z.image(me.href,me.title,me.text);break}case"strong":{le+=Z.strong(this.parseInline(me.tokens,Z));break}case"em":{le+=Z.em(this.parseInline(me.tokens,Z));break}case"codespan":{le+=Z.codespan(me.text);break}case"br":{le+=Z.br();break}case"del":{le+=Z.del(this.parseInline(me.tokens,Z));break}case"text":{le+=Z.text(me.text);break}default:{var Et='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(Et);return}else throw new Error(Et)}}}return le},we}();function Be(we,Se,re){if(typeof we>"u"||we===null)throw new Error("marked(): input parameter is undefined or null");if(typeof we!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(we)+", string expected");if(typeof Se=="function"&&(re=Se,Se=null),Se=F({},Be.defaults,Se||{}),U(Se),re){var Y=Se.highlight,Z;try{Z=He.lex(we,Se)}catch(et){return re(et)}var le=function(Et){var Qe;if(!Et)try{Se.walkTokens&&Be.walkTokens(Z,Se.walkTokens),Qe=qe.parse(Z,Se)}catch(At){Et=At}return Se.highlight=Y,Et?re(Et):re(null,Qe)};if(!Y||Y.length<3||(delete Se.highlight,!Z.length))return le();var te=0;Be.walkTokens(Z,function(et){et.type==="code"&&(te++,setTimeout(function(){Y(et.text,et.lang,function(Et,Qe){if(Et)return le(Et);Qe!=null&&Qe!==et.text&&(et.text=Qe,et.escaped=!0),te--,te===0&&le()})},0))}),te===0&&le();return}function me(et){if(et.message+=` Please report this to https://github.com/markedjs/marked.`,Se.silent)return"<p>An error occurred:</p><pre>"+m(et.message+"",!0)+"</pre>";throw et}try{var Oe=He.lex(we,Se);if(Se.walkTokens){if(Se.async)return Promise.all(Be.walkTokens(Oe,Se.walkTokens)).then(function(){return qe.parse(Oe,Se)}).catch(me);Be.walkTokens(Oe,Se.walkTokens)}return qe.parse(Oe,Se)}catch(et){me(et)}}Be.options=Be.setOptions=function(we){return F(Be.defaults,we),l(Be.defaults),Be},Be.getDefaults=a,Be.defaults=e.defaults,Be.use=function(){for(var we=arguments.length,Se=new Array(we),re=0;re<we;re++)Se[re]=arguments[re];var Y=F.apply(void 0,[{}].concat(Se)),Z=Be.defaults.extensions||{renderers:{},childTokens:{}},le;Se.forEach(function(te){if(te.extensions&&(le=!0,te.extensions.forEach(function(Oe){if(!Oe.name)throw new Error("extension name required");if(Oe.renderer){var et=Z.renderers?Z.renderers[Oe.name]:null;et?Z.renderers[Oe.name]=function(){for(var Et=arguments.length,Qe=new Array(Et),At=0;At<Et;At++)Qe[At]=arguments[At];var Ut=Oe.renderer.apply(this,Qe);return Ut===!1&&(Ut=et.apply(this,Qe)),Ut}:Z.renderers[Oe.name]=Oe.renderer}if(Oe.tokenizer){if(!Oe.level||Oe.level!=="block"&&Oe.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");Z[Oe.level]?Z[Oe.level].unshift(Oe.tokenizer):Z[Oe.level]=[Oe.tokenizer],Oe.start&&(Oe.level==="block"?Z.startBlock?Z.startBlock.push(Oe.start):Z.startBlock=[Oe.start]:Oe.level==="inline"&&(Z.startInline?Z.startInline.push(Oe.start):Z.startInline=[Oe.start]))}Oe.childTokens&&(Z.childTokens[Oe.name]=Oe.childTokens)})),te.renderer&&function(){var Oe=Be.defaults.renderer||new ke,et=function(At){var Ut=Oe[At];Oe[At]=function(){for(var fe=arguments.length,Re=new Array(fe),Je=0;Je<fe;Je++)Re[Je]=arguments[Je];var Ot=te.renderer[At].apply(Oe,Re);return Ot===!1&&(Ot=Ut.apply(Oe,Re)),Ot}};for(var Et in te.renderer)et(Et);Y.renderer=Oe}(),te.tokenizer&&function(){var Oe=Be.defaults.tokenizer||new ie,et=function(At){var Ut=Oe[At];Oe[At]=function(){for(var fe=arguments.length,Re=new Array(fe),Je=0;Je<fe;Je++)Re[Je]=arguments[Je];var Ot=te.tokenizer[At].apply(Oe,Re);return Ot===!1&&(Ot=Ut.apply(Oe,Re)),Ot}};for(var Et in te.tokenizer)et(Et);Y.tokenizer=Oe}(),te.walkTokens){var me=Be.defaults.walkTokens;Y.walkTokens=function(Oe){var et=[];return et.push(te.walkTokens.call(this,Oe)),me&&(et=et.concat(me.call(this,Oe))),et}}le&&(Y.extensions=Z),Be.setOptions(Y)})},Be.walkTokens=function(we,Se){for(var re=[],Y=function(){var me=le.value;switch(re=re.concat(Se.call(Be,me)),me.type){case"table":{for(var Oe=s(me.header),et;!(et=Oe()).done;){var Et=et.value;re=re.concat(Be.walkTokens(Et.tokens,Se))}for(var Qe=s(me.rows),At;!(At=Qe()).done;)for(var Ut=At.value,fe=s(Ut),Re;!(Re=fe()).done;){var Je=Re.value;re=re.concat(Be.walkTokens(Je.tokens,Se))}break}case"list":{re=re.concat(Be.walkTokens(me.items,Se));break}default:Be.defaults.extensions&&Be.defaults.extensions.childTokens&&Be.defaults.extensions.childTokens[me.type]?Be.defaults.extensions.childTokens[me.type].forEach(function(Ot){re=re.concat(Be.walkTokens(me[Ot],Se))}):me.tokens&&(re=re.concat(Be.walkTokens(me.tokens,Se)))}},Z=s(we),le;!(le=Z()).done;)Y();return re},Be.parseInline=function(we,Se){if(typeof we>"u"||we===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof we!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(we)+", string expected");Se=F({},Be.defaults,Se||{}),U(Se);try{var re=He.lexInline(we,Se);return Se.walkTokens&&Be.walkTokens(re,Se.walkTokens),qe.parseInline(re,Se)}catch(Y){if(Y.message+=` Please report this to https://github.com/markedjs/marked.`,Se.silent)return"<p>An error occurred:</p><pre>"+m(Y.message+"",!0)+"</pre>";throw Y}},Be.Parser=qe,Be.parser=qe.parse,Be.Renderer=ke,Be.TextRenderer=Me,Be.Lexer=He,Be.lexer=He.lex,Be.Tokenizer=ie,Be.Slugger=je,Be.parse=Be;var _t=Be.options,Wt=Be.setOptions,Tt=Be.use,rn=Be.walkTokens,_n=Be.parseInline,wt=Be,pt=qe.parse,ot=He.lex;e.Lexer=He,e.Parser=qe,e.Renderer=ke,e.Slugger=je,e.TextRenderer=Me,e.Tokenizer=ie,e.getDefaults=a,e.lexer=ot,e.marked=Be,e.options=_t,e.parse=wt,e.parseInline=_n,e.parser=pt,e.setOptions=Wt,e.use=Tt,e.walkTokens=rn,Object.defineProperty(e,"__esModule",{value:!0})})})();Vd.Lexer||exports.Lexer;Vd.Parser||exports.Parser;Vd.Renderer||exports.Renderer;Vd.Slugger||exports.Slugger;Vd.TextRenderer||exports.TextRenderer;Vd.Tokenizer||exports.Tokenizer;Vd.getDefaults||exports.getDefaults;Vd.lexer||exports.lexer;var Cb=Vd.marked||exports.marked;Vd.options||exports.options;Vd.parse||exports.parse;Vd.parseInline||exports.parseInline;Vd.parser||exports.parser;Vd.setOptions||exports.setOptions;Vd.use||exports.use;Vd.walkTokens||exports.walkTokens;function Kfr(n){return JSON.stringify(n,Gfr)}function _ue(n){let e=JSON.parse(n);return e=vue(e),e}function Gfr(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function vue(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return Yn.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof CG||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t<n.length;++t)n[t]=vue(n[t],e+1);else for(const t in n)Object.hasOwnProperty.call(n,t)&&(n[t]=vue(n[t],e+1))}return n}const Fte=Object.freeze({image:(n,e,t)=>{let i=[],r=[];return n&&({href:n,dimensions:i}=Bfr(n),r.push(`src="${l7(n)}"`)),t&&r.push(`alt="${l7(t)}"`),e&&r.push(`title="${l7(e)}"`),i.length&&(r=r.concat(i)),"<img "+r.join(" ")+">"},paragraph:n=>`<p>${n}</p>`,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=Mte(t)),e=typeof e=="string"?l7(Mte(e)):"",n=Mte(n),n=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="${n}" title="${e||n}">${t}</a>`)});function YG(n,e={},t={}){var i,r;const o=new mt;let s=!1;const a=kye(e),l=function(_){let b;try{b=_ue(decodeURIComponent(_))}catch{}return b?(b=aXe(b,y=>{if(n.uris&&n.uris[y])return Yn.revive(n.uris[y])}),encodeURIComponent(JSON.stringify(b))):_},c=function(_,b){const y=n.uris&&n.uris[_];let C=Yn.revive(y);return b?_.startsWith(Gi.data+":")?_:(C||(C=Yn.parse(_)),oZe.uriToBrowserUri(C).toString(!0)):!C||Yn.parse(_).toString()===C.toString()?_:(C.query&&(C=C.with({query:l(C.query)})),C.toString())},u=new Cb.Renderer;u.image=Fte.image,u.link=Fte.link,u.paragraph=Fte.paragraph;const d=[],h=[];if(e.codeBlockRendererSync?u.code=(_,b)=>{const y=mue.nextId(),C=e.codeBlockRendererSync(lMe(b),_);return h.push([y,C]),`<div class="code" data-code="${y}">${qW(_)}</div>`}:e.codeBlockRenderer&&(u.code=(_,b)=>{const y=mue.nextId(),C=e.codeBlockRenderer(lMe(b),_);return d.push(C.then(x=>[y,x])),`<div class="code" data-code="${y}">${qW(_)}</div>`}),e.actionHandler){const _=function(C){let x=C.target;if(!(x.tagName!=="A"&&(x=x.parentElement,!x||x.tagName!=="A")))try{let E=x.dataset.href;E&&(n.baseUri&&(E=Bte(Yn.from(n.baseUri),E)),e.actionHandler.callback(E,C))}catch(E){Oi(E)}finally{C.preventDefault()}},b=e.actionHandler.disposables.add(new ar(a,"click")),y=e.actionHandler.disposables.add(new ar(a,"auxclick"));e.actionHandler.disposables.add(nn.any(b.event,y.event)(C=>{const x=new Zp(C);!x.leftButton&&!x.middleButton||_(x)})),e.actionHandler.disposables.add(tt(a,"keydown",C=>{const x=new hs(C);!x.equals(10)&&!x.equals(3)||_(x)}))}n.supportHtml||(t.sanitizer=_=>(n.isTrusted?_.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?_:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let f=(i=n.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),n.supportThemeIcons&&(f=Rfr(f));let g;if(e.fillInIncompleteTokens){const _=Object.assign(Object.assign({},Cb.defaults),t),b=Cb.lexer(f,_),y=npr(b);g=Cb.parser(y,_)}else g=Cb.parse(f,t);n.supportThemeIcons&&(g=Hw(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const v=new DOMParser().parseFromString(bue(n,g),"text/html");if(v.body.querySelectorAll("img").forEach(_=>{const b=_.getAttribute("src");if(b){let y=b;try{n.baseUri&&(y=Bte(Yn.from(n.baseUri),y))}catch{}_.src=c(y,!0)}}),v.body.querySelectorAll("a").forEach(_=>{const b=_.getAttribute("href");if(_.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))_.replaceWith(..._.childNodes);else{let y=c(b,!1);n.baseUri&&(y=Bte(Yn.from(n.baseUri),b)),_.dataset.href=y}}),a.innerHTML=bue(n,v.body.innerHTML),d.length>0)Promise.all(d).then(_=>{var b,y;if(s)return;const C=new Map(_),x=a.querySelectorAll("div[data-code]");for(const E of x){const k=C.get((b=E.dataset.code)!==null&&b!==void 0?b:"");k&&Lc(E,k)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const _=new Map(h),b=a.querySelectorAll("div[data-code]");for(const y of b){const C=_.get((r=y.dataset.code)!==null&&r!==void 0?r:"");C&&Lc(y,C)}}if(e.asyncRenderCallback)for(const _ of a.getElementsByTagName("img")){const b=o.add(tt(_,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,o.dispose()}}}function lMe(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function Bte(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?sPe(n,e).toString():sPe($G(n),e).toString()}function bue(n,e){const{config:t,allowedSchemes:i}=Qfr(n);nZe("uponSanitizeAttribute",(o,s)=>{if(s.attrName==="style"||s.attrName==="class"){if(o.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}});const r=Ktr(i);try{return tZe(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{iZe("uponSanitizeAttribute"),r.dispose()}}const Yfr=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Qfr(n){const e=[Gi.http,Gi.https,Gi.mailto,Gi.data,Gi.file,Gi.vscodeFileResource,Gi.vscodeRemote,Gi.vscodeRemoteResource];return n.isTrusted&&e.push(Gi.command),{config:{ALLOWED_TAGS:[...Gtr],ALLOWED_ATTR:Yfr,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function Xfr(n){return typeof n=="string"?n:Zfr(n)}function Zfr(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Cb.parse(t,{renderer:epr.value}).replace(/&(#\d+|[a-zA-Z]+);/g,r=>{var o;return(o=Jfr.get(r))!==null&&o!==void 0?o:r});return bue({isTrusted:!1},i).toString()}const Jfr=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),epr=new dE(()=>{const n=new Cb.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+` `,n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+` `,n.paragraph=e=>e+` `,n.table=(e,t)=>e+t+` `,n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>` `,n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function Lye(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function tpr(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split(` `),i=t[t.length-1];if(i.includes("`"))return rpr(n);if(i.includes("**"))return cpr(n);if(i.match(/\*\w/))return opr(n);if(i.match(/(^|\s)__\w/))return upr(n);if(i.match(/(^|\s)_\w/))return spr(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return apr(n);if(i.match(/(^|\s)\[\w/))return lpr(n)}}function npr(n){let e,t;for(e=0;e<n.length;e++){const i=n[e];if(i.type==="paragraph"&&i.raw.match(/(\n|^)```/)){t=ipr(n.slice(e));break}if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=dpr(n.slice(e));break}if(e===n.length-1&&i.type==="paragraph"){const r=tpr(i);if(r){t=[r];break}}}if(t){const i=[...n.slice(0,e),...t];return i.links=n.links,i}return n}function ipr(n){const e=Lye(n);return Cb.lexer(e+"\n```")}function rpr(n){return oI(n,"`")}function opr(n){return oI(n,"*")}function spr(n){return oI(n,"_")}function apr(n){return oI(n,")")}function lpr(n){return oI(n,"](about:blank)")}function cpr(n){return oI(n,"**")}function upr(n){return oI(n,"__")}function oI(n,e){const t=Lye(Array.isArray(n)?n:[n]);return Cb.lexer(t+e)[0]}function dpr(n){const e=Lye(n),t=e.split(` `);let i,r=!1;for(let o=0;o<t.length;o++){const s=t[o].trim();if(typeof i>"u"&&s.match(/^\s*\|/)){const a=s.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(s.match(/^\s*\|/)){if(o!==t.length-1)return;r=!0}else return}if(typeof i=="number"&&i>0){const o=r?t.slice(0,-1).join(` `):e,s=!!o.match(/\|\s*$/),a=o+(s?"":"|")+` |${" --- |".repeat(i)}`;return Cb.lexer(a)}}class hpr{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(r=>r.splice(e,t,i))}}class s2 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function cMe(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.end<i.range.start)break;const r=cu.intersect(n,i.range);cu.isEmpty(r)||t.push({range:r,size:i.size})}return t}function yue({start:n,end:e},t){return{start:n+t,end:e+t}}function fpr(n){const e=[];let t=null;for(const i of n){const r=i.range.start,o=i.range.end,s=i.size;if(t&&s===t.size){t.range.end=o;continue}t={range:{start:r,end:o},size:s},e.push(t)}return e}function ppr(...n){return fpr(n.reduce((e,t)=>e.concat(t),[]))}class uMe{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const r=i.length-t,o=cMe({start:0,end:e},this.groups),s=cMe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:yue(l.range,r),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=ppr(o,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const r of this.groups){const o=r.range.end-r.range.start,s=i+o*r.size;if(e<s)return t+Math.floor((e-i)/r.size);t+=o,i=s}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const r of this.groups){const o=r.range.end-r.range.start,s=i+o;if(e<s)return this._paddingTop+t+(e-i)*r.size;t+=o*r.size,i=s}return-1}}function gpr(n){var e;try{(e=n.parentElement)===null||e===void 0||e.removeChild(n)}catch{}}class mpr{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const r=kt(".monaco-list-row"),s=this.getRenderer(e).renderTemplate(r);t={domNode:r,templateId:e,templateData:s}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const t of this.transactionNodesPendingRemoval)this.doRemoveNode(t);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),gpr(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var M1=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const VE={CurrentDragAndDropData:void 0},Wv={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class $6{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class _pr{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class vpr{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}function bpr(n,e){return Array.isArray(n)&&Array.isArray(e)?Ia(n,e):n===e}class ypr{constructor(e){e!=null&&e.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(t,i,r)=>r,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Pg{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Uee(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,r=Wv){var o,s,a,l,c,u,d,h,f,g,m,v,_;if(this.virtualDelegate=t,this.domId=`list_id_${++Pg.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new jm(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Ue.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Ue.None,this.onDragLeaveTimeout=Ue.None,this.disposables=new mt,this._onDidChangeContentHeight=new Le,this._onDidChangeContentWidth=new Le,this._horizontalScrolling=!1,r.horizontalScrolling&&r.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new uMe((o=r.paddingTop)!==null&&o!==void 0?o:0);for(const y of i)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new mpr(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof r.mouseSupport=="boolean"?r.mouseSupport:!0),this._horizontalScrolling=(s=r.horizontalScrolling)!==null&&s!==void 0?s:Wv.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new ypr(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=r.transformOptimization)!==null&&a!==void 0?a:Wv.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Zo.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new D6({forceIntegerValues:!0,smoothScrollDuration:(l=r.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>_g(y)})),this.scrollableElement=this.disposables.add(new j0e(this.rowsContainer,{alwaysConsumeMouseWheel:(c=r.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:Wv.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=r.verticalScrollMode)!==null&&u!==void 0?u:Wv.verticalScrollMode,useShadows:(d=r.useShadows)!==null&&d!==void 0?d:Wv.useShadows,mouseWheelScrollSensitivity:r.mouseWheelScrollSensitivity,fastScrollSensitivity:r.fastScrollSensitivity,scrollByPage:r.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(tt(this.rowsContainer,Jo.Change,y=>this.onTouchChange(y))),this.disposables.add(tt(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(tt(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(tt(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(tt(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(tt(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=r.setRowLineHeight)!==null&&h!==void 0?h:Wv.setRowLineHeight,this.setRowHeight=(f=r.setRowHeight)!==null&&f!==void 0?f:Wv.setRowHeight,this.supportDynamicHeights=(g=r.supportDynamicHeights)!==null&&g!==void 0?g:Wv.supportDynamicHeights,this.dnd=(m=r.dnd)!==null&&m!==void 0?m:this.disposables.add(Wv.dnd),this.layout((v=r.initialSize)===null||v===void 0?void 0:v.height,(_=r.initialSize)===null||_===void 0?void 0:_.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t=Object.assign(Object.assign({},t??{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+r),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=cu.intersect(r,o),a=new Map;for(let E=s.end-1;E>=s.start;E--){const k=this.items[E];if(k.dragStartDisposable.dispose(),k.checkedDisposable.dispose(),k.row){let L=a.get(k.templateId);L||(L=[],a.set(k.templateId,L));const D=this.renderers.get(k.templateId);D&&D.disposeElement&&D.disposeElement(k.element,E,k.row.templateData,k.size),L.push(k.row)}k.row=null}const l={start:e+t,end:this.items.length},c=cu.intersect(l,r),u=cu.relativeComplement(l,r),d=i.map(E=>({id:String(this.itemId++),element:E,templateId:this.virtualDelegate.getTemplateId(E),size:this.virtualDelegate.getHeight(E),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(E),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Ue.None,checkedDisposable:Ue.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new uMe(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=yue(c,f),v=cu.intersect(g,m);for(let E=v.start;E<v.end;E++)this.updateItemInDOM(this.items[E],E);const _=cu.relativeComplement(m,g);for(const E of _)for(let k=E.start;k<E.end;k++)this.removeItemFromDOM(k);const b=u.map(E=>yue(E,f)),C=[{start:e,end:e+i.length},...b].map(E=>cu.intersect(g,E)),x=this.getNextToLastElement(C);for(const E of C)for(let k=E.start;k<E.end;k++){const L=this.items[k],D=a.get(L.templateId),A=D==null?void 0:D.pop();this.insertItemInDOM(k,x,A)}for(const E of a.values())for(const k of E)this.cache.release(k);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(E=>E.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=_g(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return i!==-1&&(i-t)/2+t<this.scrollTop?e.start+1:e.start}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:Btr(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:Uee(this.domNode)})}render(e,t,i,r,o,s=!1){const a=this.getRenderRange(t,i),l=cu.relativeComplement(a,e),c=cu.relativeComplement(e,a),u=this.getNextToLastElement(l);if(s){const d=cu.intersect(e,a);for(let h=d.start;h<d.end;h++)this.updateItemInDOM(this.items[h],h)}this.cache.transact(()=>{for(const d of c)for(let h=d.start;h<d.end;h++)this.removeItemFromDOM(h);for(const d of l)for(let h=d.start;h<d.end;h++)this.insertItemInDOM(h,u)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const r=this.items[e];let o=!1;if(!r.row)if(i)r.row=i;else{const u=this.cache.alloc(r.templateId);r.row=u.row,o=u.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(r.element)||"listitem";r.row.domNode.setAttribute("role",s);const a=this.accessibilityProvider.isChecked(r.element);if(typeof a=="boolean")r.row.domNode.setAttribute("aria-checked",String(!!a));else if(a){const u=d=>r.row.domNode.setAttribute("aria-checked",String(!!d));u(a.value),r.checkedDisposable=a.onDidChange(u)}(o||!r.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(r.row.domNode,t):this.rowsContainer.appendChild(r.row.domNode)),this.updateItemInDOM(r,e);const l=this.renderers.get(r.templateId);if(!l)throw new Error(`No renderer found for template id ${r.templateId}`);l==null||l.renderElement(r.element,e,r.row.templateData,r.size);const c=this.dnd.getDragURI(r.element);r.dragStartDisposable.dispose(),r.row.domNode.draggable=!!c,c&&(r.dragStartDisposable=tt(r.row.domNode,"dragstart",u=>this.onDragStart(r.element,c,u))),this.horizontalScrolling&&(this.measureItemWidth(r),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Uee(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return nn.map(this.disposables.add(new ar(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return nn.map(this.disposables.add(new ar(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return nn.filter(nn.map(this.disposables.add(new ar(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return nn.map(this.disposables.add(new ar(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return nn.map(this.disposables.add(new ar(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return nn.map(this.disposables.add(new ar(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return nn.any(nn.map(this.disposables.add(new ar(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),nn.map(this.disposables.add(new ar(this.domNode,Jo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return nn.map(this.disposables.add(new ar(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return nn.map(this.disposables.add(new ar(this.rowsContainer,Jo.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var r,o;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(r5.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,i)),typeof a>"u"&&(a=String(s.length));const l=kt(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||document.body})(this.domNode);u.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new $6(s),VE.CurrentDragAndDropData=new _pr(s),(o=(r=this.dnd).onDragStart)===null||o===void 0||o.call(r,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),VE.CurrentDragAndDropData&&VE.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(VE.CurrentDragAndDropData)this.currentDragData=VE.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new vpr}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof i=="boolean"?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof i!="boolean"&&i.effect===0?"copy":"move";let r;if(typeof i!="boolean"&&i.feedback?r=i.feedback:typeof e.index>"u"?r=[-1]:r=[e.index],r=fS(r).filter(o=>o>=-1&&o<this.length).sort((o,s)=>o-s),r=r[0]===-1?[-1]:r,bpr(this.currentDragFeedback,r))return!0;if(this.currentDragFeedback=r,this.currentDragFeedbackDisposable.dispose(),r[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=mi(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const o of r){const s=this.items[o];s.dropTarget=!0,(t=s.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=mi(()=>{var o;for(const s of r){const a=this.items[s];a.dropTarget=!1,(o=a.row)===null||o===void 0||o.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=bS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,VE.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,VE.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Ue.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=aZe(this.domNode).top;this.dragOverAnimationDisposable=qtr(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=bS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const r=i.getAttribute("data-index");if(r){const o=Number(r);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const r=this.getRenderRange(e,t);let o,s;e===this.elementTop(r.start)?(o=r.start,s=0):r.end-r.start>1&&(o=r.start+1,s=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u<l.end;u++){const d=this.probeDynamicHeight(u);d!==0&&this.rangeMap.splice(u,1,[this.items[u]]),a+=d,c=c||d!==0}if(!c){a!==0&&this.eventuallyUpdateScrollDimensions();const u=cu.relativeComplement(r,l);for(const h of u)for(let f=h.start;f<h.end;f++)this.items[f].row&&this.removeItemFromDOM(f);const d=cu.relativeComplement(l,r);for(const h of d)for(let f=h.start;f<h.end;f++){const g=f+1,m=g<this.items.length?this.items[g].row:null,v=m?m.domNode:null;this.insertItemInDOM(f,v)}for(let h=l.start;h<l.end;h++)this.items[h].row&&this.updateItemInDOM(this.items[h],h);if(typeof o=="number"){const h=this.scrollable.getFutureScrollPosition().scrollTop-e,f=this.elementTop(o)-s+h;this.setScrollTop(f,i)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){var t,i,r;const o=this.items[e];if(this.virtualDelegate.getDynamicHeight){const c=this.virtualDelegate.getDynamicHeight(o.element);if(c!==null){const u=o.size;return o.size=c,o.lastDynamicHeightWidth=this.renderWidth,c-u}}if(!o.hasDynamicHeight||o.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(o.element))return 0;const s=o.size;if(o.row)return o.row.domNode.style.height="",o.size=o.row.domNode.offsetHeight,o.lastDynamicHeightWidth=this.renderWidth,o.size-s;const{row:a}=this.cache.alloc(o.templateId);a.domNode.style.height="",this.rowsContainer.appendChild(a.domNode);const l=this.renderers.get(o.templateId);if(!l)throw new Qa("Missing renderer for templateId: "+o.templateId);return l.renderElement(o.element,e,a.templateData,void 0),o.size=a.domNode.offsetHeight,(t=l.disposeElement)===null||t===void 0||t.call(l,o.element,e,a.templateData,void 0),(r=(i=this.virtualDelegate).setDynamicHeight)===null||r===void 0||r.call(i,o.element,o.size),o.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(a.domNode),this.cache.release(a),o.size-s}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return!i||!i.row?null:i.row.domNode}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e,t;for(const i of this.items)if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const r=this.renderers.get(i.row.templateId);r&&((e=r.disposeElement)===null||e===void 0||e.call(r,i.element,-1,i.row.templateData,void 0),r.disposeTemplate(i.row.templateData))}this.items=[],this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),(t=this.dragOverAnimationDisposable)===null||t===void 0||t.dispose(),this.disposables.dispose()}}Pg.InstanceCount=0;M1([Wa],Pg.prototype,"onMouseClick",null);M1([Wa],Pg.prototype,"onMouseDblClick",null);M1([Wa],Pg.prototype,"onMouseMiddleClick",null);M1([Wa],Pg.prototype,"onMouseDown",null);M1([Wa],Pg.prototype,"onMouseOver",null);M1([Wa],Pg.prototype,"onMouseOut",null);M1([Wa],Pg.prototype,"onContextMenu",null);M1([Wa],Pg.prototype,"onTouchStart",null);M1([Wa],Pg.prototype,"onTap",null);var sI=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dMe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Cpr{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const r=this.renderedElements.findIndex(o=>o.templateData===i);if(r>=0){const o=this.renderedElements[r];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const r=[];for(const o of this.renderedElements)o.index<e?r.push(o):o.index>=e+t&&r.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=r}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let Fz=class{get name(){return this._trait}get renderer(){return new Cpr(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new Le,this.onChange=this._onChange.event}splice(e,t,i){var r;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,s=e+t,a=[];let l=0;for(;l<this.sortedIndexes.length&&this.sortedIndexes[l]<e;)a.push(this.sortedIndexes[l++]);for(let u=0;u<i.length;u++)i[u]&&a.push(u+e);for(;l<this.sortedIndexes.length&&this.sortedIndexes[l]>=s;)a.push(this.sortedIndexes[l++]+o);const c=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const u=(r=this.sortedIndexes.find(d=>d>=e))!==null&&r!==void 0?r:c-1;a.push(Math.min(u,c-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=c}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(fMe),t)}_set(e,t,i){const r=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=Cue(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),r}get(){return this.indexes}contains(e){return p3(this.sortedIndexes,e,fMe)>=0}dispose(){mo(this._onChange)}};sI([Wa],Fz.prototype,"renderer",null);class wpr extends Fz{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class $te{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const r=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(r.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(r),s=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function Ww(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function yL(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:yL(n.parentElement)}function $et(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:$et(n.parentElement)}class Vet{get onKeyDown(){return nn.chain(this.disposables.add(new ar(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Ww(t.target)).map(t=>new hs(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new mt,this.multipleSelectionDisposables=new mt,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(r=>{switch(r.keyCode){case 3:return this.onEnter(r);case 16:return this.onUpArrow(r);case 18:return this.onDownArrow(r);case 11:return this.onPageUpArrow(r);case 12:return this.onPageDownArrow(r);case 9:return this.onEscape(r);case 31:this.multipleSelectionSupport&&(mr?r.metaKey:r.ctrlKey)&&this.onCtrlA(r)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(hd(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}sI([Wa],Vet.prototype,"onKeyDown",null);var wb;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(wb||(wb={}));var CL;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(CL||(CL={}));const Spr=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class Epr{constructor(e,t,i,r,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=r,this.delegate=o,this.enabled=!1,this.state=CL.Idle,this.mode=wb.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new mt,this.disposables=new mt,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:wb.Automatic}enable(){if(this.enabled)return;let e=!1;const t=nn.chain(this.enabledDisposables.add(new ar(this.view.domNode,"keydown")).event,o=>o.filter(s=>!Ww(s.target)).filter(()=>this.mode===wb.Automatic||this.triggered).map(s=>new hs(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>zi.stop(s,!0)).map(s=>s.browserEvent.key)),i=nn.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);nn.reduce(nn.any(t,i),(o,s)=>s===null?null:(o||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&bu(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=CL.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,r=this.state===CL.Idle?1:0;this.state=CL.Typing;for(let o=0;o<this.list.length;o++){const s=(i+o+r)%this.list.length,a=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(s)),l=a&&a.toString();if(this.list.options.typeNavigationEnabled){if(typeof l<"u"){if(o5(e,l)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}const c=Cfr(e,l);if(c&&c[0].end-c[0].start>1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l>"u"||o5(e,l)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class xpr{constructor(e,t){this.list=e,this.view=t,this.disposables=new mt;const i=nn.chain(this.disposables.add(new ar(t.domNode,"keydown")).event,o=>o.filter(s=>!Ww(s.target)).map(s=>new hs(s)));nn.chain(i,o=>o.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const r=i.querySelector("[tabIndex]");if(!r||!(r instanceof HTMLElement)||r.tabIndex===-1)return;const o=window.getComputedStyle(r);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}}function Het(n){return mr?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function Wet(n){return n.browserEvent.shiftKey}function Tpr(n){return n instanceof MouseEvent&&n.button===2}const hMe={isSelectionSingleChangeEvent:Het,isSelectionRangeChangeEvent:Wet};class zet{constructor(e){this.list=e,this.disposables=new mt,this._onPointer=new Le,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||hMe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Zo.addTarget(e.getHTMLElement()))),nn.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||hMe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){yL(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Ww(e.browserEvent.target)||yL(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Ww(e.browserEvent.target)||yL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Tpr(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Ww(e.browserEvent.target)||yL(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const u=this.list.getFocus()[0];i=u??t,this.list.setAnchor(i)}const r=Math.min(i,t),o=Math.max(i,t),s=hd(r,o+1),a=this.list.getSelection(),l=Lpr(Cue(a,[i]),i);if(l.length===0)return;const c=Cue(s,Dpr(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const r=this.list.getSelection(),o=r.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),r.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class Uet{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const r=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${r} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` .monaco-drag-image, .monaco-list${r}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&o.push(` .monaco-drag-image, .monaco-list${r}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } `),e.listInactiveFocusForeground&&(o.push(`.monaco-list${r} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${r} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${r} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${r} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${r} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${r} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${r} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${r} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${r}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${r}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=mT(e.listFocusAndSelectionOutline,mT(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));s&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(` .monaco-drag-image, .monaco-list${r}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${r}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } `);const a=mT(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${r} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${r} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${r} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${r} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(` .monaco-list${r}.drop-target, .monaco-list${r} .monaco-list-rows.drop-target, .monaco-list${r} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; } `),e.tableColumnsBorder&&o.push(` .monaco-table > .monaco-split-view2, .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { border-color: ${e.tableColumnsBorder}; } .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { border-color: transparent; } `),e.tableOddRowsBackgroundColor&&o.push(` .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=o.join(` `)}}const kpr={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:ze.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ze.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ze.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},Ipr={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Lpr(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let r=t-1;for(;r>=0&&n[r]===e-(t-r);)i.push(n[r--]);for(i.reverse(),r=t;r<n.length&&n[r]===e+(r-t);)i.push(n[r++]);return i}function Cue(n,e){const t=[];let i=0,r=0;for(;i<n.length||r<e.length;)if(i>=n.length)t.push(e[r++]);else if(r>=e.length)t.push(n[i++]);else if(n[i]===e[r]){t.push(n[i]),i++,r++;continue}else n[i]<e[r]?t.push(n[i++]):t.push(e[r++]);return t}function Dpr(n,e){const t=[];let i=0,r=0;for(;i<n.length||r<e.length;)if(i>=n.length)t.push(e[r++]);else if(r>=e.length)t.push(n[i++]);else if(n[i]===e[r]){i++,r++;continue}else n[i]<e[r]?t.push(n[i++]):r++;return t}const fMe=(n,e)=>n-e;class Apr{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,r){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],r)}disposeElement(e,t,i,r){var o;let s=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[s],r),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class Npr{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const r=this.accessibilityProvider.getAriaLabel(e);r?i.setAttribute("aria-label",r):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class Rpr{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,r;(r=(i=this.dnd).onDragStart)===null||r===void 0||r.call(i,e,t)}onDragOver(e,t,i,r){return this.dnd.onDragOver(e,t,i,r)}onDragLeave(e,t,i,r){var o,s;(s=(o=this.dnd).onDragLeave)===null||s===void 0||s.call(o,e,t,i,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,r){this.dnd.drop(e,t,i,r)}dispose(){this.dnd.dispose()}}class n_{get onDidChangeFocus(){return nn.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return nn.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=nn.chain(this.disposables.add(new ar(this.view.domNode,"keydown")).event,o=>o.map(s=>new hs(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>zi.stop(s,!0)).filter(()=>!1)),i=nn.chain(this.disposables.add(new ar(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(s=>new hs(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>zi.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,u=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),r=nn.chain(this.view.onContextMenu,o=>o.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new Zp(l),browserEvent:l})));return nn.any(t,i,r)}get onKeyDown(){return this.disposables.add(new ar(this.view.domNode,"keydown")).event}get onDidFocus(){return nn.signal(this.disposables.add(new ar(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,r,o=Ipr){var s,a,l,c;this.user=e,this._options=o,this.focus=new Fz("focused"),this.anchor=new Fz("anchor"),this.eventBufferer=new n0e,this._ariaLabel="",this.disposables=new mt,this._onDidDispose=new Le,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new wpr(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new Npr(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(f=>new Apr(f.templateId,[...d,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new Rpr(this,o.dnd)});if(this.view=this.createListView(t,i,r,h),this.view.domNode.setAttribute("role",u),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=vg(this.view.domNode);this.styleController=new Uet(f,this.view.domId)}if(this.spliceable=new hpr([new $te(this.focus,this.view,o.identityProvider),new $te(this.selection,this.view,o.identityProvider),new $te(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new xpr(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new Vet(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||Spr;this.typeNavigationController=new Epr(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,r){return new Pg(e,t,i,r)}createMouseController(e){return new zet(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new s2(this.user,`Invalid start index: ${e}`);if(t<0)throw new s2(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new s2(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new s2(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return nXe(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new s2(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,r){if(this.length===0)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,r);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,r){if(this.length===0)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,r);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){return dMe(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const r=this.getFocus()[0];if(r!==i&&(r===void 0||i>r)){const o=this.findPreviousIndex(i,!1,t);o>-1&&r!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;i>r&&(s-=this.view.elementHeight(i)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),yield vS(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return dMe(this,void 0,void 0,function*(){let i;const r=this.view.getScrollTop();r===0?i=this.view.indexAt(r):i=this.view.indexAfter(r-1);const o=this.getFocus()[0];if(o!==i&&(o===void 0||o>=i)){const s=this.findNextIndex(i,!1,t);s>-1&&o!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=r;this.view.setScrollTop(r-this.view.renderHeight),this.view.getScrollTop()!==s&&(this.setFocus([]),yield vS(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const r=this.findNextIndex(e,!1,i);r>-1&&this.setFocus([r],t)}findNextIndex(e,t=!1,i){for(let r=0;r<this.length;r++){if(e>=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let r=0;r<this.length;r++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>this.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new s2(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(pS(t)){const s=o-this.view.renderHeight;this.view.setScrollTop(s*Nh(t,0,1)+r)}else{const s=r+o,a=i+this.view.renderHeight;r<i&&s>=a||(r<i||s>=a&&o>=this.view.renderHeight?this.view.setScrollTop(r):s>=a&&this.view.setScrollTop(s-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}sI([Wa],n_.prototype,"onDidChangeFocus",null);sI([Wa],n_.prototype,"onDidChangeSelection",null);sI([Wa],n_.prototype,"onContextMenu",null);sI([Wa],n_.prototype,"onKeyDown",null);sI([Wa],n_.prototype,"onDidFocus",null);const Xx=kt,jet="selectOption.entry.template";class Opr{get templateId(){return jet}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=lt(e,Xx(".option-text")),t.detail=lt(e,Xx(".option-detail")),t.decoratorRight=lt(e,Xx(".option-decorator-right")),t}renderElement(e,t,i){const r=i,o=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;r.text.textContent=o,r.detail.textContent=s||"",r.decoratorRight.innerText=a||"",l?r.root.classList.add("option-disabled"):r.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Sb extends Ue{constructor(e,t,i,r,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=r,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Sb.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new Le,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return jet}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=kt(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=lt(this.selectDropDownContainer,Xx(".select-box-details-pane"));const t=lt(this.selectDropDownContainer,Xx(".select-box-dropdown-container-width-control")),i=lt(t,Xx(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",lt(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=vg(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(tt(this.selectDropDownContainer,Yt.DRAG_START,r=>{zi.stop(r,!0)}))}registerListeners(){this._register($a(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)})),this._register(tt(this.selectElement,Yt.CLICK,t=>{zi.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(tt(this.selectElement,Yt.MOUSE_DOWN,t=>{zi.stop(t)}));let e;this._register(tt(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(tt(this.selectElement,"touchend",t=>{zi.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(tt(this.selectElement,Yt.KEY_DOWN,t=>{const i=new hs(t);let r=!1;mr?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(r=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(r=!0),r&&(this.showSelectDropDown(),zi.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ia(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,r)=>{this.selectElement.add(this.createOption(i.text,r,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` `)}styleSelectElement(){var e,t,i;const r=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=r,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=mT(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=r,this.selectionDetailsPane.style.backgroundColor=r;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!i,r}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=pl(this.selectElement),i=getComputedStyle(this.selectElement),r=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-Sb.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const d=this._hasDetails?this._cachedMaxDetailsHeight:0,h=u+r+d,f=Math.floor((o-r-d)/this.getHeight()),g=Math.floor((s-r-d)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.top<Sb.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||f<1&&g<1?!1:(f<Sb.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&g>f&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.top<Sb.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||this._dropDownPosition===0&&f<1||this._dropDownPosition===1&&g<1)return this.hideSelectDropDown(!0),!1;if(this._dropDownPosition===0){if(this._isVisible&&f+g<1)return this.hideSelectDropDown(!0),!1;h>o&&(u=f*this.getHeight())}else h>s&&(u=g*this.getHeight());return this.selectList.layout(u),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=u+r+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=u+r+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,r=0;this.options.forEach((o,s)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>r&&(i=s,r=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=th(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=lt(e,Xx(".select-box-dropdown-list-container")),this.listRenderer=new Opr,this.selectList=new n_("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:r=>{let o=r.text;return r.detail&&(o+=`. ${r.detail}`),r.decoratorRight&&(o+=`. ${r.decoratorRight}`),r.description&&(o+=`. ${r.description}`),o},getWidgetAriaLabel:()=>T({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>mr?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ar(this.selectDropDownListContainer,"keydown")),i=nn.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(o=>new hs(o)));this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(nn.chain(i,r=>r.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(tt(this.selectList.getHTMLElement(),Yt.POINTER_UP,r=>this.onPointerUp(r))),this._register(this.selectList.onMouseOver(r=>typeof r.index<"u"&&this.selectList.setFocus([r.index]))),this._register(this.selectList.onDidChangeFocus(r=>this.onListFocus(r))),this._register(tt(this.selectDropDownContainer,Yt.FOCUS_OUT,r=>{!this._isVisible||Qc(r.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;zi.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const r=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");r>=0&&r<this.options.length&&!o&&(this.selected=r,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=o=>{for(let s=0;s<o.childNodes.length;s++){const a=o.childNodes.item(s);(a.tagName&&a.tagName.toLowerCase())==="img"?o.removeChild(a):i(a)}},r=YG({value:e,supportThemeIcons:!0},{actionHandler:t});return r.element.classList.add("select-box-description-markdown"),i(r.element),r.element}onListFocus(e){!this._isVisible||!this._hasDetails||this.updateDetail(e.indexes[0])}updateDetail(e){var t,i;this.selectionDetailsPane.innerText="";const r=this.options[e],o=(t=r==null?void 0:r.description)!==null&&t!==void 0?t:"",s=(i=r==null?void 0:r.descriptionIsMarkdown)!==null&&i!==void 0?i:!1;if(o){if(s){const a=r.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(o,a))}else this.selectionDetailsPane.innerText=o;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){zi.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){zi.stop(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){zi.stop(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(zi.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){zi.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onPageDown(e){zi.stop(e),this.selectList.focusNextPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){zi.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){zi.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Sy.toString(e.keyCode);let i=-1;for(let r=0;r<this.options.length-1;r++)if(i=(r+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),zi.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}Sb.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32;Sb.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2;Sb.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class Ppr extends Ue{constructor(e,t,i,r){super(),this.selected=0,this.selectBoxOptions=r||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new Le),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(Zo.addTarget(this.selectElement)),[Jo.Tap].forEach(e=>{this._register(tt(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register($a(this.selectElement,"click",e=>{zi.stop(e,!0)})),this._register($a(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register($a(this.selectElement,"keydown",e=>{let t=!1;mr?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Ia(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,r)=>{this.selectElement.add(this.createOption(i.text,r,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&typeof this.options[this.selected].text=="string"?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){var e,t,i;this.selectElement&&(this.selectElement.style.backgroundColor=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",this.selectElement.style.color=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",this.selectElement.style.borderColor=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"")}createOption(e,t,i){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!i,r}}class Mpr extends Jm{constructor(e,t,i,r,o){super(),mr&&!(o!=null&&o.useCustomDrawn)?this.selectBoxDelegate=new Ppr(e,t,r,o):this.selectBoxDelegate=new Sb(e,t,i,r,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}class H_ extends Ue{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Pd&&this._register(t.onDidChange(r=>{this.element&&this.handleActionChangeEvent(r)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new xA)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Zo.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,mg&&this._register(tt(e,Yt.DRAG_START,r=>{var o;return(o=r.dataTransfer)===null||o===void 0?void 0:o.setData(r5.TEXT,this._action.label)}))),this._register(tt(t,Jo.Tap,r=>this.onClick(r,!0))),this._register(tt(t,Yt.MOUSE_DOWN,r=>{i||zi.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),mr&&this._register(tt(t,Yt.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(tt(t,Yt.CLICK,r=>{zi.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(tt(t,Yt.DBLCLICK,r=>{zi.stop(r,!0)})),[Yt.MOUSE_UP,Yt.MOUSE_OUT].forEach(r=>{this._register(tt(t,r,o=>{zi.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;zi.stop(e,!0);const r=xf(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,r)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=Fet(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class UA extends H_{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=lt(this.element,kt("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(lt(this.element,kt("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===oc.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=T({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Fpr extends H_{constructor(e,t,i,r,o,s,a){super(e,t),this.selectBox=new Mpr(i,r,o,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Bpr extends xA{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new Le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=lt(e,kt(".monaco-dropdown")),this._label=lt(this._element,kt(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[Yt.CLICK,Yt.MOUSE_DOWN,Jo.Tap])this._register(tt(this.element,o,s=>zi.stop(s,!0)));for(const o of[Yt.MOUSE_DOWN,Jo.Tap])this._register(tt(this._label,o,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(tt(this._label,Yt.KEY_UP,o=>{const s=new hs(o);(s.equals(3)||s.equals(10))&&(zi.stop(o,!0),this.visible?this.hide():this.show())}));const r=i(this._label);r&&this._register(r),this._register(Zo.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class $pr extends Bpr{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class Bz extends H_{constructor(e,t,i,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new Le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=r,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=lt(o,kt("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),r={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new $pr(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}function Vpr(n){return n?n.condition!==void 0:!1}var IP=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},gD;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(gD||(gD={}));var wL;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(wL||(wL={}));class mD extends Ue{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new KT),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=wL.None,this.cache=new Map,this.flushDelayer=this._register(new bZe(mD.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((r,o)=>this.acceptExternal(o,r)),(i=e.deleted)===null||i===void 0||i.forEach(r=>this.acceptExternal(r,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===wL.Closed)return;let i=!1;xf(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return xf(i)?t:i}getBoolean(e,t){const i=this.get(e);return xf(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return xf(i)?t:parseInt(i,10)}set(e,t,i=!1){return IP(this,void 0,void 0,function*(){if(this.state===wL.Closed)return;if(xf(t))return this.delete(e,i);const r=kd(t)||Array.isArray(t)?Kfr(t):String(t);if(this.cache.get(e)!==r)return this.cache.set(e,r),this.pendingInserts.set(e,r),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()})}delete(e,t=!1){return IP(this,void 0,void 0,function*(){if(!(this.state===wL.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return IP(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return IP(this,void 0,void 0,function*(){return this.options.hint===gD.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}mD.DEFAULT_FLUSH_DELAY=100;class Vte{constructor(){this.onDidChangeItemsExternal=nn.None,this.items=new Map}updateItems(e){var t,i;return IP(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((r,o)=>this.items.set(o,r)),(i=e.delete)===null||i===void 0||i.forEach(r=>this.items.delete(r))})}}const oV="__$__targetStorageMarker",i_=or("storageService");var $z;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})($z||($z={}));function Hpr(n){const e=n.get(oV);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class QG extends Ue{constructor(e={flushInterval:QG.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new KT),this._onDidChangeTarget=this._register(new KT),this._onWillSaveState=this._register(new Le),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return nn.filter(this._onDidChangeValue.event,r=>r.scope===e&&(t===void 0||r.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:r}=t;if(i===oV){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:r})}get(e,t,i){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.get(e,i)}getBoolean(e,t,i){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getBoolean(e,i)}getNumber(e,t,i){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getNumber(e,i)}store(e,t,i,r,o=!1){if(xf(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,i,r),(s=this.getStorage(i))===null||s===void 0||s.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))===null||r===void 0||r.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,r=!1){var o,s;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(oV,JSON.stringify(a),r)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(oV,JSON.stringify(a),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Hpr(t):Object.create(null)}}QG.DEFAULT_FLUSH_INTERVAL=60*1e3;class Wpr extends QG{constructor(){super(),this.applicationStorage=this._register(new mD(new Vte,{hint:gD.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new mD(new Vte,{hint:gD.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new mD(new Vte,{hint:gD.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function zpr(n,e){const t=Object.assign({},e);for(const i in n){const r=n[i];t[i]=r!==void 0?an(r):void 0}return t}const Upr={keybindingLabelBackground:an(Eor),keybindingLabelForeground:an(xor),keybindingLabelBorder:an(Tor),keybindingLabelBottomBorder:an(kor),keybindingLabelShadow:an(Rb)},jpr={buttonForeground:an(gP),buttonSeparator:an(cor),buttonBackground:an(mP),buttonHoverBackground:an(uor),buttonSecondaryForeground:an(hor),buttonSecondaryBackground:an(Sce),buttonSecondaryHoverBackground:an(por),buttonBorder:an(dor)},qpr={progressBarBackground:an(_or)},Vz={inputActiveOptionBorder:an(M0e),inputActiveOptionForeground:an(F0e),inputActiveOptionBackground:an(qx)};an(ssr),an(lsr),an(asr);an(ua),an(Mb),an(Rb),an(ur),an(Esr),an(xsr),an(Tsr),an(Zrr);const Hz={inputBackground:an(XZe),inputForeground:an(ZZe),inputBorder:an(JZe),inputValidationInfoBorder:an(tor),inputValidationInfoBackground:an(Jrr),inputValidationInfoForeground:an(eor),inputValidationWarningBorder:an(ror),inputValidationWarningBackground:an(nor),inputValidationWarningForeground:an(ior),inputValidationErrorBorder:an(aor),inputValidationErrorBackground:an(oor),inputValidationErrorForeground:an(sor)},Kpr={listFilterWidgetBackground:an(Jor),listFilterWidgetOutline:an(esr),listFilterWidgetNoMatchesOutline:an(tsr),listFilterWidgetShadow:an(nsr),inputBoxStyles:Hz,toggleStyles:Vz},qet={badgeBackground:an(Q$),badgeForeground:an(gor),badgeBorder:an(ur)};an(_sr),an(msr),an(IOe),an(IOe),an(vsr);const aI={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:an(zor),listFocusForeground:an(Uor),listFocusOutline:an(jor),listActiveSelectionBackground:an(Hy),listActiveSelectionForeground:an($b),listActiveSelectionIconForeground:an(yP),listFocusAndSelectionOutline:an(qor),listFocusAndSelectionBackground:an(Hy),listFocusAndSelectionForeground:an($b),listInactiveSelectionBackground:an(Kor),listInactiveSelectionIconForeground:an(Yor),listInactiveSelectionForeground:an(Gor),listInactiveFocusBackground:an(Qor),listInactiveFocusOutline:an(Xor),listHoverBackground:an(nJe),listHoverForeground:an(iJe),listDropBackground:an(Zor),listSelectionOutline:an(ys),listHoverOutline:an(ys),treeIndentGuidesStroke:an(CP),treeInactiveIndentGuidesStroke:an(isr),tableColumnsBorder:an(rsr),tableOddRowsBackgroundColor:an(osr)};function cR(n){return zpr(n,aI)}const Gpr={selectBackground:an(Ob),selectListBackground:an(lor),selectForeground:an(By),decoratorRightForeground:an(eJe),selectBorder:an(cL),focusBorder:an(Mf),listFocusBackground:an(Gx),listInactiveSelectionIconForeground:an(uL),listFocusForeground:an(Kx),listFocusOutline:Yrr(ys,ze.transparent.toString()),listHoverBackground:an(nJe),listHoverForeground:an(iJe),listHoverOutline:an(ys),selectListBorder:an(Fb),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},Ypr={shadowColor:an(Rb),borderColor:an(csr),foregroundColor:an(usr),backgroundColor:an(dsr),selectionForegroundColor:an(hsr),selectionBackgroundColor:an(fsr),selectionBorderColor:an(psr),separatorColor:an(gsr),scrollbarShadow:an(mor),scrollbarSliderBackground:an(_P),scrollbarSliderHoverBackground:an(vP),scrollbarSliderActiveBackground:an(bP)};var XG=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},sh=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ket=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Qpr(n,e,t,i){const r=n.getActions(e),o=Py.getInstance(),s=o.keyStatus.altKey||(eu||Zu)&&o.keyStatus.shiftKey;Yet(r,t,s,i?a=>a===i:a=>a==="navigation")}function Get(n,e,t,i,r,o){const s=n.getActions(e);Yet(s,t,!1,typeof i=="string"?l=>l===i:i,r,o)}function Yet(n,e,t,i=s=>s==="navigation",r=()=>!1,o=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of n){let d;i(c)?(d=s,d.length>0&&o&&d.push(new oc)):(d=a,d.length>0&&d.push(new oc));for(let h of u){t&&(h=h instanceof zm&&h.alt?h.alt:h);const f=d.push(h);h instanceof TA&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=i(c)?s:a,f=u.actions;r(u,c,h.length)&&h.splice(d,1,...f)}}let rk=class extends UA{constructor(e,t,i,r,o,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=r,this._contextKeyService=o,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Nc),this._altKey=Py.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Ket(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}})}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var r;const o=!!(!((r=this._menuItemAction.alt)===null||r===void 0)&&r.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(tt(e,"mouseleave",r=>{t=!1,i()})),this._register(tt(e,"mouseenter",r=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),r=this._commandAction.tooltip||this._commandAction.label;let o=i?T("titleAndKb","{0} ({1})",r,i):r;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?T("titleAndKb","{0} ({1})",s,l):s;o=T("titleAndKbAndAlt",`{0} [{1}] {2}`,o,vye.modifierLabels[Pf].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const r=this._commandAction.checked&&Vpr(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(Qn.isThemeIcon(r)){const o=Qn.asClassNameArray(r);i.classList.add(...o),this._itemClassDispose.value=mi(()=>{i.classList.remove(...o)})}else{const o=OA(this._themeService.getColorTheme().type)?_S(r.dark):_S(r.light),s=kt("span");s.style.webkitMask=s.style.mask=`${o} no-repeat 50% 50%`,s.style.background="var(--vscode-icon-foreground)",s.style.display="inline-block",s.style.width="100%",s.style.height="100%",i.appendChild(s),i.classList.add("icon"),this._itemClassDispose.value=km(mi(()=>{i.classList.remove("icon"),Lc(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};rk=XG([sh(2,Qo),sh(3,za),sh(4,vi),sh(5,Hl),sh(6,t_),sh(7,O1)],rk);let wue=class extends Bz{constructor(e,t,i,r,o){var s,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Qn.isThemeIcon(e.item.icon)?Qn.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>i.lookupKeybinding(u.id)});super(e,{getActions:()=>e.actions},r,c),this._keybindingService=i,this._contextMenuService=r,this._themeService=o}render(e){super.render(e),Io(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Qn.isThemeIcon(i)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=OA(this._themeService.getColorTheme().type)?_S(i.dark):_S(i.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};wue=XG([sh(2,Qo),sh(3,t_),sh(4,Hl)],wue);let Sue=class extends H_{constructor(e,t,i,r,o,s,a,l){var c,u,d;super(null,e),this._keybindingService=i,this._notificationService=r,this._contextMenuService=o,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(m=>f===m.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(rk,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=Object.assign(Object.assign({keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new xA});this._dropdown=new Bz(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof zm&&this.update(m.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(rk,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends xA{runAction(i,r){return Ket(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(uZe(this._container,kt(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const r=this._keybindingService.lookupKeybinding(e.id);r&&(i=`(${r.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=kt(".action-container");this._defaultAction.render(lt(this._container,t)),this._register(tt(t,Yt.KEY_DOWN,r=>{const o=new hs(r);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=kt(".dropdown-action-container");this._dropdown.render(lt(this._container,i)),this._register(tt(i,Yt.KEY_DOWN,r=>{var o;const s=new hs(r);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),s.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};Sue=XG([sh(2,Qo),sh(3,za),sh(4,t_),sh(5,L0),sh(6,di),sh(7,i_)],Sue);let Eue=class extends Fpr{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===oc.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,Gpr,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=an(cL)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};Eue=XG([sh(1,P1)],Eue);function Xpr(n,e,t){return e instanceof zm?n.createInstance(rk,e,t):e instanceof T3?e.item.isSelection?n.createInstance(Eue,e):e.item.rememberDefaultAction?n.createInstance(Sue,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(wue,e,t):void 0}var Zpr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class wg extends Ue{constructor(e,t={}){var i,r,o,s,a,l;super(),this._actionRunnerDisposables=this._register(new mt),this.viewItemDisposables=this._register(new e0e),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new Le),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new Le({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new Le),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new Le),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(r=this.options.orientation)!==null&&r!==void 0?r:0,this._triggerKeys={keyDown:(s=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new xA,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(d=>this._onDidRun.fire(d))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(d=>this._onWillRun.fire(d))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,u;switch(this._orientation){case 0:c=[15],u=[17];break;case 1:c=[16],u=[18],this.domNode.className+=" vertical";break}this._register(tt(this.domNode,Yt.KEY_DOWN,d=>{const h=new hs(d);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():u&&(h.equals(u[0])||h.equals(u[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof H_&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(tt(this.domNode,Yt.KEY_UP,d=>{const h=new hs(d);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(c0(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Im()===this.domNode||!Qc(Im(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof H_&&i.isEnabled());t instanceof H_&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof H_&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(Qc(Im(),t)){this.focusedItem=e;break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(t=>t.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i<this.actionsList.childNodes.length;i++)if(this.actionsList.childNodes[i]===e)return this.viewItems[i].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let r=pS(t.index)?t.index:null;i.forEach(o=>{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new UA(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,tt(s,Yt.CONTEXT_MENU,c=>{zi.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof H_&&this.viewItems.length===0&&a.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[r]),this.viewItems.splice(r,0,a),r++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=mo(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ic(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const r=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=r===-1?void 0:r,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===oc.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===oc.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var r;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])===null||r===void 0||r.blur());const o=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(o){let s=!0;_3(o.focus)||(s=!1),this.options.focusOnlyEnabledItems&&_3(o.isEnabled)&&!o.isEnabled()&&(s=!1),o.action.id===oc.ID&&(s=!1),s?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof H_){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return Zpr(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=mo(this.viewItems),this.getContainer().remove(),super.dispose()}}const xue=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Hte=/(&)?(&)([^\s&])/g;var Wz;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(Wz||(Wz={}));class _D extends wg{constructor(e,t,i,r){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,s),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...mr||Zu?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new mt),this.initializeOrUpdateStyleSheet(e,r),this._register(Zo.addTarget(o)),tt(o,Yt.KEY_DOWN,l=>{new hs(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(tt(o,Yt.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){zi.stop(l,!0);const u=this.mnemonics.get(c);if(u.length===1&&(u[0]instanceof pMe&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(l)),u.length>1){const d=u.shift();d&&d.container&&(this.focusItemByElement(d.container),u.push(d)),this.mnemonics.set(c,u)}}})),Zu&&this._register(tt(o,Yt.KEY_DOWN,l=>{const c=new hs(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),zi.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),zi.stop(l,!0))})),this._register(tt(this.domNode,Yt.MOUSE_OUT,l=>{const c=l.relatedTarget;Qc(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(tt(this.actionsList,Yt.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!Qc(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}})),this._register(Zo.addTarget(this.actionsList)),this._register(tt(this.actionsList,Jo.Tap,l=>{let c=l.initialTarget;if(!(!c||!Qc(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}}));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new A6(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,r),this._register(tt(o,Jo.Change,l=>{zi.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(tt(a,Yt.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=i.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof gMe)).forEach((l,c,u)=>{l.updatePositionInSet(c+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(XW(e)?this.styleSheet=vg(e):(_D.globalStyleSheet||(_D.globalStyleSheet=vg()),this.styleSheet=_D.globalStyleSheet)),this.styleSheet.textContent=egr(t,XW(e))}styleScrollElement(e,t){var i,r;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",s=(r=t.backgroundColor)!==null&&r!==void 0?r:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++){const i=this.actionsList.children[t];if(e===i){this.focusedItem=t;break}}}updateFocus(e){super.updateFocus(e,!0,!0),typeof this.focusedItem<"u"&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof oc)return new gMe(t.context,e,{icon:!0},this.menuStyles);if(e instanceof TA){const r=new pMe(e,e.actions,i,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}),this.menuStyles);if(t.enableMnemonics){const o=r.getMnemonic();if(o&&r.isEnabled()){let s=[];this.mnemonics.has(o)&&(s=this.mnemonics.get(o)),s.push(r),this.mnemonics.set(o,s)}}return r}else{const r={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const s=t.getKeyBinding(e);if(s){const a=s.getLabel();a&&(r.keybinding=a)}}const o=new Qet(t.context,e,r,this.menuStyles);if(t.enableMnemonics){const s=o.getMnemonic();if(s&&o.isEnabled()){let a=[];this.mnemonics.has(s)&&(a=this.mnemonics.get(s)),a.push(o),this.mnemonics.set(s,a)}}return o}}}class Qet extends H_{constructor(e,t,i,r){if(i.isMenu=!0,super(t,t,i),this.menuStyle=r,this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass="",this.options.label&&i.enableMnemonics){const o=this.action.label;if(o){const s=xue.exec(o);s&&(this.mnemonic=(s[1]?s[1]:s[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new $o(()=>{this.element&&(this._register(tt(this.element,Yt.MOUSE_UP,o=>{if(zi.stop(o,!0),mg){if(new Zp(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(tt(this.element,Yt.CONTEXT_MENU,o=>{zi.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=lt(this.element,kt("a.action-menu-item")),this._action.id===oc.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=lt(this.item,kt("span.menu-item-check"+Qn.asCSSSelector(Ht.menuSelection))),this.check.setAttribute("role","none"),this.label=lt(this.item,kt("span.action-label")),this.options.label&&this.options.keybinding&&(lt(this.item,kt("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Ic(this.label);let t=Tye(this.action.label);if(t){const i=Jpr(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const r=xue.exec(t);if(r){t=qW(t),Hte.lastIndex=0;let o=Hte.exec(t);for(;o&&o[1];)o=Hte.exec(t);const s=a=>a.replace(/&&/g,"&");o?this.label.append(b6(s(t.substr(0,o.index))," "),kt("u",{"aria-hidden":"true"},o[3]),PXe(s(t.substr(o.index+o[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(r[1]?r[1]:r[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,r=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=r,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class pMe extends Qet{constructor(e,t,i,r,o){super(e,e,r,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=r,this.mysubmenu=null,this.submenuDisposables=this._register(new mt),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:Wz.Right,this.showScheduler=new $o(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new $o(()=>{this.element&&!Qc(Im(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=lt(this.item,kt("span.submenu-indicator"+Qn.asCSSSelector(Ht.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(tt(this.element,Yt.KEY_UP,t=>{const i=new hs(t);(i.equals(17)||i.equals(3))&&(zi.stop(t,!0),this.createSubmenu(!0))})),this._register(tt(this.element,Yt.KEY_DOWN,t=>{const i=new hs(t);Im()===this.item&&(i.equals(17)||i.equals(3))&&zi.stop(t,!0)})),this._register(tt(this.element,Yt.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(tt(this.element,Yt.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(tt(this.element,Yt.FOCUS_OUT,t=>{this.element&&!Qc(Im(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){zi.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,r){const o={top:0,left:0};return o.left=bL(e.width,t.width,{position:r===Wz.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=bL(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=lt(this.element,kt("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new _D(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new rG],this.submenuOptions,this.menuStyle);const r=this.element.getBoundingClientRect(),o={top:r.top-i,left:r.left,height:r.height+2*i,width:r.width},s=this.submenuContainer.getBoundingClientRect(),{top:a,left:l}=this.calculateSubmenuMenuLayout(new qr(window.innerWidth,window.innerHeight),qr.lift(s),o,this.expandDirection);this.submenuContainer.style.left=`${l-s.left}px`,this.submenuContainer.style.top=`${a-s.top}px`,this.submenuDisposables.add(tt(this.submenuContainer,Yt.KEY_UP,c=>{new hs(c).equals(15)&&(zi.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(tt(this.submenuContainer,Yt.KEY_DOWN,c=>{new hs(c).equals(15)&&zi.stop(c,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class gMe extends UA{constructor(e,t,i,r){super(e,t,i),this.menuStyles=r}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Jpr(n){const e=xue,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function mMe(n){const e=AXe()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function egr(n,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } ${mMe(Ht.menuSelection)} ${mMe(Ht.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; overflow: hidden; white-space: nowrap; } .monaco-menu .monaco-action-bar .actions-container { display: flex; margin: 0 auto; padding: 0; width: 100%; justify-content: flex-end; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: inline-block; } .monaco-menu .monaco-action-bar.reverse .actions-container { flex-direction: row-reverse; } .monaco-menu .monaco-action-bar .action-item { cursor: pointer; display: inline-block; transition: transform 50ms ease; position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ } .monaco-menu .monaco-action-bar .action-item.disabled { cursor: default; } .monaco-menu .monaco-action-bar.animated .action-item.active { transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */ } .monaco-menu .monaco-action-bar .action-item .icon, .monaco-menu .monaco-action-bar .action-item .codicon { display: inline-block; } .monaco-menu .monaco-action-bar .action-item .codicon { display: flex; align-items: center; } .monaco-menu .monaco-action-bar .action-label { font-size: 11px; margin-right: 4px; } .monaco-menu .monaco-action-bar .action-item.disabled .action-label, .monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { color: var(--vscode-disabledForeground); } /* Vertical actions */ .monaco-menu .monaco-action-bar.vertical { text-align: left; } .monaco-menu .monaco-action-bar.vertical .action-item { display: block; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { display: block; border-bottom: 1px solid var(--vscode-menu-separatorBackground); padding-top: 1px; padding: 30px; } .monaco-menu .secondary-actions .monaco-action-bar .action-label { margin-left: 6px; } /* Action Items */ .monaco-menu .monaco-action-bar .action-item.select-container { overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ flex: 1; max-width: 170px; min-width: 60px; display: flex; align-items: center; justify-content: center; margin-right: 10px; } .monaco-menu .monaco-action-bar.vertical { margin-left: 0; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: block; } .monaco-menu .monaco-action-bar.vertical .action-item { padding: 0; transform: none; display: flex; } .monaco-menu .monaco-action-bar.vertical .action-item.active { transform: none; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { flex: 1 1 auto; display: flex; height: 2em; align-items: center; position: relative; margin: 0 4px; border-radius: 4px; } .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding, .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { opacity: unset; } .monaco-menu .monaco-action-bar.vertical .action-label { flex: 1 1 auto; text-decoration: none; padding: 0 1em; background: none; font-size: 12px; line-height: 1; } .monaco-menu .monaco-action-bar.vertical .keybinding, .monaco-menu .monaco-action-bar.vertical .submenu-indicator { display: inline-block; flex: 2 1 auto; padding: 0 1em; text-align: right; font-size: 12px; line-height: 1; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { font-size: 16px !important; display: flex; align-items: center; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { margin-left: auto; margin-right: -20px; } .monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, .monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { opacity: 0.4; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { display: inline-block; box-sizing: border-box; margin: 0; } .monaco-menu .monaco-action-bar.vertical .action-item { position: static; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { position: absolute; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { width: 100%; height: 0px !important; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label.separator.text { padding: 0.7em 1em 0.1em 1em; font-weight: bold; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label:hover { color: inherit; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { position: absolute; visibility: hidden; width: 1em; height: 100%; } .monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { visibility: visible; display: flex; align-items: center; justify-content: center; } /* Context Menu */ .context-view.monaco-menu-container { outline: 0; border: none; animation: fadeIn 0.083s linear; -webkit-app-region: no-drag; } .context-view.monaco-menu-container :focus, .context-view.monaco-menu-container .monaco-action-bar.vertical:focus, .context-view.monaco-menu-container .monaco-action-bar.vertical :focus { outline: 0; } .hc-black .context-view.monaco-menu-container, .hc-light .context-view.monaco-menu-container, :host-context(.hc-black) .context-view.monaco-menu-container, :host-context(.hc-light) .context-view.monaco-menu-container { box-shadow: none; } .hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused, .hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { background: none; } /* Vertical Action Bar Styles */ .monaco-menu .monaco-action-bar.vertical { padding: 4px 0; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { height: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), .monaco-menu .monaco-action-bar.vertical .keybinding { font-size: inherit; padding: 0 2em; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { font-size: inherit; width: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { font-size: inherit; margin: 5px 0 !important; padding: 0; border-radius: 0; } .linux .monaco-menu .monaco-action-bar.vertical .action-label.separator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { margin-left: 0; margin-right: 0; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { font-size: 60%; padding: 0 1.8em; } .linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; mask-size: 10px 10px; -webkit-mask-size: 10px 10px; } .monaco-menu .action-item { cursor: default; }`;if(e){t+=` /* Arrows */ .monaco-scrollable-element > .scrollbar > .scra { cursor: pointer; font-size: 11px !important; } .monaco-scrollable-element > .visible { opacity: 1; /* Background rule added for IE9 - to allow clicks on dom node */ background:rgba(0,0,0,0); transition: opacity 100ms linear; } .monaco-scrollable-element > .invisible { opacity: 0; pointer-events: none; } .monaco-scrollable-element > .invisible.fade { transition: opacity 800ms linear; } /* Scrollable Content Inset Shadow */ .monaco-scrollable-element > .shadow { position: absolute; display: none; } .monaco-scrollable-element > .shadow.top { display: block; top: 0; left: 3px; height: 3px; width: 100%; } .monaco-scrollable-element > .shadow.left { display: block; top: 3px; left: 0; height: 100%; width: 3px; } .monaco-scrollable-element > .shadow.top-left-corner { display: block; top: 0; left: 0; height: 3px; width: 3px; } `;const i=n.scrollbarShadow;i&&(t+=` .monaco-scrollable-element > .shadow.top { box-shadow: ${i} 0 6px 6px -6px inset; } .monaco-scrollable-element > .shadow.left { box-shadow: ${i} 6px 0 6px -6px inset; } .monaco-scrollable-element > .shadow.top.left { box-shadow: ${i} 6px 6px 6px -6px inset; } `);const r=n.scrollbarSliderBackground;r&&(t+=` .monaco-scrollable-element > .scrollbar > .slider { background: ${r}; } `);const o=n.scrollbarSliderHoverBackground;o&&(t+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${o}; } `);const s=n.scrollbarSliderActiveBackground;s&&(t+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${s}; } `)}return t}class tgr{constructor(e,t,i,r){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=r,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const r=b0e(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var s;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(kt(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=tt(this.block,Yt.MOUSE_DOWN,u=>u.stopPropagation()));const l=new mt,c=e.actionRunner||new xA;return c.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new _D(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},Ypr),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(tt(window,Yt.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(tt(window,Yt.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const d=new Zp(u);let h=d.target;if(!d.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),km(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Im()===this.lastContainer||Qc(Im(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},r,!!r)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Dv(e.error)&&this.notificationService.error(e.error)}}var ngr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},a2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Tue=class extends Ue{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new tgr(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,r,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=r,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new Le),this._onDidHideContextMenu=this._store.add(new Le)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=kue.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),Py.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};Tue=ngr([a2(0,dp),a2(1,za),a2(2,P1),a2(3,Qo),a2(4,L0),a2(5,vi)],Tue);var kue;(function(n){function e(i){return i&&i.menuId instanceof ue}function t(i,r,o){if(!e(i))return i;const{menuId:s,menuActionOptions:a,contextKeyService:l}=i;return Object.assign(Object.assign({},i),{getActions:()=>{const c=[];if(s){const u=r.createMenu(s,l??o);Qpr(u,a,c),u.dispose()}return i.getActions?oc.join(i.getActions(),c):c}})}n.transform=t})(kue||(kue={}));var zz;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(zz||(zz={}));var Dye=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Uz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Lx=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let Iue=class{constructor(e){this._commandService=e}open(e,t){return Lx(this,void 0,void 0,function*(){if(!gye(e,Gi.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Yn.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=_ue(decodeURIComponent(e.query))}catch{try{i=_ue(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};Iue=Dye([Uz(0,_a)],Iue);let Lue=class{constructor(e){this._editorService=e}open(e,t){return Lx(this,void 0,void 0,function*(){typeof e=="string"&&(e=Yn.parse(e));const{selection:i,uri:r}=shr(e);return e=r,e.scheme===Gi.file&&(e=Wcr(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?zz.USER:zz.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};Lue=Dye([Uz(0,eo)],Lue);let Due=class{constructor(e,t){this._openers=new Id,this._validators=new Id,this._resolvers=new Id,this._resolvedUriTargets=new mu(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Id,this._defaultExternalOpener={openExternal:i=>Lx(this,void 0,void 0,function*(){return HPe(i,Gi.http,Gi.https)?hZe(i):window.location.href=i,!0})},this._openers.push({open:(i,r)=>Lx(this,void 0,void 0,function*(){return r!=null&&r.openExternal||HPe(i,Gi.mailto,Gi.http,Gi.https,Gi.vsls)?(yield this._doOpenExternal(i,r),!0):!1})}),this._openers.push(new Iue(t)),this._openers.push(new Lue(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return Lx(this,void 0,void 0,function*(){const r=typeof e=="string"?Yn.parse(e):e,o=(i=this._resolvedUriTargets.get(r))!==null&&i!==void 0?i:e;for(const s of this._validators)if(!(yield s.shouldOpen(o,t)))return!1;for(const s of this._openers)if(yield s.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return Lx(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const r=yield i.resolveExternalUri(e,t);if(r)return this._resolvedUriTargets.has(r.resolved)||this._resolvedUriTargets.set(r.resolved,e),r}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return Lx(this,void 0,void 0,function*(){const i=typeof e=="string"?Yn.parse(e):e;let r;try{r=(yield this.resolveExternalUri(i,t)).resolved}catch{r=i}let o;if(typeof e=="string"&&i.toString()===r.toString()?o=e:o=encodeURI(r.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:s},nr.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},nr.None)})}dispose(){this._validators.clear()}};Due=Dye([Uz(0,eo),Uz(1,_a)],Due);const r_=or("editorWorkerService");var Qs;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Qs||(Qs={}));(function(n){function e(s,a){return a-s}n.compare=e;const t=Object.create(null);t[n.Error]=T("sev.error","Error"),t[n.Warning]=T("sev.warning","Warning"),t[n.Info]=T("sev.info","Info");function i(s){return t[s]||""}n.toString=i;function r(s){switch(s){case Sa.Error:return n.Error;case Sa.Warning:return n.Warning;case Sa.Info:return n.Info;case Sa.Ignore:return n.Hint}}n.fromSeverity=r;function o(s){switch(s){case n.Error:return Sa.Error;case n.Warning:return Sa.Warning;case n.Info:return Sa.Info;case n.Hint:return Sa.Ignore}}n.toSeverity=o})(Qs||(Qs={}));var jz;(function(n){const e="";function t(r){return i(r,!0)}n.makeKey=t;function i(r,o){const s=[e];return r.source?s.push(r.source.replace("¦","\\¦")):s.push(e),r.code?typeof r.code=="string"?s.push(r.code.replace("¦","\\¦")):s.push(r.code.value.replace("¦","\\¦")):s.push(e),r.severity!==void 0&&r.severity!==null?s.push(Qs.toString(r.severity)):s.push(e),r.message&&o?s.push(r.message.replace("¦","\\¦")):s.push(e),r.startLineNumber!==void 0&&r.startLineNumber!==null?s.push(r.startLineNumber.toString()):s.push(e),r.startColumn!==void 0&&r.startColumn!==null?s.push(r.startColumn.toString()):s.push(e),r.endLineNumber!==void 0&&r.endLineNumber!==null?s.push(r.endLineNumber.toString()):s.push(e),r.endColumn!==void 0&&r.endColumn!==null?s.push(r.endColumn.toString()):s.push(e),s.push(e),s.join("¦")}n.makeKeyOptionalMessage=i})(jz||(jz={}));const N0=or("markerService");function igr(n,e){const t=[],i=[];for(const r of n)e.has(r)||t.push(r);for(const r of e)n.has(r)||i.push(r);return{removed:t,added:i}}function rgr(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var ogr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_Me=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Aue=class extends Ue{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new Le),this._markerDecorations=new mu,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new sgr(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Gi.inMemory||e.uri.scheme===Gi.internal||e.uri.scheme===Gi.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(r=>r.owner).forEach(r=>this._markerService.remove(r,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};Aue=ogr([_Me(0,Ds),_Me(1,N0)],Aue);class sgr extends Ue{constructor(e){super(),this.model=e,this._map=new Vir,this._register(mi(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=igr(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const r=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(r,o);for(const a of i)this._map.delete(a);for(let a=0;a<s.length;a++)this._map.set(t[a],s[a]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=J.lift(t);if(t.severity===Qs.Hint&&!this._hasMarkerTag(t,1)&&!this._hasMarkerTag(t,2)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const r=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(r===1||i.endColumn>=r)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new J(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const r=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);r<i.endColumn&&(i=new J(i.startLineNumber,r,i.endLineNumber,i.endColumn),t.startColumn=r)}return i}_createDecorationOption(e){let t,i,r,o,s;switch(e.severity){case Qs.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",r=0;break;case Qs.Info:t="squiggly-info",i=Gs(Par),r=10,s={color:Gs(bsr),position:jh.Inline};break;case Qs.Warning:t="squiggly-warning",i=Gs(Oar),r=20,s={color:Gs(ysr),position:jh.Inline};break;case Qs.Error:default:t="squiggly-error",i=Gs(Rar),r=30,s={color:Gs(Csr),position:jh.Inline};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(o="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:np.Right},minimap:s,zIndex:r,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}var agr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},T2;function HE(n){return n.toString()}class lgr{constructor(e,t,i){this.model=e,this._modelEventListeners=new mt,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>i(e,r)))}dispose(){this._modelEventListeners.dispose()}}const cgr=Zu||mr?1:2;class ugr{constructor(e,t,i,r,o,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=r,this.heapSize=o,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let qz=T2=class extends Ue{constructor(e,t,i,r,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=r,this._languageConfigurationService=o,this._onModelAdded=this._register(new Le),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new Le),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new Le),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let r=gu.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(r=f),r<1&&(r=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let s=gu.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=cgr;const l=e.eol;l===`\r `?a=2:l===` `&&(a=1);let c=gu.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let u=gu.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(u=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=gu.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=gu.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:r,indentSize:o,insertSpaces:s,detectIndentation:u,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:Pf===3||Pf===2?` `:`\r `}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const r=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[r+t];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);o=T2._readModelOptions({editor:s,eol:a},i),this._modelCreationOptionsByLanguageAndResource[r+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let r=0,o=i.length;r<o;r++){const s=i[r],a=this._models[s],l=a.model.getLanguageId(),c=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:c})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:c}))continue;const u=t[l+c],d=this.getCreationOptions(l,c,a.model.isForSimpleWidget);T2._setModelOptionsForModel(a.model,d,u)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&jf(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(HE(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(HE(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(HE(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,r)=>i.time-r.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,r){const o=this.getCreationOptions(t,i,r),s=new f0(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(HE(i))){const c=this._removeDisposedModel(i),u=this._undoRedoService.getElements(i),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of u.past)by(f)&&f.matchesResource(i)&&f.setModel(s);for(const f of u.future)by(f)&&f.matchesResource(i)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,f=>by(f)&&f.matchesResource(i)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=HE(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new lgr(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,i,r=!1){let o;return t?o=this._createModelData(e,t,i,r):o=this._createModelData(e,qf,i,r),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,r=t.length;i<r;i++){const o=t[i];e.push(this._models[o].model)}return e}getModel(e){const t=HE(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Gi.file||e.scheme===Gi.vscodeRemote||e.scheme===Gi.vscodeUserData||e.scheme===Gi.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=HE(e.uri),i=this._models[t],r=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,s=0;if(r||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const c=this._undoRedoService.getElements(e.uri);if(c.past.length>0||c.future.length>0){for(const u of c.past)by(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)by(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=T2.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!r&&(s>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>by(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new ugr(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),r,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!r){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,r=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);T2._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new ZG}};qz.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;qz=T2=agr([PO(0,dr),PO(1,WZe),PO(2,VG),PO(3,xs),PO(4,rs)],qz);class ZG{canComputeSHA1(e){return e.getValueLength()<=ZG.MAX_MODEL_SIZE}computeSHA1(e){const t=new TG,i=e.createSnapshot();let r;for(;r=i.read();)t.update(r);return t.digest()}}ZG.MAX_MODEL_SIZE=10*1024*1024;class dgr{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Ue.None}}renderElement(e,t,i,r){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,r);const a=new Va,l=s.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,r))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class hgr{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function fgr(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new hgr(n,e.accessibilityProvider)})}class pgr{constructor(e,t,i,r,o={}){const s=()=>this.model,a=r.map(l=>new dgr(l,s));this.list=new n_(e,t,i,a,fgr(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return nn.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return nn.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return nn.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(r=>this._model.get(r)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,hd(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var uR=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const ggr=!1;var Kz;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(Kz||(Kz={}));let mgr=4;const _gr=new Le;let vgr=300;const bgr=new Le;class Aye{constructor(){this.disposables=new mt}get onPointerMove(){return this.disposables.add(new ar(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new ar(window,"mouseup")).event}dispose(){this.disposables.dispose()}}uR([Wa],Aye.prototype,"onPointerMove",null);uR([Wa],Aye.prototype,"onPointerUp",null);class Nye{get onPointerMove(){return this.disposables.add(new ar(this.el,Jo.Change)).event}get onPointerUp(){return this.disposables.add(new ar(this.el,Jo.End)).event}constructor(e){this.el=e,this.disposables=new mt}dispose(){this.disposables.dispose()}}uR([Wa],Nye.prototype,"onPointerMove",null);uR([Wa],Nye.prototype,"onPointerUp",null);class Gz{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}uR([Wa],Gz.prototype,"onPointerMove",null);uR([Wa],Gz.prototype,"onPointerUp",null);const vMe="pointer-events-disabled";class uu extends Ue{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=lt(this.el,kt(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(mi(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ar(this._orthogonalStartDragHandle,"mouseenter")).event(()=>uu.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ar(this._orthogonalStartDragHandle,"mouseleave")).event(()=>uu.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=lt(this.el,kt(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(mi(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ar(this._orthogonalEndDragHandle,"mouseenter")).event(()=>uu.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ar(this._orthogonalEndDragHandle,"mouseleave")).event(()=>uu.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=vgr,this.hoverDelayer=this._register(new jm(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new Le),this._onDidStart=this._register(new Le),this._onDidChange=this._register(new Le),this._onDidReset=this._register(new Le),this._onDidEnd=this._register(new Le),this.orthogonalStartSashDisposables=this._register(new mt),this.orthogonalStartDragHandleDisposables=this._register(new mt),this.orthogonalEndSashDisposables=this._register(new mt),this.orthogonalEndDragHandleDisposables=this._register(new mt),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=lt(e,kt(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),mr&&this.el.classList.add("mac");const r=this._register(new ar(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new Aye),this));const o=this._register(new ar(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new ar(this.el,"mouseenter")).event;this._register(s(()=>uu.onMouseEnter(this)));const a=this._register(new ar(this.el,"mouseleave")).event;this._register(a(()=>uu.onMouseLeave(this))),this._register(Zo.addTarget(this.el));const l=this._register(new ar(this.el,Jo.Start)).event;this._register(l(d=>this.onPointerStart(d,new Nye(this.el)),this));const c=this._register(new ar(this.el,Jo.Tap)).event;let u;this._register(c(d=>{if(u){clearTimeout(u),u=void 0,this.onPointerDoublePress(d);return}clearTimeout(u),u=setTimeout(()=>u=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=mgr,this._register(_gr.event(d=>{this.size=d,this.layout()}))),this._register(bgr.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",ggr),this.layout()}onPointerStart(e,t){zi.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new Gz(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new Gz(t))),!this.state)return;const r=document.getElementsByTagName("iframe");for(const g of r)g.classList.add(vMe);const o=e.pageX,s=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=vg(this.el),u=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=mr?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=mr?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new mt;u(),i||this.onDidEnablementChange.event(u,null,d);const h=g=>{zi.stop(g,!1);const m={startX:o,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(m)},f=g=>{zi.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const m of r)m.classList.remove(vMe)};t.onPointerMove(h,null,d),t.onPointerUp(f,null,d),d.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&uu.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&uu.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){uu.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const ygr={separatorBorder:ze.transparent};class Xet{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,r;e!==this.visible&&(e?(this.size=Nh(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),(r=(i=this.view).setVisible)===null||r===void 0||r.call(i,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,r){this.container=e,this.view=t,this.disposable=r,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class Cgr extends Xet{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class wgr extends Xet{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var py;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(py||(py={}));var Yz;(function(n){n.Distribute={type:"distribute"};function e(r){return{type:"split",index:r}}n.Split=e;function t(r){return{type:"auto",index:r}}n.Auto=t;function i(r){return{type:"invisible",cachedVisibleSize:r}}n.Invisible=i})(Yz||(Yz={}));class Zet extends Ue{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,r,o,s,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=py.Idle,this._onDidSashChange=this._register(new Le),this._onDidSashReset=this._register(new Le),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(r=t.inverseAltBehavior)!==null&&r!==void 0?r:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=lt(this.el,kt(".sash-container")),this.viewContainer=kt(".split-view-container"),this.scrollable=this._register(new D6({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:_g})),this.scrollableElement=this._register(new j0e(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new ar(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),lt(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||ygr),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=Bh(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this.contentSize=this.viewItems.reduce((c,u)=>c+u.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,r){this.doAddView(e,t,i,r)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let r=0;for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"?r+=a:e-=s.size}for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"&&(s.size=Nh(Math.round(a*e/r),s.minimumSize,s.maximumSize))}}else{const r=hd(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const r=this.sashItems.findIndex(a=>a.sash===e),o=km(tt(document.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),tt(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(r===this.sashItems.length-1){const m=this.viewItems[r];u=(m.minimumSize-m.size)/2,d=(m.maximumSize-m.size)/2}else{const m=this.viewItems[r+1];u=(m.size-m.maximumSize)/2,d=(m.size-m.minimumSize)/2}let h,f;if(!l){const g=hd(r,-1),m=hd(r+1,this.viewItems.length),v=g.reduce((L,D)=>L+(this.viewItems[D].minimumSize-c[D]),0),_=g.reduce((L,D)=>L+(this.viewItems[D].viewMaximumSize-c[D]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((L,D)=>L+(c[D]-this.viewItems[D].minimumSize),0),y=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((L,D)=>L+(c[D]-this.viewItems[D].viewMaximumSize),0),C=Math.max(v,y),x=Math.min(b,_),E=this.findFirstSnapIndex(g),k=this.findFirstSnapIndex(m);if(typeof E=="number"){const L=this.viewItems[E],D=Math.floor(L.viewMinimumSize/2);h={index:E,limitDelta:L.visible?C-D:C+D,size:L.size}}if(typeof k=="number"){const L=this.viewItems[k],D=Math.floor(L.viewMinimumSize/2);f={index:k,limitDelta:L.visible?x+D:x-D,size:L.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:r,alt:o,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-i,d=this.resize(t,u,r,void 0,void 0,s,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,m=this.viewItems[g],v=m.size-m.maximumSize,_=m.size-m.minimumSize,b=h?t-1:t+1;this.resize(b,-d,f,void 0,void 0,v,_)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Nh(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==py.Idle)throw new Error("Cant modify splitview");if(this.state=py.Busy,e<0||e>=this.viewItems.length)return;const i=hd(this.viewItems.length).filter(a=>a!==e),r=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=Nh(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(r,o),this.state=py.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=Nh(i,a.minimumSize,a.maximumSize);const r=hd(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,r){if(this.state!==py.Idle)throw new Error("Cant modify splitview");this.state=py.Busy;const o=kt(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=mi(()=>this.viewContainer.removeChild(o)),l=km(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new Cgr(o,e,c,l):new wgr(o,e,c,l);if(this.viewItems.splice(i,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new uu(this.sashContainer,{getHorizontalSashTop:L=>this.getSashPosition(L),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new uu(this.sashContainer,{getVerticalSashLeft:L=>this.getSashPosition(L),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?L=>({sash:f,start:L.startY,current:L.currentY,alt:L.altKey}):L=>({sash:f,start:L.startX,current:L.currentX,alt:L.altKey}),v=nn.map(f.onDidStart,g)(this.onSashStart,this),b=nn.map(f.onDidChange,g)(this.onSashChange,this),C=nn.map(f.onDidEnd,()=>this.sashItems.findIndex(L=>L.sash===f))(this.onSashEnd,this),x=f.onDidReset(()=>{const L=this.sashItems.findIndex(F=>F.sash===f),D=hd(L,-1),A=hd(L+1,this.viewItems.length),O=this.findFirstSnapIndex(D),P=this.findFirstSnapIndex(A);typeof O=="number"&&!this.viewItems[O].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(L)}),E=km(v,b,C,x,f),k={sash:f,disposable:E};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),r||this.relayout([i],d),this.state=py.Idle,!r&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(u=>u.size),r,o,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=hd(e,-1),d=hd(e+1,this.viewItems.length);if(o)for(const k of o)Dee(u,k),Dee(d,k);if(r)for(const k of r)S9(u,k),S9(d,k);const h=u.map(k=>this.viewItems[k]),f=u.map(k=>i[k]),g=d.map(k=>this.viewItems[k]),m=d.map(k=>i[k]),v=u.reduce((k,L)=>k+(this.viewItems[L].minimumSize-i[L]),0),_=u.reduce((k,L)=>k+(this.viewItems[L].maximumSize-i[L]),0),b=d.length===0?Number.POSITIVE_INFINITY:d.reduce((k,L)=>k+(i[L]-this.viewItems[L].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((k,L)=>k+(i[L]-this.viewItems[L].maximumSize),0),C=Math.max(v,y,s),x=Math.min(b,_,a);let E=!1;if(l){const k=this.viewItems[l.index],L=t>=l.limitDelta;E=L!==k.visible,k.setVisible(L,l.size)}if(!E&&c){const k=this.viewItems[c.index],L=t<c.limitDelta;E=L!==k.visible,k.setVisible(L,c.size)}if(E)return this.resize(e,t,i,r,o,s,a);t=Nh(t,C,x);for(let k=0,L=t;k<h.length;k++){const D=h[k],A=Nh(f[k]+L,D.minimumSize,D.maximumSize),O=A-f[k];L-=O,D.size=A}for(let k=0,L=t;k<g.length;k++){const D=g[k],A=Nh(m[k]-L,D.minimumSize,D.maximumSize),O=A-m[k];L+=O,D.size=A}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-t;const r=hd(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);for(const a of s)Dee(r,a);for(const a of o)S9(r,a);typeof e=="number"&&S9(r,e);for(let a=0;i!==0&&a<r.length;a++){const l=this.viewItems[r[a]],c=Nh(l.size+i,l.minimumSize,l.maximumSize),u=c-l.size;i-=u,l.size=c}}layoutViews(){this.contentSize=this.viewItems.reduce((t,i)=>t+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const o=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l<this.sashItems.length;l++){const{sash:c}=this.sashItems[l],u=this.viewItems[l];a+=u.size;const d=!(t[l]&&s[l+1]),h=!(i[l]&&o[l+1]);if(d&&h){const f=hd(l,-1),g=hd(l+1,this.viewItems.length),m=this.findFirstSnapIndex(f),v=this.findFirstSnapIndex(g),_=typeof m=="number"&&!this.viewItems[m].visible,b=typeof v=="number"&&!this.viewItems[v].visible;_&&o[l]&&(a>0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a<this.contentSize||this.endSnappingEnabled)?c.state=2:c.state=0}else d&&!h?c.state=1:!d&&h?c.state=2:c.state=3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const i=this.viewItems[t];if(i.visible&&i.snap)return t}for(const t of e){const i=this.viewItems[t];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),mo(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class V6{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=V6.TemplateId,this.renderedTemplates=new Set;const r=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const s=r.get(o.templateId);if(!s)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=lt(e,kt(".monaco-table-tr")),i=[],r=[];for(let s=0;s<this.columns.length;s++){const a=this.renderers[s],l=lt(t,kt(".monaco-table-td",{"data-col-index":s}));l.style.width=`${this.getColumnSize(s)}px`,i.push(l),r.push(a.renderTemplate(l))}const o={container:e,cellContainers:i,cellTemplateData:r};return this.renderedTemplates.add(o),o}renderElement(e,t,i,r){for(let o=0;o<this.columns.length;o++){const a=this.columns[o].project(e);this.renderers[o].renderElement(a,t,i.cellTemplateData[o],r)}}disposeElement(e,t,i,r){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const l=this.columns[o].project(e);s.disposeElement(l,t,i.cellTemplateData[o],r)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);Ic(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}V6.TemplateId="row";function Sgr(n){return{getHeight(e){return n.getHeight(e)},getTemplateId(){return V6.TemplateId}}}class Egr{get minimumSize(){var e;return(e=this.column.minimumWidth)!==null&&e!==void 0?e:120}get maximumSize(){var e;return(e=this.column.maximumWidth)!==null&&e!==void 0?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return(e=this.column.onDidChangeWidthConstraints)!==null&&e!==void 0?e:nn.None}constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new Le,this.onDidLayout=this._onDidLayout.event,this.element=kt(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}layout(e){this._onDidLayout.fire([this.index,e])}}class JG{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,r,o,s){this.virtualDelegate=i,this.domId=`table_id_${++JG.InstanceCount}`,this.disposables=new mt,this.cachedWidth=0,this.cachedHeight=0,this.domNode=lt(t,kt(`.monaco-table.${this.domId}`));const a=r.map((u,d)=>new Egr(u,d)),l={size:a.reduce((u,d)=>u+d.column.weight,0),views:a.map(u=>({size:u.column.weight,view:u}))};this.splitview=this.disposables.add(new Zet(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new V6(r,o,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new n_(e,this.domNode,Sgr(i),[c],s)),nn.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((f,g)=>f+g.weight,0),h=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=vg(this.domNode),this.style(kpr)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` `),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}JG.InstanceCount=0;class dR extends Jm{constructor(e){super(),this._onChange=this._register(new Le),this.onChange=this._onChange.event,this._onKeyDown=this._register(new Le),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Qn.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const xgr=T("caseDescription","Match Case"),Tgr=T("wordsDescription","Match Whole Word"),kgr=T("regexDescription","Use Regular Expression");class Jet extends dR{constructor(e){super({icon:Ht.caseSensitive,title:xgr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ett extends dR{constructor(e){super({icon:Ht.wholeWord,title:Tgr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ttt extends dR{constructor(e){super({icon:Ht.regex,title:kgr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Igr{constructor(e,t=0,i=e.length,r=t-1){this.items=e,this.start=t,this.end=i,this.index=r}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Lgr{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new Igr(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const MO=kt;let Dgr=class extends Jm{constructor(e,t,i){var r;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new Le),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new Le),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(r=this.options.tooltip)!==null&&r!==void 0?r:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=lt(e,MO(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=lt(this.element,MO(".ibwrapper"));if(this.input=lt(s,MO(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=lt(s,MO("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new hJe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),lt(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new ar(document,"selectionchange")),l=nn.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new wg(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:jx(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&jf(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${mT(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=th(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{var o,s;if(!this.message)return null;e=lt(r,MO(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?Wfr(this.message.content,a):Hfr(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",lt(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=T("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=T("alertWarningMessage","Warning: {0}",this.message.content):i=T("alertInfoMessage","Info: {0}",this.message.content),bu(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const r=this.options.inputBoxStyles,o=(e=r.inputBackground)!==null&&e!==void 0?e:"",s=(t=r.inputForeground)!==null&&t!==void 0?t:"",a=(i=r.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${mT(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=jx(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,r=t.selectionEnd,o=t.value;i!==null&&r!==null&&(this.value=o.substr(0,i)+e+o.substr(r),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class ntt extends Dgr{constructor(e,t,i){const r=T({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${r}`,s=` (⇅ ${r})`;super(e,t,i),this._onDidFocus=this._register(new Le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Le),this.onDidBlur=this._onDidBlur.event,this.history=new Lgr(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:s,c=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(u=>{u.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const u=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=u:this.setPlaceHolder(u),!0}else return!1};l(s)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",wS(this.value?this.value:T("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,wS(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const Agr=T("defaultLabel","input");class itt extends Jm{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Nc),this.additionalToggles=[],this._onDidOptionChange=this._register(new Le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Le),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new Le),this._onKeyUp=this._register(new Le),this._onCaseSensitiveKeyDown=this._register(new Le),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new Le),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||Agr,this.showCommonFindToggles=!!i.showCommonFindToggles;const r=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,u=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new ntt(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new ttt(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new ett(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new Jet(Object.assign({appendTitle:r,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),zi.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(tt(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(tt(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const r of this.additionalToggles)r.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const r of this.additionalToggles)r.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new mt;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,r,o,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(r=this.wholeWords)===null||r===void 0?void 0:r.width())!==null&&o!==void 0?o:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var Zv;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Zv||(Zv={}));var Zx;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(Zx||(Zx={}));class kf extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class Rye{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function Oye(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function s5(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function Wte(n){return typeof n.collapsible=="boolean"}class Ngr{constructor(e,t,i,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new n0e,this._onDidChangeCollapseState=new Le,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new Le,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new Le,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new jm(vZe),this.collapseByDefault=typeof r.collapseByDefault>"u"?!1:r.collapseByDefault,this.filter=r.filter,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=tr.empty(),r={}){if(e.length===0)throw new kf(this.user,"Invalid tree location");r.diffIdentityProvider?this.spliceSmart(r.diffIdentityProvider,e,t,i,r):this.spliceSimple(e,t,i,r)}spliceSmart(e,t,i,r,o,s){var a;r===void 0&&(r=tr.empty()),s===void 0&&(s=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,r,o);const c=[...r],u=t[t.length-1],d=new _b({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+i)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(v,_,b)=>{if(s>0)for(let y=0;y<b;y++)v--,_--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[_].children,o,s-1)};let g=Math.min(l.children.length,u+i),m=c.length;for(const v of d.changes.sort((_,b)=>b.originalStart-_.originalStart))f(g,m,g-(v.originalStart+v.originalLength)),g=v.originalStart,m=v.modifiedStart-u,this.spliceSimple([...h,g],v.originalLength,tr.slice(c,m,m+v.modifiedLength),o);f(g,m,g)}spliceSimple(e,t,i=tr.empty(),{onDidCreateNode:r,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=tr.map(i,k=>this.createTreeNode(k,a,a.visible?1:0,c,d,r)),f=e[e.length-1],g=a.children.length>0;let m=0;for(let k=f;k>=0&&k<a.children.length;k--){const L=a.children[k];if(L.visible){m=L.visibleChildIndex;break}}const v=[];let _=0,b=0;for(const k of h)v.push(k),b+=k.renderNodeCount,k.visible&&(k.visibleChildIndex=m+_++);const y=iRe(a.children,f,t,v);s?a.lastDiffIds?iRe(a.lastDiffIds,f,t,v.map(k=>s.getId(k.element).toString())):a.lastDiffIds=a.children.map(k=>s.getId(k.element).toString()):a.lastDiffIds=void 0;let C=0;for(const k of y)k.visible&&C++;if(C!==0)for(let k=f+v.length;k<a.children.length;k++){const L=a.children[k];L.visible&&(L.visibleChildIndex-=C)}if(a.visibleChildrenCount+=_-C,c&&u){const k=y.reduce((L,D)=>L+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-k),this.list.splice(l,k,d)}if(y.length>0&&o){const k=L=>{o(L),L.children.forEach(k)};y.forEach(k)}this._onDidSplice.fire({insertedNodes:v,deletedNodes:y});const x=a.children.length>0;g!==x&&this.setCollapsible(e.slice(0,-1),x);let E=a;for(;E;){if(E.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}E=E.parent}}rerender(e){if(e.length===0)throw new kf(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:r}=this.getTreeNodeWithListIndex(e);t.visible&&r&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:r}=this.getTreeNodeWithListIndex(e);return i&&r?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const r={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const r=this.getTreeNode(e);typeof t>"u"&&(t=!r.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:r,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,r,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!Wte(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l<i.children.length;l++)if(i.children[l].visible)if(a>-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,i,r){const o=this._setNodeCollapseState(e,r,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let r;if(e===this.root?r=!1:(Wte(t)?(r=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(r=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):r=!1,r&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!Wte(t)&&t.recursive)for(const o of e.children)r=this._setNodeCollapseState(o,t,!0)||r;return r}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,r,o,s){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,r&&o.push(a);const c=e.children||tr.empty(),u=r&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,o,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,r&&o.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,r=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,r&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,r&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):Oye(i)?(e.filterData=i.data,s5(i.visibility)):(e.filterData=void 0,s5(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...r]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(r,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...r]=e;if(i<0||i>t.children.length)throw new kf(this.user,"Invalid tree location");return this.getTreeNode(r,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:r,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new kf(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:i,revealed:r,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,r=!0,o=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new kf(this.user,"Invalid tree location");for(let l=0;l<s;l++)i+=t.children[l].renderNodeCount;return r=r&&!t.collapsed,o=o&&t.visible,a.length===0?{parentNode:t,listIndex:i,revealed:r,visible:o}:this.getParentNodeWithListIndex(a,t.children[s],i+1,r,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){if(e.length!==0)return e.length===1?[]:sZi(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(t.children.length!==0)return t.children[0].element}}globalThis&&globalThis.__awaiter;class Rgr extends $6{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function zte(n){return n instanceof $6?new Rgr(n):n}class Ogr{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Ue.None,this.disposables=new mt}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,r;(r=(i=this.dnd).onDragStart)===null||r===void 0||r.call(i,zte(e),t)}onDragOver(e,t,i,r,o=!0){const s=this.dnd.onDragOver(zte(e),t&&t.element,i,r),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return s;if(a&&typeof s!="boolean"&&s.autoExpand&&(this.autoExpandDisposable=bS(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof s=="boolean"||!s.accept||typeof s.bubble>"u"||s.feedback){if(!o){const h=typeof s=="boolean"?s:s.accept,f=typeof s=="boolean"?void 0:s.effect;return{accept:h,effect:f,feedback:[i]}}return s}if(s.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),m=h.getNode(g),v=g&&h.getListIndex(g);return this.onDragOver(e,m,v,r,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),u=l.getListIndex(c),d=l.getListRenderCount(c);return Object.assign(Object.assign({},s),{feedback:hd(u,u+d)})}drop(e,t,i,r){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(zte(e),t&&t.element,i,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Pgr(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Ogr(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),r=i.getNodeLocation(t),o=i.getParentNodeLocation(r);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class Pye{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,r;(r=(i=this.delegate).setDynamicHeight)===null||r===void 0||r.call(i,e.element,t)}}var a5;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(a5||(a5={}));class Mgr{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new mt,this.onDidChange=nn.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class l5{constructor(e,t,i,r,o,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=r,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=l5.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Ue.None,this.disposables=new mt,this.templateId=e.templateId,this.updateOptions(s),nn.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=Nh(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,r]of this.renderedNodes)this.renderTreeElement(i,r)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==a5.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,r]of this.renderedNodes)this._renderIndentGuides(i,r);if(this.indentGuidesDisposable.dispose(),t){const i=new mt;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=lt(e,kt(".monaco-tl-row")),i=lt(t,kt(".monaco-tl-indent")),r=lt(t,kt(".monaco-tl-twistie")),o=lt(t,kt(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:r,indentGuidesDisposable:Ue.None,templateData:s}}renderElement(e,t,i,r){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,r)}disposeElement(e,t,i,r){var o,s;i.indentGuidesDisposable.dispose(),(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,e,t,i.templateData,r),typeof r=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=l5.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Qn.asClassNameArray(Ht.treeItemExpanded));let r=!1;this.renderer.renderTwistie&&(r=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(r||t.twistie.classList.add(...Qn.asClassNameArray(Ht.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Ic(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new mt,r=this.modelProvider();for(;;){const o=r.getNodeLocation(e),s=r.getParentNodeLocation(o);if(!s)break;const a=r.getNode(s),l=kt(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(mi(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(r=>{const o=i.getNodeLocation(r);try{const s=i.getParentNodeLocation(o);r.collapsible&&r.children.length>0&&!r.collapsed?t.add(r):s&&t.add(i.getNode(s))}catch{}}),this.activeIndentNodes.forEach(r=>{t.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.remove("active"))}),t.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),mo(this.disposables)}}l5.DefaultIndent=8;class Fgr{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new mt,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?i=s?1:0:Oye(s)?i=s5(s.visibility):i=s,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:pv.Default,visibility:i};const r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(r)?r:[r];for(const s of o){const a=s&&s.toString();if(typeof a>"u")return{data:pv.Default,visibility:i};let l;if(this.tree.findMatchType===ok.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let u=this._lowercasePattern.length;u>0;u--)l.push(c+u-1)}}else l=ik(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===Vb.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:pv.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){mo(this.disposables)}}var Vb;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Vb||(Vb={}));var ok;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(ok||(ok={}));let Bgr=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,r,o,s={}){var a,l;this.tree=e,this.view=i,this.filter=r,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new Le,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new Le,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new Le,this._onDidChangeOpenState=new Le,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new mt,this.disposables=new mt,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Vb.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:ok.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,r;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:T("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(r=this.widget)===null||r===void 0||r.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===Vb.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!pv.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function bMe(n){let e=Zx.Unknown;return jee(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Zx.Twistie:jee(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Zx.Element:jee(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Zx.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function sV(n,e){e(n),n.children.forEach(t=>sV(t,e))}class Ute{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new Le,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Ia(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const r=this;this._onDidChange.fire({get elements(){return r.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>sV(u,c)),this.set([...l.values()]);return}const i=new Set,r=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>sV(l,r));const o=new Map,s=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>sV(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const d=o.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class $gr extends zet{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if($et(e.browserEvent.target)||Ww(e.browserEvent.target)||yL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,r=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!r&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const s=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([s]),this.tree.toggleCollapsed(s,a),o&&r){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class Vgr extends n_{constructor(e,t,i,r,o,s,a,l){super(e,t,i,r,l),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new $gr(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const r=[],o=[];let s;i.forEach((a,l)=>{this.focusTrait.has(a)&&r.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),r.length>0&&super.setFocus(fS([...super.getFocus(),...r])),o.length>0&&super.setSelection(fS([...super.getSelection(),...o])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(r=>this.element(r)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(r=>this.element(r)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class rtt{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return nn.filter(nn.map(this.view.onMouseDblClick,bMe),e=>e.target!==Zx.Filter)}get onPointer(){return nn.map(this.view.onPointer,bMe)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return nn.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:Vb.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:ok.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,r,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new n0e,this.onDidChangeFindOpenState=nn.None,this.disposables=new mt,this._onWillRefilter=new Le,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new Le;const a=new Pye(i),l=new uRe,c=new uRe,u=this.disposables.add(new Mgr(c.event)),d=new x0e;this.renderers=r.map(v=>new l5(v,()=>this.model,l.event,u,d,o));for(const v of this.renderers)this.disposables.add(v);let h;o.keyboardNavigationLabelProvider&&(h=new Fgr(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new Ute(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new Ute(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new Ute(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new Vgr(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},Pgr(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=nn.forEach(this.model.onDidSplice,v=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(v),this.selection.onDidModelSplice(v)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new Le),m=this.disposables.add(new jm(0));if(this.disposables.add(nn.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{m.trigger(()=>{const v=new Set;for(const _ of this.focus.getNodes())v.add(_);for(const _ of this.selection.getNodes())v.add(_);g.fire([...v.values()])})})),c.input=g.event,o.keyboardSupport!==!1){const v=nn.chain(this.view.onKeyDown,_=>_.filter(b=>!Ww(b.target)).map(b=>new hs(b)));nn.chain(v,_=>_.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),nn.chain(v,_=>_.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),nn.chain(v,_=>_.filter(b=>b.keyCode===10))(this.onSpace,this,this.disposables)}if((!((s=o.findWidgetEnabled)!==null&&s!==void 0)||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const v=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new Bgr(this,this.model,this.view,h,o.contextViewProvider,v),this.focusNavigationFilter=_=>this.findController.shouldAllowFocus(_),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=nn.None,this.onDidChangeFindMatchType=nn.None;this.styleElement=vg(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===a5.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===a5.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),pS(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(` `),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(r,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(r,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],r=this.model.getNodeLocation(i);if(!this.model.setCollapsed(r,!0)){const s=this.model.getParentNodeLocation(r);if(!s)return;const a=this.model.getListIndex(s);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],r=this.model.getNodeLocation(i);if(!this.model.setCollapsed(r,!1)){if(!i.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],r=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,o)}dispose(){mo(this.disposables),this.view.dispose()}}class Mye{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Ngr(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(r,o){return i.sorter.compare(r.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=tr.empty(),i={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),i)}_setChildren(e,t=tr.empty(),i){const r=new Set,o=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(r.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.add(d),this.nodesByIdentity.set(d,u)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(r.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:s,onDidDeleteNode:a}))}preserveCollapseState(e=tr.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),tr.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(s)}if(!i){let s;return typeof t.collapsed>"u"?s=void 0:t.collapsed===Zv.Collapsed||t.collapsed===Zv.PreserveOrCollapsed?s=!0:t.collapsed===Zv.Expanded||t.collapsed===Zv.PreserveOrExpanded?s=!1:s=!!t.collapsed,Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:s})}const r=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Zv.PreserveOrCollapsed||t.collapsed===Zv.PreserveOrExpanded?o=i.collapsed:t.collapsed===Zv.Collapsed?o=!0:t.collapsed===Zv.Expanded?o=!1:o=!!t.collapsed,Object.assign(Object.assign({},t),{collapsible:r,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const r=this.getElementLocation(e);return this.model.setCollapsed(r,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new kf(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new kf(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new kf(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(i);return this.model.getNode(r).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new kf(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function aV(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:tr.map(tr.from(n.children),aV),collapsible:n.collapsible,collapsed:n.collapsed}}function lV(n){const e=[n.element],t=n.incompressible||!1;let i,r;for(;[r,i]=tr.consume(tr.from(n.children),2),!(r.length!==1||r[0].incompressible);)n=r[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:tr.map(tr.concat(r,i),lV),collapsible:n.collapsible,collapsed:n.collapsed}}function Nue(n,e=0){let t;return e<n.element.elements.length-1?t=[Nue(n,e+1)]:t=tr.map(tr.from(n.children),i=>Nue(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function yMe(n){return Nue(n,0)}function ott(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:tr.map(tr.from(n.children),i=>ott(i,e,t))})}const Hgr=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class Wgr{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new Mye(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=tr.empty(),i){const r=i.diffIdentityProvider&&Hgr(i.diffIdentityProvider);if(e===null){const g=tr.map(t,this.enabled?lV:aV);this._setChildren(null,g,{diffIdentityProvider:r,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new kf(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=yMe(s),u=ott(c,e,t),d=(this.enabled?lV:aV)(u),h=i.diffIdentityProvider?(g,m)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(m):void 0;if(Ia(d.element.elements,s.element.elements,h)){this._setChildren(o,d.children||tr.empty(),{diffIdentityProvider:r,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:r,diffDepth:s.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,r=tr.map(i,yMe),o=tr.map(r,e?lV:aV);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const r=new Set,o=a=>{for(const l of a.element.elements)r.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)r.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:s}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const r=this.getCompressedNode(e);return this.model.setCollapsed(r,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new kf(this.user,`Tree element not found: ${e}`);return t}}const zgr=n=>n[n.length-1];class Fye{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new Fye(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function Ugr(n,e){return{splice(t,i,r){e.splice(t,i,r.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function jgr(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class qgr{get onDidSplice(){return nn.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return nn.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return nn.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||zgr;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new Rye(o=>new Fye(r,o)),this.model=new Wgr(e,Ugr(this.nodeMapper,t),jgr(r,i))}setChildren(e,t=tr.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var Kgr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class Bye extends rtt{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,r,o={}){super(e,t,i,r,o),this.user=e}setChildren(e,t=tr.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new Mye(e,t,i)}}class stt{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,r){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,r)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,r))}disposeElement(e,t,i,r){var o,s,a,l;i.compressedTreeNode?(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,i.compressedTreeNode,t,i.data,r):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}Kgr([Wa],stt.prototype,"compressedTreeNodeProvider",null);function Ggr(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class att extends Bye{constructor(e,t,i,r,o={}){const s=()=>this,a=r.map(l=>new stt(s,l));super(e,t,i,a,Ggr(s,o))}setChildren(e,t=tr.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new qgr(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var aC=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function jte(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function Rue(n,e){return e.parent?e.parent===n?!0:Rue(n,e.parent):!1}function Ygr(n,e){return n===e||Rue(n,e)||Rue(e,n)}class $ye{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new $ye(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class Qgr{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,r){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Qn.asClassNameArray(Ht.treeItemLoading)),!0):(t.classList.remove(...Qn.asClassNameArray(Ht.treeItemLoading)),!1)}disposeElement(e,t,i,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,i.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function CMe(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function wMe(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class Xgr extends $6{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function qte(n){return n instanceof $6?new Xgr(n):n}class Zgr{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,r;(r=(i=this.dnd).onDragStart)===null||r===void 0||r.call(i,qte(e),t)}onDragOver(e,t,i,r,o=!0){return this.dnd.onDragOver(qte(e),t&&t.element,i,r)}drop(e,t,i,r){this.dnd.drop(qte(e),t&&t.element,i,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function ltt(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new Zgr(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)})}function Oue(n,e){e(n),n.children.forEach(t=>Oue(t,e))}class ctt{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return nn.map(this.tree.onDidChangeFocus,CMe)}get onDidChangeSelection(){return nn.map(this.tree.onDidChangeSelection,CMe)}get onMouseDblClick(){return nn.map(this.tree.onMouseDblClick,wMe)}get onPointer(){return nn.map(this.tree.onPointer,wMe)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,r,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new Le,this._onDidChangeNodeSlowState=new Le,this.nodeMapper=new Rye(a=>new $ye(a)),this.disposables=new mt,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,r,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=jte({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,r,o){const s=new Pye(i),a=r.map(c=>new Qgr(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=ltt(o)||{};return new Bye(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return aC(this,void 0,void 0,function*(){this.refreshPromises.forEach(r=>r.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,r,o){return aC(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new kf(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield nn.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,r,o),i)try{this.tree.rerender(s)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return aC(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new kf(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield nn.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield nn.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const r=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield nn.toPromise(this._onDidRender.event)),r})}setSelection(e,t){const i=e.map(r=>this.getDataNode(r));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(r=>this.getDataNode(r));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new kf(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,r){return aC(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,r)})}refreshNode(e,t,i){return aC(this,void 0,void 0,function*(){let r;if(this.subTreeRefreshPromises.forEach((o,s)=>{!r&&Ygr(s,e)&&(r=o.then(()=>this.refreshNode(e,t,i)))}),r)return r;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return aC(this,void 0,void 0,function*(){let r;e.refreshPromise=new Promise(o=>r=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield ace.settled(o.map(s=>this.doRefreshSubTree(s,t,i)))}finally{r()}})}doRefreshNode(e,t,i){return aC(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(tr.empty());else{const o=this.doGetChildren(e);if(rRe(o))r=Promise.resolve(o);else{const s=vS(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),r=o.finally(()=>s.cancel())}}try{const o=yield r;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Dv(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return rRe(i)?this.processChildren(i):(t=Sl(()=>aC(this,void 0,void 0,function*(){return this.processChildren(yield i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Oi))}setChildren(e,t,i,r){const o=[...t];if(e.children.length===0&&o.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)if(s.set(u.element,u),this.identityProvider){const d=this.tree.isCollapsed(u);a.set(u.id,{node:u,collapsed:d})}const l=[],c=o.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const m=jte({element:u,parent:e,hasChildren:d});return d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(m.collapsedByDefault=!1,l.push(m)),m}const h=this.identityProvider.getId(u).toString(),f=a.get(h);if(f){const m=f.node;return s.delete(m.element),this.nodes.delete(m.element),this.nodes.set(u,m),m.element=u,m.hasChildren=d,i?f.collapsed?(m.children.forEach(v=>Oue(v,_=>this.nodes.delete(_.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(m.collapsedByDefault=!1,l.push(m)),m}const g=jte({element:u,parent:e,id:h,hasChildren:d});return r&&r.viewState.focus&&r.viewState.focus.indexOf(h)>-1&&r.focus.push(g),r&&r.viewState.selection&&r.viewState.selection.indexOf(h)>-1&&r.selection.push(g),r&&r.viewState.expanded&&r.viewState.expanded.indexOf(h)>-1?l.push(g):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const u of s.values())Oue(u,d=>this.nodes.delete(d.element));for(const u of c)this.nodes.set(u.element,u);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,i){const r=e.children.map(s=>this.asTreeElement(s,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(s){return i.diffIdentityProvider.getId(s.element)}}});this.tree.setChildren(e===this.root?null:e,r,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?tr.map(e.children,r=>this.asTreeElement(r,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class Vye{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new Vye(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class Jgr{constructor(e,t,i,r){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,r){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,r)}renderCompressedElements(e,t,i,r){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Qn.asClassNameArray(Ht.treeItemLoading)),!0):(t.classList.remove(...Qn.asClassNameArray(Ht.treeItemLoading)),!1)}disposeElement(e,t,i,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,i.templateData,r)}disposeCompressedElements(e,t,i,r){var o,s;(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=mo(this.disposables)}}function emr(n){const e=n&<t(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class tmr extends ctt{constructor(e,t,i,r,o,s,a={}){super(e,t,i,o,s,a),this.compressionDelegate=r,this.compressibleNodeMapper=new Rye(l=>new Vye(l)),this.filter=a.filter}createTree(e,t,i,r,o){const s=new Pye(i),a=r.map(c=>new Jgr(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=emr(o)||{};return new att(e,t,s,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=h=>this.identityProvider.getId(h).toString(),r=h=>{const f=new Set;for(const g of h){const m=this.tree.getCompressedTreeNode(g===this.root?null:g);if(m.element)for(const v of m.element.elements)f.add(i(v.element))}return f},o=r(this.tree.getSelection()),s=r(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let u=!1;const d=h=>{const f=h.element;if(f)for(let g=0;g<f.elements.length;g++){const m=i(f.elements[g].element),v=f.elements[f.elements.length-1].element;o.has(m)&&a.indexOf(v)===-1&&(a.push(v),l=!0),s.has(m)&&c.indexOf(v)===-1&&(c.push(v),u=!0)}h.children.forEach(d)};d(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),u&&this.setFocus(c)}processChildren(e){return this.filter&&(e=tr.filter(e,t=>{const i=this.filter.filter(t,1),r=nmr(i);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function nmr(n){return typeof n=="boolean"?n?1:0:Oye(n)?s5(n.visibility):s5(n)}class imr extends rtt{constructor(e,t,i,r,o,s={}){super(e,t,i,r,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new Mye(e,t,i)}}new sn("isMac",mr,T("isMac","Whether the operating system is macOS"));new sn("isLinux",Zu,T("isLinux","Whether the operating system is Linux"));const eY=new sn("isWindows",eu,T("isWindows","Whether the operating system is Windows")),utt=new sn("isWeb",lE,T("isWeb","Whether the platform is a web browser"));new sn("isMacNative",mr&&!lE,T("isMacNative","Whether the operating system is macOS on a non-browser platform"));new sn("isIOS",vv,T("isIOS","Whether the operating system is iOS"));new sn("isMobile",xZi,T("isMobile","Whether the platform is a mobile web browser"));new sn("isDevelopment",!1,!0);new sn("productQualityType","",T("productQualityType","Quality type of VS Code"));const dtt="inputFocus";new sn(dtt,!1,T("inputFocus","Whether keyboard focus is inside an input box"));var F1=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fs=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Mg=or("listService");class rmr{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new mt,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new Uet(vg(),"").style(aI)),this.lists.some(r=>r.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),km(e.onDidFocus(()=>this.setLastFocusedList(e)),mi(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(r=>r!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const c5=new sn("listScrollAtBoundary","none");at.or(c5.isEqualTo("top"),c5.isEqualTo("both"));at.or(c5.isEqualTo("bottom"),c5.isEqualTo("both"));const htt=new sn("listFocus",!0),tY=new sn("listSupportsMultiselect",!0),ftt=at.and(htt,at.not(dtt)),Hye=new sn("listHasSelectionOrFocus",!1),Wye=new sn("listDoubleSelection",!1),zye=new sn("listMultiSelection",!1),nY=new sn("listSelectionNavigation",!1),omr=new sn("listSupportsFind",!0),Uye=new sn("treeElementCanCollapse",!1),smr=new sn("treeElementHasParent",!1),jye=new sn("treeElementCanExpand",!1),amr=new sn("treeElementHasChild",!1),lmr=new sn("treeFindOpen",!1),ptt="listTypeNavigationMode",gtt="listAutomaticKeyboardNavigation";function iY(n,e){const t=n.createScoped(e.getHTMLElement());return htt.bindTo(t),t}function rY(n,e){const t=c5.bindTo(n),i=()=>{const r=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;r&&o?t.set("both"):r?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const lI="workbench.list.multiSelectModifier",cV="workbench.list.openMode",cg="workbench.list.horizontalScrolling",qye="workbench.list.defaultFindMode",Kye="workbench.list.typeNavigationMode",Qz="workbench.list.keyboardNavigation",Cv="workbench.list.scrollByPage",Gye="workbench.list.defaultFindMatchType",u5="workbench.tree.indent",Xz="workbench.tree.renderIndentGuides",wv="workbench.list.smoothScrolling",p0="workbench.list.mouseWheelScrollSensitivity",g0="workbench.list.fastScrollSensitivity",Zz="workbench.tree.expandMode";function m0(n){return n.getValue(lI)==="alt"}class cmr extends Ue{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=m0(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(lI)&&(this.useAltAsMultipleSelectionModifier=m0(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Het(e)}isSelectionRangeChangeEvent(e){return Wet(e)}}function oY(n,e){var t;const i=n.get(dr),r=n.get(Qo),o=new mt;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(wv),mouseWheelScrollSensitivity:i.getValue(p0),fastScrollSensitivity:i.getValue(g0),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new cmr(i)),keyboardNavigationEventFilter:hmr(r),scrollByPage:!!i.getValue(Cv)}),o]}let Pue=class extends n_{constructor(e,t,i,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(cg),[d,h]=c.invokeFunction(oY,o);super(e,t,i,r,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables.add(h),this.contextKeyService=iY(s,this),this.disposables.add(rY(this.contextKeyService,this)),this.listSupportsMultiSelect=tY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),nY.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=Hye.bindTo(this.contextKeyService),this.listDoubleSelection=Wye.bindTo(this.contextKeyService),this.listMultiSelection=zye.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=m0(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||m.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||m.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(lI)&&(this._useAltAsMultipleSelectionModifier=m0(l));let m={};if(g.affectsConfiguration(cg)&&this.horizontalScrolling===void 0){const v=!!l.getValue(cg);m=Object.assign(Object.assign({},m),{horizontalScrolling:v})}if(g.affectsConfiguration(Cv)){const v=!!l.getValue(Cv);m=Object.assign(Object.assign({},m),{scrollByPage:v})}if(g.affectsConfiguration(wv)){const v=!!l.getValue(wv);m=Object.assign(Object.assign({},m),{smoothScrolling:v})}if(g.affectsConfiguration(p0)){const v=l.getValue(p0);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(g0)){const v=l.getValue(g0);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:v})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new mtt(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?cR(e):aI)}};Pue=F1([fs(5,vi),fs(6,Mg),fs(7,dr),fs(8,di)],Pue);let SMe=class extends pgr{constructor(e,t,i,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(cg),[d,h]=c.invokeFunction(oY,o);super(e,t,i,r,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables=new mt,this.disposables.add(h),this.contextKeyService=iY(s,this),this.disposables.add(rY(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=tY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),nY.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=m0(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(lI)&&(this._useAltAsMultipleSelectionModifier=m0(l));let m={};if(g.affectsConfiguration(cg)&&this.horizontalScrolling===void 0){const v=!!l.getValue(cg);m=Object.assign(Object.assign({},m),{horizontalScrolling:v})}if(g.affectsConfiguration(Cv)){const v=!!l.getValue(Cv);m=Object.assign(Object.assign({},m),{scrollByPage:v})}if(g.affectsConfiguration(wv)){const v=!!l.getValue(wv);m=Object.assign(Object.assign({},m),{smoothScrolling:v})}if(g.affectsConfiguration(p0)){const v=l.getValue(p0);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(g0)){const v=l.getValue(g0);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:v})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new mtt(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?cR(e):aI)}dispose(){this.disposables.dispose(),super.dispose()}};SMe=F1([fs(5,vi),fs(6,Mg),fs(7,dr),fs(8,di)],SMe);let EMe=class extends JG{constructor(e,t,i,r,o,s,a,l,c,u){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!c.getValue(cg),[h,f]=u.invokeFunction(oY,s);super(e,t,i,r,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables.add(f),this.contextKeyService=iY(a,this),this.disposables.add(rY(this.contextKeyService,this)),this.listSupportsMultiSelect=tY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),nY.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=Hye.bindTo(this.contextKeyService),this.listDoubleSelection=Wye.bindTo(this.contextKeyService),this.listMultiSelection=zye.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=m0(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||v.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(m=>{m.affectsConfiguration(lI)&&(this._useAltAsMultipleSelectionModifier=m0(c));let v={};if(m.affectsConfiguration(cg)&&this.horizontalScrolling===void 0){const _=!!c.getValue(cg);v=Object.assign(Object.assign({},v),{horizontalScrolling:_})}if(m.affectsConfiguration(Cv)){const _=!!c.getValue(Cv);v=Object.assign(Object.assign({},v),{scrollByPage:_})}if(m.affectsConfiguration(wv)){const _=!!c.getValue(wv);v=Object.assign(Object.assign({},v),{smoothScrolling:_})}if(m.affectsConfiguration(p0)){const _=c.getValue(p0);v=Object.assign(Object.assign({},v),{mouseWheelScrollSensitivity:_})}if(m.affectsConfiguration(g0)){const _=c.getValue(g0);v=Object.assign(Object.assign({},v),{fastScrollSensitivity:_})}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new umr(this,Object.assign({configurationService:c},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?cR(e):aI)}dispose(){this.disposables.dispose(),super.dispose()}};EMe=F1([fs(6,vi),fs(7,Mg),fs(8,dr),fs(9,di)],EMe);class Yye extends Ue{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new Le),this.onDidOpen=this._onDidOpen.event,this._register(nn.filter(this.widget.onDidChangeSelection,r=>r.browserEvent instanceof KeyboardEvent)(r=>this.onSelectionFromKeyboard(r))),this._register(this.widget.onPointer(r=>this.onPointer(r.element,r.browserEvent))),this._register(this.widget.onMouseDblClick(r=>this.onMouseDblClick(r.element,r.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(cV))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(cV)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(cV))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,r=typeof t.pinned=="boolean"?t.pinned:!i,o=!1;this._open(this.getSelectedElement(),i,r,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const r=t.button===1,o=!0,s=r,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}_open(e,t,i,r,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:o})}}class mtt extends Yye{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class umr extends Yye{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class dmr extends Yye{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function hmr(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let xMe=class extends Bye{constructor(e,t,i,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(H6,o);super(e,t,i,r,u),this.disposables.add(h),this.internals=new sk(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};xMe=F1([fs(5,di),fs(6,vi),fs(7,Mg),fs(8,dr)],xMe);let TMe=class extends att{constructor(e,t,i,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(H6,o);super(e,t,i,r,u),this.disposables.add(h),this.internals=new sk(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};TMe=F1([fs(5,di),fs(6,vi),fs(7,Mg),fs(8,dr)],TMe);let kMe=class extends imr{constructor(e,t,i,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(H6,s);super(e,t,i,r,o,d),this.disposables.add(f),this.internals=new sk(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};kMe=F1([fs(6,di),fs(7,vi),fs(8,Mg),fs(9,dr)],kMe);let Mue=class extends ctt{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(H6,s);super(e,t,i,r,o,d),this.disposables.add(f),this.internals=new sk(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Mue=F1([fs(6,di),fs(7,vi),fs(8,Mg),fs(9,dr)],Mue);let IMe=class extends tmr{constructor(e,t,i,r,o,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(H6,a);super(e,t,i,r,o,s,h),this.disposables.add(g),this.internals=new sk(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};IMe=F1([fs(7,di),fs(8,vi),fs(9,Mg),fs(10,dr)],IMe);function _tt(n){const e=n.getValue(qye);if(e==="highlight")return Vb.Highlight;if(e==="filter")return Vb.Filter;const t=n.getValue(Qz);if(t==="simple"||t==="highlight")return Vb.Highlight;if(t==="filter")return Vb.Filter}function vtt(n){const e=n.getValue(Gye);if(e==="fuzzy")return ok.Fuzzy;if(e==="contiguous")return ok.Contiguous}function H6(n,e){var t;const i=n.get(dr),r=n.get(P1),o=n.get(vi),s=n.get(di),a=()=>{const f=o.getContextKeyValue(ptt);if(f==="automatic")return wb.Automatic;if(f==="trigger"||o.getContextKeyValue(gtt)===!1)return wb.Trigger;const m=i.getValue(Kye);if(m==="automatic")return wb.Automatic;if(m==="trigger")return wb.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(cg),[c,u]=s.invokeFunction(oY,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(Xz);return{getTypeNavigationMode:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(u5)=="number"?i.getValue(u5):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(wv),defaultFindMode:_tt(i),defaultFindMatchType:vtt(i),horizontalScrolling:l,scrollByPage:!!i.getValue(Cv),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(Zz)==="doubleClick",contextViewProvider:r,findWidgetStyles:Kpr})}}let sk=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,r,o,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=iY(o,e),this.disposables.push(rY(this.contextKeyService,e)),this.listSupportsMultiSelect=tY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),nY.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=omr.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=Hye.bindTo(this.contextKeyService),this.hasDoubleSelection=Wye.bindTo(this.contextKeyService),this.hasMultiSelection=zye.bindTo(this.contextKeyService),this.treeElementCanCollapse=Uye.bindTo(this.contextKeyService),this.treeElementHasParent=smr.bindTo(this.contextKeyService),this.treeElementCanExpand=jye.bindTo(this.contextKeyService),this.treeElementHasChild=amr.bindTo(this.contextKeyService),this.treeFindOpen=lmr.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=m0(a),this.updateStyleOverrides(r);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(ptt),d.add(gtt),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(lI)&&(this._useAltAsMultipleSelectionModifier=m0(a)),h.affectsConfiguration(u5)){const g=a.getValue(u5);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(Xz)&&t.renderIndentGuides===void 0){const g=a.getValue(Xz);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(wv)){const g=!!a.getValue(wv);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(qye)||h.affectsConfiguration(Qz)){const g=_tt(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(Kye)||h.affectsConfiguration(Qz)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(Gye)){const g=vtt(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(cg)&&t.horizontalScrolling===void 0){const g=!!a.getValue(cg);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(Cv)){const g=!!a.getValue(Cv);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(Zz)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(Zz)==="doubleClick"})),h.affectsConfiguration(p0)){const g=a.getValue(p0);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(g0)){const g=a.getValue(g0);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new dmr(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?cR(e):aI)}dispose(){this.disposables=mo(this.disposables)}};sk=F1([fs(4,vi),fs(5,Mg),fs(6,dr)],sk);const fmr=Hs.as(Nv.Configuration);fmr.registerConfiguration({id:"workbench",order:7,title:T("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[lI]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[T("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),T("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:T({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[cV]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:T({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[cg]:{type:"boolean",default:!1,description:T("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Cv]:{type:"boolean",default:!1,description:T("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[u5]:{type:"number",default:8,minimum:4,maximum:40,description:T("tree indent setting","Controls tree indentation in pixels.")},[Xz]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:T("render tree indent guides","Controls whether the tree should render indent guides.")},[wv]:{type:"boolean",default:!1,description:T("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[p0]:{type:"number",default:1,markdownDescription:T("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[g0]:{type:"number",default:5,markdownDescription:T("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[qye]:{type:"string",enum:["highlight","filter"],enumDescriptions:[T("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),T("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:T("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[Qz]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[T("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),T("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),T("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:T("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:T("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[Gye]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[T("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),T("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:T("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[Zz]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:T("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Kye]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:T("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var Fue;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(Fue||(Fue={}));const cI={Quickaccess:"workbench.contributions.quickaccess"};class pmr{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),mi(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return s0([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Hs.add(cI.Quickaccess,new pmr);const gmr={ctrlCmd:!1,alt:!1};var d5;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(d5||(d5={}));var A_;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(A_||(A_={}));const Rv=or("quickInputService");var mmr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},LMe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Bue=class extends Ue{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Hs.as(cI.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var r;const[o,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,i);return}if(s&&!(i!=null&&i.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===Fue.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new mt,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,i),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(u.itemActivation=(r=i==null?void 0:i.itemActivation)!==null&&r!==void 0?r:A_.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new vG,c.add(nn.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,o,s,e,i==null?void 0:i.providerOptions));const h=c.add(new Va);if(o&&c.add(o.provide(u,h.token,i==null?void 0:i.providerOptions)),nn.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,i){var r;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(r=t==null?void 0:t.prefix.length)!==null&&r!==void 0?r:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,r,o){const s=new mt,a=this.visibleQuickAccess={picker:e,descriptor:i,value:r};return s.add(mi(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),i&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};Bue=mmr([LMe(0,Rv),LMe(1,di)],Bue);ze.white.toString(),ze.white.toString();class $ue extends Ue{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new Le),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,r=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=r||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(Zo.addTarget(this._element)),[Yt.CLICK,Jo.Tap].forEach(o=>{this._register(tt(this._element,o,s=>{if(!this.enabled){zi.stop(s);return}this._onDidClick.fire(s)}))}),this._register(tt(this._element,Yt.KEY_DOWN,o=>{const s=new hs(o);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(o),a=!0):s.equals(9)&&(this._element.blur(),a=!0),a&&zi.stop(s,!0)})),this._register(tt(this._element,Yt.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(tt(this._element,Yt.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(c0(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of Hw(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const r=document.createElement("span");r.textContent=i,t.push(r)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Vw(this._label)&&Vw(e)&&Mfr(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(Vw(e)){const r=YG(e,{inline:!0});r.dispose();const o=(t=r.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const s=tZe(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=s}else Lc(i)}else this.options.supportIcons?Lc(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=Xfr(e)),this._label=e}get label(){return this._label}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}class Vue{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=lt(e,kt(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=GT(this.countFormat,this.count),this.element.title=GT(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const DMe="done",AMe="active",Kte="infinite",Gte="infinite-long-running",NMe="discrete";class sY extends Ue{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new $o(()=>Mh(this.element),0)),this.longRunningScheduler=this._register(new $o(()=>this.infiniteLongRunning(),sY.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(AMe,Kte,Gte,NMe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(DMe),this.element.classList.contains(Kte)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(NMe,DMe,Gte),this.element.classList.add(AMe,Kte),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(Gte)}getContainer(){return this.element}}sY.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const _mr=kt;class vmr extends Ue{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>tt(this.findInput.inputBox.inputElement,Yt.KEY_DOWN,s=>{o(new hs(s))}),this.onMouseDown=o=>tt(this.findInput.inputBox.inputElement,Yt.MOUSE_DOWN,s=>{o(new Zp(s))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=lt(this.parent,_mr(".quick-input-box")),this.findInput=this._register(new itt(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const r=this.findInput.inputBox.inputElement;r.role="combobox",r.ariaHasPopup="menu",r.ariaAutoComplete="list",r.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===Sa.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Sa.Info?1:e===Sa.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Sa.Info?1:e===Sa.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class zw{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=lt(e,kt("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",r){e||(e=""),r&&(e=zw.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&jf(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const s=this.text.substring(t,i.start);this.supportIcons?e.push(...Hw(s)):e.push(s),t=i.start}const r=this.text.substring(t,i.end),o=kt("span.highlight",void 0,...this.supportIcons?Hw(r):[r]);i.extraClasses&&o.classList.add(...i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);this.supportIcons?e.push(...Hw(i)):e.push(i)}Lc(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,r=0;return e.replace(/\r\n|\r|\n/g,(o,s)=>{r=o===`\r `?-1:0,s+=i;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=r),a.end>=s&&(a.end+=r));return i+=r,"⏎"})}}class Yte{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class Jz extends Ue{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Yte(lt(e,kt(".monaco-icon-label")))),this.labelContainer=lt(this.domNode.element,kt(".monaco-icon-label-container"));const i=lt(this.labelContainer,kt("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new Cmr(i,!!t.supportIcons):this.nameNode=new bmr(i),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const r=["monaco-icon-label"],o=["monaco-icon-label-container"];let s="";if(i&&(i.extraClasses&&r.push(...i.extraClasses),i.italic&&r.push("italic"),i.strikethrough&&r.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(s+=i.title)),this.domNode.className=r.join(" "),this.domNode.element.setAttribute("aria-label",s),this.labelContainer.className=o.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof zw?(a.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(a.element,i==null?void 0:i.descriptionTitle)):(a.textContent=t&&(i!=null&&i.labelEscapeNewLines)?zw.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(i==null?void 0:i.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)$fr(e,t);else{const r=Fet(this.hoverDelegate,e,t);r&&this.customHovers.set(e,r)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new Yte(lt(this.labelContainer,kt("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new zw(lt(t.element,kt("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new Yte(lt(t.element,kt("span.label-description"))))}return this.descriptionNode}}class bmr{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&jf(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=lt(this.container,kt("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const r=e[i],o=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${i}`;lt(this.container,kt("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},r)),i<e.length-1&<(this.container,kt("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function ymr(n,e,t){if(!t)return;let i=0;return n.map(r=>{const o={start:i,end:i+r.length},s=t.map(a=>cu.intersect(o,a)).filter(a=>!cu.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,s})}class Cmr{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&jf(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new zw(lt(this.container,kt("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",r=ymr(e,i,t==null?void 0:t.matches);for(let o=0;o<e.length;o++){const s=e[o],a=r?r[o]:void 0,l=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${o}`,c=kt("a.label-name",{id:l,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new zw(lt(this.container,c),{supportIcons:this.supportIcons}).set(s,a,void 0,t==null?void 0:t.labelEscapeNewLines),o<e.length-1&<(c,kt("span.label-separator",void 0,i))}}}}const c7=kt,wmr={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class W6{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const r=this.options.keybindingLabelForeground;this.domNode=lt(e,c7(".monaco-keybinding")),r&&(this.domNode.style.color=r),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&W6.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){var e;if(this.clear(),this.keybinding){const t=this.keybinding.getChords();t[0]&&this.renderChord(this.domNode,t[0],this.matches?this.matches.firstPart:null);for(let r=1;r<t.length;r++)lt(this.domNode,c7("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,t[r],this.matches?this.matches.chordPart:null);const i=(e=this.options.disableTitle)!==null&&e!==void 0&&e?void 0:this.keybinding.getAriaLabel()||void 0;i!==void 0?this.domNode.title=i:this.domNode.removeAttribute("title")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){Ic(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const r=vye.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,r.ctrlKey,!!(i!=null&&i.ctrlKey),r.separator),t.shiftKey&&this.renderKey(e,r.shiftKey,!!(i!=null&&i.shiftKey),r.separator),t.altKey&&this.renderKey(e,r.altKey,!!(i!=null&&i.altKey),r.separator),t.metaKey&&this.renderKey(e,r.metaKey,!!(i!=null&&i.metaKey),r.separator);const o=t.keyLabel;o&&this.renderKey(e,o,!!(i!=null&&i.keyCode),"")}renderKey(e,t,i,r){lt(e,this.createKeyElement(t,i?".highlight":"")),r&<(e,c7("span.monaco-keybinding-key-separator",void 0,r))}renderUnbound(e){lt(e,this.createKeyElement(T("unbound","Unbound")))}createKeyElement(e,t=""){const i=c7("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),i}static areSame(e,t){return e===t||!e&&!t?!0:!!e&&!!t&&jf(e.firstPart,t.firstPart)&&jf(e.chordPart,t.chordPart)}}const RMe=new dE(()=>{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function Smr(n,e,t=!1){const i=n||"",r=e||"",o=RMe.value.collator.compare(i,r);return RMe.value.collatorIsNumeric&&o===0&&i!==r?i<r?-1:1:o}function Emr(n,e,t){const i=n.toLowerCase(),r=e.toLowerCase(),o=xmr(n,e,t);if(o)return o;const s=i.endsWith(t),a=r.endsWith(t);if(s!==a)return s?-1:1;const l=Smr(i,r);return l!==0?l:i.localeCompare(r)}function xmr(n,e,t){const i=n.toLowerCase(),r=e.toLowerCase(),o=i.startsWith(t),s=r.startsWith(t);if(o!==s)return o?-1:1;if(o&&s){if(i.length<r.length)return-1;if(i.length>r.length)return 1}return 0}var Tmr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class btt{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Tmr([Wa],btt.prototype,"toString",null);const kmr=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function Imr(n){const e=[];let t=0,i;for(;i=kmr.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,r,o,,s]=i;s?e.push({label:r,href:o,title:s}):e.push({label:r,href:o}),t=i.index+i[0].length}return t<n.length&&e.push(n.substring(t)),new btt(e)}const Qte={},Lmr=new Iye("quick-input-button-icon-");function Hue(n){if(!n)return;let e;const t=n.dark.toString();return Qte[t]?e=Qte[t]:(e=Lmr.nextId(),oce(`.${e}, .hc-light .${e}`,`background-image: ${_S(n.light||n.dark)}`),oce(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${_S(n.dark)}`),Qte[t]=e),e}function Dmr(n,e,t){Lc(e);const i=Imr(n);let r=0;for(const o of i.nodes)if(typeof o=="string")e.append(...Hw(o));else{let s=o.title;!s&&o.href.startsWith("command:")?s=T("executeCommand","Click to execute command '{0}'",o.href.substring(8)):s||(s=o.href);const a=kt("a",{href:o.href,title:s,tabIndex:r++},o.label);a.style.textDecoration="underline";const l=f=>{Htr(f)&&zi.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new ar(a,Yt.CLICK)).event,u=t.disposables.add(new ar(a,Yt.KEY_DOWN)).event,d=nn.chain(u,f=>f.filter(g=>{const m=new hs(g);return m.equals(10)||m.equals(3)}));t.disposables.add(Zo.addTarget(a));const h=t.disposables.add(new ar(a,Jo.Tap)).event;nn.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var ytt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OMe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const y_=kt;class Amr{constructor(e,t,i,r,o,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=r,this.index=i,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=r?nn.map(nn.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):nn.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new dE(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=kP(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(m=>Pfr(m)).filter(m=>!!m).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class z6{constructor(e){this.themeService=e}get templateId(){return z6.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=lt(e,y_(".quick-input-list-entry"));const i=lt(t.entry,y_("label.quick-input-list-label"));t.toDisposeTemplate.push($a(i,Yt.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=lt(i,y_("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push($a(t.checkbox,Yt.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const r=lt(i,y_(".quick-input-list-rows")),o=lt(r,y_(".quick-input-list-row")),s=lt(r,y_(".quick-input-list-row"));t.label=new Jz(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=uZe(t.label.element,y_(".quick-input-list-icon"));const a=lt(o,y_(".quick-input-list-entry-keybinding"));t.keybinding=new W6(a,Pf);const l=lt(s,y_(".quick-input-list-label-meta"));return t.detail=new Jz(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=lt(t.entry,y_(".quick-input-list-separator")),t.actionBar=new wg(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var r,o,s,a;i.element=e,e.element=(r=i.entry)!==null&&r!==void 0?r:void 0;const l=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(g=>i.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const g=OA(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,m=Yn.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=_S(m)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:u||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,h),i.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:d,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(i.actionBar.push(f.map((g,m)=>{let v=g.iconClass||(g.iconPath?Hue(g.iconPath):void 0);return g.alwaysVisible&&(v=v?`${v} always-visible`:"always-visible"),{id:`id-${m}`,class:v,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=mo(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=mo(e.toDisposeElement),e.toDisposeTemplate=mo(e.toDisposeTemplate)}}z6.ID="listelement";class Nmr{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return z6.ID}}var Ql;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage"})(Ql||(Ql={}));class Qye{constructor(e,t,i,r){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new Le,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new Le,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new Le,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new Le,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new Le,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new Le,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new Le,this.onKeyDown=this._onKeyDown.event,this._onLeave=new Le,this.onLeave=this._onLeave.event,this._listElementChecked=new Le,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=lt(this.parent,y_(".quick-input-list"));const o=new Nmr,s=new Pmr;if(this.list=i.createList("QuickInput",this.container,o,[new z6(r)],{identityProvider:{getId:a=>{var l,c,u,d,h,f,g,m;return(m=(f=(d=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(u=a.item)===null||u===void 0?void 0:u.label)!==null&&d!==void 0?d:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.label)!==null&&m!==void 0?m:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new hs(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(mr?a.metaKey:a.ctrlKey)&&this.list.setFocus(hd(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(tt(this.container,Yt.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),i.hoverDelegate){const a=new bZe(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>OMe(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Qc(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>OMe(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(u){if(!Dv(u))throw u}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;Qc(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return nn.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return nn.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.hidden)if(o.checked)t=!0;else return!1}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,r=t.length;i<r;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,r=t.length;i<r;i++)t[i].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach(t=>{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=mo(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),i=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const r=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new Amr(a,u,l,o,t,i,this._listElementChecked),h=s.length;return s.push(d),r.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=r,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Ql.Second&&this.list.length<2&&(e=Ql.First),e){case Ql.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case Ql.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case Ql.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case Ql.Next:{this.list.focusNext(void 0,!0,void 0,r=>!!r.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case Ql.Previous:{this.list.focusPrevious(void 0,!0,void 0,r=>!!r.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case Ql.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case Ql.PreviousPage:this.list.focusPreviousPage(void 0,i=>!!i.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,r;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.options.hoverDelegate).onDidHideHover)===null||i===void 0||i.call(t),(r=this._lastHover)===null||r===void 0||r.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const o=r.index&&this.inputElements[r.index-1];r.item&&(r.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let r;this.elements.forEach(o=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=Pte(e,kP(o.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=Rmr(t,kP(o.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=Pte(e,kP(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=Pte(e,kP(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(o.labelHighlights=u,o.descriptionHighlights=d,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];r=f&&f.type==="separator"?f:r,r&&!o.hidden&&(o.separator=r,r=void 0)}})}const i=this.elements.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();i.sort((o,s)=>Omr(o,s,r))}return this.elementsToIndexes=i.reduce((r,o,s)=>{var a;return r.set((a=o.item)!==null&&a!==void 0?a:o.separator,s),r},new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=mo(this.elementDisposables),this.disposables=mo(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new mt;i.add(this.list.onDidChangeFocus(r=>{r.indexes.length&&this.showHover(r.elements[0])})),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}ytt([Wa],Qye.prototype,"onDidChangeFocus",null);ytt([Wa],Qye.prototype,"onDidChangeSelection",null);function Rmr(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return PMe(n,t);const r=b6(t," "),o=t.length-r.length,s=PMe(n,r);if(s)for(const a of s){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return s}function PMe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function Omr(n,e,t){const i=n.labelHighlights||[],r=e.labelHighlights||[];return i.length&&!r.length?-1:!i.length&&r.length?1:i.length===0&&r.length===0?0:Emr(n.saneSortLabel,e.saneSortLabel,t)}class Pmr{getWidgetAriaLabel(){return T("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var MMe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Wue={iconClass:Qn.asClassName(Ht.quickInputBack),tooltip:T("quickInput.back","Back"),handle:-1};class U6 extends Ue{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=U6.noPromptMessage,this._severity=Sa.Ignore,this.onDidTriggerButtonEmitter=this._register(new Le),this.onDidHideEmitter=this._register(new Le),this.onDisposeEmitter=this._register(new Le),this.visibleDisposables=this._register(new mt),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!vv;this._ignoreFocusOut=e&&!vv,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=d5.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const r=this.getDescription();if(this.ui.description1.textContent!==r&&(this.ui.description1.textContent=r),this.ui.description2.textContent!==r&&(this.ui.description2.textContent=r),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Lc(this.ui.widget,this._widget):Lc(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Zm,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(l=>l===Wue);this.ui.leftActionBar.push(s.map((l,c)=>{const u=new Pd(`id-${c}`,"",l.iconClass||Hue(l.iconPath),!0,()=>MMe(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==Wue);this.ui.rightActionBar.push(a.map((l,c)=>{const u=new Pd(`id-${c}`,"",l.iconClass||Hue(l.iconPath),!0,()=>MMe(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof dR))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,Lc(this.ui.message),Dmr(o,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?T("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Sa.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}U6.noPromptMessage=T("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class h5 extends U6{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new Le),this.onWillAcceptEmitter=this._register(new Le),this.onDidAcceptEmitter=this._register(new Le),this.onDidCustomEmitter=this._register(new Le),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=A_.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new Le),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new Le),this.onDidTriggerItemButtonEmitter=this._register(new Le),this.onDidTriggerSeparatorButtonEmitter=this._register(new Le),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?gmr:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Ql.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Ql.Next),this.canSelectMany&&this.ui.list.domFocus(),zi.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Ql.Previous):this.ui.list.focus(Ql.Last),this.canSelectMany&&this.ui.list.domFocus(),zi.stop(e,!0);break;case 12:this.ui.list.focus(Ql.NextPage),this.canSelectMany&&this.ui.list.domFocus(),zi.stop(e,!0);break;case 11:this.ui.list.focus(Ql.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),zi.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ql.First),zi.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ql.Last),zi.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ia(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ia(e,this._selectedItems,(i,r)=>i===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ia(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return tt(this.ui.container,Yt.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new hs(e),i=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let r=this.ariaLabel;if(!r&&i.inputBox&&(r=this.placeholder||h5.DEFAULT_ARIA_LABEL,this.title&&(r+=` - ${this.title}`)),this.ui.list.ariaLabel!==r&&(this.ui.list.ariaLabel=r??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case A_.NONE:this._itemActivation=A_.FIRST;break;case A_.SECOND:this.ui.list.focus(Ql.Second),this._itemActivation=A_.FIRST;break;case A_.LAST:this.ui.list.focus(Ql.Last),this._itemActivation=A_.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Ql.First)),this.keepScrollPosition&&(this.scrollTop=e)}}h5.DEFAULT_ARIA_LABEL=T("quickInputBox.ariaLabel","Type to narrow down results.");class Mmr extends U6{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new Le),this.onDidAcceptEmitter=this._register(new Le),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Lh=kt;class aY extends Ue{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new Le),this.onDidCustomEmitter=this._register(new Le),this.onDidTriggerButtonEmitter=this._register(new Le),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new Le),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new Le),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(tt(window,Yt.KEY_DOWN,e,!0)),this._register(tt(window,Yt.KEY_UP,e,!0)),this._register(tt(window,Yt.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=lt(this.parentElement,Lh(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=vg(e),i=lt(e,Lh(".quick-input-titlebar")),r=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new wg(i,r));o.domNode.classList.add("quick-input-left-action-bar");const s=lt(i,Lh(".quick-input-title")),a=this._register(new wg(i,r));a.domNode.classList.add("quick-input-right-action-bar");const l=lt(e,Lh(".quick-input-header")),c=lt(l,Lh("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",T("quickInput.checkAll","Toggle all checkboxes")),this._register($a(c,Yt.CHANGE,F=>{const B=c.checked;O.setAllVisibleChecked(B)})),this._register(tt(c,Yt.CLICK,F=>{(F.x||F.y)&&f.setFocus()}));const u=lt(l,Lh(".quick-input-description")),d=lt(l,Lh(".quick-input-and-message")),h=lt(d,Lh(".quick-input-filter")),f=this._register(new vmr(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=lt(h,Lh(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new Vue(g,{countFormat:T({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),v=lt(h,Lh(".quick-input-count"));v.setAttribute("aria-live","polite");const _=new Vue(v,{countFormat:T({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),b=lt(l,Lh(".quick-input-action")),y=this._register(new $ue(b,this.styles.button));y.label=T("ok","OK"),this._register(y.onDidClick(F=>{this.onDidAcceptEmitter.fire()}));const C=lt(l,Lh(".quick-input-action")),x=this._register(new $ue(C,this.styles.button));x.label=T("custom","Custom"),this._register(x.onDidClick(F=>{this.onDidCustomEmitter.fire()}));const E=lt(d,Lh(`#${this.idPrefix}message.quick-input-message`)),k=this._register(new sY(e,this.styles.progressBar));k.getContainer().classList.add("quick-input-progress");const L=lt(e,Lh(".quick-input-html-widget"));L.tabIndex=-1;const D=lt(e,Lh(".quick-input-description")),A=this.idPrefix+"list",O=this._register(new Qye(e,A,this.options,this.themeService));f.setAttribute("aria-controls",A),this._register(O.onDidChangeFocus(()=>{var F;f.setAttribute("aria-activedescendant",(F=O.getActiveDescendant())!==null&&F!==void 0?F:"")})),this._register(O.onChangedAllVisibleChecked(F=>{c.checked=F})),this._register(O.onChangedVisibleCount(F=>{m.setCount(F)})),this._register(O.onChangedCheckedCount(F=>{_.setCount(F)})),this._register(O.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof h5&&this.controller.canSelectMany&&O.clearFocus()},0)}));const P=c0(e);return this._register(P),this._register(tt(e,Yt.FOCUS,F=>{Qc(F.relatedTarget,e)||(this.previousFocusElement=F.relatedTarget instanceof HTMLElement?F.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(d5.Blur),this.previousFocusElement=void 0})),this._register(tt(e,Yt.FOCUS,F=>{f.setFocus()})),this._register($a(e,Yt.KEY_DOWN,F=>{if(!Qc(F.target,L))switch(F.keyCode){case 3:zi.stop(F,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:zi.stop(F,!0),this.hide(d5.Gesture);break;case 2:if(!F.altKey&&!F.ctrlKey&&!F.metaKey){const B=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?B.push("input"):B.push("input[type=text]"),this.getUI().list.isDisplayed()&&B.push(".monaco-list"),this.getUI().message&&B.push(".quick-input-message a"),this.getUI().widget){if(Qc(F.target,this.getUI().widget))break;B.push(".quick-input-html-widget")}const M=e.querySelectorAll(B.join(", "));F.shiftKey&&F.target===M[0]?(zi.stop(F,!0),O.clearFocus()):!F.shiftKey&&Qc(F.target,M[M.length-1])&&(zi.stop(F,!0),M[0].focus())}break;case 10:F.ctrlKey&&(zi.stop(F,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:s,description1:D,description2:u,widget:L,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:m,countContainer:v,count:_,okContainer:b,ok:y,message:E,customButtonContainer:C,customButton:x,list:O,progressBar:k,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:F=>this.show(F),hide:()=>this.hide(),setVisibilities:F=>this.setVisibilities(F),setEnabled:F=>this.setEnabled(F),setContextKey:F=>this.options.setContextKey(F),linkOpenerDelegate:F=>this.options.linkOpenerDelegate(F)},this.updateStyles(),this.ui}pick(e,t={},i=nr.None){return new Promise((r,o)=>{let s=u=>{var d;s=r,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),r(u)};if(i.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},u),{removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),f=h.splice(d,1),g=a.activeItems.filter(v=>v!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=m}}}))),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{mo(c),s(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{o(u),a.hide()})})}createQuickPick(){const e=this.getUI();return new h5(e)}createInputBox(){const e=this.getUI();return new Mmr(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",Lc(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Sa.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Lc(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const r=this.options.backKeybindingLabel();Wue.tooltip=r?T("quickInput.backWithKeybinding","Back ({0})",r):T("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,r;const o=this.controller;if(!o)return;const s=!Qc(document.activeElement,(i=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&i!==void 0?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(r=a.parentElement)!==null&&r!==void 0?r:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,aY.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:r,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=r?`1px solid ${r}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(` `);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}aY.MAX_WIDTH=600;var Fmr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},u7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let zue=class extends gar{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Bue))),this._quickAccess}constructor(e,t,i,r){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this._onShow=this._register(new Le),this._onHide=this._register(new Le),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(s=>{s.get(rf).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,s,a,l,c)=>this.instantiationService.createInstance(Pue,o,s,a,l,c),styles:this.computeStyles()},r=this._register(new aY(Object.assign(Object.assign({},i),t),this.themeService));return r.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(o=>r.layout(o,e.offset.quickPickTop))),this._register(r.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(r.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new sn(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=nr.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:an(TOe),quickInputForeground:an(Cor),quickInputTitleBackground:an(wor),widgetBorder:an(P0e),widgetShadow:an(Rb)},inputBox:Hz,toggle:Vz,countBadge:qet,button:jpr,progressBar:qpr,keybindingLabel:Upr,list:cR({listBackground:TOe,listFocusBackground:Gx,listFocusForeground:Kx,listInactiveFocusForeground:Kx,listInactiveSelectionIconForeground:uL,listInactiveFocusBackground:Gx,listFocusOutline:ys,listInactiveFocusOutline:ys}),pickerGroup:{pickerGroupBorder:an(Sor),pickerGroupForeground:an(eJe)}}}};zue=Fmr([u7(0,di),u7(1,vi),u7(2,Hl),u7(3,lR)],zue);var Ctt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},SL=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Uue=class extends zue{constructor(e,t,i,r,o){super(t,i,r,new Qce(e.getContainerDomNode(),o)),this.host=void 0;const s=jA.get(e);if(s){const a=s.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};Uue=Ctt([SL(1,di),SL(2,vi),SL(3,Hl),SL(4,eo)],Uue);let jue=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(Uue,e);this.mapEditorToService.set(e,t),gS(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=nr.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};jue=Ctt([SL(0,di),SL(1,eo)],jue);class jA{static get(e){return e.getContribution(jA.ID)}constructor(e){this.editor=e,this.widget=new lY(this.editor)}dispose(){this.widget.dispose()}}jA.ID="editor.controller.quickInput";class lY{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return lY.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}lY.ID="editor.contrib.quickInputWidget";Vr(jA.ID,jA,4);class Bmr{constructor(e,t,i,r,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=r,this.background=o}}function $mr(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,r=n.length;i<r;i++){const o=n[i];let s=-1;if(typeof o.fontStyle=="string"){s=0;const c=o.fontStyle.split(" ");for(let u=0,d=c.length;u<d;u++)switch(c[u]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let a=null;typeof o.foreground=="string"&&(a=o.foreground);let l=null;typeof o.background=="string"&&(l=o.background),e[t++]=new Bmr(o.token||"",i,s,a,l)}return e}function Vmr(n,e){n.sort((u,d)=>{const h=jmr(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,i="000000",r="ffffff";for(;n.length>=1&&n[0].token==="";){const u=n.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(i=u.foreground),u.background!==null&&(r=u.background)}const o=new Wmr;for(const u of e)o.getId(u);const s=o.getId(i),a=o.getId(r),l=new Xye(t,s,a),c=new Zye(l);for(let u=0,d=n.length;u<d;u++){const h=n[u];c.insert(h.token,h.fontStyle,o.getId(h.foreground),o.getId(h.background))}return new wtt(o,c)}const Hmr=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class Wmr{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const t=e.match(Hmr);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=ze.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class wtt{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme($mr(e),t)}static createFromParsedTokenTheme(e,t){return Vmr(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(typeof i>"u"){const r=this._match(t),o=Umr(t);i=(r.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const zmr=/\b(comment|string|regex|regexp)\b/;function Umr(n){const e=n.match(zmr);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function jmr(n,e){return n<e?-1:n>e?1:0}class Xye{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new Xye(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class Zye{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,r;t===-1?(i=e,r=""):(i=e.substring(0,t),r=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(r):this._mainRule}insert(e,t,i,r){if(e===""){this._mainRule.acceptOverwrite(t,i,r);return}const o=e.indexOf(".");let s,a;o===-1?(s=e,a=""):(s=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(s);typeof l>"u"&&(l=new Zye(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,i,r)}}function qmr(n){const e=[];for(let t=1,i=n.length;t<i;t++){const r=n[t];e[t]=`.mtk${t} { color: ${r}; }`}return e.push(".mtki { font-style: italic; }"),e.push(".mtkb { font-weight: bold; }"),e.push(".mtku { text-decoration: underline; text-underline-position: under; }"),e.push(".mtks { text-decoration: line-through; }"),e.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),e.join(` `)}const Kmr={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Pl]:"#FFFFFE",[vm]:"#000000",[tJe]:"#E5EBF1",[N6]:"#D3D3D3",[R6]:"#939393",[B0e]:"#ADD6FF4D"}},Gmr={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Pl]:"#1E1E1E",[vm]:"#D4D4D4",[tJe]:"#3A3D41",[N6]:"#404040",[R6]:"#707070",[B0e]:"#ADD6FF26"}},Ymr={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Pl]:"#000000",[vm]:"#FFFFFF",[N6]:"#FFFFFF",[R6]:"#FFFFFF"}},Qmr={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Pl]:"#FFFFFF",[vm]:"#292929",[N6]:"#292929",[R6]:"#292929"}},Xmr={IconContribution:"base.contributions.icons"};var FMe;(function(n){function e(t,i){let r=t.defaults;for(;Qn.isThemeIcon(r);){const o=uI.getIcon(r.id);if(!o)return;r=o.defaults}return r}n.getDefinition=e})(FMe||(FMe={}));var BMe;(function(n){function e(i){return{weight:i.weight,style:i.style,src:i.src.map(r=>({format:r.format,location:r.location.toString()}))}}n.toJSONObject=e;function t(i){const r=o=>Od(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Od(o.format)&&Od(o.location)))return{weight:r(i.weight),style:r(i.style),src:i.src.map(o=>({format:o.format,location:Yn.parse(o.location)}))}}n.fromJSONObject=t})(BMe||(BMe={}));class Zmr{constructor(){this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:T("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:T("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Qn.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,r){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const s={id:e,description:i,defaults:t,deprecationMessage:r};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return r&&(a.deprecationMessage=r),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,s)=>o.id.localeCompare(s.id),t=o=>{for(;Qn.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const r=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of r.filter(s=>!!s.description).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${Qn.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of r.filter(s=>!Qn.isThemeIcon(s.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join(` `)}}const uI=new Zmr;Hs.add(Xmr.IconContribution,uI);function Da(n,e,t,i){return uI.registerIcon(n,e,t,i)}function Stt(){return uI}function Jmr(){const n=AXe();for(const e in n){const t="\\"+n[e].toString(16);uI.registerIcon(e,{fontCharacter:t})}}Jmr();const Ett="vscode://schemas/icons",xtt=Hs.as(EG.JSONContribution);xtt.registerSchema(Ett,uI.getIconSchema());const $Me=new $o(()=>xtt.notifySchemaChanged(Ett),200);uI.onDidChange(()=>{$Me.isScheduled()||$Me.schedule()});const Ttt=Da("widget-close",Ht.close,T("widgetClose","Icon for the close action in widgets."));Da("goto-previous-location",Ht.arrowUp,T("previousChangeIcon","Icon for goto previous editor location."));Da("goto-next-location",Ht.arrowDown,T("nextChangeIcon","Icon for goto next editor location."));Qn.modify(Ht.sync,"spin");Qn.modify(Ht.loading,"spin");function e_r(n){const e=new mt,t=e.add(new Le),i=Stt();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const r=n?n.getProductIconTheme():new ktt,o={},s=l=>{const c=r.getIcon(l);if(!c)return;const u=c.font;return u?(o[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${NRe(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of i.getIcons()){const c=s(l);c&&a.push(c)}for(const l in o){const c=o[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${_S(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${NRe(l)};${u}${d} font-display: block; }`)}return a.join(` `)}}}class ktt{getIcon(e){const t=Stt();let i=e.defaults;for(;Qn.isThemeIcon(i);){const r=t.getIcon(i.id);if(!r)return;i=r.defaults}return i}}const Iy="vs",vD="vs-dark",CT="hc-black",wT="hc-light",Itt=Hs.as(QZe.ColorContribution),t_r=Hs.as(fJe.ThemingContribution);class Ltt{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(uV(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,ze.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=que(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,ze.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=Itt.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Iy:return Jp.LIGHT;case CT:return Jp.HIGH_CONTRAST_DARK;case wT:return Jp.HIGH_CONTRAST_LIGHT;default:return Jp.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=que(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],r=this.themeData.colors["editor.background"];if(i||r){const o={token:""};i&&(o.foreground=i),r&&(o.background=r),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=wtt.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=Kc.getForeground(o),a=Kc.getFontStyle(o);return{foreground:s,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function uV(n){return n===Iy||n===vD||n===CT||n===wT}function que(n){switch(n){case Iy:return Kmr;case vD:return Gmr;case CT:return Ymr;case wT:return Qmr}}function d7(n){const e=que(n);return new Ltt(n,e)}class n_r extends Ue{constructor(){super(),this._onColorThemeChange=this._register(new Le),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new Le),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new ktt,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Iy,d7(Iy)),this._knownThemes.set(vD,d7(vD)),this._knownThemes.set(CT,d7(CT)),this._knownThemes.set(wT,d7(wT));const e=this._register(e_r(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Iy),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),WXe("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return XW(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=vg(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Ue.None}_registerShadowDomContainer(e){const t=vg(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!uV(t.base)&&!uV(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new Ltt(e,t)),uV(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Iy),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==fv(this._theme.type)){let t;OA(this._theme.type)?t=e?CT:vD:t=e?wT:Iy,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};t_r.getThemingParticipants().forEach(s=>s(this._theme,i,this._environment));const r=[];for(const s of Itt.getColors()){const a=this._theme.getColor(s.id,!0);a&&r.push(`${O0e(s.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${r.join(` `)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(qmr(o)),this._themeCSS=e.join(` `),this._updateCSS(),Ks.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const fp=or("themeService");var i_r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Kue=class extends Ue{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new Le,this._onDidChangeReducedMotion=new Le,this._accessibilityModeEnabledContext=k6.bindTo(this._contextKeyService);const r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(r(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(tt(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};Kue=i_r([Xte(0,vi),Xte(1,lR),Xte(2,dr)],Kue);var cY=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ak=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},k2,yC;let Gue=class{constructor(e,t){this._commandService=e,this._hiddenStates=new eU(t)}createMenu(e,t,i){return new Que(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};Gue=cY([ak(0,_a),ak(1,i_)],Gue);let eU=k2=class{constructor(e){this._storageService=e,this._disposables=new mt,this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(k2._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,k2._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(k2._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,r;const o=this._isHiddenByDefault(e,t),s=(r=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&r!==void 0?r:!1;return o?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const s=o.indexOf(t);s>=0&&aZi(o,s),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(k2._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};eU._key="menu.hiddenCommands";eU=k2=cY([ak(0,i_)],eU);let Yue=yC=class{constructor(e,t,i,r,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=r,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=xc.getMenuItems(this._id);let t;e.sort(yC._compareMenuItems);for(const i of e){const r=i.group||"";(!t||t[0]!==r)&&(t=[r,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(yC._fillInKbExprKeys(e.when,this._structureContextKeys),oL(e)){if(e.command.precondition&&yC._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;yC._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&xc.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[r,o]=i,s=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=oL(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=r_r(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new zm(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new yC(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=oc.join(...u.map(h=>h[1]));d.length>0&&s.push(new T3(a,c,d))}}s.length>0&&t.push([r,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,r=t.group;if(i!==r){if(i){if(!r)return-1}else return 1;if(i==="navigation")return-1;if(r==="navigation")return 1;const a=i.localeCompare(r);if(a!==0)return a}const o=e.order||0,s=t.order||0;return o<s?-1:o>s?1:yC._compareTitles(oL(e)?e.command.title:e.title,oL(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,r=typeof t=="string"?t:t.original;return i.localeCompare(r)}};Yue=yC=cY([ak(3,_a),ak(4,vi)],Yue);let Que=class{constructor(e,t,i,r,o){this._disposables=new mt,this._menuInfo=new Yue(e,t,i.emitEventsForSubmenuChanges,r,o);const s=new $o(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(s),this._disposables.add(xc.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new mt),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new yXe({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};Que=cY([ak(3,_a),ak(4,vi)],Que);function r_r(n,e,t){const i=Zer(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,o=ZL({id:`hide/${n.id}/${i}`,label:T("hide.label","Hide '{0}'",r),run(){t.updateHidden(n,i,!0)}}),s=ZL({id:`toggle/${n.id}/${i}`,label:r,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:s,get isHidden(){return!s.checked}}}var o_r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},VMe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},WE=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let Xue=class extends Ue{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(C1||zXe)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new vG;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>WE(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(tt(this.layoutService.container,"click",e)),this._register(tt(this.layoutService.container,"keydown",e)))}writeText(e,t){return WE(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,r=document.body.appendChild(kt("textarea",{"aria-hidden":!0}));r.style.height="1px",r.style.width="1px",r.style.position="absolute",r.value=e,r.focus(),r.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(r)})}readText(e){return WE(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return WE(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return WE(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return WE(this,void 0,void 0,function*(){this.resources=e})}readResources(){return WE(this,void 0,void 0,function*(){return this.resources})}};Xue=o_r([VMe(0,lR),VMe(1,hp)],Xue);const B1=or("clipboardService");var s_r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},a_r=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const KM="data-keybinding-context";let Jye=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};class qA extends Jye{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}qA.INSTANCE=new qA;class f5 extends Jye{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=pD.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(r=>{if(r.source===7){const o=Array.from(this._values,([s])=>s);this._values.clear(),i.fire(new WMe(o))}else{const o=[];for(const s of r.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...tr.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new WMe(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(f5._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(f5._keyPrefix.length),i=this._configurationService.getValue(t);let r;switch(typeof i){case"number":case"boolean":case"string":r=i;break;default:Array.isArray(i)?r=JSON.stringify(i):r=i}return this._values.set(e,r),r}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}f5._keyPrefix="config.";class l_r{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class HMe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class WMe{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class c_r{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function u_r(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class Dtt extends Ue{constructor(e){super(),this._onDidChangeContext=this._register(new KT({merge:t=>new c_r(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new l_r(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new d_r(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new HMe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new HMe(e))}getContext(e){return this._isDisposed?qA.INSTANCE:this.getContextValuesContainer(h_r(e))}dispose(){super.dispose(),this._isDisposed=!0}}let Zue=class extends Dtt{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new f5(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?qA.INSTANCE:this._contexts.get(e)||qA.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new Jye(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Zue=s_r([a_r(0,dr)],Zue);class d_r extends Dtt{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Nc),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(KM)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(KM,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;u_r(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(KM),super.dispose())}getContextValuesContainer(e){return this._isDisposed?qA.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function h_r(n){for(;n;){if(n.hasAttribute(KM)){const e=n.getAttribute(KM);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function f_r(n,e,t){n.get(vi).createKey(String(e),p_r(t))}function p_r(n){return aXe(n,e=>{if(typeof e=="object"&&e.$mid===1)return Yn.revive(e).toString();if(e instanceof Yn)return e.toString()})}_r.registerCommand("_setContext",f_r);_r.registerCommand({id:"getContextKeyInfo",handler(){return[...sn.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:T("getContextKeyInfo","A command that returns information about context keys"),args:[]}});_r.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of sn.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let g_r=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class zMe{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);i.outgoing.set(r.key,r),r.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new g_r(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}] `);return e.join(` `)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),r=this._findCycle(t,i);if(r)return r}}_findCycle(e,t){for(const[i,r]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(r,t);if(o)return o;t.delete(i)}}}const m_r=!1;class UMe extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: ${e.toString()}`}}class tU{constructor(e=new HG,t=!1,i,r=m_r){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=r,this._activeInstantiations=new Set,this._services.set(di,this),this._globalGraph=r?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new zMe(s=>s):void 0}createChild(e){return new tU(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=nh.traceInvocation(this._enableTracing,e);let r=!1;try{return e({get:s=>{if(r)throw Zbe("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(s,i);if(!a)throw new Error(`[invokeFunction] unknown service '${s}'`);return a}},...t)}finally{r=!0,i.stop()}}createInstance(e,...t){let i,r;return e instanceof ab?(i=nh.traceCreation(this._enableTracing,e.ctor),r=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=nh.traceCreation(this._enableTracing,e),r=this._createInstance(e,t,i)),i.stop(),r}_createInstance(e,t=[],i){const r=ev.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of r){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const s=r.length>0?r[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const a=s-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,s)}return Reflect.construct(e,t.concat(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof ab)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof ab?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var r;const o=new zMe(l=>l.id.toString());let s=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),s++>1e3)throw new UMe(o);for(const c of ev.getServiceDependencies(l.desc.ctor)){const u=this._getServiceInstanceOrDescriptor(c.id);if(u||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(r=this._globalGraph)===null||r===void 0||r.insertEdge(String(l.id),String(c.id)),u instanceof ab){const d={id:c.id,desc:u,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,d),a.push(d)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new UMe(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof ab){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,d)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],r,o){if(this._services.get(e)instanceof ab)return this._createServiceInstance(e,t,i,r,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,r,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],r,o){if(r){const s=new tU(void 0,this._strict,this,this._enableTracing);s._globalGraphImplicitDependency=String(e);const a=new Map,l=new U$(()=>{const c=s._createInstance(t,i,o);for(const[u,d]of a){const h=c[u];if(typeof h=="function")for(const f of d)h.apply(c,f)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,u){if(!l.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let f=a.get(u);return f||(f=new Id,a.set(u,f)),(m,v,_)=>{const b=f.push([m,v,_]);return mi(b)}}if(u in c)return c[u];const d=l.value;let h=d[u];return typeof h!="function"||(h=h.bind(d),c[u]=h),h},set(c,u,d){return l.value[u]=d,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class nh{static traceInvocation(e,t){return e?new nh(2,t.name||new Error().stack.split(` `).slice(3,4).join(` `)):nh._None}static traceCreation(e,t){return e?new nh(1,t.name):nh._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new nh(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;nh._totals+=e;let t=!1;function i(o,s){const a=[],l=new Array(o+1).join(" ");for(const[c,u,d]of s._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,d);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` `)}const r=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${nh._totals.toFixed(2)}ms)`];(e>2||t)&&nh.all.add(r.join(` `))}}nh.all=new Set;nh._None=new class extends nh{constructor(){super(0,null)}stop(){}branch(){return this}};nh._totals=0;const __r=new Set([Gi.inMemory,Gi.vscodeSourceControl,Gi.walkThrough,Gi.walkThroughSnippet]);class v_r{constructor(){this._byResource=new mu,this._byOwner=new Map}set(e,t,i){let r=this._byResource.get(e);r||(r=new Map,this._byResource.set(e,r)),r.set(t,i);let o=this._byOwner.get(t);o||(o=new mu,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,r=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const s=this._byOwner.get(t);if(s&&(r=s.delete(e)),i!==r)throw new Error("illegal state");return i&&r}values(e){var t,i,r,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:tr.empty():Yn.isUri(e)?(o=(r=this._byResource.get(e))===null||r===void 0?void 0:r.values())!==null&&o!==void 0?o:tr.empty():tr.map(tr.concat(...this._byOwner.values()),s=>s[1])}}class b_r{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new mu,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const r=this._resourceStats(t);this._add(r),this._data.set(t,r)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(__r.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Qs.Error?t.errors+=1:i===Qs.Warning?t.warnings+=1:i===Qs.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class LC{constructor(){this._onMarkerChanged=new yXe({delay:0,merge:LC._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new v_r,this._stats=new b_r(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(tXe(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const o of i){const s=LC._toMarker(e,t,o);s&&r.push(s)}this._data.set(t,e,r),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}=i;if(s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}}changeAll(e,t){const i=[],r=this._data.values(e);if(r)for(const o of r){const s=tr.first(o);s&&(i.push(s.resource),this._data.delete(s.resource,e))}if(Cu(t)){const o=new mu;for(const{resource:s,marker:a}of t){const l=LC._toMarker(e,s,a);if(!l)continue;const c=o.get(s);c?c.push(l):(o.set(s,[l]),i.push(s))}for(const[s,a]of o)this._data.set(s,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:r,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const s=this._data.get(i,t);if(s){const a=[];for(const l of s)if(LC._accept(l,r)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const s=[];for(const a of this._data.values())for(const l of a)if(LC._accept(l,r)){const c=s.push(l);if(o>0&&c===o)return s}return s}else{const s=this._data.values(i??t),a=[];for(const l of s)for(const c of l)if(LC._accept(c,r)){const u=a.push(c);if(o>0&&u===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new mu;for(const i of e)for(const r of i)t.set(r,!0);return Array.from(t.keys())}}class y_r extends Ue{constructor(){super(...arguments),this._configurationModel=new fu}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new fu;const e=Hs.as(Nv.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const r of e){const o=i[r],s=t[r];o!==void 0?this._configurationModel.addValue(r,o):s?this._configurationModel.addValue(r,s.default):this._configurationModel.removeValue(r)}}}const j6=or("audioCue");class Yi{static register(e){return new Yi(e.fileName)}constructor(e){this.fileName=e}}Yi.error=Yi.register({fileName:"error.mp3"});Yi.warning=Yi.register({fileName:"warning.mp3"});Yi.foldedArea=Yi.register({fileName:"foldedAreas.mp3"});Yi.break=Yi.register({fileName:"break.mp3"});Yi.quickFixes=Yi.register({fileName:"quickFixes.mp3"});Yi.taskCompleted=Yi.register({fileName:"taskCompleted.mp3"});Yi.taskFailed=Yi.register({fileName:"taskFailed.mp3"});Yi.terminalBell=Yi.register({fileName:"terminalBell.mp3"});Yi.diffLineInserted=Yi.register({fileName:"diffLineInserted.mp3"});Yi.diffLineDeleted=Yi.register({fileName:"diffLineDeleted.mp3"});Yi.diffLineModified=Yi.register({fileName:"diffLineModified.mp3"});Yi.chatRequestSent=Yi.register({fileName:"chatRequestSent.mp3"});Yi.chatResponsePending=Yi.register({fileName:"chatResponsePending.mp3"});Yi.chatResponseReceived1=Yi.register({fileName:"chatResponseReceived1.mp3"});Yi.chatResponseReceived2=Yi.register({fileName:"chatResponseReceived2.mp3"});Yi.chatResponseReceived3=Yi.register({fileName:"chatResponseReceived3.mp3"});Yi.chatResponseReceived4=Yi.register({fileName:"chatResponseReceived4.mp3"});class C_r{constructor(e){this.randomOneOf=e}}class Nr{static register(e){const t=new C_r("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Nr(t,e.name,e.settingsKey);return Nr._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}Nr._audioCues=new Set;Nr.error=Nr.register({name:T("audioCues.lineHasError.name","Error on Line"),sound:Yi.error,settingsKey:"audioCues.lineHasError"});Nr.warning=Nr.register({name:T("audioCues.lineHasWarning.name","Warning on Line"),sound:Yi.warning,settingsKey:"audioCues.lineHasWarning"});Nr.foldedArea=Nr.register({name:T("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:Yi.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Nr.break=Nr.register({name:T("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:Yi.break,settingsKey:"audioCues.lineHasBreakpoint"});Nr.inlineSuggestion=Nr.register({name:T("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:Yi.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Nr.terminalQuickFix=Nr.register({name:T("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:Yi.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Nr.onDebugBreak=Nr.register({name:T("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:Yi.break,settingsKey:"audioCues.onDebugBreak"});Nr.noInlayHints=Nr.register({name:T("audioCues.noInlayHints","No Inlay Hints on Line"),sound:Yi.error,settingsKey:"audioCues.noInlayHints"});Nr.taskCompleted=Nr.register({name:T("audioCues.taskCompleted","Task Completed"),sound:Yi.taskCompleted,settingsKey:"audioCues.taskCompleted"});Nr.taskFailed=Nr.register({name:T("audioCues.taskFailed","Task Failed"),sound:Yi.taskFailed,settingsKey:"audioCues.taskFailed"});Nr.terminalCommandFailed=Nr.register({name:T("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:Yi.error,settingsKey:"audioCues.terminalCommandFailed"});Nr.terminalBell=Nr.register({name:T("audioCues.terminalBell","Terminal Bell"),sound:Yi.terminalBell,settingsKey:"audioCues.terminalBell"});Nr.notebookCellCompleted=Nr.register({name:T("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:Yi.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Nr.notebookCellFailed=Nr.register({name:T("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:Yi.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Nr.diffLineInserted=Nr.register({name:T("audioCues.diffLineInserted","Diff Line Inserted"),sound:Yi.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Nr.diffLineDeleted=Nr.register({name:T("audioCues.diffLineDeleted","Diff Line Deleted"),sound:Yi.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Nr.diffLineModified=Nr.register({name:T("audioCues.diffLineModified","Diff Line Modified"),sound:Yi.diffLineModified,settingsKey:"audioCues.diffLineModified"});Nr.chatRequestSent=Nr.register({name:T("audioCues.chatRequestSent","Chat Request Sent"),sound:Yi.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Nr.chatResponseReceived=Nr.register({name:T("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Yi.chatResponseReceived1,Yi.chatResponseReceived2,Yi.chatResponseReceived3,Yi.chatResponseReceived4]}});Nr.chatResponsePending=Nr.register({name:T("audioCues.chatResponsePending","Chat Response Pending"),sound:Yi.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class w_r extends Ue{constructor(e,t=[]){super(),this.logger=new etr([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const Att=[];function uY(n){Att.push(n)}function S_r(){return Att.slice(0)}var mE=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wc=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},bD=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class E_r{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new Le}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let Jue=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new xJi(new E_r(t))):Promise.reject(new Error("Model not found"))}};Jue=mE([wc(0,Ds)],Jue);class dY{show(){return dY.NULL_PROGRESS_RUNNER}showWhile(e,t){return bD(this,void 0,void 0,function*(){yield e})}}dY.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class x_r{withProgress(e,t,i){return t({report:()=>{}})}}class T_r{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class k_r{confirm(e){return bD(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let i=e;return t&&(i=i+` `+t),window.confirm(i)}prompt(e){var t,i;return bD(this,void 0,void 0,function*(){let r;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),r=yield(i=s[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1})}return{result:r}})}error(e,t){return bD(this,void 0,void 0,function*(){yield this.prompt({type:Sa.Error,message:e,detail:t})})}}class p5{info(e){return this.notify({severity:Sa.Info,message:e})}warn(e){return this.notify({severity:Sa.Warning,message:e})}error(e){return this.notify({severity:Sa.Error,message:e})}notify(e){switch(e.severity){case Sa.Error:console.error(e.message);break;case Sa.Warning:console.warn(e.message);break;default:console.log(e.message);break}return p5.NO_OP}prompt(e,t,i,r){return p5.NO_OP}status(e,t){return Ue.None}}p5.NO_OP=new Adr;let ede=class{constructor(e){this._onWillExecuteCommand=new Le,this._onDidExecuteCommand=new Le,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=_r.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const r=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}};ede=mE([wc(0,di)],ede);let KA=class extends $hr{constructor(e,t,i,r,o,s){super(e,t,i,r,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new mt;g.add(tt(f,Yt.KEY_DOWN,m=>{const v=new hs(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(tt(f,Yt.KEY_UP,m=>{const v=new hs(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new I_r(f,g))},l=f=>{for(let g=0;g<this._domNodeListeners.length;g++){const m=this._domNodeListeners[g];m.domNode===f&&(this._domNodeListeners.splice(g,1),m.dispose())}},c=f=>{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,r){return km(_r.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(i=>{var r;return{keybinding:nce(i.keybinding,Pf),command:(r=i.command)!==null&&r!==void 0?r:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),mi(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(hh.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new qM(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let r=0;for(const o of e){const s=o.when||void 0,a=o.keybinding;if(!a)i[r++]=new tMe(void 0,o.command,o.commandArgs,s,t,null,!1);else{const l=e5.resolveKeybinding(a,Pf);for(const c of l)i[r++]=new tMe(c,o.command,o.commandArgs,s,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new w1(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new e5([t],Pf)}};KA=mE([wc(0,vi),wc(1,_a),wc(2,dp),wc(3,za),wc(4,hp),wc(5,eo)],KA);class I_r extends Ue{constructor(e,t){super(),this.domNode=e,this._register(t)}}function jMe(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof Yn)}class Ntt{constructor(){this._onDidChangeConfiguration=new Le,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new y_r;this._configuration=new jG(e.reload(),new fu,new fu,new fu),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,r=jMe(e)?e:jMe(t)?t:{};return this._configuration.getValue(i,r,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const r of e){const[o,s]=r;this.getValue(o)!==s&&(this._configuration.updateValue(o,s),i.push(o))}if(i.length>0){const r=new Phr({keys:i,overrides:[]},t,this._configuration);r.source=8,r.sourceConfig=null,this._onDidChangeConfiguration.fire(r)}return Promise.resolve()}updateValue(e,t,i,r){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let tde=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new Le,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(o,s)=>r.affectsConfiguration(s)})})}getValue(e,t,i){const r=De.isIPosition(t)?t:null,o=r?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,r):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};tde=mE([wc(0,dr),wc(1,Ds),wc(2,xs)],tde);let nde=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Zu||mr?` `:`\r `}};nde=mE([wc(0,dr)],nde);class L_r{publicLog2(){}}class g5{constructor(){const e=Yn.from({scheme:g5.SCHEME,authority:"model",path:"/"});this.workspace={id:wet,folders:[new efr({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===g5.SCHEME?this.workspace.folders[0]:null}}g5.SCHEME="inmemory";function nU(n,e,t){if(!e||!(n instanceof Ntt))return;const i=[];Object.keys(e).forEach(r=>{Dhr(r)&&i.push([`editor.${r}`,e[r]]),t&&Ahr(r)&&i.push([`diffEditor.${r}`,e[r]])}),i.length>0&&n.updateValues(i)}let ide=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return bD(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:_ye.convert(e),r=new Map;for(const a of i){if(!(a instanceof Jy))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=r.get(l);c||(c=[],r.set(l,c)),c.push(Is.replaceMove(J.lift(a.textEdit.range),a.textEdit.text))}let o=0,s=0;for(const[a,l]of r)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,o+=l.length;return{ariaSummary:GT(aue.bulkEditServiceSummary,o,s),isApplied:o>0}})}};ide=mE([wc(0,Ds)],ide);class D_r{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Cg(e)}}let rde=class extends lue{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const r=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();r&&(t=r.getContainerDomNode())}return super.showContextView(e,t,i)}};rde=mE([wc(0,lR),wc(1,eo)],rde);class A_r{constructor(){this._neverEmitter=new Le,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class N_r extends i5{constructor(){super()}}class R_r extends w_r{constructor(){super(new Jer)}}let ode=class extends Tue{constructor(e,t,i,r,o,s){super(e,t,i,r,o,s),this.configure({blockMouse:!1})}};ode=mE([wc(0,dp),wc(1,za),wc(2,P1),wc(3,Qo),wc(4,L0),wc(5,vi)],ode);class O_r{playAudioCue(e,t){return bD(this,void 0,void 0,function*(){})}}vr(dr,Ntt,0);vr(k0e,tde,0);vr(WZe,nde,0);vr(nk,g5,0);vr(VA,D_r,0);vr(dp,L_r,0);vr(M6,k_r,0);vr(pye,T_r,0);vr(za,p5,0);vr(N0,LC,0);vr(xs,N_r,0);vr(fp,n_r,0);vr(hp,R_r,0);vr(Ds,qz,0);vr(R0e,Aue,0);vr(vi,Zue,0);vr(Cet,x_r,0);vr(gE,dY,0);vr(i_,Wpr,0);vr(r_,_ce,0);vr(F6,ide,0);vr(Eet,A_r,0);vr(bh,Jue,0);vr(O1,Kue,0);vr(Mg,rmr,0);vr(_a,ede,0);vr(Qo,KA,0);vr(Rv,jue,0);vr(P1,rde,0);vr(rf,Due,0);vr(B1,Xue,0);vr(t_,ode,0);vr(L0,Gue,0);vr(j6,O_r,0);var ai;(function(n){const e=new HG;for(const[l,c]of HRe())e.set(l,c);const t=new tU(e,!0);e.set(di,t);function i(l){r||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof ab?t.invokeFunction(u=>u.get(l)):c}n.get=i;let r=!1;const o=new Le;function s(l){if(r)return t;r=!0;for(const[u,d]of HRe())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=or(u);e.get(d)instanceof ab&&e.set(d,l[u])}const c=S_r();for(const u of c)try{t.createInstance(u)}catch(d){Oi(d)}return o.fire(),t}n.initialize=s;function a(l){if(r)return l();const c=new mt,u=c.add(o.event(()=>{u.dispose(),c.add(l())}));return c}n.withServices=a})(ai||(ai={}));let P_r;function t1(){return P_r}let Rtt;function M_r(n){Rtt=n}class Ott{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,r=t===void 0?e:t;return Rtt({owner:i,debugName:()=>{const o=dI(r);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`}},o=>r(this.read(o),o))}}class q6 extends Ott{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function ks(n,e){const t=new Ptt(n,e);try{n(t)}finally{t.finish()}}function sde(n,e,t){n?e(n):ks(e,t)}class Ptt{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=t1())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():dI(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:r}of t)i.endUpdate(r);(e=t1())===null||e===void 0||e.handleEndTransaction()}}function e1e(n,e,t,i){let r;if(n!==void 0)if(typeof n=="function"){if(r=n(),r!==void 0)return r}else return n;if(e!==void 0&&(r=dI(e),r!==void 0))return r;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function dI(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=i?i[1]:void 0;return r==null?void 0:r.trim()}function ds(n,e){return typeof n=="string"?new ade(void 0,n,e):new ade(n,void 0,e)}class ade extends q6{get debugName(){var e;return(e=e1e(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var r;if(this._value===e)return;let o;t||(t=o=new Ptt(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=t1())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function iU(n,e){return typeof n=="string"?new qMe(void 0,n,e):new qMe(n,void 0,e)}class qMe extends ade{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const m5=(n,e)=>n===e;function fr(n,e){return e!==void 0?new v5(n,void 0,e,void 0,void 0,void 0,m5):new v5(void 0,void 0,n,void 0,void 0,void 0,m5)}function KMe(n,e){var t;return new v5(n.owner,n.debugName,e,void 0,void 0,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:m5)}function F_r(n,e){var t;return new v5(n.owner,n.debugName,e,n.createEmptyChangeSummary,n.handleChange,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:m5)}function _5(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const r=new mt;return new v5(i,()=>{var o;return(o=dI(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(r.clear(),t(o,r)),void 0,void 0,()=>r.dispose(),m5)}M_r(fr);class v5 extends q6{get debugName(){var e;return(e=e1e(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,r,o,s=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=r,this._handleChange=o,this._handleLastObserverRemoved=s,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=t1())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const r=this.state!==0,o=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=r&&!this._equalityComparator(o,this.value);if((t=t1())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:r}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new Qa}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(i&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function t1e(n,e){return new fY(n.debugName,e,void 0,void 0)}function ts(n){return new fY(void 0,n,void 0,void 0)}function hY(n,e){return new fY(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function Oh(n){const e=new mt,t=t1e({debugName:()=>dI(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return mi(()=>{t.dispose(),e.dispose()})}class fY{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=dI(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,i,r){var o,s;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=t1())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const r=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=r,this.state=3;try{if(!this.disposed){(e=t1())===null||e===void 0||e.handleAutorunTriggered(this);const o=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,o)}}finally{(i=t1())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,x3(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=fY})(ts||(ts={}));function rU(n){return new B_r(n)}class B_r extends Ott{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function $_r(n,e){return new Promise(t=>{let i=!1,r=!1;const o=ts(s=>{const a=n.read(s);e(a)&&(i?o.dispose():r=!0,t(a))});i=!0,r&&o.dispose()})}function Tc(n,e){return new Mtt(n,e)}class Mtt extends q6{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var r;const o=this._getValue(i),s=!this.hasValue||this.value!==o;(r=t1())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:s,hadValue:this.hasValue}),s&&(this.value=o,this.hasValue&&ks(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return dI(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(n){n.Observer=Mtt})(Tc||(Tc={}));function If(n,e){return new V_r(n,e)}class V_r extends q6{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{ks(i=>{for(const r of this.observers)i.updateObserver(r,this),r.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function Ftt(n){return typeof n=="string"?new GMe(n):new GMe(void 0,n)}class GMe extends q6{get debugName(){var e;return(e=e1e(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){ks(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function b5(n){const e=new H_r(!0);return n.addObserver(e),n.reportChanges(),mi(()=>{n.removeObserver(e)})}class H_r{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function Btt(){return!!SXe.VSCODE_DEV}function W_r(n){if(Btt()){const e=z_r();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function z_r(){h7||(h7=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of h7){const i=t(e);if(i)return i}}),h7}let h7;function U_r(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const r=[];let o=0,s=0;for(;o<n.length&&s<e.length;){const a=n[o],l=e[s],c=t(a),u=t(l);c<u?(r.push(a),o++):c>u?(r.push(l),s++):(r.push(i(a,l)),o++,s++)}for(;o<n.length;)r.push(n[o]),o++;for(;s<e.length;)r.push(e[s]),s++;return r}function oU(n,e){const t=new mt,i=n.createDecorationsCollection();return t.add(t1e({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function f7(n,e){return n.appendChild(e),mi(()=>{n.removeChild(e)})}class j_r extends Ue{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new YZe(e,t)),this._width=ds(this,this.elementSizeObserver.getWidth()),this._height=ds(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>ks(r=>{this._width.set(this.elementSizeObserver.getWidth(),r),this._height.set(this.elementSizeObserver.getHeight(),r)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function YMe(n,e){let t=n.get(),i=t,r=t;const o=ds("animatedValue",t);let s=-1;const a=300;let l;e.add(hY({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(u,d)=>(u.didChange(n)&&(d.animate=d.animate||u.change),!0)},(u,d)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),i=r,t=n.read(u),s=Date.now()-(d.animate?0:a),c()}));function c(){const u=Date.now()-s;r=Math.floor(q_r(u,i,t-i,a)),u<a?l=requestAnimationFrame(c):r=t,o.set(r,void 0)}return o}function q_r(n,e,t,i){return n===i?e+t:t*(-Math.pow(2,-10*n/i)+1)+e}class $tt extends Ue{constructor(e,t,i){super(),this._register(new pY(e,i)),this._register(Uw(i,{height:t.actualHeight,top:t.actualTop}))}}class sU{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=ds(this,void 0),this._actualHeight=ds(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=i=>{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class pY{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${pY._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}pY._counter=0;function Uw(n,e){return ts(t=>{for(let[i,r]of Object.entries(e))r&&typeof r=="object"&&"read"in r&&(r=r.read(t)),typeof r=="number"&&(r=`${r}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=r})}function DC(n,e){return K_r([n],e),n}function K_r(n,e){Btt()&&If("reload",i=>W_r(r=>{if([...Object.values(r)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function aU(n,e,t){const i=new mt,r=[];return i.add(ts(o=>{const s=e.read(o),a=new Map,l=new Map;t&&t(!0),n.changeViewZones(c=>{for(const u of r)c.removeZone(u);r.length=0;for(const u of s){const d=c.addZone(u);r.push(d),a.set(u,d)}}),t&&t(!1),i.add(hY({createEmptyChangeSummary(){return[]},handleChange(c,u){const d=l.get(c.changedObservable);return d!==void 0&&u.push(d),!0}},(c,u)=>{for(const d of s)d.onChange&&(l.set(d.onChange,a.get(d)),d.onChange.read(c));t&&t(!0),n.changeViewZones(d=>{for(const h of u)d.layoutZone(h)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const s of r)o.removeZone(s)}),t&&t(!1)}}),i}class G_r extends Va{dispose(){super.dispose(!0)}}var n1e=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},i1e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Y_r=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Q_r=Da("diff-review-insert",Ht.add,T("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),X_r=Da("diff-review-remove",Ht.remove,T("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),Z_r=Da("diff-review-close",Ht.close,T("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let lw=class extends Ue{constructor(e,t,i,r,o,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=r,this._width=o,this._height=s,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=_5(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(lde,this._diffs,this._editors,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(cde,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(b5(this.model))}next(){ks(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){ks(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){ks(e=>{this._setVisible(!1,e)})}};lw._ttPolicy=R1("diffReview",{createHTML:n=>n});lw=n1e([i1e(8,di)],lw);let lde=class extends Ue{constructor(e,t,i,r,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=r,this._audioCueService=o,this._groups=ds(this,[]),this._currentGroupIdx=ds(this,0),this._currentElementIdx=ds(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(ts(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=J_r(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());ks(c=>{const u=this._editors.modified.getPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber)<h.range.modified.endLineNumberExclusive);d!==-1&&this._currentGroupIdx.set(d,c)}this._groups.set(l,c)})})),this._register(ts(s=>{const a=this.currentElement.read(s);(a==null?void 0:a.type)===yd.Deleted?this._audioCueService.playAudioCue(Nr.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===yd.Added&&this._audioCueService.playAudioCue(Nr.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ts(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==yd.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(J.fromPositions(new De(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||sde(t,r=>{this._currentGroupIdx.set(rr.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),r),this._currentElementIdx.set(0,r)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||ks(i=>{this._currentElementIdx.set(rr.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&ks(r=>{this._currentElementIdx.set(i,r)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===yd.Deleted?(this._editors.original.setSelection(J.fromPositions(new De(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==yd.Header&&(this._editors.modified.setSelection(J.fromPositions(new De(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};lde=n1e([i1e(4,j6)],lde);const FO=3;function J_r(n,e,t){const i=[];for(const r of JQe(n,(o,s)=>s.modified.startLineNumber-o.modified.endLineNumberExclusive<2*FO)){const o=[];o.push(new tvr);const s=new cr(Math.max(1,r[0].original.startLineNumber-FO),Math.min(r[r.length-1].original.endLineNumberExclusive+FO,e+1)),a=new cr(Math.max(1,r[0].modified.startLineNumber-FO),Math.min(r[r.length-1].modified.endLineNumberExclusive+FO,t+1));eXe(r,(u,d)=>{const h=new cr(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new cr(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new rvr(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{o.push(new nvr(d,g))}),d.modified.forEach(g=>{o.push(new ivr(d,g))}))});const l=r[0].modified.join(r[r.length-1].modified),c=r[0].original.join(r[r.length-1].original);i.push(new evr(new u0(l,c),o))}return i}var yd;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(yd||(yd={}));class evr{constructor(e,t){this.range=e,this.lines=t}}class tvr{constructor(){this.type=yd.Header}}class nvr{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=yd.Deleted,this.modifiedLineNumber=void 0}}class ivr{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=yd.Added,this.originalLineNumber=void 0}}class rvr{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=yd.Unchanged}}let cde=class extends Ue{constructor(e,t,i,r,o,s){super(),this._element=e,this._model=t,this._width=i,this._height=r,this._editors=o,this._languageService=s,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new wg(a)),this._register(ts(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Pd("diffreview.close",T("label.close","Close"),"close-diff-review "+Qn.asClassName(Z_r),!0,()=>Y_r(this,void 0,void 0,function*(){return t.close()})),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new A6(this._content,{})),Lc(this.domNode,this._scrollbar.getDomNode(),a),this._register(mi(()=>{Lc(this.domNode)})),this._register(Uw(this.domNode,{width:this._width,height:this._height})),this._register(Uw(this._content,{width:this._width,height:this._height})),this._register(Oh((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register($a(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),r=document.createElement("div");r.className="diff-review-table",r.setAttribute("role","list"),r.setAttribute("aria-label",T("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Zc(r,i.get(50)),Lc(this._content,r);const o=this._editors.original.getModel(),s=this._editors.modified.getModel();if(!o||!s)return;const a=o.getOptions(),l=s.getOptions(),c=i.get(66),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===yd.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const m=u.range,v=this._model.currentGroupIndex.get(),_=this._model.groups.get().length,b=E=>E===0?T("no_lines_changed","no lines changed"):E===1?T("one_line_changed","1 line changed"):T("more_lines_changed","{0} lines changed",E),y=b(m.original.length),C=b(m.modified.length);g.setAttribute("aria-label",T({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,_,m.original.startLineNumber,y,m.modified.startLineNumber,C));const x=document.createElement("div");x.className="diff-review-cell diff-review-summary",x.appendChild(document.createTextNode(`${v+1}/${_}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),g.appendChild(x),h=g}else h=this._createRow(d,c,this._width.get(),t,o,a,i,s,l);r.appendChild(h);const f=fr(g=>this._model.currentElement.read(g)===d);e.add(ts(g=>{const m=f.read(g);h.tabIndex=m?0:-1,m&&h.focus()})),e.add(tt(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,r,o,s,a,l,c){const u=r.get(143),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",m="";const v="diff-review-spacer";let _=null;switch(e.type){case yd.Added:g="diff-review-row line-insert",m=" char-insert",_=Q_r;break;case yd.Deleted:g="diff-review-row line-delete",m=" char-delete",_=X_r;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,b.appendChild(y);const C=document.createElement("span");C.style.width=d+"px",C.style.minWidth=d+"px",C.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.originalLineNumber))):C.innerText=" ",y.appendChild(C);const x=document.createElement("span");x.style.width=f+"px",x.style.minWidth=f+"px",x.style.paddingRight="10px",x.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?x.appendChild(document.createTextNode(String(e.modifiedLineNumber))):x.innerText=" ",y.appendChild(x);const E=document.createElement("span");if(E.className=v,_){const D=document.createElement("span");D.className=Qn.asClassName(_),D.innerText=" ",E.appendChild(D)}else E.innerText=" ";y.appendChild(E);let k;if(e.modifiedLineNumber!==void 0){let D=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);lw._ttPolicy&&(D=lw._ttPolicy.createHTML(D)),y.insertAdjacentHTML("beforeend",D),k=l.getLineContent(e.modifiedLineNumber)}else{let D=this._getLineHtml(o,r,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);lw._ttPolicy&&(D=lw._ttPolicy.createHTML(D)),y.insertAdjacentHTML("beforeend",D),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=T("blankLine","blank"));let L="";switch(e.type){case yd.Unchanged:e.originalLineNumber===e.modifiedLineNumber?L=T({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",k,e.originalLineNumber):L=T("equalLine","{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case yd.Added:L=T("insertLine","+ {0} modified line {1}",k,e.modifiedLineNumber);break;case yd.Deleted:L=T("deleteLine","- {0} original line {1}",k,e.originalLineNumber);break}return b.setAttribute("aria-label",L),b}_getLineHtml(e,t,i,r,o){const s=e.getLineContent(r),a=t.get(50),l=Ol.createEmpty(s,o),c=ip.isBasicASCII(s,e.mightContainNonBasicASCII()),u=ip.containsRTL(s,c,e.mightContainRTL());return IG(new fE(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Tf.OFF,null)).html}};cde=n1e([i1e(5,xs)],cde);const ovr=Da("diff-insert",Ht.add,T("diffInsertIcon","Line decoration for inserts in the diff editor.")),Vtt=Da("diff-remove",Ht.remove,T("diffRemoveIcon","Line decoration for removals in the diff editor.")),QMe=Ri.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Qn.asClassName(ovr),marginClassName:"gutter-insert"}),XMe=Ri.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Qn.asClassName(Vtt),marginClassName:"gutter-delete"}),ZMe=Ri.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),JMe=Ri.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),e4e=Ri.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),svr=Ri.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),avr=Ri.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),ude=Ri.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),lvr=Ri.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),cvr=Ri.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),uvr=Ri.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Gc(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(T("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Qn.asClassName(Ht.arrowRight),zIndex:10001});class jw extends Ue{constructor(e,t,i,r,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=r,this._editors=o,this._originalScrollTop=Tc(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Tc(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=If("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=ds(this,0),this._modifiedViewZonesChangedSignal=If("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=If("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=_5((h,f)=>{var g;this._element.replaceChildren();const m=this._diffModel.read(h),v=(g=m==null?void 0:m.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!v||v.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const _=this._originalEditorLayoutInfo.read(h),b=this._modifiedEditorLayoutInfo.read(h);if(!_||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=v.map(A=>{function O(H,ie){const se=ie.getTopForLineNumber(H.startLineNumber,!0),Q=ie.getTopForLineNumber(H.endLineNumberExclusive,!0);return(se+Q)/2}const P=O(A.lineRangeMapping.original,this._editors.original),F=this._originalScrollTop.read(h),B=O(A.lineRangeMapping.modified,this._editors.modified),M=this._modifiedScrollTop.read(h),V=P-F,U=B-M,W=Math.min(P,B),q=Math.max(P,B);return{range:new rr(W,q),from:V,to:U,fromWithoutScroll:P,toWithoutScroll:B,move:A}});y.sort(dZi(sg(A=>A.fromWithoutScroll>A.toWithoutScroll,hZi),sg(A=>A.fromWithoutScroll>A.toWithoutScroll?A.fromWithoutScroll:-A.toWithoutScroll,Qy)));const C=r1e.compute(y.map(A=>A.range)),x=10,E=_.verticalScrollbarWidth,k=(C.getTrackCount()-1)*10+x*2,L=E+k+(b.contentLeft-jw.movedCodeBlockPadding);let D=0;for(const A of y){const O=C.getTrack(D),P=E+x+O*10,F=15,B=15,M=L,V=b.glyphMarginWidth+b.lineNumbersWidth,U=18,W=document.createElementNS("http://www.w3.org/2000/svg","rect");W.classList.add("arrow-rectangle"),W.setAttribute("x",`${M-V}`),W.setAttribute("y",`${A.to-U/2}`),W.setAttribute("width",`${V}`),W.setAttribute("height",`${U}`),this._element.appendChild(W);const q=document.createElementNS("http://www.w3.org/2000/svg","g"),H=document.createElementNS("http://www.w3.org/2000/svg","path");H.setAttribute("d",`M 0 ${A.from} L ${P} ${A.from} L ${P} ${A.to} L ${M-B} ${A.to}`),H.setAttribute("fill","none"),q.appendChild(H);const ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");ie.classList.add("arrow"),f.add(ts(se=>{H.classList.toggle("currentMove",A.move===m.activeMovedText.read(se)),ie.classList.toggle("currentMove",A.move===m.activeMovedText.read(se))})),ie.setAttribute("points",`${M-B},${A.to-F/2} ${M},${A.to} ${M-B},${A.to+F/2}`),q.appendChild(ie),this._element.appendChild(q),D++}this.width.set(k,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(mi(()=>this._element.remove())),this._register(ts(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-jw.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(b5(this._state));const s=fr(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(m=>({move:m,original:new sU(rU(m.lineRangeMapping.original.startLineNumber-1),18),modified:new sU(rU(m.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(aU(this._editors.original,s.map(h=>h.map(f=>f.original)))),this._register(aU(this._editors.modified,s.map(h=>h.map(f=>f.modified)))),this._register(Oh((h,f)=>{const g=s.read(h);for(const m of g)f.add(new t4e(this._editors.original,m.original,m.move,"original",this._diffModel.get())),f.add(new t4e(this._editors.modified,m.modified,m.move,"modified",this._diffModel.get()))}));const a=Tc(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=Tc(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=If("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),u=If("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let d="modified";this._register(hY({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(d="original"),h.didChange(u)&&(d="modified"),!0)},h=>{c.read(h),u.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let m;if(g&&d==="original"){const v=a.read(h);v&&(m=g.movedTexts.find(_=>_.lineRangeMapping.original.contains(v.lineNumber)))}if(g&&d==="modified"){const v=l.read(h);v&&(m=g.movedTexts.find(_=>_.lineRangeMapping.modified.contains(v.lineNumber)))}m!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(m)}))}}jw.movedCodeBlockPadding=4;class r1e{static compute(e){const t=[],i=[];for(const r of e){let o=t.findIndex(s=>!s.intersectsStrict(r));o===-1&&(t.length>=6?o=Tir(t,sg(a=>a.intersectWithRangeLength(r),Qy)):(o=t.length,t.push(new E0e))),t[o].addRange(r),i.push(o)}return new r1e(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class t4e extends $tt{constructor(e,t,i,r,o){const s=_c("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=i,this._kind=r,this._diffModel=o,this._nodes=_c("div.diff-moved-code-block",{style:{marginRight:"4px"}},[_c("div.text-content@textContent"),_c("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=Tc(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Uw(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?T("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):T("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?T("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):T("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new wg(this._nodes.actionBar,{highlightToggledItems:!0})),u=new Pd("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new Pd("","Compare",Qn.asClassName(Ht.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ts(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;d.checked=f})),c.push(d,{icon:!1,label:!0})}}class dvr extends Ue{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=fr(this,r=>{var o;const s=(o=this._diffModel.read(r))===null||o===void 0?void 0:o.diff.read(r);if(!s)return null;const a=this._diffModel.read(r).movedTextToCompare.read(r),l=this._options.renderIndicators.read(r),c=this._options.showEmptyDecorations.read(r),u=[],d=[];if(!a)for(const f of s.mappings){if(f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?XMe:JMe}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?QMe:ZMe}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:lvr}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:svr});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&u.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?cvr:ude}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&d.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?avr:e4e});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(r)&&!a&&d.push({range:J.fromPositions(new De(f.lineRangeMapping.modified.startLineNumber,1)),options:uvr})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&u.push({range:g,options:l?XMe:JMe});const m=f.modified.toInclusiveRange();m&&d.push({range:m,options:l?QMe:ZMe});for(const v of f.innerChanges||[])u.push({range:v.originalRange,options:ude}),d.push({range:v.modifiedRange,options:e4e})}const h=this._diffModel.read(r).activeMovedText.read(r);for(const f of s.movedTexts)u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[jw.movedCodeBlockPadding,0,jw.movedCodeBlockPadding,jw.movedCodeBlockPadding]}}),d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:d}}),this._register(oU(this._editors.original,this._decorations.map(r=>(r==null?void 0:r.originalDecorations)||[]))),this._register(oU(this._editors.modified,this._decorations.map(r=>(r==null?void 0:r.modifiedDecorations)||[])))}}class hvr extends Ue{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=ds(this,void 0),this.sashLeft=fr(this,r=>{var o;const s=(o=this._sashRatio.read(r))!==null&&o!==void 0?o:this._options.splitViewDefaultRatio.read(r);return this._computeSashLeft(s,r)}),this._sash=this._register(new uu(this._domNode,{getVerticalSashTop:r=>0,getVerticalSashLeft:r=>this.sashLeft.get(),getVerticalSashHeight:r=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(r=>{const o=this._dimensions.width.get(),s=this._computeSashLeft((this._startSashPosition+(r.currentX-r.startX))/o,void 0);this._sashRatio.set(s/o,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(ts(r=>{const o=this._options.enableSplitViewResizing.read(r);this._sash.state=o?3:0,this.sashLeft.read(r),this._dimensions.height.read(r),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),r=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):r,s=100;return i<=s*2?r:o<s?s:o>i-s?i-s:o}}let EL=class{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=i;for(let o=0;t.children.get(r)!==void 0;o++)r=`${i}_${o}`;return r}static empty(e){return e.children.size===0}},n4e=class extends EL{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}},fvr=class extends EL{constructor(e,t,i,r){super(),this.id=e,this.parent=t,this.label=i,this.order=r,this.children=new Map}},pvr=class ux extends EL{static create(e,t,i){const r=new Va(i),o=new ux(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=EL.findId(`provider_${u}`,o),f=new fvr(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const m of g||[])ux._makeOutlineElement(m,f);return f},g=>(tl(g),f)).then(g=>{EL.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Ia(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!i.isCancellationRequested?ux.create(e,t,i):o._compact()).finally(()=>{r.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=EL.findId(e,t),r=new n4e(i,t,e);if(e.children)for(const o of e.children)ux._makeOutlineElement(o,r);t.children.set(r.id,r)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=tr.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof n4e?e.push(t.symbol):e.push(...tr.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>J.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return ux._flattenDocumentSymbols(t,e,""),t.sort((i,r)=>De.compare(J.getStartPosition(i.range),J.getStartPosition(r.range))||De.compare(J.getEndPosition(r.range),J.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||i,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&ux._flattenDocumentSymbols(e,r.children,r.name)}};var Htt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wtt=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gvr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let dde=class extends Ue{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,r){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=r,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=_5(this,(c,u)=>{const d=this._editors.modifiedModel.read(c);if(d)return u.add(new hde(this._languageFeaturesService,d))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();ks(d=>{for(const h of this._editors.original.getSelections()||[])u==null||u.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,d)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();ks(d=>{for(const h of this._editors.modified.getSelections()||[])u==null||u.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,d)})}}));const o=this._diffModel.map((c,u)=>{var d,h;return((d=c==null?void 0:c.diff.read(u))===null||d===void 0?void 0:d.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(u))!==null&&h!==void 0?h:[]}),s=_5(this,(c,u)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),m=o.read(c);for(const v of m)if(!v.shouldHideControls(c)){{const _=fr(y=>v.getHiddenOriginalRange(y).startLineNumber-1),b=new sU(_,24);h.push(b),u.add(new i4e(this._editors.original,b,v,v.originalUnchangedRange,!g,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const _=fr(y=>v.getHiddenModifiedRange(y).startLineNumber-1),b=new sU(_,24);f.push(b),u.add(new i4e(this._editors.modified,b,v,v.modifiedUnchangedRange,!1,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new Gc(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(T("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Qn.asClassName(Ht.fold),zIndex:10001};this._register(oU(this._editors.original,fr(c=>{const u=o.read(c),d=u.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:J.fromPositions(new De(h.originalLineNumber,1)),options:l});return d}))),this._register(oU(this._editors.modified,fr(c=>{const u=o.read(c),d=u.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:cr.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return d}))),this._register(aU(this._editors.original,s.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(aU(this._editors.modified,s.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(ts(c=>{const u=o.read(c);this._editors.original.setHiddenAreas(u.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(m3)),this._editors.modified.setHiddenAreas(u.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(m3))})),this._register(this._editors.modified.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&(!((u=c.target.element)===null||u===void 0)&&u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&(!((u=c.target.element)===null||u===void 0)&&u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};dde=Htt([Wtt(3,bn)],dde);let hde=class extends Ue{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=ds(this,void 0);const i=If("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=If("_textModel.onDidChangeContent",nn.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(Oh((o,s)=>gvr(this,void 0,void 0,function*(){i.read(o),r.read(o);const a=s.add(new G_r),l=yield pvr.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);s.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const r=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return r.sort(rXe(sg(o=>o.range.endLineNumber-o.range.startLineNumber,Qy))),r.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};hde=Htt([Wtt(0,bn)],hde);class i4e extends $tt{constructor(e,t,i,r,o,s,a,l){const c=_c("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=r,this.hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=_c("div.diff-hidden-lines",[_c("div.top@top",{title:T("diff.hiddenLines.top","Click or drag to show more above")}),_c("div.center@content",{style:{display:"flex"}},[_c("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[kt("a",{title:T("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Hw("$(unfold)"))]),_c("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),_c("div.bottom@bottom",{title:T("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=Tc(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?Lc(this._nodes.first):this._register(Uw(this._nodes.first,{width:u.map(h=>h.contentLeft)}));const d=this._editor;this._register(tt(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=tt(window,"mousemove",b=>{const C=b.clientY-f;g=g||Math.abs(C)>2;const x=Math.round(C/d.getOption(66)),E=Math.max(0,Math.min(m+x,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(E,void 0)}),_=tt(window,"mouseup",b=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(!1,void 0),v.dispose(),_.dispose()})})),this._register(tt(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=tt(window,"mousemove",b=>{const C=b.clientY-f;g=g||Math.abs(C)>2;const x=Math.round(C/d.getOption(66)),E=Math.max(0,Math.min(m-x,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(E,void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-k))}),_=tt(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const y=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),_.dispose()})})),this._register(ts(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,m=T("hiddenLines","{0} hidden lines",g),v=kt("span",{title:T("diff.hiddenLines.expandAll","Double click to unfold")},m);v.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const _=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(_,h);if(b.length>0){f.push(kt("span",void 0," | "));for(let y=0;y<b.length;y++){const C=b[y],x=UW.toIcon(C.kind),E=_c("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[gue(x)," ",C.name,...y===b.length-1?[]:[gue(Ht.chevronRight)]]).root;f.push(E),E.onclick=()=>{this._revealModifiedHiddenLine(C.startLineNumber)}}}}Lc(this._nodes.others,...f)}))}}class Sv{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Sv(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const r=e.getVisibleRanges();if(r.length>0){t=r[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new Sv(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,r,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=r,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var mvr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},_vr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},dx;let lU=dx=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new Le,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,i,r){var o,s;return _vr(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,r);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new yg(new cr(1,2),new cr(1,t.getLineCount()+1),[new CS(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=dx.diffCache.get(a);if(c&&c.context===l)return c.result;const u=Eu.create(),d=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=d==null?void 0:d.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),r.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return dx.diffCache.size>10&&dx.diffCache.delete(dx.diffCache.keys().next().value),dx.diffCache.set(a,{result:d,context:l}),d})}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};lU.diffCache=new Map;lU=dx=mvr([r4e(1,r_),r4e(2,dp)],lU);var vvr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bvr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ztt=or("diffProviderFactoryService");let fde=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(lU,t)}};fde=vvr([bvr(0,di)],fde);vr(ztt,fde,1);var yvr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cvr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},o4e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let pde=class extends Ue{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,r){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=r,this._isDiffUpToDate=ds(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=ds(this,void 0),this.diff=this._diff,this._unchangedRegions=ds(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=fr(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(ks(c=>{for(const u of this._unchangedRegions.get().regions)u.collapseAll(c)}),[])),this.movedTextToCompare=ds(this,void 0),this._activeMovedText=ds(this,void 0),this._hoveredMovedText=ds(this,void 0),this.activeMovedText=fr(this,l=>{var c,u;return(u=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&u!==void 0?u:this._activeMovedText.read(l)}),this._cancellationTokenSource=new Va,this._diffProvider=fr(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),u=If("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:u}}),this._register(mi(()=>this._cancellationTokenSource.cancel()));const o=Ftt("contentChangedSignal"),s=this._register(new $o(()=>o.trigger(void 0),200)),a=(l,c,u)=>{const d=cU.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(u),this._options.hideUnchangedRegionsContextLineCount.read(u)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(_=>e.original.getDecorationRange(_)).filter(_=>!!_).map(_=>cr.fromRange(_)),g=h.modifiedDecorationIds.map(_=>e.modified.getDecorationRange(_)).filter(_=>!!_).map(_=>cr.fromRange(_)),m=e.original.deltaDecorations(h.originalDecorationIds,d.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),v=e.modified.deltaDecorations(h.modifiedDecorationIds,d.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const _ of d)for(let b=0;b<h.regions.length;b++)if(_.originalUnchangedRange.intersectsStrict(f[b])&&_.modifiedUnchangedRange.intersectsStrict(g[b])){_.setHiddenModifiedRange(h.regions[b].getHiddenModifiedRange(void 0),c);break}this._unchangedRegions.set({regions:d,originalDecorationIds:m,modifiedDecorationIds:v},c)};this._register(e.modified.onDidChangeContent(l=>{if(this._diff.get()){const u=zy.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const u=zy.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(Oh((l,c)=>o4e(this,void 0,void 0,function*(){var u,d;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),s.cancel(),o.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),DC(VZe,l),DC(mce,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(v=>{const _=zy.fromModelContentChanges(v.changes);f=Cz(f,_)}));let g=[];c.add(e.modified.onDidChangeContent(v=>{const _=zy.fromModelContentChanges(v.changes);g=Cz(g,_)}));let m=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(m=wvr(m,e.original,e.modified),m=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:m,m=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:m,ks(v=>{a(m,v),this._lastDiff=m;const _=o1e.fromDiffResult(m);this._diff.set(_,v),this._isDiffUpToDate.set(!0,v);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(b.lineRangeMapping.modified)):void 0,v)}))})))}ensureModifiedLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const r=this._unchangedRegions.get().regions;for(const o of r)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const r=this._unchangedRegions.get().regions;for(const o of r)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t);return}}waitForDiff(){return o4e(this,void 0,void 0,function*(){yield $_r(this.isDiffUpToDate,e=>e)})}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions.map(r=>cr.deserialize(r.range)),i=this._unchangedRegions.get();ks(r=>{for(const o of i.regions)for(const s of t)if(o.modifiedUnchangedRange.intersect(s)){o.setHiddenModifiedRange(s,r);break}})}};pde=yvr([Cvr(3,ztt)],pde);function wvr(n,e,t){return{changes:n.changes.map(i=>new yg(i.original,i.modified,i.innerChanges?i.innerChanges.map(r=>Svr(r,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function Svr(n,e,t){let i=n.originalRange,r=n.modifiedRange;return(i.endColumn!==1||r.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&r.endColumn===t.getLineMaxColumn(r.endLineNumber)&&i.endLineNumber<e.getLineCount()&&r.endLineNumber<t.getLineCount()&&(i=i.setEndPosition(i.endLineNumber+1,1),r=r.setEndPosition(r.endLineNumber+1,1)),new CS(i,r)}class o1e{static fromDiffResult(e){return new o1e(e.changes.map(t=>new Utt(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,r){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=r}}class Utt{constructor(e){this.lineRangeMapping=e}}class cU{static fromDiffs(e,t,i,r,o){const s=yg.inverse(e,t,i),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,f=c+d===t+1&&u+d===i+1;(h||f)&&d>=o+r?(h&&!f&&(d-=o),f&&!h&&(c+=o,u+=o,d-=o),a.push(new cU(c,u,d,0,0))):d>=o*2+r&&(c+=o,u+=o,d-=o*2,a.push(new cU(c,u,d,0,0)))}return a}get originalUnchangedRange(){return cr.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return cr.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,r,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=ds(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=ds(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=fr(this,s=>this.visibleLineCountTop.read(s)+this.visibleLineCountBottom.read(s)===this.lineCount&&!this.isDragged.read(s)),this.isDragged=ds(this,!1),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return cr.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return cr.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,r=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,r,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i<r?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+i,t):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+r,t)}showOriginalLine(e,t){const i=e-this.originalLineNumber,r=this.originalLineNumber+this.lineCount-e;i<r?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+r-i,this.getMaxVisibleLineCountTop()),t):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+i-r,this.getMaxVisibleLineCountBottom()),t)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}}var Zte=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Evr extends Ue{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,r,o,s,a,l,c){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=i,this._diff=r,this._editor=o,this._viewLineCounts=s,this._originalTextModel=a,this._contextMenuService=l,this._clipboardService=c,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Qn.asClassName(Ht.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const u=this._modifiedEditor.getOption(66);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${u}px`,this._diffActions.style.lineHeight=`${u}px`,this._marginDomNode.appendChild(this._diffActions);let d=0;const h=i.getOption(126)&&!vv,f=(g,m)=>{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=i.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:m}),getActions:()=>{const _=[],b=r.modified.isEmpty;return _.push(new Pd("diff.clipboard.copyDeletedContent",b?r.original.length>1?T("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):T("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?T("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):T("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>Zte(this,void 0,void 0,function*(){const C=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());yield this._clipboardService.writeText(C)}))),r.original.length>1&&_.push(new Pd("diff.clipboard.copyDeletedLineContent",b?T("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):T("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,()=>Zte(this,void 0,void 0,function*(){let C=this._originalTextModel.getLineContent(r.original.startLineNumber+d);C===""&&(C=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r `),yield this._clipboardService.writeText(C)}))),i.getOption(90)||_.push(new Pd("diff.inline.revertChange",T("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>Zte(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),_},autoSelectFirstItem:!0})};this._register($a(this._diffActions,"mousedown",g=>{const{top:m,height:v}=pl(this._diffActions),_=Math.floor(u/3);g.preventDefault(),f(g.posx,m+v+_)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,i){const{top:r}=pl(e),o=t-r,s=Math.floor(o/i),a=s*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],s<l)return c}return s}}const s4e=R1("diffEditorWidget",{createHTML:n=>n});function xvr(n,e,t,i){Zc(i,e.fontInfo);const r=t.length>0,o=new rR(1e4);let s=0,a=0;const l=[];for(let h=0;h<n.lineTokens.length;h++){const f=h+1,g=n.lineTokens[h],m=n.lineBreakData[h],v=Vh.filter(t,f,1,Number.MAX_SAFE_INTEGER);if(m){let _=0;for(const b of m.breakOffsets){const y=g.sliceAndInflate(_,b,0);s=Math.max(s,a4e(a,y,Vh.extractWrapped(v,_,b),r,n.mightContainNonBasicASCII,n.mightContainRTL,e,o)),a++,_=b}l.push(m.breakOffsets.length)}else l.push(1),s=Math.max(s,a4e(a,g,v,r,n.mightContainNonBasicASCII,n.mightContainRTL,e,o)),a++}s+=e.scrollBeyondLastColumn;const c=o.build(),u=s4e?s4e.createHTML(c):c;i.innerHTML=u;const d=s*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:d,viewLineCounts:l}}class Tvr{constructor(e,t,i,r){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=r}}class s1e{static fromEditor(e){var t;const i=e.getOptions(),r=i.get(50),o=i.get(143);return new s1e(((t=e.getModel())===null||t===void 0?void 0:t.getOptions().tabSize)||0,r,i.get(33),r.typicalHalfwidthCharacterWidth,i.get(103),i.get(66),o.decorationsWidth,i.get(116),i.get(98),i.get(93),i.get(51))}constructor(e,t,i,r,o,s,a,l,c,u,d){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=r,this.scrollBeyondLastColumn=o,this.lineHeight=s,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=u,this.fontLigatures=d}}function a4e(n,e,t,i,r,o,s,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(n*s.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=ip.isBasicASCII(l,r),u=ip.containsRTL(l,c,o),d=T6(new fE(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Tf.OFF,null),a);return a.appendString("</div>"),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var kvr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},l4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let gde=class extends Ue{constructor(e,t,i,r,o,s,a){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=r,this._canIgnoreViewZoneUpdateEvent=o,this._clipboardService=s,this._contextMenuService=a,this._originalTopPadding=ds(this,0),this._originalScrollOffset=ds(this,0),this._originalScrollOffsetAnimated=YMe(this._originalScrollOffset,this._store),this._modifiedTopPadding=ds(this,0),this._modifiedScrollOffset=ds(this,0),this._modifiedScrollOffsetAnimated=YMe(this._modifiedScrollOffset,this._store);let l=!1;const c=ds("state",0),u=this._register(new $o(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(144)||C.hasChanged(66))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(144)||C.hasChanged(66))&&u.schedule()}));const d=this._diffModel.map(C=>C?Tc(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===2):void 0).map((C,x)=>C==null?void 0:C.read(x)),h=new Set,f=new Set,g=fr(C=>{const x=this._diffModel.read(C),E=x==null?void 0:x.diff.read(C);if(!x||!E)return null;c.read(C);const L=this._options.renderSideBySide.read(C);return c4e(this._editors.original,this._editors.modified,E.mappings,h,f,L)}),m=fr(C=>{var x;const E=(x=this._diffModel.read(C))===null||x===void 0?void 0:x.movedTextToCompare.read(C);if(!E)return null;c.read(C);const k=E.changes.map(L=>new Utt(L));return c4e(this._editors.original,this._editors.modified,k,h,f,!0)});function v(){const C=document.createElement("div");return C.className="diagonal-fill",C}const _=this._register(new mt),b=fr(C=>{var x,E,k,L,D,A,O,P;_.clear();const F=g.read(C)||[],B=[],M=[],V=this._modifiedTopPadding.read(C);V>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:V,showInHiddenAreas:!0,suppressMouseDown:!0});const U=this._originalTopPadding.read(C);U>0&&B.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:U,showInHiddenAreas:!0,suppressMouseDown:!0});const W=this._options.renderSideBySide.read(C),q=W||(x=this._editors.modified._getViewModel())===null||x===void 0?void 0:x.createLineBreaksComputer();if(q){for(const ke of F)if(ke.diff)for(let Me=ke.originalRange.startLineNumber;Me<ke.originalRange.endLineNumberExclusive;Me++)q==null||q.addRequest(this._editors.original.getModel().getLineContent(Me),null,null)}const H=(E=q==null?void 0:q.finalize())!==null&&E!==void 0?E:[];let ie=0;const se=this._editors.modified.getOption(66),Q=(k=this._diffModel.read(C))===null||k===void 0?void 0:k.movedTextToCompare.read(C),Ee=(D=(L=this._editors.original.getModel())===null||L===void 0?void 0:L.mightContainNonBasicASCII())!==null&&D!==void 0?D:!1,Fe=(O=(A=this._editors.original.getModel())===null||A===void 0?void 0:A.mightContainRTL())!==null&&O!==void 0?O:!1,He=s1e.fromEditor(this._editors.modified);for(const ke of F)if(ke.diff&&!W){if(!ke.originalRange.isEmpty){d.read(C);const je=document.createElement("div");je.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const qe=new Tvr(ke.originalRange.mapToLineArray(rn=>this._editors.original.getModel().tokenization.getLineTokens(rn)),ke.originalRange.mapToLineArray(rn=>H[ie++]),Ee,Fe),Be=[];for(const rn of ke.diff.innerChanges||[])Be.push(new DM(rn.originalRange.delta(-(ke.diff.original.startLineNumber-1)),ude.className,0));const _t=xvr(qe,He,Be,je),Wt=document.createElement("div");if(Wt.className="inline-deleted-margin-view-zone",Zc(Wt,He.fontInfo),this._options.renderIndicators.read(C))for(let rn=0;rn<_t.heightInLines;rn++){const _n=document.createElement("div");_n.className=`delete-sign ${Qn.asClassName(Vtt)}`,_n.setAttribute("style",`position:absolute;top:${rn*se}px;width:${He.lineDecorationsWidth}px;height:${se}px;right:0;`),Wt.appendChild(_n)}let Tt;_.add(new Evr(()=>zx(Tt),Wt,this._editors.modified,ke.diff,this._diffEditorWidget,_t.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let rn=0;rn<_t.viewLineCounts.length;rn++){const _n=_t.viewLineCounts[rn];_n>1&&B.push({afterLineNumber:ke.originalRange.startLineNumber+rn,domNode:v(),heightInPx:(_n-1)*se,showInHiddenAreas:!0,suppressMouseDown:!0})}M.push({afterLineNumber:ke.modifiedRange.startLineNumber-1,domNode:je,heightInPx:_t.heightInLines*se,minWidthInPx:_t.minWidthInPx,marginDomNode:Wt,setZoneId(rn){Tt=rn},showInHiddenAreas:!0,suppressMouseDown:!0})}const Me=document.createElement("div");Me.className="gutter-delete",B.push({afterLineNumber:ke.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:ke.modifiedHeightInPx,marginDomNode:Me,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Me=ke.modifiedHeightInPx-ke.originalHeightInPx;if(Me>0){if(Q!=null&&Q.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ke.originalRange.endLineNumberExclusive-1))continue;B.push({afterLineNumber:ke.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Me,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let je=function(){const Be=document.createElement("div");return Be.className="arrow-revert-change "+Qn.asClassName(Ht.arrowRight),kt("div",{},Be)};if(Q!=null&&Q.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ke.modifiedRange.endLineNumberExclusive-1))continue;let qe;ke.diff&&ke.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(C)&&(qe=je()),M.push({afterLineNumber:ke.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Me,marginDomNode:qe,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ke of(P=m.read(C))!==null&&P!==void 0?P:[]){if(!(Q!=null&&Q.lineRangeMapping.original.intersect(ke.originalRange))||!(Q!=null&&Q.lineRangeMapping.modified.intersect(ke.modifiedRange)))continue;const Me=ke.modifiedHeightInPx-ke.originalHeightInPx;Me>0?B.push({afterLineNumber:ke.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Me,showInHiddenAreas:!0,suppressMouseDown:!0}):M.push({afterLineNumber:ke.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Me,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:B,mod:M}});this._register(Oh(C=>{const x=Sv.capture(this._editors.modified),E=b.read(C);l=!0,this._editors.original.changeViewZones(k=>{for(const L of h)k.removeZone(L);h.clear();for(const L of E.orig){const D=k.addZone(L);L.setZoneId&&L.setZoneId(D),h.add(D)}}),this._editors.modified.changeViewZones(k=>{for(const L of f)k.removeZone(L);f.clear();for(const L of E.mod){const D=k.addZone(L);L.setZoneId&&L.setZoneId(D),f.add(D)}}),l=!1,x.restore(this._editors.modified)})),this._register(mi(()=>{this._editors.original.changeViewZones(C=>{for(const x of h)C.removeZone(x);h.clear()}),this._editors.modified.changeViewZones(C=>{for(const x of f)C.removeZone(x);f.clear()})}));let y=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!y&&(y=!0,this._editors.modified.setScrollLeft(C.scrollLeft),y=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!y&&(y=!0,this._editors.original.setScrollLeft(C.scrollLeft),y=!1)})),this._originalScrollTop=Tc(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Tc(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ts(C=>{const x=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));x!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(x,1)})),this._register(ts(C=>{const x=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));x!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(x,1)})),this._register(ts(C=>{var x;const E=(x=this._diffModel.read(C))===null||x===void 0?void 0:x.movedTextToCompare.read(C);let k=0;if(E){const L=this._editors.original.getTopForLineNumber(E.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();k=this._editors.modified.getTopForLineNumber(E.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-L}k>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(k,void 0)):k<0?(this._modifiedTopPadding.set(-k,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-k,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+k,void 0,!0)}))}};gde=kvr([l4e(5,B1),l4e(6,t_)],gde);function c4e(n,e,t,i,r,o){const s=new y1(u4e(n,i)),a=new y1(u4e(e,r)),l=n.getOption(66),c=e.getOption(66),u=[];let d=0,h=0;function f(g,m){for(;;){let v=s.peek(),_=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),_&&_.lineNumber>=m&&(_=void 0),!v&&!_)break;const b=v?v.lineNumber-d:Number.MAX_VALUE,y=_?_.lineNumber-h:Number.MAX_VALUE;b<y?(s.dequeue(),_={lineNumber:v.lineNumber-d+h,heightInPx:0}):b>y?(a.dequeue(),v={lineNumber:_.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:cr.ofLength(v.lineNumber,1),modifiedRange:cr.ofLength(_.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+_.heightInPx,diff:void 0})}}for(const g of t){let y=function(C,x){var E,k,L,D;if(C<b||x<_)return;if(v)v=!1;else if(C===b||x===_)return;const A=new cr(b,C),O=new cr(_,x);if(A.isEmpty&&O.isEmpty)return;const P=(k=(E=s.takeWhile(B=>B.lineNumber<C))===null||E===void 0?void 0:E.reduce((B,M)=>B+M.heightInPx,0))!==null&&k!==void 0?k:0,F=(D=(L=a.takeWhile(B=>B.lineNumber<x))===null||L===void 0?void 0:L.reduce((B,M)=>B+M.heightInPx,0))!==null&&D!==void 0?D:0;u.push({originalRange:A,modifiedRange:O,originalHeightInPx:A.length*l+P,modifiedHeightInPx:O.length*c+F,diff:g.lineRangeMapping}),b=C,_=x};const m=g.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,_=m.modified.startLineNumber,b=m.original.startLineNumber;if(o)for(const C of m.innerChanges||[])C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&y(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber),C.originalRange.endColumn<n.getModel().getLineMaxColumn(C.originalRange.endLineNumber)&&y(C.originalRange.endLineNumber,C.modifiedRange.endLineNumber);y(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive),d=m.original.endLineNumberExclusive,h=m.modified.endLineNumberExclusive}return f(Number.MAX_VALUE,Number.MAX_VALUE),u}function u4e(n,e){const t=[],i=[],r=n.getOption(144).wrappingColumn!==-1,o=n._getViewModel().coordinatesConverter,s=n.getOption(66);if(r)for(let l=1;l<=n.getModel().getLineCount();l++){const c=o.getModelLineViewLineCount(l);c>1&&i.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new De(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return U_r(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var Ivr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lvr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},S_;let n1=S_=class extends Ue{constructor(e,t,i,r,o,s,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=r,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._options=a,this._themeService=l;const c=Tc(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),u=fr(f=>{const g=c.read(f),m=g.getColor(Hor)||(g.getColor($or)||Ece).transparent(2),v=g.getColor(Wor)||(g.getColor(Vor)||xce).transparent(2);return{insertColor:m,removeColor:v}}),d=Tc(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=Tc(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Oh((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const m=io(document.createElement("div"));m.setClassName("diffViewport"),m.setPosition("absolute");const v=_c("div.diffOverview",{style:{position:"absolute",top:"0px",width:S_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(f7(v,m.domNode)),g.add($a(v,Yt.POINTER_DOWN,_=>{this._editors.modified.delegateVerticalScrollbarPointerDown(_)})),g.add(tt(v,Yt.MOUSE_WHEEL,_=>{this._editors.modified.delegateScrollFromMouseWheelEvent(_)},{passive:!1})),g.add(f7(this._rootElement,v)),g.add(Oh((_,b)=>{const y=this._diffModel.read(_),C=this._editors.original.createOverviewRuler("original diffOverviewRuler");C&&(b.add(C),b.add(f7(v,C.getDomNode())));const x=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(x&&(b.add(x),b.add(f7(v,x.getDomNode()))),!C||!x)return;const E=If("viewZoneChanged",this._editors.original.onDidChangeViewZones),k=If("viewZoneChanged",this._editors.modified.onDidChangeViewZones),L=If("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),D=If("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(ts(A=>{var O;E.read(A),k.read(A),L.read(A),D.read(A);const P=u.read(A),F=(O=y==null?void 0:y.diff.read(A))===null||O===void 0?void 0:O.mappings;function B(U,W,q){const H=q._getViewModel();return H?U.filter(ie=>ie.length>0).map(ie=>{const se=H.coordinatesConverter.convertModelPositionToViewPosition(new De(ie.startLineNumber,1)),Q=H.coordinatesConverter.convertModelPositionToViewPosition(new De(ie.endLineNumberExclusive,1)),Ee=Q.lineNumber-se.lineNumber;return new OJe(se.lineNumber,Q.lineNumber,Ee,W.toString())}):[]}const M=B((F||[]).map(U=>U.lineRangeMapping.original),P.removeColor,this._editors.original),V=B((F||[]).map(U=>U.lineRangeMapping.modified),P.insertColor,this._editors.modified);C==null||C.setZones(M),x==null||x.setZones(V)})),b.add(ts(A=>{const O=this._rootHeight.read(A),P=this._rootWidth.read(A),F=this._modifiedEditorLayoutInfo.read(A);if(F){const B=S_.ENTIRE_DIFF_OVERVIEW_WIDTH-2*S_.ONE_OVERVIEW_WIDTH;C.setLayout({top:0,height:O,right:B+S_.ONE_OVERVIEW_WIDTH,width:S_.ONE_OVERVIEW_WIDTH}),x.setLayout({top:0,height:O,right:0,width:S_.ONE_OVERVIEW_WIDTH});const M=d.read(A),V=h.read(A),U=this._editors.modified.getOption(102),W=new FA(U.verticalHasArrows?U.arrowSize:0,U.verticalScrollbarSize,0,F.height,V,M);m.setTop(W.getSliderPosition()),m.setHeight(W.getSliderSize())}else m.setTop(0),m.setHeight(0);v.style.height=O+"px",v.style.left=P-S_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",m.setWidth(S_.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};n1.ONE_OVERVIEW_WIDTH=15;n1.ENTIRE_DIFF_OVERVIEW_WIDTH=S_.ONE_OVERVIEW_WIDTH*2;n1=S_=Ivr([Lvr(7,Hl)],n1);he("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},T("diffEditor.move.border","The border color for text that got moved in the diff editor."));he("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},T("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class gY extends Ue{constructor(){super(...arguments),this._id=++gY.idCounter,this._onDidDispose=this._register(new Le),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,r=!0){this._targetEditor.revealRange(e,t,i,r)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}gY.idCounter=0;var Dvr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let mde=class extends Ue{constructor(e,t,i,r,o,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=o,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new Le),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),r.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),r.modifiedEditor||{})),this.modifiedModel=Tc(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(hY({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return r.setContextValue("isInDiffLeftEditor",!0),r}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return r.setContextValue("isInDiffRightEditor",!0),r}_constructInnerEditor(e,t,i,r){const o=this._createInnerEditor(e,t,i,r);return this._register(o.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+n1.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Lv.revealHorizontalRightPadding.defaultValue+n1.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=T("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};mde=Dvr([d4e(5,di),d4e(6,Qo)],mde);class Avr{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=fr(this,r=>this._options.read(r).renderSideBySide&&this.diffEditorWidth.read(r)<=this._options.read(r).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=fr(this,r=>this._options.read(r).renderOverviewRuler),this.renderSideBySide=fr(this,r=>this._options.read(r).renderSideBySide&&!(this._options.read(r).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(r))),this.readOnly=fr(this,r=>this._options.read(r).readOnly),this.shouldRenderRevertArrows=fr(this,r=>!(!this._options.read(r).renderMarginRevertIcon||!this.renderSideBySide.read(r)||this.readOnly.read(r))),this.renderIndicators=fr(this,r=>this._options.read(r).renderIndicators),this.enableSplitViewResizing=fr(this,r=>this._options.read(r).enableSplitViewResizing),this.splitViewDefaultRatio=fr(this,r=>this._options.read(r).splitViewDefaultRatio),this.ignoreTrimWhitespace=fr(this,r=>this._options.read(r).ignoreTrimWhitespace),this.maxComputationTimeMs=fr(this,r=>this._options.read(r).maxComputationTime),this.showMoves=fr(this,r=>this._options.read(r).experimental.showMoves&&this.renderSideBySide.read(r)),this.isInEmbeddedEditor=fr(this,r=>this._options.read(r).isInEmbeddedEditor),this.diffWordWrap=fr(this,r=>this._options.read(r).diffWordWrap),this.originalEditable=fr(this,r=>this._options.read(r).originalEditable),this.diffCodeLens=fr(this,r=>this._options.read(r).diffCodeLens),this.accessibilityVerbose=fr(this,r=>this._options.read(r).accessibilityVerbose),this.diffAlgorithm=fr(this,r=>this._options.read(r).diffAlgorithm),this.showEmptyDecorations=fr(this,r=>this._options.read(r).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=fr(this,r=>this._options.read(r).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=fr(this,r=>this._options.read(r).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=fr(this,r=>this._options.read(r).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=fr(this,r=>this._options.read(r).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=fr(this,r=>this._options.read(r).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),h4e(e,Au));this._options=ds(this,i)}updateOptions(e){const t=h4e(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function h4e(n,e){var t,i,r,o,s,a,l,c;return{enableSplitViewResizing:Bn(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:RZi(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Bn(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Bn(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:ox(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:ox(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Bn(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Bn(n.renderIndicators,e.renderIndicators),originalEditable:Bn(n.originalEditable,e.originalEditable),diffCodeLens:Bn(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Bn(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Ma(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Ma(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Bn(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Bn((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Bn((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:Bn((o=(r=n.hideUnchangedRegions)===null||r===void 0?void 0:r.enabled)!==null&&o!==void 0?o:(s=n.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:ox((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:ox((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:ox((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Bn(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Bn(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:ox(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Bn(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var Nvr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},BO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let lk=class extends gY{constructor(e,t,i,r,o,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=r,this._parentInstantiationService=o,this._audioCueService=a,this._editorProgressService=l,this.elements=_c("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[_c("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[kt("span",{},"No Changes")]),_c("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),_c("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),_c("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(iU("diffModel",void 0)),this.onDidChangeModel=nn.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new HG([vi,this._contextKeyService])),this._boundarySashes=ds(this,void 0),this._accessibleDiffViewerShouldBeVisible=ds(this,!1),this._accessibleDiffViewerVisible=fr(this,m=>this._options.onlyShowAccessibleDiffViewer.read(m)?!0:this._accessibleDiffViewerShouldBeVisible.read(m)),this.movedBlocksLinesPart=ds(this,void 0),this._layoutInfo=fr(this,m=>{var v,_,b;const y=this._rootSizeObserver.width.read(m),C=this._rootSizeObserver.height.read(m),x=(v=this._sash.read(m))===null||v===void 0?void 0:v.sashLeft.read(m),E=x??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),k=y-E-(this._options.renderOverviewRuler.read(m)?n1.ENTIRE_DIFF_OVERVIEW_WIDTH:0),L=(b=(_=this.movedBlocksLinesPart.read(m))===null||_===void 0?void 0:_.width.read(m))!==null&&b!==void 0?b:0,D=E-L;return this.elements.original.style.width=D+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=k+"px",this.elements.modified.style.left=E+"px",this._editors.original.layout({width:D,height:C}),this._editors.modified.layout({width:k,height:C}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((m,v)=>m==null?void 0:m.diff.read(v)),this.onDidUpdateDiff=nn.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(mi(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new j_r(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new Avr(t,this._rootSizeObserver.width),this._contextKeyService.createKey(de.isEmbeddedDiffEditor.key,!1);const u=de.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(ts(m=>{u.set(this._options.isInEmbeddedEditor.read(m))}));const d=de.comparingMovedCode.bindTo(this._contextKeyService);this._register(ts(m=>{var v;d.set(!!(!((v=this._diffModel.read(m))===null||v===void 0)&&v.movedTextToCompare.read(m)))}));const h=de.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(ts(m=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(m))})),this._editors=this._register(this._instantiationService.createInstance(mde,this.elements.original,this.elements.modified,this._options,i,(m,v,_,b)=>this._createInnerEditor(m,v,_,b))),this._sash=_5(this,(m,v)=>{const _=this._options.renderSideBySide.read(m);if(this.elements.root.classList.toggle("side-by-side",_),!_)return;const b=v.add(new hvr(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,C)=>y-(this._options.renderOverviewRuler.read(C)?n1.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return v.add(ts(y=>{const C=this._boundarySashes.read(y);C&&b.setBoundarySashes(C)})),b}),this._register(b5(this._sash)),this._register(Oh((m,v)=>{this.unchangedRangesFeature=v.add(this._instantiationService.createInstance(DC(dde,m),this._editors,this._diffModel,this._options))})),this._register(Oh((m,v)=>{v.add(new(DC(dvr,m))(this._editors,this._diffModel,this._options))})),this._register(Oh((m,v)=>{v.add(this._instantiationService.createInstance(DC(gde,m),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Oh((m,v)=>{v.add(this._instantiationService.createInstance(DC(n1,m),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(_=>_.modifiedEditor),this._options))})),this._register(Oh((m,v)=>{this._accessibleDiffViewer=v.add(this._register(this._instantiationService.createInstance(DC(lw,m),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(_,b)=>this._accessibleDiffViewerShouldBeVisible.set(_,b),this._options.onlyShowAccessibleDiffViewer.map(_=>!_),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((_,b)=>{var y;return(y=_==null?void 0:_.diff.read(b))===null||y===void 0?void 0:y.mappings.map(C=>C.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(m=>m?"hidden":"visible");this._register(Uw(this.elements.modified,{visibility:f})),this._register(Uw(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(b5(this._layoutInfo)),this._register(Oh((m,v)=>{this.movedBlocksLinesPart.set(v.add(new(DC(jw,m))(this.elements.root,this._diffModel,this._layoutInfo.map(_=>_.originalEditor),this._layoutInfo.map(_=>_.modifiedEditor),this._editors)),void 0)})),this._register(Uw(this.elements.overlay,{width:this._layoutInfo.map((m,v)=>m.originalEditor.width+(this._options.renderSideBySide.read(v)?0:m.modifiedEditor.width)),visibility:fr(m=>{var v,_;return this._options.hideUnchangedRegions.read(m)&&((_=(v=this._diffModel.read(m))===null||v===void 0?void 0:v.diff.read(m))===null||_===void 0?void 0:_.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(m=>{var v,_;if(!m.event.rightButton&&m.target.position&&(!((v=m.target.element)===null||v===void 0)&&v.className.includes("arrow-revert-change"))){const b=m.target.position.lineNumber,y=m.target,C=this._diffModel.get();if(!C)return;const x=(_=C.diff.get())===null||_===void 0?void 0:_.mappings;if(!x)return;const E=x.find(k=>(y==null?void 0:y.detail.afterLineNumber)===k.lineRangeMapping.modified.startLineNumber-1||k.lineRangeMapping.modified.startLineNumber===b);if(!E)return;this.revert(E.lineRangeMapping),m.event.stopPropagation()}})),this._register(nn.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,m=>{var v,_;if((m==null?void 0:m.reason)===3){const b=(_=(v=this._diffModel.get())===null||v===void 0?void 0:v.diff.get())===null||_===void 0?void 0:_.mappings.find(y=>y.lineRangeMapping.modified.contains(m.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Nr.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Nr.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(Nr.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((m,v)=>m==null?void 0:m.isDiffUpToDate.read(v));this._register(Oh((m,v)=>{if(g.read(m)===!1){const _=this._editorProgressService.show(!0,1e3);v.add(mi(()=>_.done()))}}))}_createInnerEditor(e,t,i,r){return e.createInstance($A,t,i,r)}_createDiffEditorContributions(){const e=JL.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Oi(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return x6.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(pde,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),ks(i=>{this._diffModel.set(t,i)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?Pvr(t):null}revert(e){var t;const i=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!i)return;const r=e.innerChanges?e.innerChanges.map(o=>({range:o.modifiedRange,text:i.original.getValueInRange(o.originalRange)})):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",r)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),r=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let s;const a=r.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=f4e(a.getStartPosition(),l),u=f4e(a.getEndPosition(),l);s=J.plusRange(c,u)}}return{destination:o,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&ks(i=>{for(const r of t)r.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&ks(i=>{for(const r of t)r.showAll(i)})}};lk=Nvr([BO(3,vi),BO(4,di),BO(5,eo),BO(6,j6),BO(7,gE)],lk);function f4e(n,e){const t=rz(e,r=>r.original.startLineNumber<=n.lineNumber);if(!t)return J.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const r=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return J.fromPositions(new De(r,n.column))}if(!t.innerChanges)return J.fromPositions(new De(t.modified.startLineNumber,1));const i=rz(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const r=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return J.fromPositions(new De(r,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const r=Rvr(i.originalRange.getEndPosition(),n);return J.fromPositions(Ovr(i.modifiedRange.getEndPosition(),r))}}function Rvr(n,e){return n.lineNumber===e.lineNumber?new G3(0,e.column-n.column):new G3(e.lineNumber-n.lineNumber,e.column-1)}function Ovr(n,e){return e.lineCount===0?new De(n.lineNumber,n.column+e.columnCount):new De(n.lineNumber+e.lineCount,e.columnCount+1)}function Pvr(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,r,o,s,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,r=0,a=void 0):(i=t.original.startLineNumber,r=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,a=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:r,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var a1e=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ss=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Mvr=0,p4e=!1;function Fvr(n){if(!n){if(p4e)return;p4e=!0}Mrr(n||document.body)}let uU=class extends $A{constructor(e,t,i,r,o,s,a,l,c,u,d,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||Pz.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+Pz.accessibilityHelpMessage,super(e,f,{},i,r,o,s,l,c,u,d,h),a instanceof KA?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Fvr(f.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const r="DYNAMIC_"+ ++Mvr,o=at.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,o),r}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Ue.None;const t=e.id,i=e.label,r=at.and(at.equals("editorId",this.getId()),at.deserialize(e.precondition)),o=e.keybindings,s=at.and(r,at.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new mt,d=this.getId()+":"+t;if(u.add(_r.registerCommand(d,c)),a){const f={command:{id:d,title:i},when:r,group:a,order:l};u.add(xc.appendMenuItem(ue.EditorContext,f))}if(Array.isArray(o))for(const f of o)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new PJe(d,i,i,r,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(mi(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof kz)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};uU=a1e([Ss(2,di),Ss(3,eo),Ss(4,_a),Ss(5,vi),Ss(6,Qo),Ss(7,Hl),Ss(8,za),Ss(9,O1),Ss(10,rs),Ss(11,bn)],uU);let _de=class extends uU{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m){const v=Object.assign({},t);nU(u,v,!1);const _=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const b=v.model;delete v.model,super(e,v,i,r,o,s,a,l,c,d,g,m),this._configurationService=u,this._standaloneThemeService=l,this._register(_);let y;if(typeof b>"u"){const C=f.getLanguageIdByMimeType(v.language)||v.language||qf;y=jtt(h,f,v.value||"",C,void 0),this._ownsModel=!0}else y=b,this._ownsModel=!1;if(this._attachModel(y),y){const C={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(C)}}dispose(){super.dispose()}updateOptions(e){nU(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};_de=a1e([Ss(2,di),Ss(3,eo),Ss(4,_a),Ss(5,vi),Ss(6,Qo),Ss(7,fp),Ss(8,za),Ss(9,dr),Ss(10,O1),Ss(11,Ds),Ss(12,xs),Ss(13,rs),Ss(14,bn)],_de);let vde=class extends lk{constructor(e,t,i,r,o,s,a,l,c,u,d,h){const f=Object.assign({},t);nU(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&s.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},r,i,o,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){nU(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(uU,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};vde=a1e([Ss(2,di),Ss(3,vi),Ss(4,eo),Ss(5,fp),Ss(6,za),Ss(7,dr),Ss(8,t_),Ss(9,gE),Ss(10,B1),Ss(11,j6)],vde);function jtt(n,e,t,i,r){if(t=t||"",!i){const o=t.indexOf(` `);let s=t;return o!==-1&&(s=t.substring(0,o)),g4e(n,t,e.createByFilepathOrFirstLine(r||null,s),r)}return g4e(n,t,e.createById(i),r)}function g4e(n,e,t,i){return n.createModel(e,t,i)}var qtt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Bvr(n,e,t){return ai.initialize(t||{}).createInstance(_de,n,e)}function $vr(n){return ai.get(eo).onCodeEditorAdd(t=>{n(t)})}function Vvr(n){return ai.get(eo).onDiffEditorAdd(t=>{n(t)})}function Hvr(){return ai.get(eo).listCodeEditors()}function Wvr(){return ai.get(eo).listDiffEditors()}function zvr(n,e,t){return ai.initialize(t||{}).createInstance(vde,n,e)}function Uvr(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return _r.registerCommand(n.id,n.run)}function jvr(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=at.deserialize(n.precondition),t=(r,...o)=>ac.runEditorCommand(r,o,e,(s,a,l)=>Promise.resolve(n.run(a,...l))),i=new mt;if(i.add(_r.registerCommand(n.id,t)),n.contextMenuGroupId){const r={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(xc.appendMenuItem(ue.EditorContext,r))}if(Array.isArray(n.keybindings)){const r=ai.get(Qo);if(!(r instanceof KA))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=at.and(e,at.deserialize(n.keybindingContext));i.add(r.addDynamicKeybindings(n.keybindings.map(s=>({keybinding:s,command:n.id,when:o}))))}}return i}function qvr(n){return Ktt([n])}function Ktt(n){const e=ai.get(Qo);return e instanceof KA?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:at.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Ue.None)}function Kvr(n,e,t){const i=ai.get(xs),r=i.getLanguageIdByMimeType(e)||e;return jtt(ai.get(Ds),i,n,r,t)}function Gvr(n,e){const t=ai.get(xs),i=t.getLanguageIdByMimeType(e)||e||qf;n.setLanguage(t.createById(i))}function Yvr(n,e,t){n&&ai.get(N0).changeOne(e,n.uri,t)}function Qvr(n){ai.get(N0).changeAll(n,[])}function Xvr(n){return ai.get(N0).read(n)}function Zvr(n){return ai.get(N0).onMarkerChanged(n)}function Jvr(n){return ai.get(Ds).getModel(n)}function ebr(){return ai.get(Ds).getModels()}function tbr(n){return ai.get(Ds).onModelAdded(n)}function nbr(n){return ai.get(Ds).onModelRemoved(n)}function ibr(n){return ai.get(Ds).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function rbr(n){return crr(ai.get(Ds),ai.get(rs),n)}function obr(n,e){const t=ai.get(xs),i=ai.get(fp);return N0e.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function sbr(n,e,t){const i=ai.get(xs);return ai.get(fp).registerEditorContainer(document.body),N0e.colorize(i,n,e,t)}function abr(n,e,t=4){return ai.get(fp).registerEditorContainer(document.body),N0e.colorizeModelLine(n,e,t)}function lbr(n){const e=Ks.get(n);return e||{getInitialState:()=>DA,tokenize:(t,i,r)=>L0e(n,r)}}function cbr(n,e){Ks.getOrCreate(e);const t=lbr(e),i=l0(n),r=[];let o=t.getInitialState();for(let s=0,a=i.length;s<a;s++){const l=i[s],c=t.tokenize(l,!0,o);r[s]=c.tokens,o=c.endState}return r}function ubr(n,e){ai.get(fp).defineTheme(n,e)}function dbr(n){ai.get(fp).setTheme(n)}function hbr(){Zle.clearAllFontInfos()}function fbr(n,e){return _r.registerCommand({id:n,handler:e})}function pbr(n){return ai.get(rf).registerOpener({open(t){return qtt(this,void 0,void 0,function*(){return typeof t=="string"&&(t=Yn.parse(t)),n.open(t)})}})}function gbr(n){return ai.get(eo).registerCodeEditorOpenHandler((t,i,r)=>qtt(this,void 0,void 0,function*(){var o;if(!i)return null;const s=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),(yield n.openCodeEditor(i,t.resource,a))?i:null}))}function mbr(){return{create:Bvr,getEditors:Hvr,getDiffEditors:Wvr,onDidCreateEditor:$vr,onDidCreateDiffEditor:Vvr,createDiffEditor:zvr,addCommand:Uvr,addEditorAction:jvr,addKeybindingRule:qvr,addKeybindingRules:Ktt,createModel:Kvr,setModelLanguage:Gvr,setModelMarkers:Yvr,getModelMarkers:Xvr,removeAllMarkers:Qvr,onDidChangeMarkers:Zvr,getModels:ebr,getModel:Jvr,onDidCreateModel:tbr,onWillDisposeModel:nbr,onDidChangeModelLanguage:ibr,createWebWorker:rbr,colorizeElement:obr,colorize:sbr,colorizeModelLine:abr,tokenize:cbr,defineTheme:ubr,setTheme:dbr,remeasureFonts:hbr,registerCommand:fbr,registerLinkOpener:pbr,registerEditorOpener:gbr,AccessibilitySupport:ule,ContentWidgetPositionPreference:mle,CursorChangeReason:_le,DefaultEndOfLine:vle,EditorAutoIndentStrategy:yle,EditorOption:Cle,EndOfLinePreference:wle,EndOfLineSequence:Sle,MinimapPosition:Nle,MouseTargetType:Rle,OverlayWidgetPositionPreference:Ole,OverviewRulerLane:Ple,GlyphMarginLane:Ele,RenderLineNumbersType:Fle,RenderMinimap:Ble,ScrollbarVisibility:Vle,ScrollType:$le,TextEditorCursorBlinkingStyle:jle,TextEditorCursorStyle:qle,TrackedRangeStickiness:Kle,WrappingIndent:Gle,InjectedTextCursorStops:Tle,PositionAffinity:Mle,ConfigurationChangedEvent:mXe,BareFontInfo:gT,FontInfo:Xle,TextModelResolvedOptions:q$,FindMatch:L3,ApplyUpdateResult:kM,EditorZoom:Hp,EditorType:x6,EditorOptions:Lv}}function _br(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function p7(n,e){return typeof n=="boolean"?n:e}function m4e(n,e){return typeof n=="string"?n:e}function vbr(n){const e={};for(const t of n)e[t]=!0;return e}function _4e(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=vbr(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function bde(n,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,s){i=!0;let a="";if(typeof n[s]=="string")a=n[s];else if(n[s]&&n[s]instanceof RegExp)a=n[s].source;else throw n[s]===void 0?bs(n,"language definition does not contain attribute '"+s+"', used at: "+e):bs(n,"attribute reference '"+s+"' must be a string, used at: "+e);return x2(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");const r=(n.ignoreCase?"i":"")+(n.unicode?"u":"");return new RegExp(e,r)}function bbr(n,e,t,i){if(i<0)return n;if(i<e.length)return e[i];if(i>=100){i=i-100;const r=t.split(".");if(r.unshift(t),i<r.length)return r[i]}return null}function ybr(n,e,t,i){let r=-1,o=t,s=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);s&&(s[3]&&(r=parseInt(s[3]),s[2]&&(r=r+100)),o=s[4]);let a="~",l=o;!o||o.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(s=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),s&&(a=s[1],l=s[2]));let c;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){const u=_4e(l.split("|"),n.ignoreCase);c=function(d){return a==="~"?u(d):!u(d)}}else if(a==="@"||a==="!@"){const u=n[l];if(!u)throw bs(n,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!_br(function(h){return typeof h=="string"},u))throw bs(n,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const d=_4e(u,n.ignoreCase);c=function(h){return a==="@"?d(h):!d(h)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const u=bde(n,"^"+l+"$");c=function(d){return a==="~"?u.test(d):!u.test(d)}}else c=function(u,d,h,f){return bde(n,"^"+BC(n,l,d,h,f)+"$").test(u)};else if(l.indexOf("$")<0){const u=Bw(n,l);c=function(d){return a==="=="?d===u:d!==u}}else{const u=Bw(n,l);c=function(d,h,f,g,m){const v=BC(n,u,h,f,g);return a==="=="?d===v:d!==v}}return r===-1?{name:t,value:i,test:function(u,d,h,f){return c(u,u,d,h,f)}}:{name:t,value:i,test:function(u,d,h,f){const g=bbr(u,d,h,r);return c(g||"",u,d,h,f)}}}function yde(n,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw bs(n,"a 'token' attribute must be of type string, in rule: "+e);{const i={token:t.token};if(t.token.indexOf("$")>=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw bs(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw bs(n,"the next state must be a string value in rule: "+e);{let r=t.next;if(!/^(@pop|@push|@popall)$/.test(r)&&(r[0]==="@"&&(r=r.substr(1)),r.indexOf("$")<0&&!Irr(n,BC(n,r,"",[],""))))throw bs(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=r}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let r=0,o=t.length;r<o;r++)i[r]=yde(n,e,t[r]);return{group:i}}else if(t.cases){const i=[];for(const o in t.cases)if(t.cases.hasOwnProperty(o)){const s=yde(n,e,t.cases[o]);o==="@default"||o==="@"||o===""?i.push({test:void 0,value:s,name:o}):o==="@eos"?i.push({test:function(a,l,c,u){return u},value:s,name:o}):i.push(ybr(n,e,o,s))}const r=n.defaultToken;return{test:function(o,s,a,l){for(const c of i)if(!c.test||c.test(o,s,a,l))return c.value;return r}}}else throw bs(n,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class Cbr{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if(typeof t=="string")i=t;else if(t instanceof RegExp)i=t.source;else throw bs(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=i.length>0&&i[0]==="^",this.name=this.name+": "+i,this.regex=bde(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=yde(e,this.name,t)}}function Gtt(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=p7(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=p7(e.ignoreCase,!1),t.unicode=p7(e.unicode,!1),t.tokenPostfix=m4e(e.tokenPostfix,"."+t.languageId),t.defaultToken=m4e(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function r(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw bs(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw bs(t,"include target '"+u+"' is not defined at: "+s);r(s+"."+u,a,e.tokenizer[u])}else{const d=new Cbr(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(i,h)}else throw bs(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+s);else d.setAction(i,c[1]);else{if(!c.regex)throw bs(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=p7(c.matchOnlyAtLineStart,!1)),d.setRegex(i,c.regex),d.setAction(i,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw bs(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,r("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw bs(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw bs(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Bw(t,a.open),close:Bw(t,a.close)});else throw bs(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}var wbr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Sbr(n){IA.registerLanguage(n)}function Ebr(){let n=[];return n=n.concat(IA.getLanguages()),n}function xbr(n){return ai.get(xs).languageIdCodec.encodeLanguageId(n)}function Tbr(n,e){return ai.withServices(()=>{const i=ai.get(xs).onDidRequestRichLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function kbr(n,e){return ai.withServices(()=>{const i=ai.get(xs).onDidRequestBasicLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function Ibr(n,e){if(!ai.get(xs).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return ai.get(rs).register(n,e,100)}class Lbr{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return y5.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const r=this._actual.tokenizeEncoded(e,i);return new iG(r.tokens,r.endState)}}class y5{constructor(e,t,i,r){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=r}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let r=0;for(let o=0,s=e.length;o<s;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<r&&(l=r),i[o]=new b3(l,a.scopes,t),r=l}return i}static adaptTokenize(e,t,i,r){const o=t.tokenize(i,r),s=y5._toClassicTokens(o.tokens,e);let a;return o.endState.equals(r)?a=r:a=o.endState,new o0e(s,a)}tokenize(e,t,i){return y5.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),r=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let s=0,a=0;for(let c=0,u=t.length;c<u;c++){const d=t[c],h=r.match(i,d.scopes)|1024;if(s>0&&o[s-1]===h)continue;let f=d.startIndex;c===0?f=0:f<a&&(f=a),o[s++]=f,o[s++]=h,a=f}const l=new Uint32Array(s);for(let c=0;c<s;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const r=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,r.tokens);let s;return r.endState.equals(i)?s=i:s=r.endState,new iG(o,s)}}function Dbr(n){return typeof n.getInitialState=="function"}function Abr(n){return"tokenizeEncoded"in n}function Ytt(n){return n&&typeof n.then=="function"}function Nbr(n){const e=ai.get(fp);if(n){const t=[null];for(let i=1,r=n.length;i<r;i++)t[i]=ze.fromHex(n[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function Qtt(n,e){return Abr(e)?new Lbr(n,e):new y5(n,e,ai.get(xs),ai.get(fp))}function l1e(n,e){const t=new oer(()=>wbr(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?Dbr(i)?Qtt(n,i):new M3(ai.get(xs),ai.get(fp),n,Gtt(n,i),ai.get(dr)):null}));return Ks.registerFactory(n,t)}function Rbr(n,e){if(!ai.get(xs).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return Ytt(e)?l1e(n,{create:()=>e}):Ks.register(n,Qtt(n,e))}function Obr(n,e){const t=i=>new M3(ai.get(xs),ai.get(fp),n,Gtt(n,i),ai.get(dr));return Ytt(e)?l1e(n,{create:()=>e}):Ks.register(n,t(e))}function Pbr(n,e){return ai.get(bn).referenceProvider.register(n,e)}function Mbr(n,e){return ai.get(bn).renameProvider.register(n,e)}function Fbr(n,e){return ai.get(bn).signatureHelpProvider.register(n,e)}function Bbr(n,e){return ai.get(bn).hoverProvider.register(n,{provideHover:(i,r,o)=>{const s=i.getWordAtPosition(r);return Promise.resolve(e.provideHover(i,r,o)).then(a=>{if(a)return!a.range&&s&&(a.range=new J(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)),a.range||(a.range=new J(r.lineNumber,r.column,r.lineNumber,r.column)),a})}})}function $br(n,e){return ai.get(bn).documentSymbolProvider.register(n,e)}function Vbr(n,e){return ai.get(bn).documentHighlightProvider.register(n,e)}function Hbr(n,e){return ai.get(bn).linkedEditingRangeProvider.register(n,e)}function Wbr(n,e){return ai.get(bn).definitionProvider.register(n,e)}function zbr(n,e){return ai.get(bn).implementationProvider.register(n,e)}function Ubr(n,e){return ai.get(bn).typeDefinitionProvider.register(n,e)}function jbr(n,e){return ai.get(bn).codeLensProvider.register(n,e)}function qbr(n,e,t){return ai.get(bn).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,o,s,a)=>{const c=ai.get(N0).read({resource:r.uri}).filter(u=>J.areIntersectingOrTouching(u,o));return e.provideCodeActions(r,o,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Kbr(n,e){return ai.get(bn).documentFormattingEditProvider.register(n,e)}function Gbr(n,e){return ai.get(bn).documentRangeFormattingEditProvider.register(n,e)}function Ybr(n,e){return ai.get(bn).onTypeFormattingEditProvider.register(n,e)}function Qbr(n,e){return ai.get(bn).linkProvider.register(n,e)}function Xbr(n,e){return ai.get(bn).completionProvider.register(n,e)}function Zbr(n,e){return ai.get(bn).colorProvider.register(n,e)}function Jbr(n,e){return ai.get(bn).foldingRangeProvider.register(n,e)}function e0r(n,e){return ai.get(bn).declarationProvider.register(n,e)}function t0r(n,e){return ai.get(bn).selectionRangeProvider.register(n,e)}function n0r(n,e){return ai.get(bn).documentSemanticTokensProvider.register(n,e)}function i0r(n,e){return ai.get(bn).documentRangeSemanticTokensProvider.register(n,e)}function r0r(n,e){return ai.get(bn).inlineCompletionsProvider.register(n,e)}function o0r(n,e){return ai.get(bn).inlayHintsProvider.register(n,e)}function s0r(){return{register:Sbr,getLanguages:Ebr,onLanguage:Tbr,onLanguageEncountered:kbr,getEncodedLanguageId:xbr,setLanguageConfiguration:Ibr,setColorMap:Nbr,registerTokensProviderFactory:l1e,setTokensProvider:Rbr,setMonarchTokensProvider:Obr,registerReferenceProvider:Pbr,registerRenameProvider:Mbr,registerCompletionItemProvider:Xbr,registerSignatureHelpProvider:Fbr,registerHoverProvider:Bbr,registerDocumentSymbolProvider:$br,registerDocumentHighlightProvider:Vbr,registerLinkedEditingRangeProvider:Hbr,registerDefinitionProvider:Wbr,registerImplementationProvider:zbr,registerTypeDefinitionProvider:Ubr,registerCodeLensProvider:jbr,registerCodeActionProvider:qbr,registerDocumentFormattingEditProvider:Kbr,registerDocumentRangeFormattingEditProvider:Gbr,registerOnTypeFormattingEditProvider:Ybr,registerLinkProvider:Qbr,registerColorProvider:Zbr,registerFoldingRangeProvider:Jbr,registerDeclarationProvider:e0r,registerSelectionRangeProvider:t0r,registerDocumentSemanticTokensProvider:n0r,registerDocumentRangeSemanticTokensProvider:i0r,registerInlineCompletionsProvider:r0r,registerInlayHintsProvider:o0r,DocumentHighlightKind:ble,CompletionItemKind:fle,CompletionItemTag:ple,CompletionItemInsertTextRule:hle,SymbolKind:zle,SymbolTag:Ule,IndentAction:xle,CompletionTriggerKind:gle,SignatureHelpTriggerKind:Wle,InlayHintKind:kle,InlineCompletionTriggerKind:Ile,CodeActionTriggerType:dle,FoldingRangeKind:Ld,SelectedSuggestionInfo:NXe}}const c1e=or("IEditorCancelService"),Xtt=new sn("cancellableOperation",!1,T("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));vr(c1e,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(r=>{const o=Xtt.bindTo(r.get(vi)),s=new Id;return{key:o,tokens:s}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class a0r extends Va{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(c1e).add(e,this))}dispose(){this._unregister(),super.dispose()}}zt(new class extends ac{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Xtt})}runEditorCommand(n,e){n.get(c1e).cancel(e)}});let Ztt=class Cde{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?GT("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Cde))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new Cde(e,this.flags))}};class IS extends a0r{constructor(e,t,i,r){super(e,r),this._listener=new mt,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!J.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!J.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class u1e extends Va{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function _0(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===x6.ICodeEditor:!1}function Jtt(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===x6.IDiffEditor:!1}function l0r(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function ent(n){return _0(n)?n:Jtt(n)?n.getModifiedEditor():l0r(n)&&_0(n.activeCodeEditor)?n.activeCodeEditor:null}class GA{static _handleEolEdits(e,t){let i;const r=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&r.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),r}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),r=i.validateRange(t.range);return i.getFullModelRange().equalsRange(r)}static execute(e,t,i){i&&e.pushUndoStop();const r=Sv.capture(e),o=GA._handleEolEdits(e,t);o.length===1&&GA._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(s=>Is.replace(J.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",o.map(s=>Is.replaceMove(J.lift(s.range),s.text))),i&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class v4e{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class c0r{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(v4e.toKey(e))}has(e){return this._set.has(v4e.toKey(e))}}var Ev=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function d1e(n){if(n=n.filter(r=>r.range),!n.length)return;let{range:e}=n[0];for(let r=1;r<n.length;r++)e=J.plusRange(e,n[r].range);const{startLineNumber:t,endLineNumber:i}=e;t===i?n.length===1?bu(T("hint11","Made 1 formatting edit on line {0}",t)):bu(T("hintn1","Made {0} formatting edits on line {1}",n.length,t)):n.length===1?bu(T("hint1n","Made 1 formatting edit between lines {0} and {1}",t,i)):bu(T("hintnn","Made {0} formatting edits between lines {1} and {2}",n.length,t,i))}function tnt(n,e,t){const i=[],r=new c0r,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&r.add(a.extensionId);const s=e.ordered(t);for(const a of s){if(a.extensionId){if(r.has(a.extensionId))continue;r.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,u){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,u)}})}return i}class ck{static setFormatterSelector(e){return{dispose:ck._selectors.unshift(e)}}static select(e,t,i){return Ev(this,void 0,void 0,function*(){if(e.length===0)return;const r=tr.first(ck._selectors);if(r)return yield r(e,t,i)})}}ck._selectors=new Id;function nnt(n,e,t,i,r,o){return Ev(this,void 0,void 0,function*(){const s=n.get(di),{documentRangeFormattingEditProvider:a}=n.get(bn),l=_0(e)?e.getModel():e,c=a.ordered(l),u=yield ck.select(c,l,i);u&&(r.report(u),yield s.invokeFunction(u0r,u,e,t,o))})}function u0r(n,e,t,i,r){var o,s;return Ev(this,void 0,void 0,function*(){const a=n.get(r_),l=n.get(hp);let c,u;_0(t)?(c=t.getModel(),u=new IS(t,5,void 0,r)):(c=t,u=new u1e(t,r));const d=[];let h=0;for(const _ of Kbe(i).sort(J.compareRangesUsingStarts))h>0&&J.areIntersectingOrTouching(d[h-1],_)?d[h-1]=J.fromPositions(d[h-1].getStartPosition(),_.getEndPosition()):h=d.push(_);const f=_=>Ev(this,void 0,void 0,function*(){var b,y;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)===null||b===void 0?void 0:b.value,_);const C=(yield e.provideDocumentRangeFormattingEdits(c,_,c.getFormattingOptions(),u.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,C),C}),g=(_,b)=>{if(!_.length||!b.length)return!1;const y=_.reduce((C,x)=>J.plusRange(C,x.range),_[0].range);if(!b.some(C=>J.intersectRanges(y,C.range)))return!1;for(const C of _)for(const x of b)if(J.intersectRanges(C.range,x.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(o=e.extensionId)===null||o===void 0?void 0:o.value,d);const _=(yield e.provideDocumentRangesFormattingEdits(c,d,c.getFormattingOptions(),u.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(s=e.extensionId)===null||s===void 0?void 0:s.value,_),v.push(_)}else{for(const _ of d){if(u.token.isCancellationRequested)return!0;v.push(yield f(_))}for(let _=0;_<d.length;++_)for(let b=_+1;b<d.length;++b){if(u.token.isCancellationRequested)return!0;if(g(v[_],v[b])){const y=J.plusRange(d[_],d[b]),C=yield f(y);d.splice(b,1),d.splice(_,1),d.push(y),v.splice(b,1),v.splice(_,1),v.push(C),_=0,b=0}}}for(const _ of v){if(u.token.isCancellationRequested)return!0;const b=yield a.computeMoreMinimalEdits(c.uri,_);b&&m.push(...b)}}finally{u.dispose()}if(m.length===0)return!1;if(_0(t))GA.execute(t,m,!0),d1e(m),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:_}]=m,b=new kn(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn);c.pushEditOperations([b],m.map(y=>({text:y.text,range:J.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:C}of y)if(J.areIntersectingOrTouching(C,b))return[new kn(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return!0})}function d0r(n,e,t,i,r){return Ev(this,void 0,void 0,function*(){const o=n.get(di),s=n.get(bn),a=_0(e)?e.getModel():e,l=tnt(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield ck.select(l,a,t);c&&(i.report(c),yield o.invokeFunction(h0r,c,e,t,r))})}function h0r(n,e,t,i,r){return Ev(this,void 0,void 0,function*(){const o=n.get(r_);let s,a;_0(t)?(s=t.getModel(),a=new IS(t,5,void 0,r)):(s=t,a=new u1e(t,r));let l;try{const c=yield e.provideDocumentFormattingEdits(s,s.getFormattingOptions(),a.token);if(l=yield o.computeMoreMinimalEdits(s.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(_0(t))GA.execute(t,l,i!==2),i!==2&&(d1e(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,u=new kn(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);s.pushEditOperations([u],l.map(d=>({text:d.text,range:J.lift(d.range),forceMoveMarkers:!0})),d=>{for(const{range:h}of d)if(J.areIntersectingOrTouching(h,u))return[new kn(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function f0r(n,e,t,i,r,o){return Ev(this,void 0,void 0,function*(){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,r,o)).catch(tl);if(Cu(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function p0r(n,e,t,i,r){return Ev(this,void 0,void 0,function*(){const o=tnt(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of o){const a=yield Promise.resolve(s.provideDocumentFormattingEdits(t,i,r)).catch(tl);if(Cu(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function int(n,e,t,i,r,o,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(r)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,r,o,s)).catch(tl).then(l=>n.computeMoreMinimalEdits(t.uri,l))}_r.registerCommand("_executeFormatRangeProvider",function(n,...e){return Ev(this,void 0,void 0,function*(){const[t,i,r]=e;Io(Yn.isUri(t)),Io(J.isIRange(i));const o=n.get(bh),s=n.get(r_),a=n.get(bn),l=yield o.createModelReference(t);try{return f0r(s,a,l.object.textEditorModel,J.lift(i),r,nr.None)}finally{l.dispose()}})});_r.registerCommand("_executeFormatDocumentProvider",function(n,...e){return Ev(this,void 0,void 0,function*(){const[t,i]=e;Io(Yn.isUri(t));const r=n.get(bh),o=n.get(r_),s=n.get(bn),a=yield r.createModelReference(t);try{return p0r(o,s,a.object.textEditorModel,i,nr.None)}finally{a.dispose()}})});_r.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return Ev(this,void 0,void 0,function*(){const[t,i,r,o]=e;Io(Yn.isUri(t)),Io(De.isIPosition(i)),Io(typeof r=="string");const s=n.get(bh),a=n.get(r_),l=n.get(bn),c=yield s.createModelReference(t);try{return int(a,l,c.object.textEditorModel,De.lift(i),r,o,nr.None)}finally{c.dispose()}})});Lv.wrappingIndent.defaultValue=0;Lv.glyphMargin.defaultValue=!1;Lv.autoIndent.defaultValue=3;Lv.overviewRulerLanes.defaultValue=2;ck.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const Hd=RXe();Hd.editor=mbr();Hd.languages=s0r();const rnt=Hd.CancellationTokenSource,ont=Hd.Emitter,snt=Hd.KeyCode,ant=Hd.KeyMod,lnt=Hd.Position,cnt=Hd.Range,unt=Hd.Selection,dnt=Hd.SelectionDirection,hnt=Hd.MarkerSeverity,fnt=Hd.MarkerTag,pnt=Hd.Uri,gnt=Hd.Token,mnt=Hd.editor,_nt=Hd.languages,Jte=globalThis.MonacoEnvironment;(Jte!=null&&Jte.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Hd);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const K6=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:rnt,Emitter:ont,KeyCode:snt,KeyMod:ant,MarkerSeverity:hnt,MarkerTag:fnt,Position:lnt,Range:cnt,Selection:unt,SelectionDirection:dnt,Token:gnt,Uri:pnt,editor:mnt,languages:_nt},Symbol.toStringTag,{value:"Module"}));/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var g0r=Object.defineProperty,m0r=Object.getOwnPropertyDescriptor,_0r=Object.getOwnPropertyNames,v0r=Object.prototype.hasOwnProperty,b4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of _0r(e))!v0r.call(n,r)&&r!==t&&g0r(n,r,{get:()=>e[r],enumerable:!(i=m0r(e,r))||i.enumerable});return n},b0r=(n,e,t)=>(b4e(n,e,"default"),t&&b4e(t,e,"default")),LP={};b0r(LP,K6);var vnt={},ene={},bnt=class{constructor(n){ra(this,"_languageId");ra(this,"_loadingTriggered");ra(this,"_lazyLoadPromise");ra(this,"_lazyLoadPromiseResolve");ra(this,"_lazyLoadPromiseReject");this._languageId=n,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(n){return ene[n]||(ene[n]=new bnt(n)),ene[n]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,vnt[this._languageId].loader().then(n=>this._lazyLoadPromiseResolve(n),n=>this._lazyLoadPromiseReject(n))),this._lazyLoadPromise}};function Vn(n){const e=n.id;vnt[e]=n,LP.languages.register(n);const t=bnt.getOrCreate(e);LP.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),LP.languages.onLanguageEncountered(e,async()=>{const i=await t.load();LP.languages.setLanguageConfiguration(e,i.conf)})}Vn({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>ne(()=>import("./abap-e5f08dc1.js"),[])});Vn({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>ne(()=>import("./apex-fc8a734c.js"),[])});Vn({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>ne(()=>import("./azcli-c4358445.js"),[])});Vn({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>ne(()=>import("./bat-eaac827b.js"),[])});Vn({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>ne(()=>import("./bicep-9f8671bb.js"),[])});Vn({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>ne(()=>import("./cameligo-ff939f45.js"),[])});Vn({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>ne(()=>import("./clojure-4a1da11c.js"),[])});Vn({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>ne(()=>import("./coffee-97023918.js"),[])});Vn({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>ne(()=>import("./cpp-a410d69a.js"),[])});Vn({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>ne(()=>import("./cpp-a410d69a.js"),[])});Vn({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>ne(()=>import("./csharp-0765aa28.js"),[])});Vn({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>ne(()=>import("./csp-dba4fa86.js"),[])});Vn({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>ne(()=>import("./css-f18eed00.js"),[])});Vn({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>ne(()=>import("./cypher-4b1a5b20.js"),[])});Vn({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>ne(()=>import("./dart-c70c4314.js"),[])});Vn({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>ne(()=>import("./dockerfile-ff7f0401.js"),[])});Vn({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>ne(()=>import("./ecl-3129e183.js"),[])});Vn({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>ne(()=>import("./elixir-ac388b4d.js"),[])});Vn({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>ne(()=>import("./flow9-049a8a6c.js"),[])});Vn({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>ne(()=>import("./fsharp-535d9fe2.js"),[])});Vn({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>ne(()=>import("./freemarker2-f4bb6427.js"),[]).then(n=>n.TagAutoInterpolationDollar)});Vn({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>ne(()=>import("./freemarker2-f4bb6427.js"),[]).then(n=>n.TagAngleInterpolationDollar)});Vn({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>ne(()=>import("./freemarker2-f4bb6427.js"),[]).then(n=>n.TagBracketInterpolationDollar)});Vn({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>ne(()=>import("./freemarker2-f4bb6427.js"),[]).then(n=>n.TagAngleInterpolationBracket)});Vn({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>ne(()=>import("./freemarker2-f4bb6427.js"),[]).then(n=>n.TagBracketInterpolationBracket)});Vn({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>ne(()=>import("./freemarker2-f4bb6427.js"),[]).then(n=>n.TagAutoInterpolationDollar)});Vn({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>ne(()=>import("./freemarker2-f4bb6427.js"),[]).then(n=>n.TagAutoInterpolationBracket)});Vn({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>ne(()=>import("./go-d4bfa116.js"),[])});Vn({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>ne(()=>import("./graphql-e5a73eb7.js"),[])});Vn({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>ne(()=>import("./handlebars-84d2d3ee.js"),[])});Vn({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>ne(()=>import("./hcl-8b69c899.js"),[])});Vn({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>ne(()=>import("./html-9bf92b87.js"),[])});Vn({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>ne(()=>import("./ini-83ae2a3a.js"),[])});Vn({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>ne(()=>import("./java-4806d9f5.js"),[])});Vn({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>ne(()=>import("./javascript-459f9896.js"),["javascript-459f9896.js","typescript-069b46f2.js"])});Vn({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>ne(()=>import("./julia-334b5fb9.js"),[])});Vn({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>ne(()=>import("./kotlin-ed14cfc6.js"),[])});Vn({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>ne(()=>import("./less-58d9b66b.js"),[])});Vn({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>ne(()=>import("./lexon-8bf535e2.js"),[])});Vn({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>ne(()=>import("./lua-96829d0e.js"),[])});Vn({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>ne(()=>import("./liquid-a9c1aa18.js"),[])});Vn({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>ne(()=>import("./m3-815f612a.js"),[])});Vn({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>ne(()=>import("./markdown-1cddbf33.js"),[])});Vn({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>ne(()=>import("./mdx-27ddcdcf.js"),[])});Vn({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>ne(()=>import("./mips-361940ec.js"),[])});Vn({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>ne(()=>import("./msdax-b98f6248.js"),[])});Vn({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>ne(()=>import("./mysql-b4d05809.js"),[])});Vn({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>ne(()=>import("./objective-c-64e6f89b.js"),[])});Vn({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>ne(()=>import("./pascal-e1cbffd7.js"),[])});Vn({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>ne(()=>import("./pascaligo-013c6c0b.js"),[])});Vn({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>ne(()=>import("./perl-d9423546.js"),[])});Vn({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>ne(()=>import("./pgsql-423e077d.js"),[])});Vn({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>ne(()=>import("./php-fb65b6b4.js"),[])});Vn({id:"pla",extensions:[".pla"],loader:()=>ne(()=>import("./pla-09e93e1b.js"),[])});Vn({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>ne(()=>import("./postiats-429bd8e8.js"),[])});Vn({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>ne(()=>import("./powerquery-0470a494.js"),[])});Vn({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>ne(()=>import("./powershell-b433b622.js"),[])});Vn({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>ne(()=>import("./protobuf-3e557056.js"),[])});Vn({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>ne(()=>import("./pug-b7980504.js"),[])});Vn({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>ne(()=>import("./python-73a4faef.js"),[])});Vn({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>ne(()=>import("./qsharp-eed62033.js"),[])});Vn({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>ne(()=>import("./r-8ce27f67.js"),[])});Vn({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>ne(()=>import("./razor-ae7cd648.js"),[])});Vn({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>ne(()=>import("./redis-aec7cdf4.js"),[])});Vn({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>ne(()=>import("./redshift-7d933e7a.js"),[])});Vn({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>ne(()=>import("./restructuredtext-a9e4c4cc.js"),[])});Vn({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>ne(()=>import("./ruby-c9974e35.js"),[])});Vn({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>ne(()=>import("./rust-9669a673.js"),[])});Vn({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>ne(()=>import("./sb-b221a0fc.js"),[])});Vn({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>ne(()=>import("./scala-9222416a.js"),[])});Vn({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>ne(()=>import("./scheme-86110af1.js"),[])});Vn({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>ne(()=>import("./scss-7da24d39.js"),[])});Vn({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>ne(()=>import("./shell-0ca4f4ad.js"),[])});Vn({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>ne(()=>import("./solidity-0072896b.js"),[])});Vn({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>ne(()=>import("./sophia-bc45fa87.js"),[])});Vn({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>ne(()=>import("./sparql-28fc150c.js"),[])});Vn({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>ne(()=>import("./sql-96f7b353.js"),[])});Vn({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>ne(()=>import("./st-c45997f6.js"),[])});Vn({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>ne(()=>import("./swift-3b85cc8e.js"),[])});Vn({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>ne(()=>import("./systemverilog-2ec460af.js"),[])});Vn({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>ne(()=>import("./systemverilog-2ec460af.js"),[])});Vn({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>ne(()=>import("./tcl-37e129b8.js"),[])});Vn({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>ne(()=>import("./twig-1734ec31.js"),[])});Vn({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>ne(()=>import("./typescript-069b46f2.js"),[])});Vn({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>ne(()=>import("./vb-77962f32.js"),[])});Vn({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>ne(()=>import("./wgsl-e67d25e4.js"),[])});Vn({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>ne(()=>import("./xml-0f8222e4.js"),[])});Vn({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>ne(()=>import("./yaml-6c958263.js"),[])});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var y0r=Object.defineProperty,C0r=Object.getOwnPropertyDescriptor,w0r=Object.getOwnPropertyNames,S0r=Object.prototype.hasOwnProperty,y4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of w0r(e))!S0r.call(n,r)&&r!==t&&y0r(n,r,{get:()=>e[r],enumerable:!(i=C0r(e,r))||i.enumerable});return n},E0r=(n,e,t)=>(y4e(n,e,"default"),t&&y4e(t,e,"default")),hR={};E0r(hR,K6);var h1e=class{constructor(e,t,i){ra(this,"_onDidChange",new hR.Emitter);ra(this,"_options");ra(this,"_modeConfiguration");ra(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},f1e={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},p1e={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},ynt=new h1e("css",f1e,p1e),Cnt=new h1e("scss",f1e,p1e),wnt=new h1e("less",f1e,p1e);hR.languages.css={cssDefaults:ynt,lessDefaults:wnt,scssDefaults:Cnt};function g1e(){return ne(()=>import("./cssMode-90a402a0.js"),[])}hR.languages.onLanguage("less",()=>{g1e().then(n=>n.setupMode(wnt))});hR.languages.onLanguage("scss",()=>{g1e().then(n=>n.setupMode(Cnt))});hR.languages.onLanguage("css",()=>{g1e().then(n=>n.setupMode(ynt))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var x0r=Object.defineProperty,T0r=Object.getOwnPropertyDescriptor,k0r=Object.getOwnPropertyNames,I0r=Object.prototype.hasOwnProperty,C4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k0r(e))!I0r.call(n,r)&&r!==t&&x0r(n,r,{get:()=>e[r],enumerable:!(i=T0r(e,r))||i.enumerable});return n},L0r=(n,e,t)=>(C4e(n,e,"default"),t&&C4e(t,e,"default")),mY={};L0r(mY,K6);var D0r=class{constructor(e,t,i){ra(this,"_onDidChange",new mY.Emitter);ra(this,"_options");ra(this,"_modeConfiguration");ra(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},A0r={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},_Y={format:A0r,suggest:{},data:{useDefaultDataProvider:!0}};function vY(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===GM,documentFormattingEdits:n===GM,documentRangeFormattingEdits:n===GM}}var GM="html",w4e="handlebars",S4e="razor",Snt=bY(GM,_Y,vY(GM)),N0r=Snt.defaults,Ent=bY(w4e,_Y,vY(w4e)),R0r=Ent.defaults,xnt=bY(S4e,_Y,vY(S4e)),O0r=xnt.defaults;mY.languages.html={htmlDefaults:N0r,razorDefaults:O0r,handlebarDefaults:R0r,htmlLanguageService:Snt,handlebarLanguageService:Ent,razorLanguageService:xnt,registerHTMLLanguageService:bY};function P0r(){return ne(()=>import("./htmlMode-5492356d.js"),[])}function bY(n,e=_Y,t=vY(n)){const i=new D0r(n,e,t);let r;const o=mY.languages.onLanguage(n,async()=>{r=(await P0r()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var M0r=Object.defineProperty,F0r=Object.getOwnPropertyDescriptor,B0r=Object.getOwnPropertyNames,$0r=Object.prototype.hasOwnProperty,E4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of B0r(e))!$0r.call(n,r)&&r!==t&&M0r(n,r,{get:()=>e[r],enumerable:!(i=F0r(e,r))||i.enumerable});return n},V0r=(n,e,t)=>(E4e(n,e,"default"),t&&E4e(t,e,"default")),G6={};V0r(G6,K6);var H0r=class{constructor(e,t,i){ra(this,"_onDidChange",new G6.Emitter);ra(this,"_diagnosticsOptions");ra(this,"_modeConfiguration");ra(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},W0r={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},z0r={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Tnt=new H0r("json",W0r,z0r);G6.languages.json={jsonDefaults:Tnt};function U0r(){return ne(()=>import("./jsonMode-e160b2de.js"),[])}G6.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});G6.languages.onLanguage("json",()=>{U0r().then(n=>n.setupMode(Tnt))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var j0r=Object.defineProperty,q0r=Object.getOwnPropertyDescriptor,K0r=Object.getOwnPropertyNames,G0r=Object.prototype.hasOwnProperty,x4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of K0r(e))!G0r.call(n,r)&&r!==t&&j0r(n,r,{get:()=>e[r],enumerable:!(i=q0r(e,r))||i.enumerable});return n},Y0r=(n,e,t)=>(x4e(n,e,"default"),t&&x4e(t,e,"default")),Q0r="5.0.2",YA={};Y0r(YA,K6);var knt=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(knt||{}),Int=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(Int||{}),Lnt=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(Lnt||{}),Dnt=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(Dnt||{}),Ant=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(Ant||{}),Nnt=class{constructor(n,e,t,i,r){ra(this,"_onDidChange",new YA.Emitter);ra(this,"_onDidExtraLibsChange",new YA.Emitter);ra(this,"_extraLibs");ra(this,"_removedExtraLibs");ra(this,"_eagerModelSync");ra(this,"_compilerOptions");ra(this,"_diagnosticsOptions");ra(this,"_workerOptions");ra(this,"_onDidExtraLibsChangeTimeout");ra(this,"_inlayHintsOptions");ra(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},X0r=Q0r,Rnt={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},Ont=new Nnt({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Rnt),Pnt=new Nnt({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Rnt),Z0r=()=>yY().then(n=>n.getTypeScriptWorker()),J0r=()=>yY().then(n=>n.getJavaScriptWorker());YA.languages.typescript={ModuleKind:knt,JsxEmit:Int,NewLineKind:Lnt,ScriptTarget:Dnt,ModuleResolutionKind:Ant,typescriptVersion:X0r,typescriptDefaults:Ont,javascriptDefaults:Pnt,getTypeScriptWorker:Z0r,getJavaScriptWorker:J0r};function yY(){return ne(()=>import("./tsMode-12ff05e3.js"),[])}YA.languages.onLanguage("typescript",()=>yY().then(n=>n.setupTypeScript(Ont)));YA.languages.onLanguage("javascript",()=>yY().then(n=>n.setupJavaScript(Pnt)));class eyr extends up{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:T("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Ht.map,toggled:at.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:at.has("isInDiffEditor"),menu:{when:at.has("isInDiffEditor"),id:ue.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(dr),r=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}ws(eyr);class Mnt extends up{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:T("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:at.has("isInDiffEditor")})}run(e,...t){const i=e.get(dr),r=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",r)}}ws(Mnt);class Fnt extends up{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:T("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:at.has("isInDiffEditor")})}run(e,...t){const i=e.get(dr),r=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}ws(Fnt);xc.appendMenuItem(ue.EditorTitle,{command:{id:new Fnt().desc.id,title:T("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:at.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:at.has("isInDiffEditor")},order:11,group:"1_diff",when:at.and(de.diffEditorRenderSideBySideInlineBreakpointReached,at.has("isInDiffEditor"))});xc.appendMenuItem(ue.EditorTitle,{command:{id:new Mnt().desc.id,title:T("showMoves","Show Moved Code Blocks"),icon:Ht.move,toggled:tR.create("config.diffEditor.experimental.showMoves",!0),precondition:at.has("isInDiffEditor")},order:10,group:"1_diff",when:at.has("isInDiffEditor")});const CY={value:T("diffEditor","Diff Editor"),original:"Diff Editor"};class tyr extends Av{constructor(){super({id:"diffEditor.switchSide",title:{value:T("switchSide","Switch Side"),original:"Switch Side"},icon:Ht.arrowSwap,precondition:at.has("isInDiffEditor"),f1:!0,category:CY})}runEditorCommand(e,t,i){const r=pR(e);if(r instanceof lk){if(i&&i.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}ws(tyr);class nyr extends Av{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:T("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Ht.close,precondition:de.comparingMovedCode,f1:!1,category:CY,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const r=pR(e);r instanceof lk&&r.exitCompareMove()}}ws(nyr);class iyr extends Av{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:T("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Ht.fold,precondition:at.has("isInDiffEditor"),f1:!0,category:CY})}runEditorCommand(e,t,...i){const r=pR(e);r instanceof lk&&r.collapseAllUnchangedRegions()}}ws(iyr);class ryr extends Av{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:T("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Ht.unfold,precondition:at.has("isInDiffEditor"),f1:!0,category:CY})}runEditorCommand(e,t,...i){const r=pR(e);r instanceof lk&&r.showAllUnchangedRegions()}}ws(ryr);const Bnt={value:T("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class fR extends up{constructor(){super({id:fR.id,title:{value:T("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:Bnt,precondition:at.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=pR(e);t==null||t.accessibleDiffViewerNext()}}fR.id="editor.action.accessibleDiffViewer.next";xc.appendMenuItem(ue.EditorTitle,{command:{id:fR.id,title:T("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:at.has("isInDiffEditor")},order:10,group:"2_diff",when:at.and(de.accessibleDiffViewerVisible.negate(),at.has("isInDiffEditor"))});class Y6 extends up{constructor(){super({id:Y6.id,title:{value:T("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:Bnt,precondition:at.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=pR(e);t==null||t.accessibleDiffViewerPrev()}}Y6.id="editor.action.accessibleDiffViewer.prev";function pR(n){var e;const t=n.get(eo),i=t.listDiffEditors(),r=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!r)return null;for(let s=0,a=i.length;s<a;s++){const l=i[s];if(l.getModifiedEditor().getId()===r.getId()||l.getOriginalEditor().getId()===r.getId())return l}const o=Im();if(o)for(const s of i){const a=s.getContainerDomNode();if(oyr(a,o))return s}return null}function oyr(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}_r.registerCommandAlias("editor.action.diffReview.next",fR.id);ws(fR);_r.registerCommandAlias("editor.action.diffReview.prev",Y6.id);ws(Y6);var syr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ayr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wY=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},wde;const SY=new sn("selectionAnchorSet",!1);let S1=wde=class{static get(e){return e.getContribution(wde.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=SY.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(kn.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Gc().appendText(T("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),bu(T("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(kn.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};S1.ID="editor.contrib.selectionAnchorController";S1=wde=syr([ayr(1,vi)],S1);class lyr extends mn{constructor(){super({id:"editor.action.setSelectionAnchor",label:T("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2080),weight:100}})}run(e,t){var i;return wY(this,void 0,void 0,function*(){(i=S1.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class cyr extends mn{constructor(){super({id:"editor.action.goToSelectionAnchor",label:T("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:SY})}run(e,t){var i;return wY(this,void 0,void 0,function*(){(i=S1.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class uyr extends mn{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:T("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:SY,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2089),weight:100}})}run(e,t){var i;return wY(this,void 0,void 0,function*(){(i=S1.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class dyr extends mn{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:T("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:SY,kbOpts:{kbExpr:de.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return wY(this,void 0,void 0,function*(){(i=S1.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}Vr(S1.ID,S1,4);Dt(lyr);Dt(cyr);Dt(uyr);Dt(dyr);const hyr=he("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},T("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class fyr extends mn{constructor(){super({id:"editor.action.jumpToBracket",label:T("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Lm.get(t))===null||i===void 0||i.jumpToBracket()}}class pyr extends mn{constructor(){super({id:"editor.action.selectToBracket",label:T("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var r;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(r=Lm.get(t))===null||r===void 0||r.selectToBracket(o)}}class gyr extends mn{constructor(){super({id:"editor.action.removeBrackets",label:T("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Lm.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class myr{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Lm extends Ue{static get(e){return e.getContribution(Lm.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new $o(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const r=i.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new kn(s.lineNumber,s.column,s.lineNumber,s.column):new kn(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(J.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&i.push(new kn(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const r=i.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const r=i.brackets;r&&(e[t++]={range:r[0],options:i.options},e[t++]={range:r[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let r=[];this._lastVersionId===i&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d<h;d++){const f=e[d];f.isEmpty()&&(o[s++]=f.getStartPosition())}o.length>1&&o.sort(De.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d<h;d++){const f=o[d];for(;c<u&&r[c].position.isBefore(f);)c++;if(c<u&&r[c].position.equals(f))a[l++]=r[c];else{let g=t.bracketPairs.matchBracket(f,20),m=Lm._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!g&&this._matchBrackets==="always"&&(g=t.bracketPairs.findEnclosingBrackets(f,20),m=Lm._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new myr(f,g,m)}}this._lastBracketsData=a,this._lastVersionId=i}}Lm.ID="editor.contrib.bracketMatchingController";Lm._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ri.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Gs(hyr),position:np.Center}});Lm._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ri.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});Vr(Lm.ID,Lm,1);Dt(pyr);Dt(fyr);Dt(gyr);xc.appendMenuItem(ue.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:T({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class _yr{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,r=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&r===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const s=new J(i,r-1,i,r),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new J(i,o,i,o),a)}else{const s=new J(i,o,i,o+1),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new J(i,r,i,r),a)}}computeCursorState(e,t){return this._isMovingLeft?new kn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new kn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class $nt extends mn{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],r=t.getSelections();for(const o of r)i.push(new _yr(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class vyr extends $nt{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:T("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:de.writable})}}class byr extends $nt{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:T("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:de.writable})}}Dt(vyr);Dt(byr);class yyr extends mn{constructor(){super({id:"editor.action.transposeLetters",label:T("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),r=[],o=t.getSelections();for(const s of o){if(!s.isEmpty())continue;const a=s.startLineNumber,l=s.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const u=l===c?s.getPosition():lo.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),d=lo.leftPosition(i,u),h=lo.leftPosition(i,d),f=i.getValueInRange(J.fromPositions(h,d)),g=i.getValueInRange(J.fromPositions(d,u)),m=J.fromPositions(h,u);r.push(new Hc(m,g+f))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Dt(yyr);var Cyr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const uk="9_cutcopypaste",wyr=cv||document.queryCommandSupported("cut"),Vnt=cv||document.queryCommandSupported("copy"),Syr=typeof navigator.clipboard>"u"||mg?document.queryCommandSupported("paste"):!0;function m1e(n){return n.register(),n}const Eyr=wyr?m1e(new iR({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:cv?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:ue.MenubarEditMenu,group:"2_ccp",title:T({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:ue.EditorContext,group:uk,title:T("actions.clipboard.cutLabel","Cut"),when:de.writable,order:1},{menuId:ue.CommandPalette,group:"",title:T("actions.clipboard.cutLabel","Cut"),order:1},{menuId:ue.SimpleEditorContext,group:uk,title:T("actions.clipboard.cutLabel","Cut"),when:de.writable,order:1}]})):void 0,xyr=Vnt?m1e(new iR({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:cv?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:ue.MenubarEditMenu,group:"2_ccp",title:T({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:ue.EditorContext,group:uk,title:T("actions.clipboard.copyLabel","Copy"),order:2},{menuId:ue.CommandPalette,group:"",title:T("actions.clipboard.copyLabel","Copy"),order:1},{menuId:ue.SimpleEditorContext,group:uk,title:T("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;xc.appendMenuItem(ue.MenubarEditMenu,{submenu:ue.MenubarCopy,title:{value:T("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});xc.appendMenuItem(ue.EditorContext,{submenu:ue.EditorContextCopy,title:{value:T("copy as","Copy As"),original:"Copy As"},group:uk,order:3});xc.appendMenuItem(ue.EditorContext,{submenu:ue.EditorContextShare,title:{value:T("share","Share"),original:"Share"},group:"11_share",order:-1,when:at.and(at.notEquals("resourceScheme","output"),de.editorTextFocus)});xc.appendMenuItem(ue.EditorTitleContext,{submenu:ue.EditorTitleContextShare,title:{value:T("share","Share"),original:"Share"},group:"11_share",order:-1});xc.appendMenuItem(ue.ExplorerContext,{submenu:ue.ExplorerContextShare,title:{value:T("share","Share"),original:"Share"},group:"11_share",order:-1});const tne=Syr?m1e(new iR({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:cv?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:ue.MenubarEditMenu,group:"2_ccp",title:T({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:ue.EditorContext,group:uk,title:T("actions.clipboard.pasteLabel","Paste"),when:de.writable,order:4},{menuId:ue.CommandPalette,group:"",title:T("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:ue.SimpleEditorContext,group:uk,title:T("actions.clipboard.pasteLabel","Paste"),when:de.writable,order:4}]})):void 0;class Tyr extends mn{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:T("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(kce.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),kce.forceCopyWithSyntaxHighlighting=!1)}}function Hnt(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(eo).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(37),s=r.getSelection();return s&&s.isEmpty()&&!o||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(gG().execCommand(e),!0)))}Hnt(Eyr,"cut");Hnt(xyr,"copy");tne&&(tne.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(eo),i=n.get(B1),r=t.getFocusedCodeEditor();return r&&r.hasTextFocus()?!r.getContainerDomNode().ownerDocument.execCommand("paste")&&lE?(()=>Cyr(void 0,void 0,void 0,function*(){const s=yield i.readText();if(s!==""){const a=z3.INSTANCE.get(s);let l=!1,c=null,u=null;a&&(l=r.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText<"u"?a.multicursorText:null,u=a.mode),r.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:c,mode:u})}}))():!0:!1}),tne.addImplementation(0,"generic-dom",(n,e)=>(gG().execCommand("paste"),!0)));Vnt&&Dt(Tyr);var kyr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class si{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+si.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new si(this.value+si.sep+e)}}si.sep=".";si.None=new si("@@none@@");si.Empty=new si("");si.QuickFix=new si("quickfix");si.Refactor=new si("refactor");si.RefactorExtract=si.Refactor.append("extract");si.RefactorInline=si.Refactor.append("inline");si.RefactorMove=si.Refactor.append("move");si.RefactorRewrite=si.Refactor.append("rewrite");si.Notebook=new si("notebook");si.Source=new si("source");si.SourceOrganizeImports=si.Source.append("organizeImports");si.SourceFixAll=si.Source.append("fixAll");si.SurroundWith=si.Refactor.append("surround");var Zh;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(Zh||(Zh={}));function Iyr(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>Wnt(e,t,n.include))||!n.includeSourceActions&&si.Source.contains(e))}function Lyr(n,e){const t=e.kind?new si(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>Wnt(t,i,n.include))||!n.includeSourceActions&&t&&si.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function Wnt(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Eb{static fromUser(e,t){return!e||typeof e!="object"?new Eb(t.kind,t.apply,!1):new Eb(Eb.getKindFromUser(e,t.kind),Eb.getApplyFromUser(e,t.apply),Eb.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new si(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class Dyr{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return kyr(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(r){tl(r)}i&&(this.action.edit=i.edit)}return this})}}var dU=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const znt="editor.action.codeAction",_1e="editor.action.quickFix",Unt="editor.action.autoFix",jnt="editor.action.refactor",qnt="editor.action.sourceAction",v1e="editor.action.organizeImports",b1e="editor.action.fixAll";class YM extends Ue{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Cu(e.diagnostics)?Cu(t.diagnostics)?YM.codeActionsPreferredComparator(e,t):-1:Cu(t.diagnostics)?1:YM.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(YM.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&si.QuickFix.contains(new si(e.kind))&&!!e.isPreferred)}}const T4e={actions:[],documentation:void 0};function QM(n,e,t,i,r,o){var s;return dU(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],si.Notebook]}),c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:i.type},u=new u1e(e,o),d=i.type===2,h=Ayr(n,e,d?l:a),f=new mt,g=h.map(v=>dU(this,void 0,void 0,function*(){try{r.report(v);const _=yield v.provideCodeActions(e,t,c,u.token);if(_&&f.add(_),u.token.isCancellationRequested)return T4e;const b=((_==null?void 0:_.actions)||[]).filter(C=>C&&Lyr(a,C)),y=Ryr(v,b,a.include);return{actions:b.map(C=>new Dyr(C,v)),documentation:y}}catch(_){if(Dv(_))throw _;return tl(_),T4e}})),m=n.onDidChange(()=>{const v=n.all(e);Ia(v,h)||u.cancel()});try{const v=yield Promise.all(g),_=v.map(y=>y.actions).flat(),b=[...s0(v.map(y=>y.documentation)),...Nyr(n,e,i,_)];return new YM(_,b,f)}finally{m.dispose(),u.dispose()}})}function Ayr(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(r=>Iyr(t,new si(r))):!0)}function*Nyr(n,e,t,i){var r,o,s;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},i.map(l=>l.action)))}function Ryr(n,e,t){if(!n.documentation)return;const i=n.documentation.map(r=>({kind:new si(r.kind),command:r.command}));if(t){let r;for(const o of i)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const o of i)if(o.kind.contains(new si(r.kind)))return o.command}}var hU;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(hU||(hU={}));function Oyr(n,e,t,i,r=nr.None){var o;return dU(this,void 0,void 0,function*(){const s=n.get(F6),a=n.get(_a),l=n.get(dp),c=n.get(za);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield s.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==hU.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=Pyr(u);c.error(typeof d=="string"?d:T("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function Pyr(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}_r.registerCommand("_executeCodeActionProvider",function(n,e,t,i,r){return dU(this,void 0,void 0,function*(){if(!(e instanceof Yn))throw ag();const{codeActionProvider:o}=n.get(bn),s=n.get(Ds).getModel(e);if(!s)throw ag();const a=kn.isISelection(t)?kn.liftSelection(t):J.isIRange(t)?s.validateRange(t):void 0;if(!a)throw ag();const l=typeof i=="string"?new si(i):void 0,c=yield QM(o,s,a,{type:1,triggerAction:Zh.Default,filter:{includeSourceActions:!0,include:l}},e1.None,nr.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let h=0;h<d;h++)u.push(c.validActions[h].resolve(nr.None));try{return yield Promise.all(u),c.validActions.map(h=>h.action)}finally{setTimeout(()=>c.dispose(),100)}})});var Myr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fyr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Sde;let fU=Sde=class{constructor(e){this.keybindingService=e}getResolver(){const e=new dE(()=>this.keybindingService.getKeybindings().filter(t=>Sde.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===v1e?i={kind:si.SourceOrganizeImports.value}:t.command===b1e&&(i={kind:si.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Eb.fromUser(i,{kind:si.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new si(e.kind);return t.filter(r=>r.kind.contains(i)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};fU.codeActionCommands=[jnt,znt,qnt,v1e,b1e];fU=Sde=Myr([Fyr(0,Qo)],fU);he("symbolIcon.arrayForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.booleanForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},T("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.colorForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.constantForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},T("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},T("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.fileForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.folderForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.keyForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.keywordForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.moduleForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.namespaceForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.nullForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.numberForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.objectForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.operatorForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.packageForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.propertyForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.referenceForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.snippetForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.stringForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.structForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.textForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.typeParameterForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.unitForeground",{dark:Rt,light:Rt,hcDark:Rt,hcLight:Rt},T("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));he("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Knt=Object.freeze({kind:si.Empty,title:T("codeAction.widget.id.more","More Actions...")}),Byr=Object.freeze([{kind:si.QuickFix,title:T("codeAction.widget.id.quickfix","Quick Fix")},{kind:si.RefactorExtract,title:T("codeAction.widget.id.extract","Extract"),icon:Ht.wrench},{kind:si.RefactorInline,title:T("codeAction.widget.id.inline","Inline"),icon:Ht.wrench},{kind:si.RefactorRewrite,title:T("codeAction.widget.id.convert","Rewrite"),icon:Ht.wrench},{kind:si.RefactorMove,title:T("codeAction.widget.id.move","Move"),icon:Ht.wrench},{kind:si.SurroundWith,title:T("codeAction.widget.id.surround","Surround With"),icon:Ht.symbolSnippet},{kind:si.Source,title:T("codeAction.widget.id.source","Source Action"),icon:Ht.symbolFile},Knt]);function $yr(n,e,t){if(!e)return n.map(o=>{var s;return{kind:"action",item:o,group:Knt,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((s=o.action.edit)===null||s===void 0)&&s.edits.length)}});const i=Byr.map(o=>({group:o,actions:[]}));for(const o of n){const s=o.action.kind?new si(o.action.kind):si.None;for(const a of i)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of i)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions)r.push({kind:"action",item:s,group:o.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return r}var Vyr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Hyr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ede,xL;(function(n){n.Hidden={type:0};class e{constructor(i,r,o,s){this.actions=i,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}n.Showing=e})(xL||(xL={}));let dk=Ede=class extends Ue{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new Le),this.onClick=this._onClick.event,this._state=xL.Hidden,this._domNode=kt("div.lightBulbWidget"),this._register(Zo.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const r=this._editor.getModel();(this.state.type!==1||!r||this.state.editorPosition.lineNumber>=r.getLineCount())&&this.hide()})),this._register(Otr(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:r,height:o}=pl(this._domNode),s=this._editor.getOption(66);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(a+=s),this._onClick.fire({x:i.posx,y:r+o+a,actions:this.state.actions,trigger:this.state.trigger})})),this._register(tt(this._domNode,"mouseenter",i=>{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(nn.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,r,o,s;this._preferredKbLabel=(r=(i=t.lookupKeybinding(Unt))===null||i===void 0?void 0:i.getLabel())!==null&&r!==void 0?r:void 0,this._quickFixKbLabel=(s=(o=t.lookupKeybinding(_1e))===null||o===void 0?void 0:o.getLabel())!==null&&s!==void 0?s:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const r=this._editor.getOptions();if(!r.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,c=r.get(50),u=o.getLineContent(s),d=FG(u,l),h=c.spaceWidth*d>22,f=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new xL.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:Ede._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==xL.Hidden&&(this.state=xL.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...Qn.asClassNameArray(Ht.lightBulb)),this._domNode.classList.add(...Qn.asClassNameArray(Ht.lightbulbAutofix)),this._preferredKbLabel)){this.title=T("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Qn.asClassNameArray(Ht.lightbulbAutofix)),this._domNode.classList.add(...Qn.asClassNameArray(Ht.lightBulb)),this._quickFixKbLabel?this.title=T("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=T("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};dk.ID="editor.contrib.lightbulbWidget";dk._posPref=[0];dk=Ede=Vyr([Hyr(1,Qo)],dk);var Wyr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Gnt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},xde;let E1=xde=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new Le,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new mt,o=r.add(YG(e,Object.assign(Object.assign({},this._getRenderOptions(e,r)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,r)=>Gnt(this,void 0,void 0,function*(){var o,s,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=qf);const c=yield hdr(this._languageService,r,l),u=document.createElement("span");if(u.innerHTML=(a=(s=xde._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);Zc(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>Ynt(this._openerService,i,e.isTrusted),disposables:t}}}};E1._ttpTokenizer=R1("tokenizeToString",{createHTML(n){return n}});E1=xde=Wyr([k4e(1,xs),k4e(2,rf)],E1);function Ynt(n,e,t){return Gnt(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:zyr(t)})}catch(i){return Oi(i),!1}})}function zyr(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var Uyr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},I4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dV;let qh=dV=class{static get(e){return e.getContribution(dV.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Nc,this._messageListeners=new mt,this._mouseOverMessage=!1,this._editor=e,this._visible=dV.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){bu(Vw(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Vw(e)?YG(e,{actionHandler:{callback:r=>Ynt(this._openerService,r,Vw(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new L4e(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(nn.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Qc(Im(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(tt(this._messageWidget.value.getDomNode(),Yt.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(tt(this._messageWidget.value.getDomNode(),Yt.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(r=>{r.target.position&&(i?i.containsPosition(r.target.position)||this.closeMessage():i=new J(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(L4e.fadeOut(this._messageWidget.value))}};qh.ID="editor.contrib.messageController";qh.MESSAGE_VISIBLE=new sn("messageVisible",!1,T("messageVisible","Whether the editor is currently showing an inline message"));qh=dV=Uyr([I4e(1,vi),I4e(2,rf)],qh);const jyr=ac.bindToContribution(qh.get);zt(new jyr({id:"leaveEditorMessage",precondition:qh.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let L4e=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof r=="string"?(s.classList.add("message"),s.textContent=r):(r.classList.add("message"),s.appendChild(r)),this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Vr(qh.ID,qh,4);var Qnt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Tde=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},qyr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Xnt="acceptSelectedCodeAction",Znt="previewSelectedCodeAction";class Kyr{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var r,o;i.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let kde=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const r=new W6(e,Pf);return{container:e,icon:t,text:i,keybinding:r}}renderElement(e,t,i){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(i.icon.className=Qn.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=an(e.group.icon.color.id))):(i.icon.className=Qn.asClassName(Ht.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=Jnt(e.label),i.keybinding.set(e.keybinding),jtr(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(Xnt))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(Znt))===null||s===void 0?void 0:s.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=T({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=T({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};kde=Qnt([Tde(1,Qo)],kde);class Gyr extends UIEvent{constructor(){super("acceptSelectedAction")}}class D4e extends UIEvent{constructor(){super("previewSelectedAction")}}function Yyr(n){if(n.kind==="action")return n.label}let Ide=class extends Ue{constructor(e,t,i,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Va),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new n_(e,this.domNode,a,[new kde(t,this._keybindingService),new Kyr],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Yyr},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?Jnt(l==null?void 0:l.label):"";return l.disabled&&(c=T({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>T({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(aI),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);const o=this._allMenuItems.map((c,u)=>{const d=document.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0}),s=Math.max(...o,e),a=.7,l=Math.min(r,document.body.clientHeight*a);return this._list.layout(l,s),this.domNode.style.height=`${l}px`,this._list.domFocus(),s}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],r=this._list.element(i);if(!this.focusCondition(r))return;const o=e?new D4e:new Gyr;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof D4e):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const r=i[0],o=this._list.element(r);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}onListHover(e){return qyr(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Ide=Qnt([Tde(4,P1),Tde(5,Qo)],Ide);function Jnt(n){return n.replace(/\r\n|\r|\n/g," ")}var Qyr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};he("actionBar.toggledBackground",{dark:qx,light:qx,hcDark:qx,hcLight:qx},T("actionBar.toggledBackground","Background color for toggled action items in action bar."));const hk={Visible:new sn("codeActionMenuVisible",!1,T("codeActionMenuVisible","Whether the action widget list is visible"))},hI=or("actionWidgetService");let fk=class extends Ue{get isVisible(){return hk.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Nc)}show(e,t,i,r,o,s,a){const l=hk.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Ide,e,t,i,r);this._contextViewService.showContextView({getAnchor:()=>o,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new mt,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(tt(l,Yt.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(tt(u,Yt.POINTER_MOVE,()=>u.remove())),s.add(tt(u,Yt.MOUSE_DOWN,()=>u.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(c0(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const i=kt(e),r=new wg(i);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};fk=Qyr([nne(0,P1),nne(1,vi),nne(2,di)],fk);vr(hI,fk,1);const Q6=100+1e3;ws(class extends up{constructor(){super({id:"hideCodeActionWidget",title:{value:T("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:hk.Visible,keybinding:{weight:Q6,primary:9,secondary:[1033]}})}run(n){n.get(hI).hide()}});ws(class extends up{constructor(){super({id:"selectPrevCodeAction",title:{value:T("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:hk.Visible,keybinding:{weight:Q6,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(hI);e instanceof fk&&e.focusPrevious()}});ws(class extends up{constructor(){super({id:"selectNextCodeAction",title:{value:T("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:hk.Visible,keybinding:{weight:Q6,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(hI);e instanceof fk&&e.focusNext()}});ws(class extends up{constructor(){super({id:Xnt,title:{value:T("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:hk.Visible,keybinding:{weight:Q6,primary:3,secondary:[2137]}})}run(n){const e=n.get(hI);e instanceof fk&&e.acceptSelected()}});ws(class extends up{constructor(){super({id:Znt,title:{value:T("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:hk.Visible,keybinding:{weight:Q6,primary:2051}})}run(n){const e=n.get(hI);e instanceof fk&&e.acceptSelected(!0)}});var Xyr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const eit=new sn("supportedCodeAction","");class Zyr extends Ue{constructor(e,t,i,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=r,this._autoTriggerTimer=this._register(new Zm),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>J0e(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Zh.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:r,column:o}=i.getPosition(),s=t.getLineContent(r);if(s.length===0)return;if(o===1){if(/\s/.test(s[0]))return}else if(o===t.getLineMaxColumn(r)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[o-2])&&/\s/.test(s[o-1]))return}return i}}var Dx;(function(n){n.Empty={type:0};class e{constructor(i,r,o){this.trigger=i,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(Dv(s))return tit;throw s})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(Dx||(Dx={}));const tit=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class Jyr extends Ue{constructor(e,t,i,r,o,s){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Nc),this._state=Dx.Empty,this._onDidChangeState=this._register(new Le),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=eit.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Dx.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Dx.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var r;return(r=i.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Zyr(this._editor,this._markerService,i=>{var r;if(!i){this.setState(Dx.Empty);return}const o=i.selection.getStartPosition(),s=Sl(a=>Xyr(this,void 0,void 0,function*(){var l,c,u,d,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Zh.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(si.QuickFix))){const g=yield QM(this._registry,e,i.selection,i.trigger,e1.None,a);if(a.isCancellationRequested)return tit;if(!((u=g.validActions)===null||u===void 0?void 0:u.some(v=>v.action.kind?si.QuickFix.contains(new si(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const _=i.selection.getPosition();let b=_,y=Number.MAX_VALUE,C=!1;for(const x of v){const E=x.endColumn,k=x.endLineNumber,L=x.startLineNumber;(k===_.lineNumber||L===_.lineNumber)&&Math.abs(_.column-E)<y&&(y=Math.abs(_.column-E),C=!0,b=new De(k,E))}if(C){const x={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((d=i.trigger.filter)===null||d===void 0)&&d.include?(h=i.trigger.filter)===null||h===void 0?void 0:h.include:si.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((f=i.trigger.context)===null||f===void 0?void 0:f.notAvailableMessage)||"",position:b}},E=new kn(b.lineNumber,b.column,b.lineNumber,b.column),k=yield QM(this._registry,e,E,x,e1.None,a),L=[...g.validActions];return k.validActions.length!==0&&(k.validActions.forEach(D=>{D.highlightRange=D.action.isPreferred}),L.push(...k.validActions)),{validActions:L,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return QM(this._registry,e,i.selection,i.trigger,e1.None,a)}));i.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new Dx.Triggered(i.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Zh.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var e1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ty=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$O=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},hV;const t1r="quickfix-edit-highlight";let LS=hV=class extends Ue{static get(e){return e.getContribution(hV.ID)}constructor(e,t,i,r,o,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Nc),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Jyr(this._editor,o.codeActionProvider,t,i,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new dE(()=>{const d=this._editor.getContribution(dk.ID);return d&&this._register(d.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),d}),this._resolver=r.createInstance(fU),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,r){var o;if(!this._editor.hasModel())return;(o=qh.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return $O(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(Oyr,e,hU.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Zh.QuickFix,filter:{}})}})}update(e){var t,i,r,o,s,a,l;return $O(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(u){Oi(u);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(c,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(d,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=qh.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=qh.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i){return $O(this,void 0,void 0,function*(){const r=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=De.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,u)=>$O(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!u),this._actionWidgetService.hide(),r.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),r.clear()},onHover:(c,u)=>$O(this,void 0,void 0,function*(){var d;if(yield c.resolve(u),!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}}),onFocus:c=>{var u,d;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:hV.DECORATION}];r.set(h);const f=c.action.diagnostics[0],g=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||d===void 0?void 0:d.word;wS(T("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,$yr(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=pl(this._editor.getDomNode()),r=i.left+t.left,o=i.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:T("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:T("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),r}};LS.ID="editor.contrib.codeActionController";LS.DECORATION=Ri.register({description:"quickfix-highlight",className:t1r});LS=hV=e1r([ty(1,N0),ty(2,vi),ty(3,di),ty(4,bn),ty(5,gE),ty(6,_a),ty(7,dr),ty(8,hI),ty(9,di)],LS);e_((n,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Bb));const i=n.getColor(iw);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${fv(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function X6(n){return at.regex(eit.keys()[0],new RegExp("(\\s|^)"+tp(n.value)+"\\b"))}const y1e={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:T("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:T("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[T("args.schema.apply.first","Always apply the first returned code action."),T("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),T("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:T("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function fI(n,e,t,i,r=Zh.Default){if(n.hasModel()){const o=LS.get(n);o==null||o.manualTriggerAtCurrentPosition(e,r,t,i)}}class n1r extends mn{constructor(){super({id:_1e,label:T("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:at.and(de.writable,de.hasCodeActionsProvider),kbOpts:{kbExpr:de.textInputFocus,primary:2137,weight:100}})}run(e,t){return fI(t,T("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Zh.QuickFix)}}class i1r extends ac{constructor(){super({id:znt,precondition:at.and(de.writable,de.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:y1e}]}})}runEditorCommand(e,t,i){const r=Eb.fromUser(i,{kind:si.Empty,apply:"ifSingle"});return fI(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?T("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):T("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):r.preferred?T("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):T("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class r1r extends mn{constructor(){super({id:jnt,label:T("refactor.label","Refactor..."),alias:"Refactor...",precondition:at.and(de.writable,de.hasCodeActionsProvider),kbOpts:{kbExpr:de.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:at.and(de.writable,X6(si.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:y1e}]}})}run(e,t,i){const r=Eb.fromUser(i,{kind:si.Refactor,apply:"never"});return fI(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?T("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):T("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):r.preferred?T("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):T("editor.action.refactor.noneMessage","No refactorings available"),{include:si.Refactor.contains(r.kind)?r.kind:si.None,onlyIncludePreferredActions:r.preferred},r.apply,Zh.Refactor)}}class o1r extends mn{constructor(){super({id:qnt,label:T("source.label","Source Action..."),alias:"Source Action...",precondition:at.and(de.writable,de.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:at.and(de.writable,X6(si.Source))},description:{description:"Source Action...",args:[{name:"args",schema:y1e}]}})}run(e,t,i){const r=Eb.fromUser(i,{kind:si.Source,apply:"never"});return fI(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?T("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):T("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):r.preferred?T("editor.action.source.noneMessage.preferred","No preferred source actions available"):T("editor.action.source.noneMessage","No source actions available"),{include:si.Source.contains(r.kind)?r.kind:si.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Zh.SourceAction)}}class s1r extends mn{constructor(){super({id:v1e,label:T("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:at.and(de.writable,X6(si.SourceOrganizeImports)),kbOpts:{kbExpr:de.textInputFocus,primary:1581,weight:100}})}run(e,t){return fI(t,T("editor.action.organize.noneMessage","No organize imports action available"),{include:si.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Zh.OrganizeImports)}}class a1r extends mn{constructor(){super({id:b1e,label:T("fixAll.label","Fix All"),alias:"Fix All",precondition:at.and(de.writable,X6(si.SourceFixAll))})}run(e,t){return fI(t,T("fixAll.noneMessage","No fix all action available"),{include:si.SourceFixAll,includeSourceActions:!0},"ifSingle",Zh.FixAll)}}class l1r extends mn{constructor(){super({id:Unt,label:T("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:at.and(de.writable,X6(si.QuickFix)),kbOpts:{kbExpr:de.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return fI(t,T("editor.action.autoFix.noneMessage","No auto fixes available"),{include:si.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Zh.AutoFix)}}Vr(LS.ID,LS,3);Vr(dk.ID,dk,4);Dt(n1r);Dt(r1r);Dt(o1r);Dt(s1r);Dt(l1r);Dt(a1r);zt(new i1r);Hs.as(Nv.Configuration).registerConfiguration(Object.assign(Object.assign({},UG),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:T("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));Hs.as(Nv.Configuration).registerConfiguration(Object.assign(Object.assign({},UG),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:T("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var A4e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Lde{constructor(){this.lenses=[],this._disposables=new mt}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function nit(n,e,t){return A4e(this,void 0,void 0,function*(){const i=n.ordered(e),r=new Map,o=new Lde,s=i.map((a,l)=>A4e(this,void 0,void 0,function*(){r.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){tl(c)}}));return yield Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:r.get(a.provider)<r.get(l.provider)?-1:r.get(a.provider)>r.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),o})}_r.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Io(Yn.isUri(t)),Io(typeof i=="number"||!i);const{codeLensProvider:r}=n.get(bn),o=n.get(Ds).getModel(t);if(!o)throw ag();const s=[],a=new mt;return nit(r,o,nr.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)i==null||u.symbol.command?s.push(u.symbol):i-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(o,u.symbol,nr.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var c1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},u1r=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const iit=or("ICodeLensCache");class N4e{constructor(e,t){this.lineCount=e,this.data=t}}let Dde=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new hE(20,.75);const t="codelens/cache";My(()=>e.remove(t,1));const i="codelens/cache2",r=e.get(i,1,"{}");this._deserialize(r),nn.once(e.onWillSaveState)(o=>{o.reason===$z.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),r=new Lde;r.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new N4e(e.getLineCount(),r);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const r=new Set;for(const o of i.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const r=t[i],o=[];for(const a of r.lines)o.push({range:new J(a,1,a,11)});const s=new Lde;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new N4e(r.lineCount,s))}}catch{}}};Dde=c1r([u1r(0,i_)],Dde);vr(iit,Dde,1);class d1r{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class EY{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${EY._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let r=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s&&(r=!0,s.command)){const a=Hw(s.command.title.trim());s.command.id?(i.push(kt("a",{id:String(o),title:s.command.tooltip,role:"button"},...a)),this._commands.set(String(o),s.command)):i.push(kt("span",{title:s.command.tooltip},...a)),o+1<e.length&&i.push(kt("span",void 0," | "))}}r?(Lc(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Lc(this._domNode,kt("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}EY._idPool=0;class ine{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,r=t.length;i<r;i++)this._addDecorationsCallbacks[i](t[i])}}const R4e=Ri.register({collapseOnReplaceEdit:!0,description:"codelens"});class O4e{constructor(e,t,i,r,o,s){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((c,u)=>{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:R4e},d=>this._decorationIds[u]=d),a?a=J.plusRange(a,c.symbol.range):a=J.lift(c.symbol.range)}),this._viewZone=new d1r(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new EY(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(i&&J.isEmpty(r.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,r)=>{t.addDecoration({range:i.symbol.range,options:R4e},o=>this._decorationIds[r]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:r}=this._data[t];r.command=i.command||r.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}var h1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},VO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},rit=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let QA=class{constructor(e,t,i,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new mt,this._localToDispose=new mt,this._lenses=[],this._oldCodeLensModels=new mt,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new $o(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),r=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Uh.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(bS(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const o=r.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new $o(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=Sl(s=>nit(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},Oi)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(mi(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new ine;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(mi(()=>{if(this._editor.getModel()){const r=Sv.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new ine;for(const r of this._lenses)r.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let r;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(r&&r[r.length-1].symbol.range.startLineNumber===l?r.push(a):(r=[a],i.push(r)))}if(!i.length&&!this._lenses.length)return;const o=Sv.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new ine;let u=0,d=0;for(;d<i.length&&u<this._lenses.length;){const h=i[d][0].symbol.range.startLineNumber,f=this._lenses[u].getLineNumber();f<h?(this._lenses[u].dispose(c,l),this._lenses.splice(u,1)):f===h?(this._lenses[u].updateCodeLensSymbols(i[d],c),d++,u++):(this._lenses.splice(u,0,new O4e(i[d],this._editor,c,l,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),u++,d++)}for(;u<this._lenses.length;)this._lenses[u].dispose(c,l),this._lenses.splice(u,1);for(;d<i.length;)this._lenses.push(new O4e(i[d],this._editor,c,l,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),r.push(a))}),i.length===0)return;const o=Date.now(),s=Sl(a=>{const l=i.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(m=>{d[g]=m},tl):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[u].isDisposed()&&r[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Oi(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return rit(this,void 0,void 0,function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel})}};QA.ID="css.editor.codeLens";QA=h1r([VO(1,bn),VO(2,Og),VO(3,_a),VO(4,za),VO(5,iit)],QA);Vr(QA.ID,QA,1);Dt(class extends mn{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:de.hasCodeLensProvider,label:T("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return rit(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Rv),r=e.get(_a),o=e.get(za),s=t.getSelection().positionLineNumber,a=t.getContribution(QA.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=yield i.pick(c,{canPickMany:!1,placeHolder:T("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=yield a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var m;return g.symbol.range.startLineNumber===s&&((m=g.symbol.command)===null||m===void 0?void 0:m.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{yield r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}})}});var f1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},p1r=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class C1e{constructor(e,t){this._editorWorkerClient=new I0e(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return p1r(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const r=t.range,o=t.color,s=o.alpha,a=new ze(new gr(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?ze.Format.CSS.formatRGB(a):ze.Format.CSS.formatRGBA(a),c=s?ze.Format.CSS.formatHSL(a):ze.Format.CSS.formatHSLA(a),u=s?ze.Format.CSS.formatHex(a):ze.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:c,textEdit:{range:r,text:c}}),d.push({label:u,textEdit:{range:r,text:u}}),d}}let Ade=class extends Ue{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new C1e(e,t)))}};Ade=f1r([rne(0,Ds),rne(1,rs),rne(2,bn)],Ade);uY(Ade);var Z6=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function oit(n,e,t,i=!0){return Z6(this,void 0,void 0,function*(){return w1e(new g1r,n,e,t,i)})}function sit(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class g1r{constructor(){}compute(e,t,i,r){return Z6(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)})}}class m1r{constructor(){}compute(e,t,i,r){return Z6(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)})}}class _1r{constructor(e){this.colorInfo=e}compute(e,t,i,r){return Z6(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(t,this.colorInfo,nr.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)})}}function w1e(n,e,t,i,r){return Z6(this,void 0,void 0,function*(){let o=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof C1e)s=u;else try{(yield n.compute(u,t,i,a))&&(o=!0)}catch(d){tl(d)}}return o?a:s&&r?(yield n.compute(s,t,i,a),a):[]})}function ait(n,e){const{colorProvider:t}=n.get(bn),i=n.get(Ds).getModel(e);if(!i)throw ag();const r=n.get(dr).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}_r.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof Yn))throw ag();const{model:i,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=ait(n,t);return w1e(new m1r,r,i,nr.None,o)});_r.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:r,range:o}=i;if(!(r instanceof Yn)||!Array.isArray(t)||t.length!==4||!J.isIRange(o))throw ag();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=ait(n,r),[c,u,d,h]=t;return w1e(new _1r({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,nr.None,l)});var v1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},one=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},P4e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Nde;const lit=Object.create({});let DS=Nde=class extends Ue{constructor(e,t,i,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new mt),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new I6(this._editor),this._decoratorLimitReporter=new b1r,this._colorDecorationClassRefs=this._register(new mt),this._debounceInformation=r.for(i.colorProvider,"Document Colors",{min:Nde.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const r=i.colorDecorators;if(r&&r.enable!==void 0&&!r.enable)return r.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Zm,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return P4e(this,void 0,void 0,function*(){this._computePromise=Sl(e=>P4e(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new Eu(!1),r=yield oit(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),r}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Oi(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Ri.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let o=0;o<e.length&&t.length<i;o++){const{red:s,green:a,blue:l,alpha:c}=e[o].colorInfo.color,u=new gr(Math.round(s*255),Math.round(a*255),Math.round(l*255),c),d=`rgba(${u.r}, ${u.g}, ${u.b}, ${u.a})`,h=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:d}));t.push({range:{startLineNumber:e[o].colorInfo.range.startLineNumber,startColumn:e[o].colorInfo.range.startColumn,endLineNumber:e[o].colorInfo.range.endLineNumber,endColumn:e[o].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:HXe,inlineClassName:`${h.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:lit}}})}const r=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,r),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(J.fromPositions(e,e)).filter(r=>this._colorDatas.has(r.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};DS.ID="editor.contrib.colorDetector";DS.RECOMPUTE_TIME=1e3;DS=Nde=v1r([one(1,dr),one(2,bn),one(3,Og)],DS);class b1r{constructor(){this._onDidChange=new Le,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}Vr(DS.ID,DS,1);class y1r{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new Le,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new Le,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new Le,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let r=0;r<this.colorPresentations.length;r++)if(t.toLowerCase()===this.colorPresentations[r].label){i=r;break}if(i===-1){const r=t.split("(")[0].toLowerCase();for(let o=0;o<this.colorPresentations.length;o++)if(this.colorPresentations[o].label.toLowerCase().startsWith(r)){i=o;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const Lf=kt;class C1r extends Ue{constructor(e,t,i,r=!1){super(),this.model=t,this.showingStandaloneColorPicker=r,this._closeButton=null,this._domNode=Lf(".colorpicker-header"),lt(e,this._domNode),this._pickedColorNode=lt(this._domNode,Lf(".picked-color")),lt(this._pickedColorNode,Lf("span.codicon.codicon-color-mode")),this._pickedColorPresentation=lt(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=T("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=lt(this._domNode,Lf(".original-color")),this._originalColorNode.style.backgroundColor=ze.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(uz)||ze.white,this._register(i.onDidColorThemeChange(s=>{this.backgroundColor=s.getColor(uz)||ze.white})),this._register(tt(this._pickedColorNode,Yt.CLICK,()=>this.model.selectNextColorPresentation())),this._register(tt(this._originalColorNode,Yt.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=ze.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new w1r(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ze.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class w1r extends Ue{constructor(e){super(),this._onClicked=this._register(new Le),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),lt(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),lt(this._button,t),lt(t,Lf(".button"+Qn.asCSSSelector(Da("color-picker-close",Ht.close,T("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class S1r extends Ue{constructor(e,t,i,r=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Lf(".colorpicker-body"),lt(e,this._domNode),this._saturationBox=new E1r(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new x1r(this._domNode,this.model,r),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new T1r(this._domNode,this.model,r),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),r&&(this._insertButton=this._register(new k1r(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new ze(new Nb(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ze(new Nb(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new ze(new Nb(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class E1r extends Ue{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Le,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Lf(".saturation-wrap"),lt(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",lt(this._domNode,this._canvas),this.selection=Lf(".saturation-selection"),lt(this._domNode,this.selection),this.layout(),this._register(tt(this._domNode,Yt.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new sR);const t=pl(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangePosition(r.pageX-t.left,r.pageY-t.top),()=>null);const i=tt(e.target.ownerDocument,Yt.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,r),this._onDidChange.fire({s:i,v:r})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new ze(new Nb(e.h,1,1,1)),i=this._canvas.getContext("2d"),r=i.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=ze.Format.CSS.format(t),i.fill(),i.fillStyle=r,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class cit extends Ue{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Le,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=lt(e,Lf(".standalone-strip")),this.overlay=lt(this.domNode,Lf(".standalone-overlay"))):(this.domNode=lt(e,Lf(".strip")),this.overlay=lt(this.domNode,Lf(".overlay"))),this.slider=lt(this.domNode,Lf(".slider")),this.slider.style.top="0px",this._register(tt(this.domNode,Yt.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new sR),i=pl(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const r=tt(e.target.ownerDocument,Yt.POINTER_UP,()=>{this._onColorFlushed.fire(),r.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class x1r extends cit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:r}=e.rgba,o=new ze(new gr(t,i,r,1)),s=new ze(new gr(t,i,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class T1r extends cit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class k1r extends Ue{constructor(e){super(),this._onClicked=this._register(new Le),this.onClicked=this._onClicked.event,this._button=lt(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class I1r extends Jm{constructor(e,t,i,r,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(S3.onDidChange(()=>this.layout()));const s=Lf(".colorpicker-widget");e.appendChild(s),this.header=this._register(new C1r(s,this.model,r,o)),this.body=this._register(new S1r(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var uit=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dit=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},XA=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class L1r{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let pU=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Ya.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return XA(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const r=DS.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[yield hit(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return fit(this,this._editor,this._themeService,t,e)}};pU=uit([dit(1,Hl)],pU);class D1r{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r}}let C5=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return XA(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!DS.get(this._editor))return null;const o=yield oit(i,this._editor.getModel(),nr.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;J.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:yield hit(this,this._editor.getModel(),l,c),foundInEditor:u}})}updateEditorModel(e){return XA(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new J(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield fV(this._editor.getModel(),t,this._color,i,e),i=pit(this._editor,i,t))})}renderHoverParts(e,t){return fit(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};C5=uit([dit(1,Hl)],C5);function hit(n,e,t,i){return XA(this,void 0,void 0,function*(){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new gr(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new ze(c),d=yield sit(e,t,i,nr.None),h=new y1r(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),n instanceof pU?new L1r(n,J.lift(t.range),h,i):new D1r(n,J.lift(t.range),h,i)})}function fit(n,e,t,i,r){if(i.length===0||!e.hasModel())return Ue.None;if(r.setMinimumDimensions){const h=e.getOption(66)+8;r.setMinimumDimensions(new qr(302,h))}const o=new mt,s=i[0],a=e.getModel(),l=s.model,c=o.add(new I1r(r.fragment,l,e.getOption(141),t,n instanceof C5));r.setColorPicker(c);let u=!1,d=new J(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(n instanceof C5){const h=i[0].model.color;n.color=h,fV(a,l,h,d,s),o.add(l.onColorFlushed(f=>{n.color=f}))}else o.add(l.onColorFlushed(h=>XA(this,void 0,void 0,function*(){yield fV(a,l,h,d,s),u=!0,d=pit(e,d,l,r)})));return o.add(l.onDidChangeColor(h=>{fV(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function pit(n,e,t,i){let r,o;if(t.presentation.textEdit){r=[t.presentation.textEdit],o=new J(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=n.getModel()._setTrackedRange(null,o,3);n.pushUndoStop(),n.executeEdits("colorpicker",r),o=n.getModel()._getTrackedRange(s)||o}else r=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],o=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),n.pushUndoStop(),n.executeEdits("colorpicker",r);return t.presentation.additionalTextEdits&&(r=[...t.presentation.additionalTextEdits],n.executeEdits("colorpicker",r),i&&i.hide()),n.pushUndoStop(),o}function fV(n,e,t,i,r){return XA(this,void 0,void 0,function*(){const o=yield sit(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,nr.None);e.colorPresentations=o||[]})}function Rde(n,e){return!!n[e]}class sne{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Rde(e.event,t.triggerModifier),this.hasSideBySideModifier=Rde(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class M4e{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Rde(e,t.triggerModifier)}}class g7{constructor(e,t,i,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function F4e(n){return n==="altKey"?mr?new g7(57,"metaKey",6,"altKey"):new g7(5,"ctrlKey",6,"altKey"):mr?new g7(6,"altKey",57,"metaKey"):new g7(6,"altKey",5,"ctrlKey")}class xY extends Ue{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new Le),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new Le),this.onExecute=this._onExecute.event,this._onCancel=this._register(new Le),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:r=>r.target.position?r.target.position.lineNumber:0,this._opts=F4e(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(77)){const o=F4e(this._editor.getOption(77));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new sne(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new sne(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new sne(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new M4e(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new M4e(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var A1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ny=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let AS=class extends $A{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f){super(e,Object.assign(Object.assign({},r.getRawOptions()),{overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()}),i,o,s,a,l,c,u,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){tG(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};AS=A1r([ny(4,di),ny(5,eo),ny(6,_a),ny(7,vi),ny(8,Hl),ny(9,za),ny(10,O1),ny(11,rs),ny(12,bn)],AS);const B4e=new ze(new gr(0,122,204)),N1r={showArrow:!0,showFrame:!0,className:"",frameColor:B4e,arrowColor:B4e,keepEditorSelection:!1},R1r="vs.editor.contrib.zoneWidget";class O1r{constructor(e,t,i,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class P1r{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class TY{constructor(e){this._editor=e,this._ruleName=TY._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),DRe(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){DRe(this._ruleName),oce(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:J.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}TY._IdGenerator=new Iye(".arrow-decoration-");class M1r{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new mt,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=_y(t),tG(this.options,N1r,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const r=this._getWidth(i);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(r)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new TY(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const r=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=J.isIRange(e)?J.lift(e):J.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Ri.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new O1r(s,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new P1r(R1r+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new J(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new uu(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),r=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var git=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mit=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const _it=or("IPeekViewService");vr(_it,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const r=this._widgets.get(n);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var fh;(function(n){n.inPeekEditor=new sn("inReferenceSearchEditor",!0,T("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(fh||(fh={}));let w5=class{constructor(e,t){e instanceof AS&&fh.inPeekEditor.bindTo(t)}dispose(){}};w5.ID="editor.contrib.referenceController";w5=git([mit(1,vi)],w5);Vr(w5.ID,w5,0);function F1r(n){const e=n.get(eo).getFocusedCodeEditor();return e instanceof AS?e.getParentEditor():e}const B1r={headerBackgroundColor:ze.white,primaryHeadingColor:ze.fromHex("#333333"),secondaryHeadingColor:ze.fromHex("#6c6c6cb3")};let gU=class extends M1r{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new Le,this.onDidClose=this._onDidClose.event,tG(this.options,B1r,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=kt(".head"),this._bodyElement=kt(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=kt(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),$a(this._titleElement,"click",o=>this._onTitleClick(o))),lt(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=kt("span.filename"),this._secondaryHeading=kt("span.dirname"),this._metaHeading=kt("span.meta"),lt(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=kt(".peekview-actions");lt(this._headElement,i);const r=this._getActionBarOptions();this._actionbarWidget=new wg(i,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Pd("peekview.close",T("label.close","Close"),Qn.asClassName(Ht.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Xpr.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ic(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Mh(this._metaHeading)):bd(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),r=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(r,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};gU=git([mit(2,di)],gU);const $1r=he("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ze.black,hcLight:ze.white},T("peekViewTitleBackground","Background color of the peek view title area.")),vit=he("peekViewTitleLabel.foreground",{dark:ze.white,light:ze.black,hcDark:ze.white,hcLight:vm},T("peekViewTitleForeground","Color of the peek view title.")),bit=he("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},T("peekViewTitleInfoForeground","Color of the peek view title info.")),V1r=he("peekView.border",{dark:lh,light:lh,hcDark:ur,hcLight:ur},T("peekViewBorder","Color of the peek view borders and arrow.")),H1r=he("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ze.black,hcLight:ze.white},T("peekViewResultsBackground","Background color of the peek view result list."));he("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ze.white,hcLight:vm},T("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));he("peekViewResult.fileForeground",{dark:ze.white,light:"#1E1E1E",hcDark:ze.white,hcLight:vm},T("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));he("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},T("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));he("peekViewResult.selectionForeground",{dark:ze.white,light:"#6C6C6C",hcDark:ze.white,hcLight:vm},T("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const cw=he("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ze.black,hcLight:ze.white},T("peekViewEditorBackground","Background color of the peek view editor."));he("peekViewEditorGutter.background",{dark:cw,light:cw,hcDark:cw,hcLight:cw},T("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));he("peekViewEditorStickyScroll.background",{dark:cw,light:cw,hcDark:cw,hcLight:cw},T("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));he("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},T("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));he("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},T("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));he("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:ys,hcLight:ys},T("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var W1r=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class NS{constructor(e,t,i,r){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=r,this.id=mue.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?T({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,Cg(this.uri),this.range.startLineNumber,this.range.startColumn):T("aria.oneReference","in {0} on line {1} at column {2}",Cg(this.uri),this.range.startLineNumber,this.range.startColumn)}}class z1r{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:r,column:o-t}),c=new J(r,l.startColumn,r,o),u=new J(s,a,s,1073741824),d=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class S5{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new mu}dispose(){mo(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?T("aria.fileReferences.1","1 symbol in {0}, full path {1}",Cg(this.uri),this.uri.fsPath):T("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Cg(this.uri),this.uri.fsPath)}resolve(e){return W1r(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new z1r(i))}catch(i){Oi(i)}return this})}}class Kh{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new Le,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Kh._compareReferences);let r;for(const o of e)if((!r||!Cs.isEqual(r.uri,o.uri,!0))&&(r=new S5(this,o.uri),this.groups.push(r)),r.children.length===0||Kh._compareReferences(o,r.children[r.children.length-1])!==0){const s=new NS(i===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){mo(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Kh(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?T("aria.result.0","No results found"):this.references.length===1?T("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?T("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):T("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let r=i.children.indexOf(e);const o=i.children.length,s=i.parent.groups.length;return s===1||t&&r+1<o||!t&&r>0?(t?r=(r+1)%o:r=(r+o-1)%o,i.children[r]):(r=i.parent.groups.indexOf(i),t?(r=(r+1)%s,i.parent.groups[r].children[0]):(r=(r+s-1)%s,i.parent.groups[r].children[i.parent.groups[r].children.length-1]))}nearestReference(e,t){const i=this.references.map((r,o)=>({idx:o,prefixLen:YT(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLen<o.prefixLen?1:r.offsetDist<o.offsetDist?-1:r.offsetDist>o.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&J.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Cs.compare(e.uri,t.uri)||J.compareRangesUsingStarts(e.range,t.range)}}var kY=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},IY=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ode;let Pde=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Kh||e instanceof S5}getChildren(e){if(e instanceof Kh)return e.groups;if(e instanceof S5)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Pde=kY([IY(0,bh)],Pde);class U1r{getHeight(){return 23}getTemplateId(e){return e instanceof S5?E5.id:J6.id}}let Mde=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof NS){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Cg(e.uri)}};Mde=kY([IY(0,Qo)],Mde);class j1r{getId(e){return e instanceof NS?e.id:e.uri}}let Fde=class extends Ue{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new Jz(i,{supportHighlights:!0})),this.badge=new Vue(lt(i,kt(".count")),{},qet),e.appendChild(i)}set(e,t){const i=$G(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(T("referencesCount","{0} references",r)):this.badge.setTitleFormat(T("referenceCount","{0} reference",r))}};Fde=kY([IY(1,VA)],Fde);let E5=Ode=class{constructor(e){this._instantiationService=e,this.templateId=Ode.id}renderTemplate(e){return this._instantiationService.createInstance(Fde,e)}renderElement(e,t,i){i.set(e.element,B6(e.filterData))}disposeTemplate(e){e.dispose()}};E5.id="FileReferencesRenderer";E5=Ode=kY([IY(0,di)],E5);class q1r{constructor(e){this.label=new zw(e)}set(e,t){var i;const r=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!r||!r.value)this.label.set(`${Cg(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!pv.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,B6(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class J6{constructor(){this.templateId=J6.id}renderTemplate(e){return new q1r(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}J6.id="OneReferenceRenderer";class K1r{getWidgetAriaLabel(){return T("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var G1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},iy=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$4e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class LY{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new mt,this._callOnModelChange=new mt,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let r=0,o=e.children.length;r<o;r++){const s=e.children[r];this._decorationIgnoreSet.has(s.id)||s.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:s.range,options:LY.DecorationOptions}),i.push(r))}this._editor.changeDecorations(r=>{const o=r.deltaDecorations([],t);for(let s=0;s<o.length;s++)this._decorations.set(o[s],e.children[i[s]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,r]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let s=!1;if(!J.equalsRange(o,r.range)){if(J.spansMultipleLines(o))s=!0;else{const a=r.range.endColumn-r.range.startColumn,l=o.endColumn-o.startColumn;a!==l&&(s=!0)}s?(this._decorationIgnoreSet.add(r.id),e.push(i)):r.range=o}}for(let i=0,r=e.length;i<r;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}LY.DecorationOptions=Ri.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class Y1r{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const r=JSON.parse(e);t=r.ratio,i=r.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class Q1r extends Mue{}let Bde=class extends gU{constructor(e,t,i,r,o,s,a,l,c,u,d,h){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=c,this._keybindingService=u,this._languageService=d,this._languageConfigurationService=h,this._disposeOnNewModel=new mt,this._callOnDispose=new mt,this._onDidSelectReference=new Le,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new qr(0,0),this._applyTheme(r.getColorTheme()),this._callOnDispose.add(r.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),mo(this._preview),mo(this._previewNotAvailableMessage),mo(this._tree),mo(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(V1r)||ze.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor($1r)||ze.transparent,primaryHeadingColor:e.getColor(vit),secondaryHeadingColor:e.getColor(bit)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=lt(e,kt("div.messages")),bd(this._messageContainer),this._splitView=new Zet(e,{orientation:1}),this._previewContainer=lt(e,kt("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(AS,this._previewContainer,t,{},this.editor),bd(this._previewContainer),this._previewNotAvailableMessage=new f0(T("missingPreviewMessage","no preview available"),qf,f0.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=lt(e,kt("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new K1r,keyboardNavigationLabelProvider:this._instantiationService.createInstance(Mde),identityProvider:new j1r,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:H1r}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add($a(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Q1r,"ReferencesWidget",this._treeContainer,new U1r,[this._instantiationService.createInstance(E5),this._instantiationService.createInstance(J6)],this._instantiationService.createInstance(Pde),i),this._splitView.addView({onDidChange:nn.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},Yz.Distribute),this._splitView.addView({onDidChange:nn.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},Yz.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof NS&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),bd(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new qr(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=T("noResults","No results"),Mh(this._messageContainer),Promise.resolve(void 0)):(bd(this._messageContainer),this._decorationsManager=new LY(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const r=this._getFocusedReference();r&&this._onDidSelectReference.fire({element:{uri:r.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Mh(this._treeContainer),Mh(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof NS)return e;if(e instanceof S5&&e.children.length>0)return e.children[0]}revealReference(e){return $4e(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return $4e(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Gi.inMemory?this.setTitle($cr(e.uri),this._uriLabel.getUriLabel($G(e.uri))):this.setTitle(T("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const r=yield i;if(!this._model){r.dispose();return}mo(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=J.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()})}};Bde=G1r([iy(3,Hl),iy(4,bh),iy(5,di),iy(6,_it),iy(7,VA),iy(8,VG),iy(9,Qo),iy(10,xs),iy(11,rs)],Bde);var X1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},l2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},V4e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},pV;const pI=new sn("referenceSearchVisible",!1,T("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let RS=pV=class{static get(e){return e.getContribution(pV.ID)}constructor(e,t,i,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new mt,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=pI.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),r&&e.containsPosition(r))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=Y1r.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Bde,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(T("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:u}=l;if(c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(T("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new De(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return V4e(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const r=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(r),yield this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return V4e(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const r=J.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=pV.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,Sl(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,Oi(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};RS.ID="editor.contrib.referencesController";RS=pV=X1r([l2(2,vi),l2(3,eo),l2(4,za),l2(5,di),l2(6,i_),l2(7,dr)],RS);function gI(n,e){const t=F1r(n);if(!t)return;const i=RS.get(t);i&&e(i)}hh.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:ml(2089,60),when:at.or(pI,fh.inPeekEditor),handler(n){gI(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});hh.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:at.or(pI,fh.inPeekEditor),handler(n){gI(n,e=>{e.goToNextOrPreviousReference(!0)})}});hh.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:at.or(pI,fh.inPeekEditor),handler(n){gI(n,e=>{e.goToNextOrPreviousReference(!1)})}});_r.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");_r.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");_r.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");_r.registerCommand("closeReferenceSearch",n=>gI(n,e=>e.closeWidget()));hh.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:at.and(fh.inPeekEditor,at.not("config.editor.stablePeek"))});hh.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:at.and(pI,at.not("config.editor.stablePeek"))});hh.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:at.and(pI,ftt,Uye.negate(),jye.negate()),handler(n){var e;const i=(e=n.get(Mg).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof NS&&gI(n,r=>r.revealReference(i[0]))}});hh.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:at.and(pI,ftt,Uye.negate(),jye.negate()),handler(n){var e;const i=(e=n.get(Mg).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof NS&&gI(n,r=>r.openReference(i[0],!0,!0))}});_r.registerCommand("openReference",n=>{var e;const i=(e=n.get(Mg).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof NS&&gI(n,r=>r.openReference(i[0],!1,!0))});var yit=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DP=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const S1e=new sn("hasSymbols",!1,T("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),DY=or("ISymbolNavigationService");let $de=class{constructor(e,t,i,r){this._editorService=t,this._notificationService=i,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=S1e.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new Vde(this._editorService),r=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(J0e(d.uri,a.uri))c=!0,u=u||J.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=km(i,r)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:J.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?T("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):T("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};$de=yit([DP(0,vi),DP(1,eo),DP(2,za),DP(3,Qo)],$de);vr(DY,$de,1);zt(new class extends ac{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:S1e,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(DY).revealNext(e)}});hh.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:S1e,primary:9,handler(n){n.get(DY).reset()}});let Vde=class{constructor(e){this._listener=new Map,this._disposables=new mt,this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),mo(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,km(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};Vde=yit([DP(0,eo)],Vde);var E1e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function eB(n,e,t,i){return E1e(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{tl(l)})),s=yield Promise.all(o);return s0(s.flat())})}function AY(n,e,t,i){return eB(e,t,n,(r,o,s)=>r.provideDefinition(o,s,i))}function Cit(n,e,t,i){return eB(e,t,n,(r,o,s)=>r.provideDeclaration(o,s,i))}function wit(n,e,t,i){return eB(e,t,n,(r,o,s)=>r.provideImplementation(o,s,i))}function Sit(n,e,t,i){return eB(e,t,n,(r,o,s)=>r.provideTypeDefinition(o,s,i))}function NY(n,e,t,i,r){return eB(e,t,n,(o,s,a)=>E1e(this,void 0,void 0,function*(){const l=yield o.provideReferences(s,a,{includeDeclaration:!0},r);if(!i||!l||l.length!==2)return l;const c=yield o.provideReferences(s,a,{includeDeclaration:!1},r);return c&&c.length===1?c:l}))}function tB(n){return E1e(this,void 0,void 0,function*(){const e=yield n(),t=new Kh(e,""),i=t.references.map(r=>r.link);return t.dispose(),i})}A0("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(bn),r=AY(i.definitionProvider,e,t,nr.None);return tB(()=>r)});A0("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(bn),r=Sit(i.typeDefinitionProvider,e,t,nr.None);return tB(()=>r)});A0("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(bn),r=Cit(i.declarationProvider,e,t,nr.None);return tB(()=>r)});A0("_executeReferenceProvider",(n,e,t)=>{const i=n.get(bn),r=NY(i.referenceProvider,e,t,!1,nr.None);return tB(()=>r)});A0("_executeImplementationProvider",(n,e,t)=>{const i=n.get(bn),r=wit(i.implementationProvider,e,t,nr.None);return tB(()=>r)});var Dm=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},HO,WO,zO,m7,_7,v7,b7,y7;xc.appendMenuItem(ue.EditorContext,{submenu:ue.EditorContextPeek,title:T("peek.submenu","Peek"),group:"navigation",order:100});class ZA{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof ZA||De.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class zu extends Av{static all(){return zu._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of tr.wrap(t.menu))(i.id===ue.EditorContext||i.id===ue.EditorContextPeek)&&(i.when=at.and(e.precondition,i.when));return t}constructor(e,t){super(zu._patchConfig(t)),this.configuration=e,zu._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(za),s=e.get(eo),a=e.get(gE),l=e.get(DY),c=e.get(bn),u=e.get(di),d=t.getModel(),h=t.getPosition(),f=ZA.is(i)?i:new ZA(d,h),g=new IS(t,5),m=_G(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(v=>Dm(this,void 0,void 0,function*(){var _;if(!v||g.token.isCancellationRequested)return;bu(v.ariaMessage);let b;if(v.referenceAt(d.uri,h)){const C=this._getAlternativeCommand(t);!zu._activeAlternativeCommands.has(C)&&zu._allSymbolNavigationCommands.has(C)&&(b=zu._allSymbolNavigationCommands.get(C))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const C=d.getWordAtPosition(h);(_=qh.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(C),h)}}else if(y===1&&b)zu._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(C=>b.runEditorCommand(C,t,i,r).finally(()=>{zu._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,r)}),v=>{o.error(v)}).finally(()=>{g.dispose()});return a.showWhile(m,250),m}_onResult(e,t,i,r,o){return Dm(this,void 0,void 0,function*(){const s=this._getGoToPreference(i);if(!(i instanceof AS)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(i,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",c=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,o):r.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,i,r,o){return Dm(this,void 0,void 0,function*(){let s;if(ner(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:J.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,i){const r=RS.get(e);r&&e.hasModel()?r.toggleWidget(i??e.getSelection(),Sl(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}zu._allSymbolNavigationCommands=new Map;zu._activeAlternativeCommands=new Set;class nB extends zu{_getLocationModel(e,t,i,r){return Dm(this,void 0,void 0,function*(){return new Kh(yield AY(e.definitionProvider,t,i,r),T("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?T("noResultWord","No definition found for '{0}'",e.word):T("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}ws((HO=class extends nB{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:HO.id,title:{value:T("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:T({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:at.and(de.hasDefinitionProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:[{when:de.editorTextFocus,primary:70,weight:100},{when:at.and(de.editorTextFocus,utt),primary:2118,weight:100}],menu:[{id:ue.EditorContext,group:"navigation",order:1.1},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),_r.registerCommandAlias("editor.action.goToDeclaration",HO.id)}},HO.id="editor.action.revealDefinition",HO));ws((WO=class extends nB{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:WO.id,title:{value:T("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:at.and(de.hasDefinitionProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:[{when:de.editorTextFocus,primary:ml(2089,70),weight:100},{when:at.and(de.editorTextFocus,utt),primary:ml(2089,2118),weight:100}]}),_r.registerCommandAlias("editor.action.openDeclarationToTheSide",WO.id)}},WO.id="editor.action.revealDefinitionAside",WO));ws((zO=class extends nB{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zO.id,title:{value:T("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:at.and(de.hasDefinitionProvider,fh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:ue.EditorContextPeek,group:"peek",order:2}}),_r.registerCommandAlias("editor.action.previewDeclaration",zO.id)}},zO.id="editor.action.peekDefinition",zO));class Eit extends zu{_getLocationModel(e,t,i,r){return Dm(this,void 0,void 0,function*(){return new Kh(yield Cit(e.declarationProvider,t,i,r),T("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?T("decl.noResultWord","No declaration found for '{0}'",e.word):T("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}ws((m7=class extends Eit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:m7.id,title:{value:T("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:T({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:at.and(de.hasDeclarationProvider,de.isInWalkThroughSnippet.toNegated()),menu:[{id:ue.EditorContext,group:"navigation",order:1.3},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?T("decl.noResultWord","No declaration found for '{0}'",e.word):T("decl.generic.noResults","No declaration found")}},m7.id="editor.action.revealDeclaration",m7));ws(class extends Eit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:T("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:at.and(de.hasDeclarationProvider,fh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),menu:{id:ue.EditorContextPeek,group:"peek",order:3}})}});class xit extends zu{_getLocationModel(e,t,i,r){return Dm(this,void 0,void 0,function*(){return new Kh(yield Sit(e.typeDefinitionProvider,t,i,r),T("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?T("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):T("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}ws((_7=class extends xit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:_7.ID,title:{value:T("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:T({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:at.and(de.hasTypeDefinitionProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:0,weight:100},menu:[{id:ue.EditorContext,group:"navigation",order:1.4},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},_7.ID="editor.action.goToTypeDefinition",_7));ws((v7=class extends xit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:v7.ID,title:{value:T("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:at.and(de.hasTypeDefinitionProvider,fh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),menu:{id:ue.EditorContextPeek,group:"peek",order:4}})}},v7.ID="editor.action.peekTypeDefinition",v7));class Tit extends zu{_getLocationModel(e,t,i,r){return Dm(this,void 0,void 0,function*(){return new Kh(yield wit(e.implementationProvider,t,i,r),T("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?T("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):T("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}ws((b7=class extends Tit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:b7.ID,title:{value:T("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:T({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:at.and(de.hasImplementationProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:2118,weight:100},menu:[{id:ue.EditorContext,group:"navigation",order:1.45},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},b7.ID="editor.action.goToImplementation",b7));ws((y7=class extends Tit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:y7.ID,title:{value:T("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:at.and(de.hasImplementationProvider,fh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:3142,weight:100},menu:{id:ue.EditorContextPeek,group:"peek",order:5}})}},y7.ID="editor.action.peekImplementation",y7));class kit extends zu{_getNoResultFoundMessage(e){return e?T("references.no","No references found for '{0}'",e.word):T("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}ws(class extends kit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:T("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:T({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:at.and(de.hasReferenceProvider,fh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:1094,weight:100},menu:[{id:ue.EditorContext,group:"navigation",order:1.45},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,r){return Dm(this,void 0,void 0,function*(){return new Kh(yield NY(e.referenceProvider,t,i,!0,r),T("ref.title","References"))})}});ws(class extends kit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:T("references.action.label","Peek References"),original:"Peek References"},precondition:at.and(de.hasReferenceProvider,fh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),menu:{id:ue.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,r){return Dm(this,void 0,void 0,function*(){return new Kh(yield NY(e.referenceProvider,t,i,!1,r),T("ref.title","References"))})}});class Z1r extends zu{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:T("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:at.and(fh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,r){return Dm(this,void 0,void 0,function*(){return new Kh(this._references,T("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&T("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}_r.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Yn},{name:"position",description:"The position at which to start",constraint:De.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,r,o,s)=>Dm(void 0,void 0,void 0,function*(){Io(Yn.isUri(e)),Io(De.isIPosition(t)),Io(Array.isArray(i)),Io(typeof r>"u"||typeof r=="string"),Io(typeof s>"u"||typeof s=="boolean");const a=n.get(eo),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(_0(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends Z1r{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},i,r);c.get(di).invokeFunction(u.run.bind(u),l)})})});_r.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Yn},{name:"position",description:"The position at which to start",constraint:De.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,r)=>Dm(void 0,void 0,void 0,function*(){n.get(_a).executeCommand("editor.action.goToLocations",e,t,i,r,void 0,!0)})});_r.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Io(Yn.isUri(e)),Io(De.isIPosition(t));const i=n.get(bn),r=n.get(eo);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!_0(o)||!o.hasModel())return;const s=RS.get(o);if(!s)return;const a=Sl(c=>NY(i.referenceProvider,o.getModel(),De.lift(t),!1,c).then(u=>new Kh(u,T("ref.title","References")))),l=new J(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});_r.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var J1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ane=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},H4e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},AP;let pk=AP=class{constructor(e,t,i,r){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=r,this.toUnhook=new mt,this.toUnhookForKeyboard=new mt,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new xY(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{Oi(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(AP.ID)}startFindDefinitionFromCursor(e){return H4e(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return H4e(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const r=new Ztt(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Sl(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){Oi(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?J.lift(o[0].originSelectionRange):new J(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=J.plusRange(a,l));this.addDecoration(a,new Gc().appendText(T("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new Gc().appendCodeblock(h||"",d):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let r=i.range;return r.endLineNumber-r.startLineNumber>=AP.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);o=Math.min(o,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${o-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),r=Math.min(e.getLineCount(),t+AP.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<r;o++){const s=e.getLineFirstNonWhitespaceColumn(o);if(i===s)break}return new J(t,1,o+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)===null||i===void 0?void 0:i.options)instanceof kS)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?AY(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const r=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new nB({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(vi);return fh.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};pk.ID="editor.contrib.gotodefinitionatposition";pk.MAX_SOURCE_PREVIEW_LINES=8;pk=AP=J1r([ane(1,bh),ane(2,xs),ane(3,bn)],pk);Vr(pk.ID,pk,2);const C7=kt;class Iit extends Ue{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new A6(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class x1e extends Ue{static render(e,t,i){return new x1e(e,t,i)}constructor(e,t,i){super(),this.actionContainer=lt(e,C7("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=lt(this.actionContainer,C7("a.action")),this.action.setAttribute("role","button"),t.iconClass&<(this.action,C7(`span.icon.${t.iconClass}`));const r=lt(this.action,C7("span"));r.textContent=i?`${t.label} (${i})`:t.label,this._register(tt(this.actionContainer,Yt.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(tt(this.actionContainer,Yt.KEY_DOWN,o=>{const s=new hs(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function eCr(n,e){return n&&e?T("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?T("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var tCr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},nCr=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};let iCr=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class Lit extends Ue{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new Le),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new $o(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new $o(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new $o(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=rnr(e=>this._computer.computeAsync(e)),tCr(this,void 0,void 0,function*(){var e,t,i,r;try{try{for(var o=!0,s=nCr(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;o=!0){r=a.value,o=!1;const l=r;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){Oi(l)}})):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new iCr(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class lne{constructor(e,t,i,r){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=r,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class gV{constructor(e,t,i,r,o,s){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=r,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const mI=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class T1e{constructor(){this._onDidWillResize=new Le,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new Le,this.onDidResize=this._onDidResize.event,this._sashListener=new mt,this._size=new qr(0,0),this._minSize=new qr(0,0),this._maxSize=new qr(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new uu(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new uu(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new uu(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:Kz.North}),this._southSash=new uu(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:Kz.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(nn.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(nn.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(i=r.currentX-r.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(i=-(r.currentX-r.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(nn.any(this._eastSash.onDidReset,this._westSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(nn.any(this._northSash.onDidReset,this._southSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:r}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(r,Math.min(s,t));const a=new qr(t,e);qr.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const rCr=30,oCr=24;class sCr extends Ue{constructor(e,t=new qr(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new T1e),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=qr.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new qr(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?De.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:pl(t).top+i.top-rCr}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const r=pl(t),o=nR(t.ownerDocument.body),s=r.top+i.top+i.height;return o.height-s-oCr}_findPositionPreference(e,t){var i,r;const o=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),s=Math.min((r=this._availableVerticalSpaceAbove(t))!==null&&r!==void 0?r:1/0,e),a=Math.min(Math.max(s,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var k1e=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jx=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mV,Kv;const W4e=kt;let mU=mV=class extends Ue{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(qw,this._editor)),this._participants=[];for(const r of mI.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new vU(this._editor,this._participants),this._hoverOperation=this._register(new Lit(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new Dit(this._computer.anchor,o,r.isComplete))})),this._register($a(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(Ks.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new lne(0,i.range,e.event.posx,e.event.posy)),i.type===7){const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<r&&t.push(new lne(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((r,o)=>o.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,r){this._startShowingOrUpdateHover(new lne(0,e,void 0,void 0),t,i,r,null)}_startShowingOrUpdateHover(e,t,i,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:r,highlightRange:o}=mV.computeHoverRanges(this._editor,e.range,t),s=new mt,a=s.add(new _U(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:mV._DECORATION_OPTIONS}]),s.add(mi(()=>{h.clear()}))}this._widget.showAt(l,new lCr(c,i,r,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,i){let r=1;if(e.hasModel()){const c=e._getViewModel(),u=c.coordinatesConverter,d=u.convertModelRangeToViewRange(t),h=new De(d.startLineNumber,c.getLineMinColumn(d.startLineNumber));r=u.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let s=t.startColumn,a=i[0].range,l=null;for(const c of i)a=J.plusRange(a,c.range),c.range.startLineNumber===o&&c.range.endLineNumber===o&&(s=Math.max(Math.min(s,c.range.startColumn),r)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new De(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new De(o,s),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};mU._DECORATION_OPTIONS=Ri.register({description:"content-hover-highlight",className:"hoverHighlight"});mU=mV=k1e([Jx(1,di),Jx(2,Qo)],mU);class Dit{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new aCr(this,this.anchor,t,this.isComplete)}}class aCr extends Dit{constructor(e,t,i,r){super(t,i,r),this.original=e}filter(e){return this.original.filter(e)}}class lCr{constructor(e,t,i,r,o,s,a,l,c,u){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=r,this.stoleFocus=o,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=u,this.closestMouseDistance=void 0}}const z4e=30,cne=10,cCr=6;let qw=Kv=class extends sCr{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,r,o){const s=e.getOption(66)+8,a=150,l=new qr(a,s);super(e,l),this._configurationService=i,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new Iit),this._minimumSize=l,this._hoverVisibleKey=de.hoverVisible.bindTo(t),this._hoverFocusedKey=de.hoverFocused.bindTo(t),lt(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register(c0(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Kv.ID}static _applyDimensions(e,t,i){const r=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=r,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Kv._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Kv._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const r=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=r,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Kv._applyMaxDimensions(this._hover.contentsDomNode,e,t),Kv._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-cne))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new qr(i,r),this._setHoverWidgetMaxDimensions(i,r)}_resize(e){var t,i;Kv._lastDimensions=new qr(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=cCr;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=cne),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?nR(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=pl(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=U4e(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const r=U4e(e,t,i.left,i.top,i.width,i.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Kv._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Kv._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,r,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=jx(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(r=t.colorPicker)===null||r===void 0||r.layout();const c=eCr(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new qr(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,r=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(th(i),Math.min(o,e)),this._setContentsDomNodeDimensions(th(r),Math.min(o,e-cne))}setMinimumDimensions(e){this._minimumSize=new qr(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new qr(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=jx(t),r=th(t);if(this._resizableNode.layout(i,r),this._setHoverWidgetDimensions(r,i),i=jx(t),r=th(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(i,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=jx(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-z4e})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+z4e})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};qw.ID="editor.contrib.resizableContentHoverWidget";qw._lastDimensions=new qr(0,0);qw=Kv=k1e([Jx(1,vi),Jx(2,dr),Jx(3,O1),Jx(4,Qo)],qw);let _U=class extends Ue{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=W4e("div.hover-row.status-bar"),this.actionsElement=lt(this.hoverElement,W4e("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(x1e.render(this.actionsElement,e,i))}append(e){const t=lt(this.actionsElement,e);return this._hasContent=!0,t}};_U=k1e([Jx(0,Qo)],_U);class vU{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),r=t.range.startLineNumber;if(r>i.getLineCount())return[];const o=i.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Ya.EMPTY;const i=vU._getLineDecorations(this._editor,t);return Ya.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,i,e):Ya.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=vU._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return s0(t)}}function U4e(n,e,t,i,r,o){const s=t+r/2,a=i+o/2,l=Math.max(Math.abs(n-s)-r/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const j4e=kt;class yD extends Ue{constructor(e,t,i){super(),this._renderDisposeables=this._register(new mt),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new Iit),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new E1({editor:this._editor},t,i)),this._computer=new uCr(this._editor),this._hoverOperation=this._register(new Lit(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return yD.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const r of t){const o=j4e("div.hover-row.markdown-hover"),s=lt(o,j4e("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(66),s=this._hover.containerDomNode.clientHeight,a=i-r-(s-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}yD.ID="editor.contrib.modesGlyphHoverWidget";class uCr{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=r=>({value:r}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const r of t){if(!r.options.glyphMarginClassName)continue;const o=r.options.glyphMarginHoverMessage;!o||zA(o)||i.push(...Kbe(o).map(e))}return i}}var dCr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class hCr{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function fCr(n,e,t,i,r){return dCr(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,r));if(o&&gCr(o))return new hCr(n,o,e)}catch(o){tl(o)}})}function I1e(n,e,t,i){const o=n.ordered(e).map((s,a)=>fCr(s,a,e,t,i));return Ya.fromPromises(o).coalesce()}function pCr(n,e,t,i){return I1e(n,e,t,i).map(r=>r.hover).toPromise()}A0("_executeHoverProvider",(n,e,t)=>{const i=n.get(bn);return pCr(i.hoverProvider,e,t,nr.None)});function gCr(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var mCr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},w7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const q4e=kt;class K_{constructor(e,t,i,r,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let bU=class{constructor(e,t,i,r,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new K_(this,e.range,[new Gc().appendText(T("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];let a=1e3;const l=i.getLineLength(r),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(116),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new K_(this,e.range,[{value:T("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new K_(this,e.range,[{value:T("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const m=g.range.startLineNumber===r?g.range.startColumn:1,v=g.range.endLineNumber===r?g.range.endColumn:o,_=g.options.hoverMessage;if(!_||zA(_))continue;g.options.beforeContentClassName&&(f=!0);const b=new J(e.range.startLineNumber,m,e.range.startLineNumber,v);s.push(new K_(this,b,Kbe(_),f,a++))}return s}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Ya.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Ya.EMPTY;const o=new De(e.range.startLineNumber,e.range.startColumn);return I1e(this._languageFeaturesService.hoverProvider,r,o,i).filter(s=>!zA(s.hover.contents)).map(s=>{const a=s.hover.range?J.lift(s.hover.range):e.range;return new K_(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return Ait(e,t,this._editor,this._languageService,this._openerService)}};bU=mCr([w7(1,xs),w7(2,rf),w7(3,dr),w7(4,bn)],bU);function Ait(n,e,t,i,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new mt;for(const s of e)for(const a of s.contents){if(zA(a))continue;const l=q4e("div.hover-row.markdown-hover"),c=lt(l,q4e("div.hover-contents")),u=o.add(new E1({editor:t},i,r));o.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",n.onContentsChanged()}));const d=o.add(u.render(a));c.appendChild(d.element),n.fragment.appendChild(l)}return o}var Nit=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class K4e{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Hde=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new Le,this.onDidChange=this._onDidChange.event,this._dispoables=new mt,this._markers=[],this._nextIdx=-1,Yn.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=w3(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=J.compareRangesUsingStarts(a,l)||Qs.compare(a.severity,l.severity):c=Qs.compare(a.severity,l.severity)||J.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Yn.isUri(e)?e:void 0,severities:Qs.Error|Qs.Warning|Qs.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new K4e(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=p3(this._markers,{resource:e.uri},(s,a)=>w3(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;s<this._markers.length;s++){let a=J.lift(this._markers[s]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new J(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=s,r=!0;break}if(this._markers[s].resource.toString()!==e.uri.toString())break}r||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const r=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),r!==this._nextIdx}find(e,t){let i=this._markers.findIndex(r=>r.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(J.containsPosition(this._markers[i],t))return new K4e(this._markers[i],i+1,this._markers.length)}}};Hde=Nit([yU(1,N0),yU(2,dr)],Hde);const Rit=or("IMarkerNavigationService");let Wde=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Id}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new Hde(e,this._markerService,this._configService)}};Wde=Nit([yU(0,N0),yU(1,dr)],Wde);vr(Rit,Wde,1);var zde;(function(n){function e(t){switch(t){case Sa.Ignore:return"severity-ignore "+Qn.asClassName(Ht.info);case Sa.Info:return Qn.asClassName(Ht.info);case Sa.Warning:return Qn.asClassName(Ht.warning);case Sa.Error:return Qn.asClassName(Ht.error);default:return""}}n.className=e})(zde||(zde={}));var _Cr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},c2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ude;class vCr{constructor(e,t,i,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new mt,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add($a(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new hJe(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){mo(this._disposables)}update(e){const{source:t,message:i,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=l0(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ic(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=kt("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=lt(this._codeLink,kt("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ic(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Cu(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(m),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Qs.Error:t=T("Error","Error");break;case Qs.Warning:t=T("Warning","Warning");break;case Qs.Info:t=T("Info","Info");break;case Qs.Hint:t=T("Hint","Hint");break}let i=T("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(i=`${r.getLineContent(e.startLineNumber)}, ${i}`),i}}let JA=Ude=class extends gU{constructor(e,t,i,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new mt,this._onDidSelectRelatedInformation=new Le,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Qs.Warning,this._backgroundColor=ze.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(wCr);let t=jde,i=bCr;this._severity===Qs.Warning?(t=_V,i=yCr):this._severity===Qs.Info&&(t=qde,i=CCr);const r=e.getColor(t),o=e.getColor(i);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(vit),secondaryHeadingColor:e.getColor(bit)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(r=>this.editor.focus()));const t=[],i=this._menuService.createMenu(Ude.TitleMenu,this._contextKeyService);Get(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=lt(e,kt(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new vCr(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=J.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?T("problems","{0} of {1} problems",t,i):T("change","{0} of {1} problem",t,i);this.setTitle(Cg(a.uri),l)}this._icon.className=`codicon ${zde.className(Qs.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};JA.TitleMenu=new ue("gotoErrorTitleMenu");JA=Ude=_Cr([c2(1,Hl),c2(2,rf),c2(3,L0),c2(4,di),c2(5,vi),c2(6,VA)],JA);const G4e=V3(Pb,vor),Y4e=V3(Ff,B3),Q4e=V3(lh,$3),jde=he("editorMarkerNavigationError.background",{dark:G4e,light:G4e,hcDark:ur,hcLight:ur},T("editorMarkerNavigationError","Editor marker navigation widget error color.")),bCr=he("editorMarkerNavigationError.headerBackground",{dark:Mn(jde,.1),light:Mn(jde,.1),hcDark:null,hcLight:null},T("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),_V=he("editorMarkerNavigationWarning.background",{dark:Y4e,light:Y4e,hcDark:ur,hcLight:ur},T("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),yCr=he("editorMarkerNavigationWarning.headerBackground",{dark:Mn(_V,.1),light:Mn(_V,.1),hcDark:"#0C141F",hcLight:Mn(_V,.2)},T("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),qde=he("editorMarkerNavigationInfo.background",{dark:Q4e,light:Q4e,hcDark:ur,hcLight:ur},T("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),CCr=he("editorMarkerNavigationInfo.headerBackground",{dark:Mn(qde,.1),light:Mn(qde,.1),hcDark:null,hcLight:null},T("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),wCr=he("editorMarkerNavigation.background",{dark:Pl,light:Pl,hcDark:Pl,hcLight:Pl},T("editorMarkerNavigationBackground","Editor marker navigation widget background."));var SCr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},S7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Oit=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},NP;let OS=NP=class{static get(e){return e.getContribution(NP.ID)}constructor(e,t,i,r,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new mt,this._editor=e,this._widgetVisible=Pit.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(JA,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!J.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:J.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new De(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,r;return Oit(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((i=NP.get(s))===null||i===void 0||i.close(),(r=NP.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};OS.ID="editor.contrib.markerController";OS=NP=SCr([S7(1,Rit),S7(2,vi),S7(3,eo),S7(4,di)],OS);class RY extends mn{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return Oit(this,void 0,void 0,function*(){t.hasModel()&&((i=OS.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Kw extends RY{constructor(){super(!0,!1,{id:Kw.ID,label:Kw.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:578,weight:100},menuOpts:{menuId:JA.TitleMenu,title:Kw.LABEL,icon:Da("marker-navigation-next",Ht.arrowDown,T("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Kw.ID="editor.action.marker.next";Kw.LABEL=T("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class ST extends RY{constructor(){super(!1,!1,{id:ST.ID,label:ST.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:1602,weight:100},menuOpts:{menuId:JA.TitleMenu,title:ST.LABEL,icon:Da("marker-navigation-previous",Ht.arrowUp,T("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}ST.ID="editor.action.marker.prev";ST.LABEL=T("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class ECr extends RY{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:T("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:66,weight:100},menuOpts:{menuId:ue.MenubarGoMenu,title:T({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class xCr extends RY{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:T("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:1090,weight:100},menuOpts:{menuId:ue.MenubarGoMenu,title:T({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Vr(OS.ID,OS,4);Dt(Kw);Dt(ST);Dt(ECr);Dt(xCr);const Pit=new sn("markersNavigationVisible",!1),TCr=ac.bindToContribution(OS.get);zt(new TCr({id:"closeMarkersNavigation",precondition:Pit,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:de.focus,primary:9,secondary:[1033]}}));var kCr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},une=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const im=kt;class ICr{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const X4e={type:1,filter:{include:si.QuickFix},triggerAction:Zh.QuickFixHover};let Kde=class{constructor(e,t,i,r){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:o,u=this._markerDecorationsService.getMarker(i.uri,a);if(!u)continue;const d=new J(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new ICr(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return Ue.None;const i=new mt;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const r=t.length===1?t[0]:t.sort((o,s)=>Qs.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),i}renderMarkerHover(e,t){const i=im("div.hover-row"),r=lt(i,im("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=lt(r,im("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=im("span");if(o){const g=lt(u,im("span"));g.innerText=o}const d=lt(u,im("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(tt(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=lt(d,im("span"));h.innerText=a.value;const f=lt(r,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=lt(r,im("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Cu(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=lt(r,im("div"));g.style.marginTop="8px";const m=lt(g,im("a"));m.innerText=`${Cg(d)}(${h}, ${f}): `,m.style.cursor="pointer",t.add(tt(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(Oi)}));const v=lt(g,im("span"));v.innerText=u,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Qs.Error||t.marker.severity===Qs.Warning||t.marker.severity===Qs.Info)&&e.statusBar.addAction({label:T("view problem","View Problem"),commandId:Kw.ID,run:()=>{var r;e.hide(),(r=OS.get(this._editor))===null||r===void 0||r.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const r=e.statusBar.append(im("div"));this.recentMarkerCodeActionsInfo&&(jz.makeKey(this.recentMarkerCodeActionsInfo.marker)===jz.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=T("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Ue.None:i.add(bS(()=>r.textContent=T("checkingForQuickFixes","Checking for quick fixes..."),200));r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(mi(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=T("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;i.add(mi(()=>{l||a.dispose()})),e.statusBar.addAction({label:T("quick fixes","Quick Fix..."),commandId:_1e,run:c=>{l=!0;const u=LS.get(this._editor),d=pl(c);e.hide(),u==null||u.showCodeActions(X4e,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},Oi)}}getCodeActions(e){return Sl(t=>QM(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new J(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),X4e,e1.None,t))}};Kde=kCr([une(1,R0e),une(2,rf),une(3,bn)],Kde);const Mit="editor.action.inlineSuggest.commit",Fit="editor.action.inlineSuggest.showPrevious",Bit="editor.action.inlineSuggest.showNext";var LCr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class DCr extends Ue{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new NJi),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new mt),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new x5(()=>{var r;return(r=this.toggleMenuActionViewItem)===null||r===void 0?void 0:r.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new wg(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(r,o)=>{var s;if(r.id===x5.ID)return this.toggleMenuActionViewItem=new Bz(r,r.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Qn.asClassNameArray((s=i.moreIcon)!==null&&s!==void 0?s:Ht.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(r,o);if(a)return a}if(r instanceof TA){const a=new Bz(r,r.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:r.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,i,r;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(r=o==null?void 0:o.getLabel())!==null&&r!==void 0?r:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class x5 extends Pd{constructor(e,t){t=t||T("moreActions","More Actions..."),super(x5.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return LCr(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}x5.ID="toolbar.toggle.more";var ACr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},UO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Gde=class extends DCr{constructor(e,t,i,r,o,s,a){super(e,o,Object.assign(Object.assign({getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=i,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new mt);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],i){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let f=0;f<a.length;f++){const g=a[f];!(g instanceof zm)&&!(g instanceof T3)||g.hideActions&&(c.push(g.hideActions.toggle),g.hideActions.toggle.checked&&u++,g.hideActions.isHidden&&(h=!0,a[f]=void 0,((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==0&&(d[f]=g)))}if(((s=this._options)===null||s===void 0?void 0:s.overflowBehavior)!==void 0){const f=rgr(new Set(this._options.overflowBehavior.exempted),tr.map(a,v=>v==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let m=0;for(let v=0;v<a.length;v++){const _=a[v];_&&(m++,!f.has(_.id)&&m>=g&&(a[v]=void 0,d[v]=_))}}nRe(a),nRe(d),super.setActions(a,oc.join(d,l)),c.length>0&&this._sessionDisposables.add(tt(this.getElement(),"contextmenu",f=>{var g,m,v,_,b;const y=new Zp(f),C=this.getItemAction(y.target);if(!C)return;y.preventDefault(),y.stopPropagation();let x=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){x=!0;for(let L=0;L<c.length;L++)if(c[L].checked){c[L]=ZL({id:C.id,label:C.label,checked:!0,enabled:!1,run(){}});break}}let E;if(!x&&(C instanceof zm||C instanceof T3)){if(!C.hideActions)return;E=C.hideActions.hide}else E=ZL({id:"label",label:T("hide","Hide"),enabled:!1,run(){}});const k=oc.join([E],c);!((m=this._options)===null||m===void 0)&&m.resetMenu&&!i&&(i=[this._options.resetMenu]),h&&i&&(k.push(new oc),k.push(ZL({id:"resetThisMenu",label:T("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>k,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(_=this._options)===null||_===void 0?void 0:_.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Gde=ACr([UO(2,L0),UO(3,vi),UO(4,t_),UO(5,Qo),UO(6,dp)],Gde);var L1e=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},G_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},vV;let Yde=class extends Ue{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Tc(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=fr(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new De(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Oh((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(PS,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(mi(()=>e.removeContentWidget(a))),o.add(ts(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==Xy.Explicit&&s.triggerExplicitly()}))}))}};Yde=L1e([G_(2,di)],Yde);const NCr=Da("inline-suggestion-hints-next",Ht.chevronRight,T("parameterHintsNextIcon","Icon for show next parameter hint.")),RCr=Da("inline-suggestion-hints-previous",Ht.chevronLeft,T("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let PS=vV=class extends Ue{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const r=new Pd(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=T({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,i,r,o,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${vV.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=_c("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[_c("div@toolBar")]),this.previousAction=this.createCommandAction(Fit,T("previous","Previous"),Qn.asClassName(RCr)),this.availableSuggestionCountAction=new Pd("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Bit,T("next","Next"),Qn.asClassName(NCr)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(ue.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new $o(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new $o(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(Qde,this.nodes.toolBar,ue.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof zm)return l.createInstance(PCr,h,void 0);if(h===this.availableSuggestionCountAction){const g=new OCr(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{vV._dropDownVisible=h})),this._register(ts(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(ts(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(ts(h=>{const f=this._extraCommands.read(h);if(Ia(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof zm&&g.push(_);g.length>0&&g.unshift(new oc),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};PS._dropDownVisible=!1;PS.id=0;PS=vV=L1e([G_(6,_a),G_(7,di),G_(8,Qo),G_(9,vi),G_(10,L0)],PS);class OCr extends UA{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let PCr=class extends rk{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=_c("div.keybinding").root;new W6(t,Pf,Object.assign({disableTitle:!0},wmr)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},Qde=class extends Gde{constructor(e,t,i,r,o,s,a,l){super(e,Object.assign({resetMenu:t},i),r,o,s,a,l),this.menuId=t,this.options2=i,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,r,o,s,a;const l=[],c=[];Get(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Ia(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ia(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};Qde=L1e([G_(3,L0),G_(4,vi),G_(5,t_),G_(6,Qo),G_(7,dp)],Qde);var MCr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},E7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Xde;const FCr=!1;let ph=Xde=class extends Ue{static get(e){return e.getContribution(Xde.ID)}constructor(e,t,i,r,o){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=r,this._keybindingService=o,this._toUnhook=new mt,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new $o(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===qw.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===yD.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const r=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(r)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,r,o,s;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===qw.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===qw.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===yD.ID)}_onEditorMouseMove(e){var t,i,r,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((r=this._contentWidget)===null||r===void 0)&&r.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,r;if(!e)return;const o=e.target,s=(t=o.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(s&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!FCr||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(o.type===2&&o.position){(r=this._contentWidget)===null||r===void 0||r.hide(),this._glyphWidget||(this._glyphWidget=new yD(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!r&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||PS.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(mU,this._editor)),this._contentWidget}showContentHover(e,t,i,r,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,r)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};ph.ID="editor.contrib.hover";ph=Xde=MCr([E7(1,di),E7(2,rf),E7(3,xs),E7(4,Qo)],ph);class BCr extends mn{constructor(){super({id:"editor.action.showHover",label:T({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const r=ph.get(t);if(!r)return;const o=t.getPosition(),s=new J(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);r.isHoverVisible?r.focus():r.showContentHover(s,1,1,a)}}class $Cr extends mn{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:T({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=ph.get(t);if(!i)return;const r=t.getPosition();if(!r)return;const o=new J(r.lineNumber,r.column,r.lineNumber,r.column),s=pk.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{i.showContentHover(o,1,1,!0)})}}class VCr extends mn{constructor(){super({id:"editor.action.scrollUpHover",label:T({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:16,weight:100}})}run(e,t){const i=ph.get(t);i&&i.scrollUp()}}class HCr extends mn{constructor(){super({id:"editor.action.scrollDownHover",label:T({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:18,weight:100}})}run(e,t){const i=ph.get(t);i&&i.scrollDown()}}class WCr extends mn{constructor(){super({id:"editor.action.scrollLeftHover",label:T({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:15,weight:100}})}run(e,t){const i=ph.get(t);i&&i.scrollLeft()}}class zCr extends mn{constructor(){super({id:"editor.action.scrollRightHover",label:T({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:17,weight:100}})}run(e,t){const i=ph.get(t);i&&i.scrollRight()}}class UCr extends mn{constructor(){super({id:"editor.action.pageUpHover",label:T({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=ph.get(t);i&&i.pageUp()}}class jCr extends mn{constructor(){super({id:"editor.action.pageDownHover",label:T({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=ph.get(t);i&&i.pageDown()}}class qCr extends mn{constructor(){super({id:"editor.action.goToTopHover",label:T({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=ph.get(t);i&&i.goToTop()}}class KCr extends mn{constructor(){super({id:"editor.action.goToBottomHover",label:T({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=ph.get(t);i&&i.goToBottom()}}Vr(ph.ID,ph,2);Dt(BCr);Dt($Cr);Dt(VCr);Dt(HCr);Dt(WCr);Dt(zCr);Dt(UCr);Dt(jCr);Dt(qCr);Dt(KCr);mI.register(bU);mI.register(Kde);e_((n,e)=>{const t=n.getColor(Ror);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class Zde extends Ue{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==lit||!i.range)return;const r=this._editor.getContribution(ph.ID);if(r&&!r.isColorPickerVisible){const o=new J(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}Zde.ID="editor.contrib.colorContribution";Vr(Zde.ID,Zde,2);mI.register(pU);var $it=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Z4e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Jde,ehe;let MS=Jde=class extends Ue{constructor(e,t,i,r,o,s,a){super(),this._editor=e,this._modelService=i,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=de.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=de.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new CU(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(Jde.ID)}};MS.ID="editor.contrib.standaloneColorPickerController";MS=Jde=$it([W_(1,vi),W_(2,Ds),W_(3,Qo),W_(4,di),W_(5,bn),W_(6,rs)],MS);Vr(MS.ID,MS,1);const J4e=8,GCr=22;let CU=ehe=class extends Ue{constructor(e,t,i,r,o,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new Le),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(C5,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(c0(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const m=(g=f.target.element)===null||g===void 0?void 0:g.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return ehe.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}_start(e){return Z4e(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new YCr(t.result,t.foundInEditor))})}_computeAsync(e){return Z4e(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new C1e(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),r=this._register(new _U(this._keybindingService));let o;const s={fragment:i,statusBar:r,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-GCr-J4e,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+J4e+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};CU.ID="editor.contrib.standaloneColorPickerWidget";CU=ehe=$it([W_(3,di),W_(4,Ds),W_(5,Qo),W_(6,bn),W_(7,rs)],CU);class YCr{constructor(e,t){this.value=e,this.foundInEditor=t}}class QCr extends Av{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:T("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:T({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:ue.CommandPalette}]})}runEditorCommand(e,t){var i;(i=MS.get(t))===null||i===void 0||i.showOrFocus()}}class XCr extends mn{constructor(){super({id:"editor.action.hideColorPicker",label:T({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:de.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=MS.get(t))===null||i===void 0||i.hide()}}class ZCr extends mn{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:T({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:de.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=MS.get(t))===null||i===void 0||i.insertColor()}}Dt(XCr);Dt(ZCr);ws(QCr);class uw{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const r=t.length,o=e.length;if(i+r>o)return!1;for(let s=0;s<r;s++){const a=e.charCodeAt(i+s),l=t.charCodeAt(s);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,r,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(i,u-1-i.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),_=h.substring(0,g);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(f=-1,g=-1)}let m;f!==-1&&g!==-1?(r&&f+t.length<d.length&&d.charCodeAt(f+t.length)===32&&(t=t+" "),r&&g>0&&h.charCodeAt(g-1)===32&&(i=" "+i,g-=1),m=uw._createRemoveBlockCommentOperations(new J(a,f+t.length+1,c,g+1),t,i)):(m=uw._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const r=[];return J.isEmpty(e)?r.push(Is.delete(new J(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(r.push(Is.delete(new J(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Is.delete(new J(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),r}static _createAddBlockCommentOperations(e,t,i,r){const o=[];return J.isEmpty(e)?o.push(Is.replace(new J(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Is.insert(new De(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Is.insert(new De(e.endLineNumber,e.endColumn),(r?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const r=i[0],o=i[1];return new kn(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new kn(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class gy{constructor(e,t,i,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=i-t+1;c<u;c++)l[c]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,r,o,s,a,l){let c=!0,u;e===0?u=!0:e===1?u=!1:u=!0;for(let d=0,h=r.length;d<h;d++){const f=r[d],g=o+d;if(g===o&&a){f.ignore=!0;continue}const m=i.getLineContent(g),v=Yu(m);if(v===-1){f.ignore=s,f.commentStrOffset=m.length;continue}if(c=!1,f.ignore=!1,f.commentStrOffset=v,u&&!uw._haystackHasNeedleAtOffset(m,f.commentStr,v)&&(e===0?u=!1:e===1||(f.ignore=!0)),u&&t){const _=v+f.commentStrLength;_<m.length&&m.charCodeAt(_)===32&&(f.commentStrLength+=1)}}if(e===0&&c){u=!1;for(let d=0,h=r.length;d<h;d++)r[d].ignore=!1}return{supported:!0,shouldRemoveComments:u,lines:r}}static _gatherPreflightData(e,t,i,r,o,s,a,l){const c=gy._gatherPreflightCommentStrings(i,r,o,l);return c===null?{supported:!1}:gy._analyzeLines(e,t,i,c,r,s,a,l)}_executeLineComments(e,t,i,r){let o;i.shouldRemoveComments?o=gy._createRemoveLineCommentsOperations(i.lines,r.startLineNumber):(gy._normalizeInsertionPoint(e,i.lines,r.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(i.lines,r.startLineNumber));const s=new De(r.positionLineNumber,r.positionColumn);for(let a=0,l=o.length;a<l;a++)t.addEditOperation(o[a].range,o[a].text),J.isEmpty(o[a].range)&&J.getStartPosition(o[a].range).equals(s)&&e.getLineContent(s.lineNumber).length+1===s.column&&(this._deltaColumn=(o[a].text||"").length);this._selectionId=t.trackSelection(r)}_attemptRemoveBlockComment(e,t,i,r){let o=t.startLineNumber,s=t.endLineNumber;const a=r.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(o).lastIndexOf(i,a-1),c=e.getLineContent(s).indexOf(r,t.endColumn-1-i.length);return l!==-1&&c===-1&&(c=e.getLineContent(o).indexOf(r,l+i.length),s=o),l===-1&&c!==-1&&(l=e.getLineContent(s).lastIndexOf(i,c),o=s),t.isEmpty()&&(l===-1||c===-1)&&(l=e.getLineContent(o).indexOf(i),l!==-1&&(c=e.getLineContent(o).indexOf(r,l+i.length))),l!==-1&&e.getLineContent(o).charCodeAt(l+i.length)===32&&(i+=" "),c!==-1&&e.getLineContent(s).charCodeAt(c-1)===32&&(r=" "+r,c-=1),l!==-1&&c!==-1?uw._createRemoveBlockCommentOperations(new J(o,l+i.length+1,s,c+1),i,r):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const r=e.getLanguageIdAtPosition(i.startLineNumber,1),o=this.languageConfigurationService.getLanguageConfiguration(r).comments;if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const s=o.blockCommentStartToken,a=o.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,s,a);if(!l){if(i.isEmpty()){const c=e.getLineContent(i.startLineNumber);let u=Yu(c);u===-1&&(u=c.length),l=uw._createAddBlockCommentOperations(new J(i.startLineNumber,u+1,i.startLineNumber,c.length+1),s,a,this._insertSpace)}else l=uw._createAddBlockCommentOperations(new J(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),s,a,this._insertSpace);l.length===1&&(this._deltaColumn=s.length+1)}this._selectionId=t.trackSelection(i);for(const c of l)t.addEditOperation(c.range,c.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new J(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":` `),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const r=gy._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return r.supported?this._executeLineComments(e,t,r,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new kn(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let r=0,o=e.length;r<o;r++){const s=e[r];s.ignore||i.push(Is.delete(new J(t+r,s.commentStrOffset+1,t+r,s.commentStrOffset+s.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],r=this._insertSpace?" ":"";for(let o=0,s=e.length;o<s;o++){const a=e[o];a.ignore||i.push(Is.insert(new De(t+o,a.commentStrOffset+1),a.commentStr+r))}return i}static nextVisibleColumn(e,t,i,r){return i?e+(t-e%t):e+r}static _normalizeInsertionPoint(e,t,i,r){let o=1073741824,s,a;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const u=e.getLineContent(i+l);let d=0;for(let h=0,f=t[l].commentStrOffset;d<o&&h<f;h++)d=gy.nextVisibleColumn(d,r,u.charCodeAt(h)===9,1);d<o&&(o=d)}o=Math.floor(o/r)*r;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const u=e.getLineContent(i+l);let d=0;for(s=0,a=t[l].commentStrOffset;d<o&&s<a;s++)d=gy.nextVisibleColumn(d,r,u.charCodeAt(s)===9,1);d>o?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class D1e extends mn{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(rs);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>J.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u<l.length;u++){const d=l[u];c.selection.endLineNumber===d.selection.startLineNumber&&(c.index<d.index?d.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=d))}for(const u of l)o.push(new gy(i,u.selection,s.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,u.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class JCr extends D1e{constructor(){super(0,{id:"editor.action.commentLine",label:T("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"5_insert",title:T({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class ewr extends D1e{constructor(){super(1,{id:"editor.action.addCommentLine",label:T("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2081),weight:100}})}}class twr extends D1e{constructor(){super(2,{id:"editor.action.removeCommentLine",label:T("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2099),weight:100}})}}class nwr extends mn{constructor(){super({id:"editor.action.blockComment",label:T("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"5_insert",title:T({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(rs);if(!t.hasModel())return;const r=t.getOption(23),o=[],s=t.getSelections();for(const a of s)o.push(new uw(a,r.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}Dt(JCr);Dt(ewr);Dt(twr);Dt(nwr);var iwr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zE=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},the;let eN=the=class{static get(e){return e.getContribution(the.ID)}constructor(e,t,i,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new mt,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const u=this._contextViewService.getContextViewElement(),d=c.srcElement;d.shadowRoot&&JT(u)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?ue.SimpleEditorContext:ue.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof T3){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(i.push(new TA(c.id,c.label,u)),l++)}else i.push(c),l++;l&&i.push(new oc)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let r=t;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=pl(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;r={x:l,y:c}}const o=this._editor.getOption(126)&&!vv;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new UA(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new UA(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||tfr(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let i=0;const r=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,u)=>new TA(`menu-action-${++i}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},m=[];for(const v of f)m.push(r({label:v.label,checked:h===v.value,run:g(v.value)}));return o(c,m)},a=[];a.push(r({label:T("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new oc),a.push(r({label:T("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(T("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:T("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:T("context.minimap.size.fill","Fill"),value:"fill"},{label:T("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(T("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:T("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:T("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!vv;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};eN.ID="editor.contrib.contextmenu";eN=the=iwr([zE(1,t_),zE(2,P1),zE(3,vi),zE(4,Qo),zE(5,L0),zE(6,dr),zE(7,nk)],eN);class rwr extends mn{constructor(){super({id:"editor.action.showContextMenu",label:T("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=eN.get(t))===null||i===void 0||i.showContextMenu()}}Vr(eN.ID,eN,2);Dt(rwr);class dne{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let r=0;r<t;r++)if(!this.selections[r].equalsSelection(e.selections[r]))return!1;return!0}}class hne{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class gk extends Ue{static get(e){return e.getContribution(gk.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new dne(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new hne(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new hne(new dne(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new hne(new dne(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}gk.ID="editor.contrib.cursorUndoRedoController";class owr extends mn{constructor(){super({id:"cursorUndo",label:T("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var r;(r=gk.get(t))===null||r===void 0||r.cursorUndo()}}class swr extends mn{constructor(){super({id:"cursorRedo",label:T("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var r;(r=gk.get(t))===null||r===void 0||r.cursorRedo()}}Vr(gk.ID,gk,0);Dt(owr);Dt(swr);class awr{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new J(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new kn(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new kn(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber<this.selection.endLineNumber){this.targetSelection=new kn(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new kn(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new kn(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function u2(n){return mr?n.altKey:n.ctrlKey}class i1 extends Ue{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(u2(e)&&(this._modifierPressed=!0),this._mouseDown&&u2(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(u2(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===i1.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}u2(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new De(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;i=[new kn(o,s,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new kn(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(u2(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(i1.ID,new awr(this._dragSelection,t,u2(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new J(e.lineNumber,e.column,e.lineNumber,e.column),options:i1._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}i1.ID="editor.contrib.dragAndDrop";i1.TRIGGER_KEY_VALUE=mr?6:5;i1._DECORATION_OPTIONS=Ri.register({description:"dnd-target",className:"dnd-target"});Vr(i1.ID,i1,2);const OY=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let r=0;r<i.length;r++)i[r]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){n(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=0,o="";return o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o}}();var Vit=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function A1e(n){return{asString:()=>Vit(this,void 0,void 0,function*(){return n}),asFile:()=>{},value:typeof n=="string"?n:void 0}}function lwr(n,e,t){const i={id:OY(),name:n,uri:e,data:t};return{asString:()=>Vit(this,void 0,void 0,function*(){return""}),asFile:()=>i,value:void 0}}class Hit{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return tr.some(this,([i,r])=>r.asFile())&&t.push("files"),zit(wU(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return wU(e)}}function wU(n){return n.toLowerCase()}function Wit(n,e){return zit(wU(n),e.map(wU))}function zit(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const PY=Object.freeze({create:n=>fS(n.map(e=>e.toString())).join(`\r `),split:n=>n.split(`\r `),parse:n=>PY.split(n).filter(e=>!e.startsWith("#"))}),e3e={EDITORS:"CodeEditors",FILES:"CodeFiles"};class cwr{}const uwr={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Hs.add(uwr.DragAndDropContribution,new cwr);class T5{constructor(){}static getInstance(){return T5.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}T5.INSTANCE=new T5;var dwr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Uit(n){const e=new Hit;for(const t of n.items){const i=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(i,A1e(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(i,hwr(r))}}return e}function hwr(n){const e=n.path?Yn.parse(n.path):void 0;return lwr(n.name,e,()=>dwr(this,void 0,void 0,function*(){return new Uint8Array(yield n.arrayBuffer())}))}const fwr=Object.freeze([e3e.EDITORS,e3e.FILES,r5.RESOURCES,r5.INTERNAL_URI_LIST]);function jit(n,e=!1){const t=Uit(n),i=t.get(r5.INTERNAL_URI_LIST);if(i)t.replace(Ta.uriList,i);else if(e||!t.has(Ta.uriList)){const r=[];for(const o of n.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(Yn.file(a).toString()):r.push(Yn.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(Ta.uriList,A1e(PY.create(r)))}for(const r of fwr)t.delete(r);return t}function pwr(n,e,t){var i,r;return{edits:[...e.map(o=>new Jy(n,typeof t.insertText=="string"?{range:o,text:t.insertText,insertAsSnippet:!1}:{range:o,text:t.insertText.snippet,insertAsSnippet:!0})),...(r=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&r!==void 0?r:[]]}}function qit(n){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of n)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of n)if(c!==a&&t(l,c)){let u=i.get(a);u||(u=[],i.set(a,u)),u.push(c)}if(!i.size)return Array.from(n);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(r.has(l))return s(a.slice(1));let c=[];const u=i.get(l);return u&&(o.push(l),c=s(u),o.pop()),r.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(n))}var gwr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mwr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},_wr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const vwr=Ri.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:HXe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class MY extends Ue{constructor(e,t,i,r,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=kt(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=kt("span.icon");this.domNode.append(t),t.classList.add(...Qn.asClassNameArray(Ht.loading),"codicon-modifier-spin");const i=()=>{const r=this.editor.getOption(66);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};i(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(52)||r.hasChanged(66))&&i()})),this._register(tt(this.domNode,Yt.CLICK,r=>{this.delegate.cancel()}))}getId(){return MY.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}MY.baseId="editor.widget.inlineProgressWidget";let SU=class extends Ue{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Nc),this._currentWidget=new Nc,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return _wr(this,void 0,void 0,function*(){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=bS(()=>{const o=J.fromPositions(e);this._currentDecorations.set([{range:o,options:vwr}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(MY,this.id,this._editor,o,t,i))},this._showDelay);try{return yield i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};SU=gwr([mwr(2,di)],SU);var Kit=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XM=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},t3e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},nhe;let EU=nhe=class extends Ue{constructor(e,t,i,r,o,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(mi(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(mi(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(nn.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=kt(".post-edit-widget"),this.button=this._register(new $ue(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(tt(this.domNode,Yt.CLICK,()=>this.showSelector()))}getId(){return nhe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=pl(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>ZL({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};EU.baseId="editor.widget.postEditWidget";EU=nhe=Kit([XM(7,t_),XM(8,vi),XM(9,Qo)],EU);let xU=class extends Ue{constructor(e,t,i,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Nc),this._register(nn.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,i,r){var o,s;return t3e(this,void 0,void 0,function*(){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let c=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?c=[]:c=e.map(v=>new Jy(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const d={edits:[...c,...(s=(o=l.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]},h=e[0],f=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let g,m;try{g=yield this._bulkEditService.apply(d,{editor:this._editor,token:r}),m=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}i&&g.isApplied&&t.allEdits.length>1&&this.show(m??h,t,v=>t3e(this,void 0,void 0,function*(){const _=this._editor.getModel();_&&(yield _.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,r))}))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(EU,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};xU=Kit([XM(4,di),XM(5,F6)],xU);var bwr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ry=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},ihe;const Git="editor.changePasteType",Yit=new sn("pasteWidgetVisible",!1,T("pasteWidgetVisible","Whether the paste widget is showing")),fne="application/vnd.code.copyMetadata";let mk=ihe=class extends Ue{static get(e){return e.getContribution(ihe.ID)}constructor(e,t,i,r,o,s,a){super(),this._bulkEditService=i,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(tt(l,"copy",c=>this.handleCopy(c))),this._register(tt(l,"cut",c=>this.handleCopy(c))),this._register(tt(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new SU("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(xU,"pasteIntoEditor",e,Yit,{id:Git,label:T("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},gG().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(lE&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new J(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,eu),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(_=>!!_.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=Uit(e.clipboardData),g=h.flatMap(_=>{var b;return(b=_.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=OY();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:g,defaultPastePayload:d});const v=Sl(_=>ry(this,void 0,void 0,function*(){const b=s0(yield Promise.all(h.map(y=>ry(this,void 0,void 0,function*(){try{return yield y.prepareDocumentPaste(r,a,f,_)}catch(C){console.error(C);return}}))));b.reverse();for(const y of b)for(const[C,x]of y)f.replace(C,x);return f}));(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:m,dataTransferPromise:v}}handlePaste(e){var t,i;return ry(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const r=this._editor.getModel(),o=this._editor.getSelections();if(!(o!=null&&o.length)||!r||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e),a=jit(e.clipboardData);a.delete(fne);const l=[...e.clipboardData.types,...(i=s==null?void 0:s.providerCopyMimeTypes)!==null&&i!==void 0?i:[],Ta.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(u=>{var d;return(d=u.pasteMimeTypes)===null||d===void 0?void 0:d.some(h=>Wit(h,l))});c.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,o,a,s):this.doPasteInline(c,o,a,s))})}doPasteInline(e,t,i,r){const o=Sl(s=>ry(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new IS(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(i,r,c.token),c.token.isCancellationRequested)return;const u=e.filter(h=>n3e(h,i));if(!u.length||u.length===1&&u[0].id==="text"){yield this.applyDefaultPasteHandler(i,r,c.token);return}const d=yield this.getPasteEdits(u,i,l,t,c.token);if(c.token.isCancellationRequested)return;if(d.length===1&&d[0].providerId==="text"){yield this.applyDefaultPasteHandler(i,r,c.token);return}if(d.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:d},h,c.token)}yield this.applyDefaultPasteHandler(i,r,c.token)}finally{c.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),T("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,t,i,r,o){const s=Sl(a=>ry(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new IS(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(r,o,u.token),u.token.isCancellationRequested)return;let d=t.filter(m=>n3e(m,r));e&&(d=d.filter(m=>m.id===e));const h=yield this.getPasteEdits(d,r,c,i,u.token);if(u.token.isCancellationRequested||!h.length)return;let f;if(e)f=h.at(0);else{const m=yield this._quickInputService.pick(h.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:T("pasteAsPickerPlaceholder","Select Paste Action")});f=m==null?void 0:m.edit}if(!f)return;const g=pwr(c.uri,i,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:T("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(fne,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(fne);if(i)try{return JSON.parse(i)}catch{return}const[r,o]=Ice.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}mergeInDataFromCopy(e,t,i){var r;return ry(this,void 0,void 0,function*(){if(t!=null&&t.id&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(Ta.uriList)){const o=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;o.length&&e.append(Ta.uriList,A1e(PY.create(o)))}})}getPasteEdits(e,t,i,r,o){return ry(this,void 0,void 0,function*(){const s=yield _G(Promise.all(e.map(l=>ry(this,void 0,void 0,function*(){var c;try{const u=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,i,r,t,o);if(u)return Object.assign(Object.assign({},u),{providerId:l.id})}catch(u){console.error(u)}}))),o),a=s0(s??[]);return qit(a)})}applyDefaultPasteHandler(e,t,i){var r,o,s;return ry(this,void 0,void 0,function*(){const a=(r=e.get(Ta.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=yield a.asString();if(i.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};mk.ID="editor.contrib.copyPasteActionController";mk=ihe=bwr([d2(1,di),d2(2,F6),d2(3,B1),d2(4,bn),d2(5,Rv),d2(6,Cet)],mk);function n3e(n,e){var t;return!!(!((t=n.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var N1e=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k5=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},tN=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const R1e=T("builtIn","Built-in");class O1e{provideDocumentPasteEdits(e,t,i,r){return tN(this,void 0,void 0,function*(){const o=yield this.getEdit(i,r);return o?{insertText:o.insertText,label:o.label,detail:o.detail,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,i,r){return tN(this,void 0,void 0,function*(){const o=yield this.getEdit(i,r);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}}class Qit extends O1e{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Ta.text],this.pasteMimeTypes=[Ta.text]}getEdit(e,t){return tN(this,void 0,void 0,function*(){const i=e.get(Ta.text);if(!i||e.has(Ta.uriList))return;const r=yield i.asString();return{handledMimeType:Ta.text,label:T("text.label","Insert Plain Text"),detail:R1e,insertText:r}})}}class Xit extends O1e{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Ta.uriList],this.pasteMimeTypes=[Ta.uriList]}getEdit(e,t){return tN(this,void 0,void 0,function*(){const i=yield Zit(e);if(!i.length||t.isCancellationRequested)return;let r=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Gi.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=i.length>1?T("defaultDropProvider.uriList.uris","Insert Uris"):T("defaultDropProvider.uriList.uri","Insert Uri"):s=i.length>1?T("defaultDropProvider.uriList.paths","Insert Paths"):T("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Ta.uriList,insertText:o,label:s,detail:R1e}})}}let TU=class extends O1e{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[Ta.uriList],this.pasteMimeTypes=[Ta.uriList]}getEdit(e,t){return tN(this,void 0,void 0,function*(){const i=yield Zit(e);if(!i.length||t.isCancellationRequested)return;const r=s0(i.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?zcr(s.uri,o):void 0}));if(r.length)return{handledMimeType:Ta.uriList,insertText:r.join(" "),label:i.length>1?T("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):T("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:R1e}})}};TU=N1e([k5(0,nk)],TU);function Zit(n){return tN(this,void 0,void 0,function*(){const e=n.get(Ta.uriList);if(!e)return[];const t=yield e.asString(),i=[];for(const r of PY.parse(t))try{i.push({uri:Yn.parse(r),originalText:r})}catch{}return i})}let rhe=class extends Ue{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new Qit)),this._register(e.documentOnDropEditProvider.register("*",new Xit)),this._register(e.documentOnDropEditProvider.register("*",new TU(t)))}};rhe=N1e([k5(0,bn),k5(1,nk)],rhe);let ohe=class extends Ue{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Qit)),this._register(e.documentPasteEditProvider.register("*",new Xit)),this._register(e.documentPasteEditProvider.register("*",new TU(t)))}};ohe=N1e([k5(0,bn),k5(1,nk)],ohe);Vr(mk.ID,mk,0);uY(ohe);zt(new class extends ac{constructor(){super({id:Git,precondition:Yit,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;return(i=mk.get(e))===null||i===void 0?void 0:i.changePasteType()}});Dt(class extends mn{constructor(){super({id:"editor.action.pasteAs",label:T("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:T("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(n,e,t){var i;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(i=mk.get(e))===null||i===void 0?void 0:i.pasteAs(r)}});class ywr{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class i3e{constructor(e){this.identifier=e}}const Jit=or("treeViewsDndService");vr(Jit,ywr,1);var Cwr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},x7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},jO=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},she;const ert="editor.experimental.dropIntoEditor.defaultProvider",trt="editor.changeDropType",nrt=new sn("dropWidgetVisible",!1,T("dropWidgetVisible","Whether the drop widget is showing"));let nN=she=class extends Ue{static get(e){return e.getContribution(she.ID)}constructor(e,t,i,r,o){super(),this._configService=i,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=T5.getInstance(),this._dropProgressManager=this._register(t.createInstance(SU,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(xU,"dropIntoEditor",e,nrt,{id:trt,label:T("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var r;return jO(this,void 0,void 0,function*(){if(!i.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=Sl(s=>jO(this,void 0,void 0,function*(){const a=new IS(e,1,void 0,s);try{const l=yield this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=yield this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([J.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,T("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o})}getDropEdits(e,t,i,r,o){return jO(this,void 0,void 0,function*(){const s=yield _G(Promise.all(e.map(l=>jO(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,i,r,o.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),o.token),a=s0(s??[]);return qit(a)})}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(ert,{resource:e.uri});for(const[r,o]of Object.entries(i)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&Wit(r,[a.handledMimeType]));if(s>=0)return s}return 0}extractDataTransferData(e){return jO(this,void 0,void 0,function*(){if(!e.dataTransfer)return new Hit;const t=jit(e.dataTransfer);if(this.treeItemsTransfer.hasData(i3e.prototype)){const i=this.treeItemsTransfer.getData(i3e.prototype);if(Array.isArray(i))for(const r of i){const o=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t})}};nN.ID="editor.contrib.dropIntoEditorController";nN=she=Cwr([x7(1,di),x7(2,dr),x7(3,bn),x7(4,Jit)],nN);Vr(nN.ID,nN,2);zt(new class extends ac{constructor(){super({id:trt,precondition:nrt,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=nN.get(e))===null||i===void 0||i.changeDropType()}});uY(rhe);Hs.as(Nv.Configuration).registerConfiguration(Object.assign(Object.assign({},UG),{properties:{[ert]:{type:"object",scope:5,description:T("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class Bu{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const r=i.options;if(r===Bu._FIND_MATCH_DECORATION||r===Bu._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let r=0,o=this._decorations.length;r<o;r++){const s=this._editor.getModel().getDecorationRange(this._decorations[r]);if(e.equalsRange(s)){t=this._decorations[r],i=r+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(r=>{if(this._highlightedDecorationId!==null&&(r.changeDecorationOptions(this._highlightedDecorationId,Bu._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Bu._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new J(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,Bu._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let r=Bu._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=Bu._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f<g;f++){const m=e[f].range;h+u>=m.startLineNumber?m.endLineNumber>h&&(h=m.endLineNumber):(o.push({range:new J(d,1,h,1),options:Bu._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=m.startLineNumber,h=m.endLineNumber)}o.push({range:new J(d,1,h,1),options:Bu._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;a<l;a++)s[a]={range:e[a].range,options:r};this._decorations=i.deltaDecorations(this._decorations,s),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Bu._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],r=this._editor.getModel().getDecorationRange(i);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumber<e.lineNumber)return r;if(!(r.endColumn>e.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){const r=this._decorations[t],o=this._editor.getModel().getDecorationRange(r);if(!(!o||o.startLineNumber<e.lineNumber)){if(o.startLineNumber>e.lineNumber)return o;if(!(o.startColumn<e.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}Bu._CURRENT_FIND_MATCH_DECORATION=Ri.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:Gs($0e),position:np.Center},minimap:{color:Gs(pL),position:jh.Inline}});Bu._FIND_MATCH_DECORATION=Ri.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:Gs($0e),position:np.Center},minimap:{color:Gs(pL),position:jh.Inline}});Bu._FIND_MATCH_NO_OVERVIEW_DECORATION=Ri.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});Bu._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Ri.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Gs($0e),position:np.Center}});Bu._RANGE_HIGHLIGHT_DECORATION=Ri.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});Bu._FIND_SCOPE_DECORATION=Ri.register({description:"find-scope",className:"findScope",isWholeLine:!0});class wwr{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const i=[];for(let s=0;s<this._ranges.length;s++)i.push({range:this._ranges[s],text:this._replaceStrings[s]});i.sort((s,a)=>J.compareRangesUsingStarts(s.range,a.range));const r=[];let o=i[0];for(let s=1;s<i.length;s++)o.range.endLineNumber===i[s].range.startLineNumber&&o.range.endColumn===i[s].range.startColumn?(o.range=o.range.plusRange(i[s].range),o.text=o.text+i[s].text):(r.push(o),o=i[s]);r.push(o);for(const s of r)t.addEditOperation(s.range,s.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function irt(n,e){if(n&&n[0]!==""){const t=r3e(n,e,"-"),i=r3e(n,e,"_");return t&&!i?o3e(n,e,"-"):!t&&i?o3e(n,e,"_"):n[0].toUpperCase()===n[0]?e.toUpperCase():n[0].toLowerCase()===n[0]?e.toLowerCase():_er(n[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function r3e(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function o3e(n,e,t){const i=e.split(t),r=n[0].split(t);let o="";return i.forEach((s,a)=>{o+=irt([r[a]],s)+t}),o.slice(0,-1)}class s3e{constructor(e){this.staticValue=e,this.kind=0}}class Swr{constructor(e){this.pieces=e,this.kind=1}}class iN{static fromStaticValue(e){return new iN([ET.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new s3e(""):e.length===1&&e[0].staticValue!==null?this._state=new s3e(e[0].staticValue):this._state=new Swr(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?irt(e,this._state.staticValue):this._state.staticValue;let i="";for(let r=0,o=this._state.pieces.length;r<o;r++){const s=this._state.pieces[r];if(s.staticValue!==null){i+=s.staticValue;continue}let a=iN._substitute(s.matchIndex,e);if(s.caseOps!==null&&s.caseOps.length>0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d<h;d++){if(u>=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class ET{static staticValue(e){return new ET(e,-1,null)}static caseOps(e,t){return new ET(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}}class Ewr{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=ET.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=ET.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=ET.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new iN(this._result)}}function xwr(n){if(!n||n.length===0)return new iN(null);const e=[],t=new Ewr(n);for(let i=0,r=n.length;i<r;i++){const o=n.charCodeAt(i);if(o===92){if(i++,i>=r)break;const s=n.charCodeAt(i);switch(s){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` `,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(s));break}continue}if(o===36){if(i++,i>=r)break;const s=n.charCodeAt(i);if(s===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(s===48||s===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(i+1<r){const l=n.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const $1=new sn("findWidgetVisible",!1);$1.toNegated();const FY=new sn("findInputFocussed",!1),P1e=new sn("replaceInputFocussed",!1),T7={primary:545,mac:{primary:2593}},k7={primary:565,mac:{primary:2613}},I7={primary:560,mac:{primary:2608}},L7={primary:554,mac:{primary:2602}},D7={primary:558,mac:{primary:2606}},as={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},dw=19999,Twr=240;class ZM{constructor(e,t){this._toDispose=new mt,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new Zm,this._decorations=new Bu(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new $o(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,mo(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},Twr)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new J(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(i,!1,dw);this._decorations.set(r,i);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&r.length>0){const a=N3(r.map(l=>l.range),l=>J.compareRangesUsingStarts(l,o)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:r}=e;const o=this._editor.getModel();return t||r===1?(i===1?i=o.getLineCount():i--,r=o.getLineMaxColumn(i)):r--,new De(i,r)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()<dw){let u=this._decorations.matchBeforePosition(e);u&&u.isEmpty()&&u.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),u=this._decorations.matchBeforePosition(e)),u&&this._setCurrentFindMatch(u);return}if(this._cannotFind())return;const i=this._decorations.getFindScope(),r=ZM._getSearchRange(this._editor.getModel(),i);r.getEndPosition().isBefore(e)&&(e=r.getEndPosition()),e.isBefore(r.getStartPosition())&&(e=r.getEndPosition());const{lineNumber:o,column:s}=e,a=this._editor.getModel();let l=new De(o,s),c=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1);if(c&&c.range.isEmpty()&&c.range.getStartPosition().equals(l)&&(l=this._prevSearchPosition(l),c=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1)),!!c){if(!t&&!r.containsRange(c.range))return this._moveToPrevMatch(c.range.getStartPosition(),!0);this._setCurrentFindMatch(c.range)}}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:r}=e;const o=this._editor.getModel();return t||r===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,r=1):r++,new De(i,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<dw){let i=this._decorations.matchAfterPosition(e);i&&i.isEmpty()&&i.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),i=this._decorations.matchAfterPosition(e)),i&&this._setCurrentFindMatch(i);return}const t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,r=!1){if(this._cannotFind())return null;const o=this._decorations.getFindScope(),s=ZM._getSearchRange(this._editor.getModel(),o);s.getEndPosition().isBefore(e)&&(e=s.getStartPosition()),e.isBefore(s.getStartPosition())&&(e=s.getStartPosition());const{lineNumber:a,column:l}=e,c=this._editor.getModel();let u=new De(a,l),d=c.findNextMatch(this._state.searchString,u,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t);return i&&d&&d.range.isEmpty()&&d.range.getStartPosition().equals(u)&&(u=this._nextSearchPosition(u),d=c.findNextMatch(this._state.searchString,u,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t)),d?!r&&!s.containsRange(d.range)?this._getNextMatch(d.range.getEndPosition(),t,i,!0):d:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_moveToMatch(e){const t=this._decorations.getDecorationRangeAt(e);t&&this._setCurrentFindMatch(t)}moveToMatch(e){this._moveToMatch(e)}_getReplacePattern(){return this._state.isRegex?xwr(this._state.replaceString):iN.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const r=e.buildReplaceString(i.matches,this._state.preserveCase),o=new Hc(t,r);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new De(t.startLineNumber,t.startColumn+r.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const r=(e||[null]).map(o=>ZM._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,r,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=dw?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new ax(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let d="mu";i.ignoreCase&&(d+="i"),i.global&&(d+="g"),i=new RegExp(i.source,d)}const r=this._editor.getModel(),o=r.getValue(1),s=r.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(i,a.buildReplaceString(null,c));const u=new K0e(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[];for(let s=0,a=i.length;s<a;s++)r[s]=t.buildReplaceString(i[s].matches,this._state.preserveCase);const o=new wwr(this._editor.getSelection(),i.map(s=>s.range),r);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new kn(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const r=this._editor.getSelection();for(let o=0,s=i.length;o<s;o++)if(i[o].equalsRange(r)){i=[r].concat(i.slice(0,o)).concat(i.slice(o+1));break}this._editor.setSelections(i)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}class BY extends Jm{constructor(e,t,i){super(),this._hideSoon=this._register(new $o(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const r={inputActiveOptionBorder:an(M0e),inputActiveOptionForeground:an(F0e),inputActiveOptionBackground:an(qx)};this.caseSensitive=this._register(new Jet(Object.assign({appendTitle:this._keybindingLabelFor(as.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},r))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new ett(Object.assign({appendTitle:this._keybindingLabelFor(as.ToggleWholeWordCommand),isChecked:this._state.wholeWord},r))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new ttt(Object.assign({appendTitle:this._keybindingLabelFor(as.ToggleRegexCommand),isChecked:this._state.isRegex},r))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let s=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(tt(this._domNode,Yt.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(tt(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return BY.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}BY.ID="editor.contrib.findOptionsWidget";function A7(n,e){return n===1?!0:n===2?!1:e}class kwr extends Ue{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return A7(this._isRegexOverride,this._isRegex)}get wholeWord(){return A7(this._wholeWordOverride,this._wholeWord)}get matchCase(){return A7(this._matchCaseOverride,this._matchCase)}get preserveCase(){return A7(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new Le),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const r={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,o=!0),typeof i<"u"&&(J.equalsRange(this._currentMatch,i)||(this._currentMatch=i,r.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(r)}change(e,t,i=!0){var r;const o={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((r=e.searchScope)===null||r===void 0)&&r.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!J.equalsRange(f,d))})||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),c!==this.matchCase&&(s=!0,o.matchCase=!0),u!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=dw}}const Iwr=T("defaultLabel","input"),Lwr=T("label.preserveCaseToggle","Preserve Case");class Dwr extends dR{constructor(e){super({icon:Ht.preserveCase,title:Lwr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Awr extends Jm{constructor(e,t,i,r){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new Le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Le),this._onInput=this._register(new Le),this._onKeyUp=this._register(new Le),this._onPreserveCaseKeyDown=this._register(new Le),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||Iwr;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,c=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new ntt(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new Dwr(Object.assign({appendTitle:o,isChecked:!1},r.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),zi.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var rrt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ort=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const M1e=new sn("suggestWidgetVisible",!1,T("suggestWidgetVisible","Whether suggestion are visible")),F1e="historyNavigationWidgetFocus",srt="historyNavigationForwardsEnabled",art="historyNavigationBackwardsEnabled";let r1;const N7=[];function lrt(n,e){if(N7.includes(e))throw new Error("Cannot register the same widget multiple times");N7.push(e);const t=new mt,i=new sn(F1e,!1).bindTo(n),r=new sn(srt,!0).bindTo(n),o=new sn(art,!0).bindTo(n),s=()=>{i.set(!0),r1=e},a=()=>{i.set(!1),r1===e&&(r1=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(mi(()=>{N7.splice(N7.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let ahe=class extends itt{constructor(e,t,i,r){super(e,t,i);const o=this._register(r.createScoped(this.inputBox.element));this._register(lrt(o,this.inputBox))}};ahe=rrt([ort(3,vi)],ahe);let lhe=class extends Awr{constructor(e,t,i,r,o=!1){super(e,t,o,i);const s=this._register(r.createScoped(this.inputBox.element));this._register(lrt(s,this.inputBox))}};lhe=rrt([ort(3,vi)],lhe);hh.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:at.and(at.has(F1e),at.equals(art,!0),at.not("isComposing"),M1e.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{r1==null||r1.showPreviousValue()}});hh.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:at.and(at.has(F1e),at.equals(srt,!0),at.not("isComposing"),M1e.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{r1==null||r1.showNextValue()}});function a3e(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var Nwr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Rwr=Da("find-selection",Ht.selection,T("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),l3e=Da("find-collapsed",Ht.chevronRight,T("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),c3e=Da("find-expanded",Ht.chevronDown,T("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Owr=Da("find-replace",Ht.replace,T("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Pwr=Da("find-replace-all",Ht.replaceAll,T("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Mwr=Da("find-previous-match",Ht.arrowUp,T("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Fwr=Da("find-next-match",Ht.arrowDown,T("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),Bwr=T("label.findDialog","Find / Replace"),$wr=T("label.find","Find"),Vwr=T("placeholder.find","Find"),Hwr=T("label.previousMatchButton","Previous Match"),Wwr=T("label.nextMatchButton","Next Match"),zwr=T("label.toggleSelectionFind","Find in Selection"),Uwr=T("label.closeButton","Close"),jwr=T("label.replace","Replace"),qwr=T("placeholder.replace","Replace"),Kwr=T("label.replaceButton","Replace"),Gwr=T("label.replaceAllButton","Replace All"),Ywr=T("label.toggleReplaceButton","Toggle Replace"),Qwr=T("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",dw),Xwr=T("label.matchesLocation","{0} of {1}"),u3e=T("label.noResults","No results"),zv=419,Zwr=275,Jwr=Zwr-54;let qO=69;const eSr=33,d3e="ctrlEnterReplaceAll.windows.donotask",h3e=mr?256:2048;class pne{constructor(e){this.afterLineNumber=e,this.heightInPx=eSr,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function f3e(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function p3e(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){n.stopPropagation();return}}class $Y extends Jm{constructor(e,t,i,r,o,s,a,l,c){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=r,this._keybindingService=o,this._contextKeyService=s,this._storageService=l,this._notificationService=c,this._ctrlEnterReplaceAllWarningPrompted=!!l.getBoolean(d3e,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new jm(500),this._register(mi(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(143)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new pne(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>Nwr(this,void 0,void 0,function*(){if(this._isVisible){const u=yield this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}}))),this._findInputFocused=FY.bindTo(s),this._findFocusTracker=this._register(c0(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=P1e.bindTo(s),this._replaceFocusTracker=this._register(c0(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new pne(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return $Y.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=th(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Oi)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=qO+"px",this._state.matchesCount>=dw?this._matchesCount.title=Qwr:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=dw&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=GT(Xwr,i,t)}else e=u3e;this._matchesCount.appendChild(document.createTextNode(e)),bu(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),qO=Math.max(qO,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===u3e)return i===""?T("ariaSearchNoResultEmpty","{0} found",e):T("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const r=T("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${r}`:r}return T("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const r=pl(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=r.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&a<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const l=aZe(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());r.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(r=>{i.heightInPx=this._getHeight(),this._viewZoneId=r.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new pne(0));const i=this._viewZone;this._codeEditor.changeViewZones(r=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const s=o-i.heightInPx;i.heightInPx=o,r.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(83).top,o<=0)return;i.heightInPx=o,this._viewZoneId=r.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!v0e(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,r=e.minimap.minimapWidth;let o=!1,s=!1,a=!1;if(this._resized&&th(this._domNode)>zv){this._domNode.style.maxWidth=`${i-28-r-15}px`,this._replaceInput.width=th(this._findInput.domNode);return}if(zv+28+r>=i&&(s=!0),zv+28+r-qO>=i&&(a=!0),zv+28+r-qO>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-r-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=th(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!J.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(h3e|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` `),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return f3e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return p3e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(h3e|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{eu&&cv&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(T("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(d3e,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` `),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return f3e(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return p3e(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new ahe(null,this._contextViewProvider,{width:Jwr,label:$wr,placeholder:Vwr,appendCaseSensitiveLabel:this._keybindingLabelFor(as.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(as.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(as.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>a3e(this._keybindingService),inputBoxStyles:Hz,toggleStyles:Vz},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Zu&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new h2({label:Hwr+this._keybindingLabelFor(as.PreviousMatchFindAction),icon:Mwr,onTrigger:()=>{zx(this._codeEditor.getAction(as.PreviousMatchFindAction)).run().then(void 0,Oi)}})),this._nextBtn=this._register(new h2({label:Wwr+this._keybindingLabelFor(as.NextMatchFindAction),icon:Fwr,onTrigger:()=>{zx(this._codeEditor.getAction(as.NextMatchFindAction)).run().then(void 0,Oi)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",i.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new dR({icon:Rwr,title:zwr+this._keybindingLabelFor(as.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:an(qx),inputActiveOptionBorder:an(M0e),inputActiveOptionForeground:an(F0e)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new h2({label:Uwr+this._keybindingLabelFor(as.CloseFindWidgetCommand),icon:Ttt,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new lhe(null,void 0,{label:jwr,placeholder:qwr,appendPreserveCaseLabel:this._keybindingLabelFor(as.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>a3e(this._keybindingService),inputBoxStyles:Hz,toggleStyles:Vz},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new h2({label:Kwr+this._keybindingLabelFor(as.ReplaceOneAction),icon:Owr,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new h2({label:Gwr+this._keybindingLabelFor(as.ReplaceAllAction),icon:Pwr,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",o.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new h2({label:Ywr,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=th(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=Bwr,this._domNode.role="dialog",this._domNode.style.width=`${zv}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new uu(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=zv;this._register(this._resizeSash.onDidStart(()=>{a=th(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<zv)return;const u=parseFloat(pG(this._domNode).maxWidth)||0;c>u||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=th(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=th(this._domNode);if(l<zv)return;let c=zv;if(!this._resized||l===zv){const u=this._codeEditor.getLayoutInfo();c=u.width-28-u.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=th(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}$Y.ID="editor.contrib.findWidget";class h2 extends Jm{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+Qn.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,i=>{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{var r,o;if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}(o=(r=this._opts).onKeyDown)===null||o===void 0||o.call(r,i)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Qn.asClassNameArray(l3e)),this._domNode.classList.add(...Qn.asClassNameArray(c3e))):(this._domNode.classList.remove(...Qn.asClassNameArray(c3e)),this._domNode.classList.add(...Qn.asClassNameArray(l3e)))}}e_((n,e)=>{const t=(m,v)=>{v&&e.addRule(`.monaco-editor ${m} { background-color: ${v}; }`)};t(".findMatch",n.getColor(Bb)),t(".currentFindMatch",n.getColor(Lor)),t(".findScope",n.getColor(Dor));const i=n.getColor(ua);t(".find-widget",i);const r=n.getColor(Rb);r&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${r}; }`);const o=n.getColor(P0e);o&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const s=n.getColor(iw);s&&e.addRule(`.monaco-editor .findMatch { border: 1px ${fv(n.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const a=n.getColor(Aor);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=n.getColor(Nor);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${fv(n.type)?"dashed":"solid"} ${l}; }`);const c=n.getColor(ur);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const u=n.getColor(Mb);u&&e.addRule(`.monaco-editor .find-widget { color: ${u}; }`);const d=n.getColor(Xrr);d&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const h=n.getColor(yor);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const m=n.getColor(Fb);m&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${m}; }`)}const f=n.getColor(Tce);f&&e.addRule(` .monaco-editor .find-widget .button:not(.disabled):hover, .monaco-editor .find-widget .codicon-find-selection:hover { background-color: ${f} !important; } `);const g=n.getColor(Mf);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var crt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},N_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},_k=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},che;const tSr=524288;function uhe(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const r=n.getConfiguredWordAtPosition(i.getStartPosition());if(r&&t===!1)return r.word}else if(n.getModel().getValueLengthInRange(i)<tSr)return n.getModel().getValueInRange(i)}return null}let Bd=che=class extends Ue{get editor(){return this._editor}static get(e){return e.getContribution(che.ID)}constructor(e,t,i,r,o){super(),this._editor=e,this._findWidgetVisible=$1.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=r,this._notificationService=o,this._updateHistoryDelayer=new jm(500),this._state=this._register(new kwr),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(s=>this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!FY.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){const e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=tp(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return _k(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const i=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const r=uhe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?i.searchString=tp(r):i.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=uhe(this._editor,e.seedSearchStringFromSelection);r&&(i.searchString=r)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const r=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;r&&(i.searchString=r)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const r=this._editor.getSelections();r.some(o=>!o.isEmpty())&&(i.searchScope=r)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new ZM(this._editor,this._state))})}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(T("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return _k(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Bd.ID="editor.contrib.findController";Bd=che=crt([N_(1,vi),N_(2,i_),N_(3,B1),N_(4,za)],Bd);let dhe=class extends Bd{constructor(e,t,i,r,o,s,a,l){super(e,i,a,l,s),this._contextViewService=t,this._keybindingService=r,this._themeService=o,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return _k(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const r=this._editor.getSelection();let o=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!r&&r.startLineNumber!==r.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||o,yield i._start.call(this,e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new $Y(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new BY(this._editor,this._state,this._keybindingService))}};dhe=crt([N_(1,P1),N_(2,vi),N_(3,Qo),N_(4,Hl),N_(5,za),N_(6,i_),N_(7,B1)],dhe);const nSr=gZe(new pZe({id:as.StartFindAction,label:T("startFindAction","Find"),alias:"Find",precondition:at.or(de.focus,at.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"3_find",title:T({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));nSr.addImplementation(0,(n,e,t)=>{const i=Bd.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const iSr={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},regex:{type:"boolean"},regexOverride:{type:"number",description:T("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. The flag will not be saved for the future. 0: Do Nothing 1: True 2: False`)},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:T("actions.find.wholeWordOverride",`Overrides "Match Whole Word" flag. The flag will not be saved for the future. 0: Do Nothing 1: True 2: False`)},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:T("actions.find.matchCaseOverride",`Overrides "Math Case" flag. The flag will not be saved for the future. 0: Do Nothing 1: True 2: False`)},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:T("actions.find.preserveCaseOverride",`Overrides "Preserve Case" flag. The flag will not be saved for the future. 0: Do Nothing 1: True 2: False`)},findInSelection:{type:"boolean"}}}}]};class rSr extends mn{constructor(){super({id:as.StartFindWithArgs,label:T("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:iSr})}run(e,t,i){return _k(this,void 0,void 0,function*(){const r=Bd.get(t);if(r){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield r.start({forceRevealReplace:!1,seedSearchStringFromSelection:r.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},o),r.setGlobalBufferTerm(r.getState().searchString)}})}}class oSr extends mn{constructor(){super({id:as.StartFindWithSelection,label:T("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return _k(this,void 0,void 0,function*(){const i=Bd.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class urt extends mn{run(e,t){return _k(this,void 0,void 0,function*(){const i=Bd.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class sSr extends urt{constructor(){super({id:as.NextMatchFindAction,label:T("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:de.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:at.and(de.focus,FY),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class aSr extends urt{constructor(){super({id:as.PreviousMatchFindAction,label:T("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:de.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:at.and(de.focus,FY),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class lSr extends mn{constructor(){super({id:as.GoToMatchFindAction,label:T("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:$1}),this._highlightDecorations=[]}run(e,t,i){const r=Bd.get(t);if(!r)return;const o=r.getState().matchesCount;if(o<1){e.get(za).notify({severity:WG.Warning,message:T("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(Rv).createInputBox();a.placeholder=T("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=r.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,r.goToMatch(d);const h=r.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=T("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(r.goToMatch(u),a.hide()):a.validationMessage=T("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Gs(_Je),position:np.Full}}}])})}}class drt extends mn{run(e,t){return _k(this,void 0,void 0,function*(){const i=Bd.get(t);if(!i)return;const r=uhe(t,"single",!1);r&&i.setSearchString(r),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class cSr extends drt{constructor(){super({id:as.NextSelectionMatchFindAction,label:T("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class uSr extends drt{constructor(){super({id:as.PreviousSelectionMatchFindAction,label:T("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const dSr=gZe(new pZe({id:as.StartFindReplaceAction,label:T("startReplace","Replace"),alias:"Replace",precondition:at.or(de.focus,at.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"3_find",title:T({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));dSr.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=Bd.get(e);if(!i)return!1;const r=e.getSelection(),o=i.isFindInputFocused(),s=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||s?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});Vr(Bd.ID,dhe,0);Dt(rSr);Dt(oSr);Dt(sSr);Dt(aSr);Dt(lSr);Dt(cSr);Dt(uSr);const Ov=ac.bindToContribution(Bd.get);zt(new Ov({id:as.CloseFindWidgetCommand,precondition:$1,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:at.and(de.focus,at.not("isComposing")),primary:9,secondary:[1033]}}));zt(new Ov({id:as.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:T7.primary,mac:T7.mac,win:T7.win,linux:T7.linux}}));zt(new Ov({id:as.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:k7.primary,mac:k7.mac,win:k7.win,linux:k7.linux}}));zt(new Ov({id:as.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:I7.primary,mac:I7.mac,win:I7.win,linux:I7.linux}}));zt(new Ov({id:as.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:L7.primary,mac:L7.mac,win:L7.win,linux:L7.linux}}));zt(new Ov({id:as.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:D7.primary,mac:D7.mac,win:D7.win,linux:D7.linux}}));zt(new Ov({id:as.ReplaceOneAction,precondition:$1,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:3094}}));zt(new Ov({id:as.ReplaceOneAction,precondition:$1,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:at.and(de.focus,P1e),primary:3}}));zt(new Ov({id:as.ReplaceAllAction,precondition:$1,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:2563}}));zt(new Ov({id:as.ReplaceAllAction,precondition:$1,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:at.and(de.focus,P1e),primary:void 0,mac:{primary:2051}}}));zt(new Ov({id:as.SelectAllMatchesAction,precondition:$1,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:515}}));const hSr={0:" ",1:"u",2:"r"},g3e=65535,R_=16777215,m3e=4278190080;class gne{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,r=e%32,o=this._states[i];t?this._states[i]=o|1<<r:this._states[i]=o&~(1<<r)}}class Ef{constructor(e,t,i){if(e.length!==t.length||e.length>g3e)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new gne(e.length),this._userDefinedStates=new gne(e.length),this._recoveredStates=new gne(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=r};for(let i=0,r=this._startIndexes.length;i<r;i++){const o=this._startIndexes[i],s=this._endIndexes[i];if(o>R_||s>R_)throw new Error("startLineNumber or endLineNumber must not exceed "+R_);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&R_}getEndLineNumber(e){return this._endIndexes[e]&R_}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let r=0;r<this._types.length;r++)this._types[r]===e&&(this.setCollapsed(r,t),i=!0);return i}toRegion(e){return new fSr(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&m3e)>>>24)+((this._endIndexes[e]&m3e)>>>16);return t===g3e?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const r=Math.floor((t+i)/2);e<this.getStartLineNumber(r)?i=r:t=r+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${hSr[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&R_,endLineNumber:this._endIndexes[e]&R_,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),r=new Uint32Array(t);let o=[],s=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,r[l]=c.endLineNumber,o.push(c.type),c.type&&(s=!0)}s||(o=void 0);const a=new Ef(i,r,o);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i){i=i??Number.MAX_VALUE;const r=(m,v)=>Array.isArray(m)?_=>_<v?m[_]:void 0:_=>_<v?m.toFoldRange(_):void 0,o=r(e,e.length),s=r(t,t.length);let a=0,l=0,c=o(0),u=s(0);const d=[];let h,f=0;const g=[];for(;c||u;){let m;if(u&&(!c||c.startLineNumber>=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?m=u:(m=c,m.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,m.source=0),c=o(++a)):(m=u,u.isCollapsed&&u.source===0&&(m.source=2)),u=s(++l);else{let v=l,_=u;for(;;){if(!_||_.startLineNumber>c.endLineNumber){m=c;break}if(_.source===1&&_.endLineNumber>c.endLineNumber)break;_=s(++v)}c=o(++a)}if(m){for(;h&&h.endLineNumber<m.startLineNumber;)h=d.pop();m.endLineNumber>m.startLineNumber&&m.startLineNumber>f&&m.endLineNumber<=i&&(!h||h.endLineNumber>=m.endLineNumber)&&(g.push(m),f=m.startLineNumber,h&&d.push(h),h=m)}}return g}}class fSr{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class pSr{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new Le,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ef(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,r)=>i.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let r=0,o=-1,s=-1;const a=l=>{for(;r<l;){const c=this._regions.getEndLineNumber(r),u=this._regions.isCollapsed(r);if(c<=o){const d=this.regions.getSource(r)!==0;i.changeDecorationOptions(this._editorDecorationIds[r],this._decorationProvider.getDecorationOption(u,c<=s,d))}u&&c>s&&(s=c),r++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;r<this._regions.length;r++){const o=this._regions.toFoldRange(r);(o.source===0||!i(o))&&t.push(o)}this.updatePost(Ef.fromFoldRanges(t))}update(e,t=[]){const i=this._currentFoldedOrManualRanges(t),r=Ef.sanitizeAndMerge(e,i,this._textModel.getLineCount());this.updatePost(Ef.fromFoldRanges(r))}updatePost(e){const t=[];let i=-1;for(let r=0,o=e.length;r<o;r++){const s=e.getStartLineNumber(r),a=e.getEndLineNumber(r),l=e.isCollapsed(r),c=e.getSource(r)!==0,u={startLineNumber:s,startColumn:this._textModel.getLineMaxColumn(s),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:u,options:this._decorationProvider.getDecorationOption(l,a<=i,c)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(r,o)=>{for(const s of e)if(r<s&&s<=o)return!0;return!1},i=[];for(let r=0,o=this._regions.length;r<o;r++){let s=this.regions.isCollapsed(r);const a=this.regions.getSource(r);if(s||a!==0){const l=this._regions.toFoldRange(r),c=this._textModel.getDecorationRange(this._editorDecorationIds[r]);c&&(s&&t(c.startLineNumber,c.endLineNumber)&&(s=!1),i.push({startLineNumber:c.startLineNumber,endLineNumber:c.endLineNumber,type:l.type,isCollapsed:s,source:a}))}}return i}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let r=0,o=e.length;r<o;r++){const s=e[r];if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const r=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&r.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const s=Ef.sanitizeAndMerge(this._regions,r,o);this.updatePost(Ef.fromFoldRanges(s))}_getLinesChecksum(e,t){return OZe(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&i.push(s),o++,r=s.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o){for(;s.length>0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&i.push(c)}else break}}else for(let s=r,a=this._regions.length;s<a;s++){const l=this._regions.toRegion(s);if(this._regions.getStartLineNumber(s)<o)(!t||t(l))&&i.push(l);else break}return i}}function hrt(n,e,t){const i=[];for(const r of t){const o=n.getRegionAtLine(r);if(o){const s=!o.isCollapsed;if(i.push(o),e>1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c<e);i.push(...a)}}}n.toggleCollapseState(i)}function gR(n,e,t=Number.MAX_VALUE,i){const r=[];if(i&&i.length>0)for(const o of i){const s=n.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=n.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&c<t);r.push(...a)}}else{const o=n.getRegionsInside(null,(s,a)=>s.isCollapsed!==e&&a<t);r.push(...o)}n.toggleCollapseState(r)}function frt(n,e,t,i){const r=[];for(const o of i){const s=n.getAllRegionsAtLine(o,(a,l)=>a.isCollapsed!==e&&l<=t);r.push(...s)}n.toggleCollapseState(r)}function gSr(n,e,t){const i=[];for(const r of t){const o=n.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function mSr(n,e,t,i){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!i.some(l=>s.containsLine(l)),o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function prt(n,e,t){const i=[];for(const s of t){const a=n.getAllRegionsAtLine(s,void 0);a.length>0&&i.push(a[0])}const r=s=>i.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function B1e(n,e,t){const i=n.textModel,r=n.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(i.getLineContent(a))&&o.push(r.toRegion(s))}n.toggleCollapseState(o)}function $1e(n,e,t){const i=n.regions,r=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&r.push(i.toRegion(o));n.toggleCollapseState(r)}function _Sr(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const r=i.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function vSr(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let r=0;for(i!==-1&&(r=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<n)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function bSr(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let r=0;if(i!==-1)r=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;r=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class ySr{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new Le,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||ES(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,c=a.getEndLineNumber(i);o<=l&&c<=s||(!e&&r<this._hiddenRanges.length&&this._hiddenRanges[r].startLineNumber===l&&this._hiddenRanges[r].endLineNumber===c?(t.push(this._hiddenRanges[r]),r++):(e=!0,t.push(new J(l,1,c,1))),o=l,s=c)}(this._hasLineChanges||e||r<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return _3e(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let r=null;const o=s=>((!r||!CSr(s,r))&&(r=_3e(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s<a;s++){let l=e[s];const c=o(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const u=o(l.endLineNumber);u&&(l=l.setEndPosition(u,i.getLineMaxColumn(u)),t=!0),e[s]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function CSr(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function _3e(n,e){const t=N3(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const wSr=5e3,SSr="indent";class V1e{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=SSr}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(TSr(this.editorModel,i,r,this.foldingRangesLimit))}}let ESr=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>R_||t>R_)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)i[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new Ef(i,r)}else{this._foldingRangesLimit.update(this._length,t);let i=0,r=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const c=this._indentOccurrences[l];if(c){if(c+i>t){r=l;break}i+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=FG(d,o);(h<r||h===r&&i++<t)&&(s[c]=u,a[c]=this._endIndexes[l],c++)}return new Ef(s,a)}}};const xSr={limit:wSr,update:()=>{}};function TSr(n,e,t,i=xSr){const r=n.getOptions().tabSize,o=new ESr(i);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const u=n.getLineContent(c),d=FG(u,r);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return o.toIndentRanges(n)}const kSr=he("editor.foldBackground",{light:Mn(nw,.3),dark:Mn(nw,.3),hcDark:null,hcLight:null},T("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);he("editorGutter.foldingControlForeground",{dark:tw,light:tw,hcDark:tw,hcLight:tw},T("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const VY=Da("folding-expanded",Ht.chevronDown,T("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),HY=Da("folding-collapsed",Ht.chevronRight,T("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),grt=Da("folding-manual-collapsed",HY,T("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),mrt=Da("folding-manual-expanded",VY,T("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),H1e={color:Gs(kSr),position:jh.Inline};class Ga{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ga.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ga.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ga.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ga.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ga.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ga.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ga.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ga.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ga.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ga.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ga.MANUALLY_EXPANDED_VISUAL_DECORATION:Ga.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ga.COLLAPSED_VISUAL_DECORATION=Ri.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Qn.asClassName(HY)});Ga.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ri.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:H1e,isWholeLine:!0,firstLineDecorationClassName:Qn.asClassName(HY)});Ga.MANUALLY_COLLAPSED_VISUAL_DECORATION=Ri.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Qn.asClassName(grt)});Ga.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ri.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:H1e,isWholeLine:!0,firstLineDecorationClassName:Qn.asClassName(grt)});Ga.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Ri.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Ga.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Ri.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:H1e,isWholeLine:!0});Ga.EXPANDED_VISUAL_DECORATION=Ri.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Qn.asClassName(VY)});Ga.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ri.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Qn.asClassName(VY)});Ga.MANUALLY_EXPANDED_VISUAL_DECORATION=Ri.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Qn.asClassName(mrt)});Ga.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ri.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Qn.asClassName(mrt)});Ga.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Ri.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Ga.HIDDEN_RANGE_DECORATION=Ri.register({description:"folding-hidden-range-decoration",stickiness:1});const ISr={},LSr="syntax";class W1e{constructor(e,t,i,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=LSr,this.disposables=new mt,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(i))}compute(e){return DSr(this.providers,this.editorModel,e).then(t=>{var i,r;return t?NSr(t,this.foldingRangesLimit):(r=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&r!==void 0?r:null})}dispose(){this.disposables.dispose()}}function DSr(n,e,t){let i=null;const r=n.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,ISr,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},tl));return Promise.all(r).then(o=>i)}class ASr{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,r){if(e>R_||t>R_)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=i,this._length++,r<30&&(this._nestingLevelCounts[r]=(this._nestingLevelCounts[r]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let r=0;r<this._length;r++)t[r]=this._startIndexes[r],i[r]=this._endIndexes[r];return new Ef(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a<this._length;a++){const c=this._nestingLevels[a];(c<i||c===i&&t++<e)&&(r[l]=this._startIndexes[a],o[l]=this._endIndexes[a],s[l]=this._types[a],l++)}return new Ef(r,o,s)}}}function NSr(n,e){const t=n.sort((s,a)=>{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),i=new ASr(e);let r;const o=[];for(const s of t)if(!r)r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}i.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return i.toIndentRanges()}var RSr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},KO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},OSr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},I2;const ku=new sn("foldingEnabled",!1);let v0=I2=class extends Ue{static get(e){return e.getContribution(I2.ID)}static getFoldingRangeProviders(e,t){var i,r;const o=e.foldingRangeProvider.ordered(t);return(r=(i=I2._foldingRangeSelector)===null||i===void 0?void 0:i.call(I2,o,t))!==null&&r!==void 0?r:o}constructor(e,t,i,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this.localToDispose=this._register(new mt),this.editor=e,this._foldingLimitReporter=new _rt(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ga(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=ku.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new pSr(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new ySr(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new jm(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new $o(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new V1e(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=I2.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new W1e(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Eu,i=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=Sl(o=>i.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=o.setCollapsedAllOfType(Ld.Imports.value,!0);u&&(s=Sv.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(o,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(Oi(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const r=[];for(const o of i){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(i[0].getPosition()))}}}).then(void 0,Oi)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const r=this.editor.getModel();if(r&&t.startColumn===r.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};v0.ID="editor.contrib.folding";v0=I2=RSr([KO(1,vi),KO(2,rs),KO(3,za),KO(4,Og),KO(5,bn)],v0);class _rt{constructor(e){this.editor=e,this._onDidChange=new Le,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class nd extends mn{runEditorCommand(e,t,i){const r=e.get(rs),o=v0.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,i,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function vrt(n){if(!Bh(n)){if(!kd(n))return!1;const e=n;if(!Bh(e.levels)&&!pS(e.levels)||!Bh(e.direction)&&!Od(e.direction)||!Bh(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(pS)))return!1}return!0}class PSr extends nd{constructor(){super({id:"editor.unfold",label:T("unfoldAction.label","Unfold"),alias:"Unfold",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. `,constraint:vrt,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,r){const o=r&&r.levels||1,s=this.getLineNumbers(r,i);r&&r.direction==="up"?frt(t,!1,o,s):gR(t,!1,o,s)}}class MSr extends nd{constructor(){super({id:"editor.unfoldRecursively",label:T("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2142),weight:100}})}invoke(e,t,i,r){gR(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class FSr extends nd{constructor(){super({id:"editor.fold",label:T("foldAction.label","Fold"),alias:"Fold",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. `,constraint:vrt,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,r){const o=this.getLineNumbers(r,i),s=r&&r.levels,a=r&&r.direction;typeof s!="number"&&typeof a!="string"?gSr(t,!0,o):a==="up"?frt(t,!0,s||1,o):gR(t,!0,s||1,o)}}class BSr extends nd{constructor(){super({id:"editor.toggleFold",label:T("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2090),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);hrt(t,1,r)}}class $Sr extends nd{constructor(){super({id:"editor.foldRecursively",label:T("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2140),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);gR(t,!0,Number.MAX_VALUE,r)}}class VSr extends nd{constructor(){super({id:"editor.foldAllBlockComments",label:T("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2138),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())$1e(t,Ld.Comment.value,!0);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+tp(a.blockCommentStartToken));B1e(t,l,!0)}}}}class HSr extends nd{constructor(){super({id:"editor.foldAllMarkerRegions",label:T("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2077),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())$1e(t,Ld.Region.value,!0);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);B1e(t,l,!0)}}}}class WSr extends nd{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:T("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2078),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())$1e(t,Ld.Region.value,!1);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);B1e(t,l,!1)}}}}class zSr extends nd{constructor(){super({id:"editor.foldAllExcept",label:T("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2136),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);prt(t,!0,r)}}class USr extends nd{constructor(){super({id:"editor.unfoldAllExcept",label:T("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2134),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);prt(t,!1,r)}}class jSr extends nd{constructor(){super({id:"editor.foldAll",label:T("foldAllAction.label","Fold All"),alias:"Fold All",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2069),weight:100}})}invoke(e,t,i){gR(t,!0)}}class qSr extends nd{constructor(){super({id:"editor.unfoldAll",label:T("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2088),weight:100}})}invoke(e,t,i){gR(t,!1)}}class vk extends nd{getFoldingLevel(){return parseInt(this.id.substr(vk.ID_PREFIX.length))}invoke(e,t,i){mSr(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}vk.ID_PREFIX="editor.foldLevel";vk.ID=n=>vk.ID_PREFIX+n;class KSr extends nd{constructor(){super({id:"editor.gotoParentFold",label:T("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=_Sr(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class GSr extends nd{constructor(){super({id:"editor.gotoPreviousFold",label:T("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=vSr(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class YSr extends nd{constructor(){super({id:"editor.gotoNextFold",label:T("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=bSr(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class QSr extends nd{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:T("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2135),weight:100}})}invoke(e,t,i){var r;const o=[],s=i.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Ef.sanitizeAndMerge(t.regions,o,(r=i.getModel())===null||r===void 0?void 0:r.getLineCount());t.updatePost(Ef.fromFoldRanges(a))}}}}class XSr extends nd{constructor(){super({id:"editor.removeManualFoldingRanges",label:T("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2137),weight:100}})}invoke(e,t,i){const r=i.getSelections();if(r){const o=[];for(const s of r){const{startLineNumber:a,endLineNumber:l}=s;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}Vr(v0.ID,v0,0);Dt(PSr);Dt(MSr);Dt(FSr);Dt($Sr);Dt(jSr);Dt(qSr);Dt(VSr);Dt(HSr);Dt(WSr);Dt(zSr);Dt(USr);Dt(BSr);Dt(KSr);Dt(GSr);Dt(YSr);Dt(QSr);Dt(XSr);for(let n=1;n<=7;n++)Xtr(new vk({id:vk.ID(n),label:T("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:ku,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2048|21+n),weight:100}}));_r.registerCommand("_executeFoldingRangeProvider",function(n,...e){return OSr(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Yn))throw ag();const i=n.get(bn),r=n.get(Ds).getModel(t);if(!r)throw ag();const o=n.get(dr);if(!o.getValue("editor.folding",{resource:t}))return[];const s=n.get(rs),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new V1e(r,s,l);let u=c;if(a!=="indentation"){const f=v0.getFoldingRangeProviders(i,r);f.length&&(u=new W1e(r,f,()=>{},l,c))}const d=yield u.compute(nr.None),h=[];try{if(d)for(let f=0;f<d.length;f++){const g=d.getType(f);h.push({start:d.getStartLineNumber(f),end:d.getEndLineNumber(f),kind:g?Ld.fromValue(g):void 0})}return h}finally{u.dispose()}})});class ZSr extends mn{constructor(){super({id:"editor.action.fontZoomIn",label:T("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){Hp.setZoomLevel(Hp.getZoomLevel()+1)}}class JSr extends mn{constructor(){super({id:"editor.action.fontZoomOut",label:T("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){Hp.setZoomLevel(Hp.getZoomLevel()-1)}}class eEr extends mn{constructor(){super({id:"editor.action.fontZoomReset",label:T("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){Hp.setZoomLevel(0)}}Dt(ZSr);Dt(JSr);Dt(eEr);var brt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},kU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},z1e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let I5=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new mt,this._sessionDisposables=new mt,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(r=>{r.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new nz;for(const r of t.autoFormatTriggerCharacters)i.add(r.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(r=>{const o=r.charCodeAt(r.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),r=new Va,o=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){r.cancel(),o.dispose();return}for(let a=0,l=s.changes.length;a<l;a++)if(s.changes[a].range.endLineNumber<=i.lineNumber){r.cancel(),o.dispose();return}});int(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),r.token).then(s=>{r.token.isCancellationRequested||Cu(s)&&(GA.execute(this._editor,s,!0),d1e(s))}).finally(()=>{o.dispose()})}};I5.ID="editor.contrib.autoFormat";I5=brt([kU(1,bn),kU(2,r_)],I5);let L5=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new mt,this._callOnModel=new mt,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(nnt,this.editor,e,2,e1.None,nr.None).catch(Oi))}};L5.ID="editor.contrib.formatOnPaste";L5=brt([kU(1,bn),kU(2,di)],L5);class tEr extends mn{constructor(){super({id:"editor.action.formatDocument",label:T("formatDocument.label","Format Document"),alias:"Format Document",precondition:at.and(de.notInCompositeEditor,de.writable,de.hasDocumentFormattingProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return z1e(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(di);yield e.get(gE).showWhile(i.invokeFunction(d0r,t,1,e1.None,nr.None),250)}})}}class nEr extends mn{constructor(){super({id:"editor.action.formatSelection",label:T("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:at.and(de.writable,de.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2084),weight:100},contextMenuOpts:{when:de.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return z1e(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(di),r=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new J(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);yield e.get(gE).showWhile(i.invokeFunction(nnt,t,o,1,e1.None,nr.None),250)})}}Vr(I5.ID,I5,2);Vr(L5.ID,L5,2);Dt(tEr);Dt(nEr);_r.registerCommand("editor.action.format",n=>z1e(void 0,void 0,void 0,function*(){const e=n.get(eo).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(_a);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var iEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},rEr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class TL{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=i;for(let o=0;t.children.get(r)!==void 0;o++)r=`${i}_${o}`;return r}static empty(e){return e.children.size===0}}class hhe extends TL{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class yrt extends TL{constructor(e,t,i,r){super(),this.id=e,this.parent=t,this.label=i,this.order=r,this.children=new Map}}class Cy extends TL{static create(e,t,i){const r=new Va(i),o=new Cy(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=TL.findId(`provider_${u}`,o),f=new yrt(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const m of g||[])Cy._makeOutlineElement(m,f);return f},g=>(tl(g),f)).then(g=>{TL.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Ia(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!i.isCancellationRequested?Cy.create(e,t,i):o._compact()).finally(()=>{r.dispose(),l.dispose(),r.dispose()})}static _makeOutlineElement(e,t){const i=TL.findId(e,t),r=new hhe(i,t,e);if(e.children)for(const o of e.children)Cy._makeOutlineElement(o,r);t.children.set(r.id,r)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=tr.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof hhe?e.push(t.symbol):e.push(...tr.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>J.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Cy._flattenDocumentSymbols(t,e,""),t.sort((i,r)=>De.compare(J.getStartPosition(i.range),J.getStartPosition(r.range))||De.compare(J.getEndPosition(r.range),J.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||i,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&Cy._flattenDocumentSymbols(e,r.children,r.name)}}const WY=or("IOutlineModelService");let fhe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new mt,this._cache=new hE(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(r=>{this._cache.delete(r.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return rEr(this,void 0,void 0,function*(){const i=this._languageFeaturesService.documentSymbolProvider,r=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Ia(o.provider,r)){const a=new Va;o={versionId:e.getVersionId(),provider:r,promiseCnt:0,source:a,promise:Cy.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return yield o.promise}finally{s.dispose()}})}};fhe=iEr([mne(0,bn),mne(1,Og),mne(2,Ds)],fhe);vr(WY,fhe,1);var oEr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};_r.registerCommand("_executeDocumentSymbolProvider",function(n,...e){return oEr(this,void 0,void 0,function*(){const[t]=e;Io(Yn.isUri(t));const i=n.get(WY),o=yield n.get(bh).createModelReference(t);try{return(yield i.getOrCreate(o.object.textEditorModel,nr.None)).getTopLevelSymbols()}finally{o.dispose()}})});class ec extends Ue{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=ec.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=ec.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=ec.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=ec.suppressSuggestions.bindTo(this.contextKeyService),this._register(ts(i=>{const r=this.model.read(i),o=r==null?void 0:r.state.read(i),s=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.ghostText)!==void 0&&!(o!=null&&o.ghostText.isEmpty());this.inlineCompletionVisible.set(s),o!=null&&o.ghostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(ts(i=>{const r=this.model.read(i);let o=!1,s=!0;const a=r==null?void 0:r.ghostText.read(i);if(r!=null&&r.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=r.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let f=Yu(u);f===-1&&(f=u.length-1),o=f>0;const g=r.textModel.getOptions().tabSize;s=yl.visibleColumnFromColumn(u,f+1,g)<g}}this.inlineCompletionSuggestsIndentation.set(o),this.inlineCompletionSuggestsIndentationLessThanTabSize.set(s)}))}}ec.inlineSuggestionVisible=new sn("inlineSuggestionVisible",!1,T("inlineSuggestionVisible","Whether an inline suggestion is visible"));ec.inlineSuggestionHasIndentation=new sn("inlineSuggestionHasIndentation",!1,T("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace"));ec.inlineSuggestionHasIndentationLessThanTabSize=new sn("inlineSuggestionHasIndentationLessThanTabSize",!0,T("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"));ec.suppressSuggestions=new sn("inlineSuggestionSuppressSuggestions",void 0,T("suppressSuggestions","Whether suggestions should be suppressed for the current suggestion"));function sEr(n,e){const t=new aEr(n),i=e.map(r=>{const o=J.lift(r.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:r.text}});i.sort((r,o)=>o.startOffset-r.startOffset);for(const r of i)n=n.substring(0,r.startOffset)+r.text+n.substring(r.endOffset);return n}class aEr{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===` `&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}const lEr=[];function cEr(){return lEr}class uEr{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Qa(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new J(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function dEr(n,e){const t=new mt,i=n.createDecorationsCollection();return t.add(t1e({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function phe(n,e){return new De(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function ghe(n){let e=1,t=1;for(const i of n)i===` `?(e++,t=1):t++;return new De(e,t)}class IU{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return sEr(i,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(` `)}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class mhe{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class _he{constructor(e,t,i,r=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=r,this.parts=[new mhe(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(` `)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function v3e(n,e){return n===e?!0:!n||!e?!1:n instanceof IU&&e instanceof IU||n instanceof _he&&e instanceof _he?n.equals(e):!1}var hEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fEr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const b3e="ghost-text";let vhe=class extends Ue{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=ds(this,!1),this.currentTextModel=Tc(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=fr(this,r=>{if(this.isDisposed.read(r))return;const o=this.currentTextModel.read(r);if(o!==this.model.targetTextModel.read(r))return;const s=this.model.ghostText.read(r);if(!s)return;const a=s instanceof _he?s.columnRange:void 0,l=[],c=[];function u(m,v){if(c.length>0){const _=c[c.length-1];v&&_.decorations.push(new Vh(_.content.length+1,_.content.length+1+m[0].length,v,0)),_.content+=m[0],m=m.slice(1)}for(const _ of m)c.push({content:_,decorations:v?[new Vh(1,_.length+1,v,0)]:[]})}const d=o.getLineContent(s.lineNumber);let h,f=0;for(const m of s.parts){let v=m.lines;h===void 0?(l.push({column:m.column,text:v[0],preview:m.preview}),v=v.slice(1)):u([d.substring(f,m.column-1)],void 0),v.length>0&&(u(v,b3e),h===void 0&&m.column<=d.length&&(h=m.column)),f=m.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new uEr(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:o}}),this.decorations=fr(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];o.replacedRange&&s.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)s.push({range:J.fromPositions(new De(o.lineNumber,a.column)),options:{description:b3e,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:tv.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new pEr(this.editor,this.languageService.languageIdCodec,fr(r=>{const o=this.uiState.read(r);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(mi(()=>{this.isDisposed.set(!0,void 0)})),this._register(dEr(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};vhe=hEr([fEr(2,xs)],vhe);class pEr extends Ue{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=If("editorOptionChanged",nn.filter(this.editor.onDidChangeConfiguration,r=>r.hasChanged(33)||r.hasChanged(116)||r.hasChanged(98)||r.hasChanged(93)||r.hasChanged(51)||r.hasChanged(50)||r.hasChanged(66))),this._register(ts(r=>{const o=this.lines.read(r);this.editorOptionsChanged.read(r),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const r=this.editor.getModel();if(!r)return;const{tabSize:o}=r.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");gEr(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function gEr(n,e,t,i,r){const o=i.get(33),s=i.get(116),a="none",l=i.get(93),c=i.get(51),u=i.get(50),d=i.get(66),h=new rR(1e4);h.appendString('<div class="suggest-preview-text">');for(let m=0,v=t.length;m<v;m++){const _=t[m],b=_.content;h.appendString('<div class="view-line'),h.appendString('" style="top:'),h.appendString(String(m*d)),h.appendString('px;width:1000000px;">');const y=C6(b),C=SA(b),x=Ol.createEmpty(b,r);T6(new fE(u.isMonospace&&!o,u.canUseHalfwidthRightwardsArrow,b,!1,y,C,0,x,_.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==Tf.OFF,null),h),h.appendString("</div>")}h.appendString("</div>"),Zc(n,u);const f=h.build(),g=y3e?y3e.createHTML(f):f;n.innerHTML=g}const y3e=R1("editorGhostText",{createHTML:n=>n});function mEr(n,e){const t=new FJe,i=new $Je(t,c=>e.getLanguageConfiguration(c)),r=new BJe(new _Er([n]),i),o=Oce(r,[],void 0,!0);let s="";const a=n.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=Ys(u,c.openingBracket.length),c.child&&(l(c.child,u),u=Ys(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=Ys(u,c.closingBracket.length);else{const h=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);s+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,Ys(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=Ys(u,d.length)}}return l(o,Dd),s}class _Er{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class lm{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),r;if(r=lm._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(lm.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(lm.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(lm.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(lm.isVariableCharacter(i)||lm.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof lm._table[i]>"u"&&!lm.isDigitCharacter(i)&&!lm.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}}lm._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class mR{constructor(){this._children=[]}appendChild(e){return e instanceof Cd&&this._children[this._children.length-1]instanceof Cd?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,r=i.children.indexOf(e),o=i.children.slice(0);o.splice(r,1,...t),i._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof iB)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Cd extends mR{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Cd(this.value)}}class Crt extends mR{}class Fp extends Crt{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof _R?this._children[0]:void 0}clone(){const e=new Fp(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class _R extends mR{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Cd&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new _R;return this.options.forEach(e.appendChild,e),e}}class U1e extends mR{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,r=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof O_&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const i of this._children)if(i instanceof O_){let r=e[i.index]||"";r=i.resolve(r),t+=r}else t+=i.toString();return t}toString(){return""}clone(){const e=new U1e;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class O_ extends mR{constructor(e,t,i,r){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=r}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,r)=>r===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new O_(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class D5 extends Crt{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Cd(t)],!0):!1}clone(){const e=new D5(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function C3e(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class iB extends mR{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Fp&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(r=>r===e?(i=!0,!1):(t+=r.len(),!0)),i?t:-1}fullLen(e){let t=0;return C3e([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Fp&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof D5&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new iB;return this._children=this.children.map(t=>t.clone()),e}walk(e){C3e(this.children,e)}}class rN{constructor(){this._scanner=new lm,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const r=new iB;return this.parseFragment(e,r),this.ensureFinalTabstop(r,i??!1,t??!1),r}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof Fp&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new Fp(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof Fp&&r.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Fp(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const r=this._scanner.next();if(r.type!==0&&r.type!==4&&r.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Cd(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Fp(Number(t)):new D5(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new Fp(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Cd("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new _R;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let r;if((r=this._accept(5,!0))?r=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||r:r=this._accept(void 0,!0),!r)return this._backTo(t),!1;i.push(r)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Cd(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new D5(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Cd("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new U1e;let i="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Cd(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const r=this._accept(8,!0);if(r)if(i){if(this._accept(4))return e.appendChild(new O_(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new O_(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new O_(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new O_(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new O_(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new O_(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new O_(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Cd(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var _ne=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function vEr(n,e,t,i,r=nr.None,o){return _ne(this,void 0,void 0,function*(){const s=CEr(e,t),a=n.all(t),l=new x0e;for(const _ of a)_.groupId&&l.add(_.groupId,_);function c(_){if(!_.yieldsToGroupIds)return[];const b=[];for(const y of _.yieldsToGroupIds||[]){const C=l.get(y);for(const x of C)b.push(x)}return b}const u=new Map,d=new Set;function h(_,b){if(b=[...b,_],d.has(_))return b;d.add(_);try{const y=c(_);for(const C of y){const x=h(C,b);if(x)return x}}finally{d.delete(_)}}function f(_){const b=u.get(_);if(b)return b;const y=h(_,[]);y&&tl(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(x=>x.toString?x.toString():""+x).join(" -> ")}`));const C=new vG;return u.set(_,C.p),(()=>_ne(this,void 0,void 0,function*(){if(!y){const x=c(_);for(const E of x){const k=yield f(E);if(k&&k.items.length>0)return}}try{return yield _.provideInlineCompletions(t,e,i,r)}catch(x){tl(x);return}}))().then(x=>C.complete(x),x=>C.error(x)),C.p}const g=yield Promise.all(a.map(_=>_ne(this,void 0,void 0,function*(){return{provider:_,completions:yield f(_)}}))),m=new Map,v=[];for(const _ of g){const b=_.completions;if(!b)continue;const y=new yEr(b,_.provider);v.push(y);for(const C of b.items){const x=LU.from(C,y,s,t,o);m.set(x.hash(),x)}}return new bEr(Array.from(m.values()),new Set(m.keys()),v)})}class bEr{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class yEr{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class LU{static from(e,t,i,r,o){let s,a,l=e.range?J.lift(e.range):i;if(typeof e.insertText=="string"){if(s=e.insertText,o&&e.completeBracketPairs){s=w3e(s,l.getStartPosition(),r,o);const c=s.length-e.insertText.length;c!==0&&(l=new J(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=w3e(e.insertText.snippet,l.getStartPosition(),r,o);const d=e.insertText.snippet.length-c;d!==0&&(l=new J(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new rN().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof Cd?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else fG(e.insertText);return new LU(s,e.command,l,s,a,e.additionalTextEdits||cEr(),e,t)}constructor(e,t,i,r,o,s,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=r,this.snippetInfo=o,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` `),r=e.replace(/\r\n|\r/g,` `)}withRange(e){return new LU(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function CEr(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new J(n.lineNumber,t.startColumn,n.lineNumber,i):J.fromPositions(n,n.with(void 0,i))}function w3e(n,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,s=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),n),a=s==null?void 0:s.sliceAndInflate(e.column-1,o.length,0);return a?mEr(a,i):n}class oN{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const r=e.getValueInRange(i,1),o=YT(r,this.text),s=phe(this.range.getStartPosition(),ghe(r.substring(0,o))),a=this.text.substring(o),l=J.fromPositions(s,this.range.getEndPosition());return new oN(l,a)}augments(e){return this.text.startsWith(e.text)&&wEr(this.range,e.range)}computeGhostText(e,t,i,r=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),a=Ko(s).length;if(o.range.startColumn-1<=a){const g=Ko(o.text).length,m=s.substring(o.range.startColumn-1,a),[v,_]=[o.range.getStartPosition(),o.range.getEndPosition()],b=v.column+m.length<=_.column?v.delta(0,m.length):_,y=J.fromPositions(b,_),C=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(g);o=new oN(y,C)}const c=e.getValueInRange(o.range),u=SEr(c,o.text);if(!u)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(m=>m.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-r;for(const g of u){const m=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m<i.column||g.originalLength>0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,_=Math.max(g.modifiedStart,Math.min(v,f)),b=o.text.substring(g.modifiedStart,_),y=o.text.substring(_,Math.max(g.modifiedStart,v));if(b.length>0){const C=l0(b);h.push(new mhe(m,C,!1))}if(y.length>0){const C=l0(y);h.push(new mhe(m,C,!0))}}return new IU(d,h)}}function wEr(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let Uv;function SEr(n,e){if((Uv==null?void 0:Uv.originalValue)===n&&(Uv==null?void 0:Uv.newValue)===e)return Uv==null?void 0:Uv.changes;{let t=E3e(n,e,!0);if(t){const i=S3e(t);if(i>0){const r=E3e(n,e,!1);r&&S3e(r)<i&&(t=r)}}return Uv={originalValue:n,newValue:e,changes:t},t}}function S3e(n){let e=0;for(const t of n)e+=t.originalLength;return e}function E3e(n,e,t){if(n.length>5e3||e.length>5e3)return;function i(c){let u=0;for(let d=0,h=c.length;d<h;d++){const f=c.charCodeAt(d);f>u&&(u=f)}return u}const r=Math.max(i(n),i(e));function o(c){if(c<0)throw new Error("unexpected");return r+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;f<g;f++)if(t&&c[f]==="("){const m=d*100+u;h[f]=o(2*m),u++}else if(t&&c[f]===")"){u=Math.max(u-1,0);const m=d*100+u;h[f]=o(2*m+1),u===0&&d++}else h[f]=c.charCodeAt(f);return h}const a=s(n),l=s(e);return new _b({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var EEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},x3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},xEr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let bhe=class extends Ue{constructor(e,t,i,r,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=r,this.languageConfigurationService=o,this._updateOperation=this._register(new Nc),this.inlineCompletions=iU("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=iU("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var r,o;const s=new kEr(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((r=this._updateOperation.value)===null||r===void 0)&&r.request.satisfies(s))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new Va,u=(()=>xEr(this,void 0,void 0,function*(){if((l||t.triggerKind===Xy.Automatic)&&(yield TEr(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=yield vEr(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const m=new Date;this._debounceValue.update(this.textModel,m.getTime()-f.getTime());const v=new DEr(g,s,this.textModel,this.versionId);if(i){const _=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!g.has(_)&&v.prepend(i.inlineCompletion,_.range,!0)}return this._updateOperation.clear(),ks(_=>{a.set(v,_)}),!0}))(),d=new LEr(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};bhe=EEr([x3e(3,bn),x3e(4,rs)],bhe);function TEr(n,e){return new Promise(t=>{let i;const r=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(r),i&&i.dispose(),t()}))})}class kEr{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&IEr(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,i)=>t.equals(i))&&(e.context.triggerKind===Xy.Automatic||this.context.triggerKind===Xy.Explicit)&&this.versionId===e.versionId}}function IEr(n,e,t){return!n||!e?n===e:t(n,e)}class LEr{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class DEr{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,r){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=i,this.versionId=r,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=fr(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=i.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new T3e(s,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const r=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new T3e(e,r,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class T3e{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,i,r){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=i,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=r??e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new oN(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,i){const r=this._toFilterTextReplacement(i).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(i).getStartPosition())||t.lineNumber!==r.range.startLineNumber)return!1;const o=e.getValueInRange(r.range,1).toLowerCase(),s=r.text.toLowerCase(),a=Math.max(0,t.column-r.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=o.substring(0,a),d=o.substring(a);const h=e.getLineIndentColumn(r.range.startLineNumber);return r.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!Iet(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new oN(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return k3e(this._getUpdatedRange(e)).isBefore(k3e(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function k3e(n){return n.startLineNumber===n.endLineNumber?new De(1,1+n.endColumn-n.startColumn):new De(1+n.endLineNumber-n.startLineNumber,n.endColumn)}var JM=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Bi={Visible:M1e,HasFocusedSuggestion:new sn("suggestWidgetHasFocusedSuggestion",!1,T("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new sn("suggestWidgetDetailsVisible",!1,T("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new sn("suggestWidgetMultipleSuggestions",!1,T("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new sn("suggestionMakesTextEdit",!0,T("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new sn("acceptSuggestionOnEnter",!0,T("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new sn("suggestionHasInsertAndReplaceRange",!1,T("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new sn("suggestionInsertMode",void 0,{type:"string",description:T("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new sn("suggestionCanResolve",!1,T("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Gw=new ue("suggestWidgetStatusBar");class AEr{constructor(e,t,i,r){var o;this.position=e,this.completion=t,this.container=i,this.provider=r,this.isInvalid=!1,this.score=pv.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,J.isIRange(t.range)?(this.editStart=new De(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new De(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new De(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||J.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new De(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new De(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new De(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||J.spansMultipleLines(t.range.insert)||J.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof r.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}resolve(e){return JM(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new Eu(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=i.elapsed()},r=>{Dv(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class A5{constructor(e=2,t=new Set,i=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=r,this.showDeprecated=o}}A5.default=new A5;let NEr;function REr(){return NEr}class OEr{constructor(e,t,i,r){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=r}}function j1e(n,e,t,i=A5.default,r={triggerKind:0},o=nr.None){return JM(this,void 0,void 0,function*(){const s=new Eu;t=t.clone();const a=e.getWordAtPosition(t),l=a?new J(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):J.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new mt,h=[];let f=!1;const g=(v,_,b)=>{var y,C,x;let E=!1;if(!_)return E;for(const k of _.suggestions)if(!i.kindFilter.has(k.kind)){if(!i.showDeprecated&&(!((y=k==null?void 0:k.tags)===null||y===void 0)&&y.includes(1)))continue;k.range||(k.range=c),k.sortText||(k.sortText=typeof k.label=="string"?k.label:k.label.label),!f&&k.insertTextRules&&k.insertTextRules&4&&(f=rN.guessNeedsClipboard(k.insertText)),u.push(new AEr(t,k,_,v)),E=!0}return Jbe(_)&&d.add(_),h.push({providerName:(C=v._debugDisplayName)!==null&&C!==void 0?C:"unknown_provider",elapsedProvider:(x=_.duration)!==null&&x!==void 0?x:-1,elapsedOverall:b.elapsed()}),E},m=(()=>JM(this,void 0,void 0,function*(){}))();for(const v of n.orderedGroups(e)){let _=!1;if(yield Promise.all(v.map(b=>JM(this,void 0,void 0,function*(){if(i.providerItemsToReuse.has(b)){const y=i.providerItemsToReuse.get(b);y.forEach(C=>u.push(C)),_=_||y.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const y=new Eu,C=yield b.provideCompletionItems(e,t,r,o);_=g(b,C,y)||_}catch(y){tl(y)}}))),_||o.isCancellationRequested)break}return yield m,o.isCancellationRequested?(d.dispose(),Promise.reject(new cE)):new OEr(u.sort(FEr(i.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)})}function q1e(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLow<e.sortTextLow)return-1;if(n.sortTextLow>e.sortTextLow)return 1}return n.textLabel<e.textLabel?-1:n.textLabel>e.textLabel?1:n.completion.kind-e.completion.kind}function PEr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return q1e(n,e)}function MEr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return q1e(n,e)}const zY=new Map;zY.set(0,PEr);zY.set(2,MEr);zY.set(1,q1e);function FEr(n){return zY.get(n)}_r.registerCommand("_executeCompletionItemProvider",(n,...e)=>JM(void 0,void 0,void 0,function*(){const[t,i,r,o]=e;Io(Yn.isUri(t)),Io(De.isIPosition(i)),Io(typeof r=="string"||!r),Io(typeof o=="number"||!o);const{completionProvider:s}=n.get(bn),a=yield n.get(bh).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(i),d=yield j1e(s,a.object.textEditorModel,u,void 0,{triggerCharacter:r??void 0,triggerKind:r?1:0});for(const h of d.items)c.length<(o??0)&&c.push(h.resolve(nr.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}}));function BEr(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class kL{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function I3e(n,e=eu){return Fcr(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var $Er=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},VEr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class L3e{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class D3e{constructor(e,t,i,r){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=r}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,r=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,r=o.multiline)}if(i&&r&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),s=Ko(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof Cd&&(a=Ko(l0(c.value).pop())),!0));const l=YT(a,s);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class A3e{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Pw(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Pw(this._model.uri.fsPath),r=i.lastIndexOf(".");return r<=0?i:i.slice(0,r)}else{if(t==="TM_DIRECTORY")return kXe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel($G(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class N3e{constructor(e,t,i,r){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=r}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(r=>!OXe(r));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let DU=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),r=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(r){if(t==="LINE_COMMENT")return r.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return r.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return r.blockCommentEndToken||void 0}}};DU=$Er([VEr(2,rs)],DU);class nv{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return nv.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return nv.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return nv.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return nv.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),r=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),s=o<10?"0"+o:o,a=Math.abs(i)-o*60,l=a<10?"0"+a:a;return r+s+":"+l}}}nv.dayNames=[T("Sunday","Sunday"),T("Monday","Monday"),T("Tuesday","Tuesday"),T("Wednesday","Wednesday"),T("Thursday","Thursday"),T("Friday","Friday"),T("Saturday","Saturday")];nv.dayNamesShort=[T("SundayShort","Sun"),T("MondayShort","Mon"),T("TuesdayShort","Tue"),T("WednesdayShort","Wed"),T("ThursdayShort","Thu"),T("FridayShort","Fri"),T("SaturdayShort","Sat")];nv.monthNames=[T("January","January"),T("February","February"),T("March","March"),T("April","April"),T("May","May"),T("June","June"),T("July","July"),T("August","August"),T("September","September"),T("October","October"),T("November","November"),T("December","December")];nv.monthNamesShort=[T("JanuaryShort","Jan"),T("FebruaryShort","Feb"),T("MarchShort","Mar"),T("AprilShort","Apr"),T("MayShort","May"),T("JuneShort","Jun"),T("JulyShort","Jul"),T("AugustShort","Aug"),T("SeptemberShort","Sep"),T("OctoberShort","Oct"),T("NovemberShort","Nov"),T("DecemberShort","Dec")];class R3e{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=Zhr(this._workspaceService.getWorkspace());if(!Yhr(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(nue(e))return Pw(e.uri.path);let t=Pw(e.configPath.path);return t.endsWith(iue)&&(t=t.substr(0,t.length-iue.length-1)),t}_resoveWorkspacePath(e){if(nue(e))return I3e(e.uri.fsPath);const t=Pw(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?I3e(i):"/"}}class O3e{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return OY()}}var HEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WEr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},C_;class Np{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=tRe(t.placeholders,Fp.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const r=this._snippet.offset(i),o=this._snippet.fullLen(i),s=J.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+o)),a=i.isFinalTabstop?Np._decor.inactiveFinal:Np._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const r=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u<c.length;u++)c[u]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+c[u]);r.push(Is.replace(a,c.join(this._editor.getModel().getEOL())))}r.length>0&&this._editor.executeEdits("snippet.placeholderTransform",r)}let t=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(r=>{const o=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new kn(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?Np._decor.activeFinal:Np._decor.active),o.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?Np._decor.activeFinal:Np._decor.active),o.add(u)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?Np._decor.inactiveFinal:Np._decor.inactive);return s});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Fp){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const r of t){if(r.isFinalTabstop)break;i||(i=[],e.set(r.index,i));const o=this._placeholderDecorations.get(r),s=this._editor.getModel().getDecorationRange(o);if(!s){e.delete(r.index);break}i.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof _R,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const r of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=r.index+(s+1)/this._nestingLevel:l.index=r.index+l.index/this._nestingLevel;this._snippet.replace(r,o._snippet.children);const a=this._placeholderDecorations.get(r);i.removeDecoration(a),this._placeholderDecorations.delete(r);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),u=o._snippet.fullLen(l),d=J.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+u)),h=i.addDecoration(d,Np._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=tRe(this._snippet.placeholders,Fp.compareByIndex)})}}Np._decor={active:Ri.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Ri.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Ri.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Ri.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const P3e={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let AU=C_=class{static adjustWhitespace(e,t,i,r,o){const s=e.getLineContent(t.lineNumber),a=Ko(s,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof Cd)||c.parent instanceof _R||o&&!o.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(i){const h=r.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l??r.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;f<u.length;f++)u[f]=e.normalizeIndentation(a+u[f])}const d=u.join(e.getEOL());return d!==c.value&&(c.parent.replace(c,[new Cd(d)]),l=void 0),!0}),a}static adjustSelection(e,t,i,r){if(i!==0||r!==0){const{positionLineNumber:o,positionColumn:s}=t,a=s-i,l=s+r,c=e.validateRange({startLineNumber:o,startColumn:a,endLineNumber:o,endColumn:l});t=kn.createWithDirection(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,r,o,s,a,l,c){const u=[],d=[];if(!e.hasModel())return{edits:u,snippets:d};const h=e.getModel(),f=e.invokeWithinContext(C=>C.get(nk)),g=e.invokeWithinContext(C=>new A3e(C.get(VA),h)),m=()=>a,v=h.getValueInRange(C_.adjustSelection(h,e.getSelection(),i,0)),_=h.getValueInRange(C_.adjustSelection(h,e.getSelection(),0,r)),b=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((C,x)=>({selection:C,idx:x})).sort((C,x)=>J.compareRangesUsingStarts(C.selection,x.selection));for(const{selection:C,idx:x}of y){let E=C_.adjustSelection(h,C,i,0),k=C_.adjustSelection(h,C,0,r);v!==h.getValueInRange(E)&&(E=C),_!==h.getValueInRange(k)&&(k=C);const L=C.setStartPosition(E.startLineNumber,E.startColumn).setEndPosition(k.endLineNumber,k.endColumn),D=new rN().parse(t,!0,o),A=L.getStartPosition(),O=C_.adjustWhitespace(h,A,s||x>0&&b!==h.getLineFirstNonWhitespaceColumn(C.positionLineNumber),D);D.resolveVariables(new L3e([g,new N3e(m,x,y.length,e.getOption(78)==="spread"),new D3e(h,C,x,l),new DU(h,C,c),new nv,new R3e(f),new O3e])),u[x]=Is.replace(L,D.toString()),u[x].identifier={major:x,minor:0},u[x]._isTracked=!0,d[x]=new Np(e,D,O)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,i,r,o,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new rN,d=new iB,h=new L3e([e.invokeWithinContext(g=>new A3e(g.get(VA),c)),new N3e(()=>o,0,e.getSelections().length,e.getOption(78)==="spread"),new D3e(c,e.getSelection(),0,s),new DU(c,e.getSelection(),a),new nv,new R3e(e.invokeWithinContext(g=>g.get(nk))),new O3e]);t=t.sort((g,m)=>J.compareRangesUsingStarts(g.range,m.range));let f=0;for(let g=0;g<t.length;g++){const{range:m,template:v}=t[g];if(g>0){const x=t[g-1].range,E=J.fromPositions(x.getEndPosition(),m.getStartPosition()),k=new Cd(c.getValueInRange(E));d.appendChild(k),f+=k.value.length}const _=u.parseFragment(v,d);C_.adjustWhitespace(c,m.getStartPosition(),!0,d,new Set(_)),d.resolveVariables(h);const b=d.toString(),y=b.slice(f);f=b.length;const C=Is.replace(m,y);C.identifier={major:g,minor:0},C._isTracked=!0,l.push(C)}return u.ensureFinalTabstop(d,i,!0),{edits:l,snippets:[new Np(e,d,"")]}}constructor(e,t,i=P3e,r){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){mo(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?C_.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):C_.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const r=i.filter(o=>!!o.identifier);for(let o=0;o<t.length;o++)t[o].initialize(r[o].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):r.map(o=>kn.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=P3e){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:r}=C_.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const s=o.filter(l=>!!l.identifier);for(let l=0;l<r.length;l++)r[l].initialize(s[l].textChange);const a=r[0].isTrivialSnippet;if(!a){for(const l of this._snippets)l.merge(r);console.assert(r.length===0)}return this._snippets[0].hasPlaceholder&&!a?this._move(void 0):s.map(l=>kn.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const r=i.move(e);t.push(...r)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const r=i.computePossibleSelections();if(t.size===0)for(const[o,s]of r){s.sort(J.compareRangesUsingStarts);for(const a of e)if(s[0].containsRange(a)){t.set(o,[]);break}}if(t.size===0)return!1;t.forEach((o,s)=>{o.push(...r.get(s))})}e.sort(J.compareRangesUsingStarts);for(const[i,r]of t){if(r.length!==e.length){t.delete(i);continue}r.sort(J.compareRangesUsingStarts);for(let o=0;o<r.length;o++)if(!r[o].containsRange(e[o])){t.delete(i);continue}}return t.size>0}};AU=C_=HEr([WEr(3,rs)],AU);var zEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},R7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},L2;const M3e={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Rc=L2=class{static get(e){return e.getContribution(L2.ID)}constructor(e,t,i,r,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new mt,this._modelVersionId=-1,this._inSnippet=L2.InSnippetMode.bindTo(r),this._hasNextTabstop=L2.HasNextTabstop.bindTo(r),this._hasPrevTabstop=L2.HasPrevTabstop.bindTo(r)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?M3e:Object.assign(Object.assign({},M3e),t))}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Io(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new AU(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((i=this._session)===null||i===void 0)&&i.hasChoice){const r={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!De.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=!!h.choice.options.find(v=>v.value===f),m=[];for(let v=0;v<h.choice.options.length;v++){const _=h.choice.options[v];m.push({kind:13,label:_.value,insertText:_.value,sortText:"a".repeat(v+1),range:h.range,filterText:g?`${f}_${_.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:T("next","Go to next placeholder...")}})}return{suggestions:m}}},o=this._editor.getModel();let s,a=!1;const l=()=>{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},r),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:r,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(r=>r.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{BEr(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};Rc.ID="snippetController2";Rc.InSnippetMode=new sn("inSnippetMode",!1,T("inSnippetMode","Whether the editor in current in snippet mode"));Rc.HasNextTabstop=new sn("hasNextTabstop",!1,T("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));Rc.HasPrevTabstop=new sn("hasPrevTabstop",!1,T("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));Rc=L2=zEr([R7(1,hp),R7(2,bn),R7(3,vi),R7(4,rs)],Rc);Vr(Rc.ID,Rc,4);const UY=ac.bindToContribution(Rc.get);zt(new UY({id:"jumpToNextSnippetPlaceholder",precondition:at.and(Rc.InSnippetMode,Rc.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:100+30,kbExpr:de.editorTextFocus,primary:2}}));zt(new UY({id:"jumpToPrevSnippetPlaceholder",precondition:at.and(Rc.InSnippetMode,Rc.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:100+30,kbExpr:de.editorTextFocus,primary:1026}}));zt(new UY({id:"leaveSnippet",precondition:Rc.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:100+30,kbExpr:de.editorTextFocus,primary:9,secondary:[1033]}}));zt(new UY({id:"acceptSnippet",precondition:Rc.InSnippetMode,handler:n=>n.finish()}));var UEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},oy=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},bf;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(bf||(bf={}));let yhe=class extends Ue{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,r,o,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=i,this.textModelVersionId=r,this._debounceValue=o,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(bhe,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=ds(this,!1),this._forceUpdate=Ftt("forceUpdate"),this._selectedInlineCompletionId=ds(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([bf.Redo,bf.Undo,bf.AcceptWord]),this._fetchInlineCompletions=F_r({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Xy.Automatic}),handleChange:(g,m)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?m.preserveCurrentCompletion=!0:g.didChange(this._forceUpdate)&&(m.inlineCompletionTriggerKind=g.change),!0)},(g,m)=>{if(this._forceUpdate.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const _=this.selectedInlineCompletion.get(),b=m.preserveCurrentCompletion||_!=null&&_.forwardStable?_:void 0,y=this._source.suggestWidgetInlineCompletions.get(),C=this.selectedSuggestItem.read(g);if(y&&!C){const k=this._source.inlineCompletions.get();ks(L=>{k&&y.request.versionId>k.request.versionId&&this._source.inlineCompletions.set(y.clone(),L),this._source.clearSuggestWidgetInlineCompletions(L)})}const x=this.cursorPosition.read(g),E={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:C==null?void 0:C.toSelectedSuggestionInfo()};return this._source.fetch(x,E,b)}),this._filteredInlineCompletionItems=fr(this,g=>{const m=this._source.inlineCompletions.read(g);if(!m)return[];const v=this.cursorPosition.read(g);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=fr(this,g=>{const m=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),_=this._selectedInlineCompletionId===void 0?-1:v.findIndex(b=>b.semanticId===m);return _===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):_}),this.selectedInlineCompletion=fr(this,g=>{const m=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return m[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=fr(this,g=>{if(this.lastTriggerKind.read(g)===Xy.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=KMe({owner:this,equalityComparer:(g,m)=>!g||!m?g===m:v3e(g.ghostText,m.ghostText)&&g.inlineCompletion===m.inlineCompletion&&g.suggestItem===m.suggestItem},g=>{var m;const v=this.textModel,_=this.selectedSuggestItem.read(g);if(_){const b=_.toSingleTextEdit().removeCommonPrefix(v),y=this._computeAugmentedCompletion(b,g);if(!this._suggestPreviewEnabled.read(g)&&!y)return;const x=(m=y==null?void 0:y.edit)!==null&&m!==void 0?m:b,E=y?y.edit.text.length-b.text.length:0,k=this._suggestPreviewMode.read(g),L=this.cursorPosition.read(g),D=x.computeGhostText(v,k,L,E);return{ghostText:D??new IU(x.range.endLineNumber,[]),inlineCompletion:y==null?void 0:y.completion,suggestItem:_}}else{if(!this._isActive.read(g))return;const b=this.selectedInlineCompletion.read(g);if(!b)return;const y=b.toSingleTextEdit(g),C=this._inlineSuggestMode.read(g),x=this.cursorPosition.read(g),E=y.computeGhostText(v,C,x);return E?{ghostText:E,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostText=KMe({owner:this,equalityComparer:v3e},g=>{const m=this.state.read(g);if(m)return m.ghostText}),this._register(b5(this._fetchInlineCompletions));let f;this._register(ts(g=>{var m,v;const _=this.state.read(g),b=_==null?void 0:_.inlineCompletion;if((b==null?void 0:b.semanticId)!==(f==null?void 0:f.semanticId)&&(f=b,b)){const y=b.inlineCompletion,C=y.source;(v=(m=C.provider).handleItemDidShow)===null||v===void 0||v.call(m,C.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}trigger(e){return oy(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return oy(this,void 0,void 0,function*(){sde(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Xy.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){sde(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const i=this.textModel,r=this._source.suggestWidgetInlineCompletions.read(t),o=r?r.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(m3);return kir(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(i,J.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return oy(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return oy(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return oy(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return oy(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Qa;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const r=i.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),r.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Is.replaceMove(r.range,""),...r.additionalTextEdits]),e.setPosition(r.snippetInfo.range.getStartPosition()),(t=Rc.get(e))===null||t===void 0||t.insert(r.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Is.replaceMove(r.range,r.insertText),...r.additionalTextEdits]),r.command&&r.source.addRef(),ks(o=>{this._source.clear(o),this._isActive.set(!1,o)}),r.command&&(yield this._commandService.executeCommand(r.command.id,...r.command.arguments||[]).then(void 0,tl),r.source.removeRef())})}acceptNextWord(e){return oy(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,i)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(r),s=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const u=/\s+/g.exec(i);return u&&u.index!==void 0&&u.index+u[0].length<l&&(l=u.index+u[0].length),l})})}acceptNextLine(e){return oy(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,i)=>{const r=i.match(/\n/);return r&&r.index!==void 0?r.index+1:i.length})})}_acceptNext(e,t){return oy(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Qa;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const r=i.ghostText,o=i.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){yield this.accept(e);return}const s=r.parts[0],a=new De(r.lineNumber,s.column),l=s.lines.join(` `),c=t(a,l);if(c===l.length&&r.parts.length===1){this.accept(e);return}const u=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Is.replace(J.fromPositions(a),u)]);const d=ghe(u);e.setPosition(phe(a,d))}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const d=J.fromPositions(o.range.getStartPosition(),phe(a,ghe(u))),h=e.getModel().getValueInRange(d,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,i;const r=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentedCompletion(r,void 0);if(!o)return;const s=o.completion.inlineCompletion;(i=(t=s.source.provider).handlePartialAccept)===null||i===void 0||i.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,r.text.length)}};yhe=UEr([vne(9,di),vne(10,_a),vne(11,rs)],yhe);var jEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},RP;class K1e{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const r=i[0].score[0];for(let o=0;o<i.length;o++){const{score:s,completion:a}=i[o];if(s[0]!==r)break;if(a.preselect)return o}return 0}}class wrt extends K1e{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class qEr extends K1e{constructor(){super("recentlyUsed"),this._cache=new hE(300,.66),this._seq=0}memorize(e,t,i){const r=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(r,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const r=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(r))return super.select(e,t,i);const o=i[0].score[0];let s=-1,a=-1,l=-1;for(let c=0;c<i.length&&i[c].score[0]===o;c++){const u=`${e.getLanguageId()}/${i[c].textLabel}`,d=this._cache.peek(u);if(d&&d.touch>l&&d.type===i[c].completion.kind&&d.insertText===i[c].completion.insertText&&(l=d.touch,a=c),i[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,r]of e)r.touch=t,r.type=typeof r.type=="number"?r.type:y3.fromString(r.type),this._cache.set(i,r);this._seq=this._cache.size}}class KEr extends K1e{constructor(){super("recentlyUsedByPrefix"),this._trie=pD.forStrings(),this._seq=0}memorize(e,t,i){const{word:r}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${r}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:r}=e.getWordUntilPosition(t);if(!r)return super.select(e,t,i);const o=`${e.getLanguageId()}/${r}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let a=0;a<i.length;a++){const{kind:l,insertText:c}=i[a].completion;if(l===s.type&&c===s.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:y3.fromString(i.type),this._trie.set(t,i)}}}let N5=RP=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new mt,this._persistSoon=new $o(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===$z.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const r=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==r){this._saveState();const o=RP._strategyCtors.get(r)||wrt;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${RP._storagePrefix}/${r}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${RP._storagePrefix}/${this._strategy.name}`,i,t,1)}}};N5._strategyCtors=new Map([["recentlyUsedByPrefix",KEr],["recentlyUsed",qEr],["first",wrt]]);N5._storagePrefix="suggest/memories";N5=RP=jEr([F3e(0,i_),F3e(1,dr)],N5);const jY=or("ISuggestMemories");vr(jY,N5,1);var GEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},YEr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Che;let R5=Che=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=Che.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(122)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(122)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),r=this._editor.getSelection(),o=i.getWordAtPosition(r.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===r.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};R5.AtEnd=new sn("atEndOfWord",!1);R5=Che=GEr([YEr(1,vi)],R5);var QEr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XEr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},OP;let bk=OP=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=OP.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(OP._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let r=i;for(let o=t.items.length;o>0&&(r=(r+t.items.length+(e?1:-1))%t.items.length,!(r===i||!t.items[r].completion.additionalTextEdits));o--);return r}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=OP._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};bk.OtherSuggestions=new sn("hasOtherSuggestions",!1);bk=OP=QEr([XEr(1,vi)],bk);class ZEr{constructor(e,t,i,r){this._disposables=new mt,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==0){const s=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&r(this._active.item)}}))}_onItem(e){if(!e||!Cu(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new nz;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var JEr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class yf{provideSelectionRanges(e,t){return JEr(this,void 0,void 0,function*(){const i=[];for(const r of t){const o=[];i.push(o);const s=new Map;yield new Promise(a=>yf._bracketsRightYield(a,0,e,r,s)),yield new Promise(a=>yf._bracketsLeftYield(a,0,e,r,s,o))}return i})}static _bracketsRightYield(e,t,i,r,o){const s=new Map,a=Date.now();for(;;){if(t>=yf._maxRounds){e();break}if(!r){e();break}const l=i.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>yf._maxDuration){setTimeout(()=>yf._bracketsRightYield(e,t+1,i,r,o));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=o.get(u);h||(h=new Id,o.set(u,h)),h.push(l.range)}}r=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,r,o,s){const a=new Map,l=Date.now();for(;;){if(t>=yf._maxRounds&&o.size===0){e();break}if(!r){e();break}const c=i.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>yf._maxDuration){setTimeout(()=>yf._bracketsLeftYield(e,t+1,i,r,o,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const f=o.get(d);if(f){const g=f.shift();f.size===0&&o.delete(d);const m=J.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=J.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:m}),s.push({range:v}),yf._addBracketLeading(i,v,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}r=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const r=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(r);o!==0&&o!==t.startColumn&&(i.push({range:J.fromPositions(new De(r,o),t.getEndPosition())}),i.push({range:J.fromPositions(new De(r,1),t.getEndPosition())}));const s=r-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(i.push({range:J.fromPositions(new De(s,a),t.getEndPosition())}),i.push({range:J.fromPositions(new De(s,1),t.getEndPosition())}))}}}yf._maxDuration=30;yf._maxRounds=2;var exr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class z_{static create(e,t){return exr(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return z_.None;const i=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(i.uri))return z_.None;const[o]=yield new yf().provideSelectionRanges(i,[r]);if(o.length===0)return z_.None;const s=yield e.computeWordRanges(i.uri,o[0].range);if(!s)return z_.None;const a=i.getWordUntilPosition(r);return delete s[a.word],new class extends z_{distance(l,c){if(!r.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(tXe(d))return 2<<20;const h=p3(d,J.fromPositions(l),J.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=o.length;for(const m of o){if(!J.containsRange(m.range,f))break;g-=1}return g}}})}}z_.None=new class extends z_{distance(){return 0}};let B3e=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class WC{constructor(e,t,i,r,o,s,a=GG.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=WC._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=r,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=WC._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=WC._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}getItemsByProvider(){return this._ensureCachedState(),this._itemsByProvider}getIncompleteProvider(){this._ensureCachedState();const e=new Set;for(const[t,i]of this.getItemsByProvider())i.length>0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let r="",o="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?ik:Tfr;for(let c=0;c<s.length;c++){const u=s[c];if(u.isInvalid)continue;const d=this._itemsByProvider.get(u.provider);d?d.push(u):this._itemsByProvider.set(u.provider,[u]);const h=u.position.column-u.editStart.column,f=h+i-(u.position.column-this._column);if(r.length!==f&&(r=f===0?"":t.slice(-f),o=r.toLowerCase()),u.word=r,f===0)u.score=pv.Default;else{let g=0;for(;g<h;){const m=r.charCodeAt(g);if(m===32||m===9)g+=1;else break}if(g>=f)u.score=pv.Default;else if(typeof u.completion.filterText=="string"){const m=l(r,o,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;Yle(u.completion.filterText,u.textLabel)===0?u.score=m:(u.score=wfr(r,o,g,u.textLabel,u.labelLow,0),u.score[0]=m[0])}else{const m=l(r,o,g,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;u.score=m}}u.idx=c,u.distance=this._wordDistance.distance(u.position,u.completion),a.push(u),e.push(u.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?Jae(e.length-.85,e,(c,u)=>c-u):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return WC._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return WC._compareCompletionItems(e,t)}}var txr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},nxr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},whe;class UE{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const r=t.getWordAtPosition(i);return!(!r||r.endColumn!==i.column&&r.startColumn+1!==i.column||!isNaN(Number(r.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function ixr(n,e,t){if(!e.getContextKeyValue(ec.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(ec.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}function rxr(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(ec.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}let She=whe=class{constructor(e,t,i,r,o,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=r,this._logService=o,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new mt,this._triggerCharacterListener=new mt,this._triggerQuickSuggest=new Zm,this._triggerState=void 0,this._completionDisposables=new mt,this._onDidCancel=new Le,this._onDidTrigger=new Le,this._onDidSuggest=new Le,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new kn(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let u=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{u=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{u=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{u||this._onCursorChange(d)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!u&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){mo(this._triggerCharacterListener),mo([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const r of i.triggerCharacters||[]){let o=e.get(r);o||(o=new Set,o.add(REr()),e.set(r,o)),o.add(i)}const t=i=>{var r;if(!rxr(this._editor,this._contextKeyService,this._configurationService)||UE.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";QT(i.charCodeAt(i.length-1))?Rl(i.charCodeAt(i.length-2))&&(o=i.substr(i.length-2)):o=i.charAt(i.length-1);const s=e.get(o);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)===null||r===void 0?void 0:r.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;kL.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(!((e=Rc.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!UE.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),r=this._editor.getOption(88);if(!kL.isAllOff(r)){if(!kL.isAllOn(r)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(kL.valueFor(r,s)!=="on")return}ixr(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){Io(this._editor.hasModel()),Io(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new UE(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(i)}trigger(e){var t,i,r,o,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new UE(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(i=e.triggerKind)!==null&&i!==void 0?i:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Va;const d=this._editor.getOption(111);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=whe._createSuggestFilter(this._editor),m=new A5(h,(o=(r=e.completionOptions)===null||r===void 0?void 0:r.kindFilter)!==null&&o!==void 0?o:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=z_.create(this._editorWorkerService,this._editor),_=j1e(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),m,u,this._requestToken.token);Promise.all([_,v]).then(([b,y])=>nxr(this,void 0,void 0,function*(){var C;if((C=this._requestToken)===null||C===void 0||C.dispose(),!this._editor.hasModel())return;let x=e==null?void 0:e.clipboardText;if(!x&&b.needsClipboard&&(x=yield this._clipboardService.readText()),this._triggerState===void 0)return;const E=this._editor.getModel(),k=new UE(E,this._editor.getPosition(),e),L=Object.assign(Object.assign({},GG.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new WC(b.items,this._context.column,{leadingLineContent:k.leadingLineContent,characterCountDelta:k.column-this._context.column},y,this._editor.getOption(117),this._editor.getOption(111),L,x),this._completionDisposables.add(b.disposable),this._onNewContext(k),this._reportDurationsTelemetry(b.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const D of b.items)D.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${D.provider._debugDisplayName}`,D.completion)})).catch(Oi)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const t=new Set;e.getOption(111)==="none"&&t.add(27);const r=e.getOption(117);return r.showMethods||t.add(0),r.showFunctions||t.add(1),r.showConstructors||t.add(2),r.showFields||t.add(3),r.showVariables||t.add(4),r.showClasses||t.add(5),r.showStructs||t.add(6),r.showInterfaces||t.add(7),r.showModules||t.add(8),r.showProperties||t.add(9),r.showEvents||t.add(10),r.showOperators||t.add(11),r.showUnits||t.add(12),r.showValues||t.add(13),r.showConstants||t.add(14),r.showEnums||t.add(15),r.showEnumMembers||t.add(16),r.showKeywords||t.add(17),r.showWords||t.add(18),r.showColors||t.add(19),r.showFiles||t.add(20),r.showReferences||t.add(21),r.showColors||t.add(22),r.showFolders||t.add(23),r.showTypeParameters||t.add(24),r.showSnippets||t.add(27),r.showUsers||t.add(25),r.showIssues||t.add(26),{itemKind:t,showDeprecated:r.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Ko(e.leadingLineContent)!==Ko(this._context.leadingLineContent)){this.cancel();return}if(e.column<this._context.column){e.leadingWord.word?this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0}):this.cancel();return}if(this._completionModel){if(e.leadingWord.word.length!==0&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){if(UE.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[r,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(r):t.set(r,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const r=UE.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(r&&this._context.leadingWord.endColumn<e.leadingWord.startColumn){this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0});return}if(this._context.triggerOptions.auto){this.cancel();return}else if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};She=whe=txr([lC(1,r_),lC(2,B1),lC(3,dp),lC(4,hp),lC(5,vi),lC(6,dr),lC(7,bn),lC(8,pye)],She);class qY{constructor(e,t){this._disposables=new mt,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),r=i.length;let o=!1;for(let a=0;a<r;a++)if(!i[a].isEmpty()){o=!0;break}if(!o){this._lastOvertyped.length!==0&&(this._lastOvertyped.length=0);return}this._lastOvertyped=[];const s=e.getModel();for(let a=0;a<r;a++){const l=i[a];if(s.getValueLengthInRange(l)>qY._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}qY._maxSelectionLength=51200;var oxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class G1e extends rk{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=T({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,G1e.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let Ehe=class{constructor(e,t,i,r,o){this._menuId=t,this._menuService=r,this._contextKeyService=o,this._menuDisposables=new mt,this.element=lt(e,kt(".suggest-status-bar"));const s=a=>a instanceof zm?i.createInstance(G1e,a,void 0):void 0;this._leftActions=new wg(this.element,{actionViewItemProvider:s}),this._rightActions=new wg(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],r=[];for(const[o,s]of e.getActions())o==="left"?i.push(...s):r.push(...s);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(r)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};Ehe=oxr([bne(2,di),bne(3,L0),bne(4,vi)],Ehe);var sxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},axr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function Y1e(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let xhe=class{constructor(e,t){this._editor=e,this._onDidClose=new Le,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new Le,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new mt,this._renderDisposeable=new mt,this._borderWidth=1,this._size=new qr(330,0),this.domNode=kt(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(E1,{editor:e}),this._body=kt(".body"),this._scrollbar=new A6(this._body,{alwaysConsumeMouseWheel:!0}),lt(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=lt(this._body,kt(".header")),this._close=lt(this._header,kt("span"+Qn.asCSSSelector(Ht.close))),this._close.title=T("details.close","Close"),this._type=lt(this._header,kt("p.type")),this._docs=lt(this._body,kt("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),r=e.get(118)||t.fontSize,o=e.get(119)||t.lineHeight,s=t.fontWeight,a=`${r}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/r}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=T("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,r;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} `,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"} `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,a+=`distance: ${e.distance} (localityBonus-setting) `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,a+=`commit_chars: ${(r=e.completion.commitCharacters)===null||r===void 0?void 0:r.join("")} `,s=new Gc().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!Y1e(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,Mh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ic(this._type),this._type.title="",bd(this._type),this.domNode.classList.add("no-type");if(Ic(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ic(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new qr(e,t);qr.equals(i,this._size)||(this._size=i,Mtr(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};xhe=sxr([axr(1,di)],xhe);class lxr{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new mt,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new T1e,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,r,o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,r=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&r){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=r.width-a.dimension.width,l=!0),a.north&&(o=r.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+s})}a.done&&(i=void 0,r=void 0,o=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const r=e.getBoundingClientRect();this._anchorBox=r,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var r;const o=nR(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new qr(220,2*s.lineHeight),l=e.top,c=function(){const y=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),C=-s.borderWidth+e.left+e.width,x=new qr(y,o.height-e.top-s.borderHeight-s.verticalPadding),E=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-t.width,maxSizeTop:x,maxSizeBottom:E,minSize:a.with(Math.min(y,a.width))}}(),u=function(){const y=e.left-s.borderWidth-s.horizontalPadding,C=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),x=new qr(y,o.height-e.top-s.borderHeight-s.verticalPadding),E=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-t.width,maxSizeTop:x,maxSizeBottom:E,minSize:a.with(Math.min(y,a.width))}}(),d=function(){const y=e.left,C=-s.borderWidth+e.top+e.height,x=new qr(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:C,left:y,fit:x.height-t.height,maxSizeBottom:x,maxSizeTop:x,minSize:a.with(x.width)}}(),h=[c,u,d],f=(r=h.find(y=>y.fit>=0))!==null&&r!==void 0?r:h.sort((y,C)=>C.fit-y.fit)[0],g=e.top+e.height-s.borderHeight;let m,v=t.height;const _=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>_&&(v=_);let b;i?v<=f.maxSizeTop.height?(m=!0,b=f.maxSizeTop):(m=!1,b=f.maxSizeBottom):v<=f.maxSizeBottom.height?(m=!1,b=f.maxSizeBottom):(m=!0,b=f.maxSizeTop),this._applyTopLeft({left:f.left,top:m?f.top:g-v}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!m,f===c,m,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=b,this._resizable.layout(v,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var Uy;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(Uy||(Uy={}));const cxr=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function O7(n,e,t,i){const r=i===Uy.ROOT_FOLDER?["rootfolder-icon"]:i===Uy.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Gi.data)o=xS.parseMetaData(t).get(xS.META_DATA_LABEL);else{const s=t.path.match(cxr);s?(o=P7(s[2].toLowerCase()),s[1]&&r.push(`${P7(s[1].toLowerCase())}-name-dir-icon`)):o=P7(t.authority.toLowerCase())}if(i===Uy.FOLDER)r.push(`${o}-name-folder-icon`);else{if(o){if(r.push(`${o}-name-file-icon`),r.push("name-file-icon"),o.length<=255){const a=o.split(".");for(let l=1;l<a.length;l++)r.push(`${a.slice(l).join(".")}-ext-file-icon`)}r.push("ext-file-icon")}const s=uxr(n,e,t);s&&r.push(`${P7(s)}-lang-file-icon`)}}return r}function uxr(n,e,t){if(!t)return null;let i=null;if(t.scheme===Gi.data){const o=xS.parseMetaData(t).get(xS.META_DATA_MIME);o&&(i=e.getLanguageIdByMimeType(o))}else{const r=n.getModel(t);r&&(i=r.getLanguageId())}return i&&i!==qf?i:e.guessLanguageIdByFilepathOrFirstLine(t)}function P7(n){return n.replace(/[\11\12\14\15\40]/g,"/")}var dxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},cC;function Srt(n){return`suggest-aria-id:${n}`}const hxr=Da("suggest-more-info",Ht.chevronRight,T("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),fxr=new(cC=class{extract(e,t){if(e.textLabel.match(cC._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(cC._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=cC._regexRelaxed.exec(e.completion.documentation);if(i&&(i.index===0||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},cC._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,cC._regexStrict=new RegExp(`^${cC._regexRelaxed.source}$`,"i"),cC);let The=class{constructor(e,t,i,r){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=r,this._onDidToggleDetails=new Le,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new mt,i=e;i.classList.add("show-file-icons");const r=lt(e,kt(".icon")),o=lt(r,kt("span.colorspan")),s=lt(e,kt(".contents")),a=lt(s,kt(".main")),l=lt(a,kt(".icon-label.codicon")),c=lt(a,kt("span.left")),u=lt(a,kt("span.right")),d=new Jz(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=lt(c,kt("span.signature-label")),f=lt(c,kt("span.qualifier-label")),g=lt(u,kt("span.details-label")),m=lt(u,kt("span.readMore"+Qn.asCSSSelector(hxr)));m.title=T("readMore","Read More");const v=()=>{const _=this._editor.getOptions(),b=_.get(50),y=b.getMassagedFontFamily(),C=b.fontFeatureSettings,x=_.get(118)||b.fontSize,E=_.get(119)||b.lineHeight,k=b.fontWeight,L=b.letterSpacing,D=`${x}px`,A=`${E}px`,O=`${L}px`;i.style.fontSize=D,i.style.fontWeight=k,i.style.letterSpacing=O,a.style.fontFamily=y,a.style.fontFeatureSettings=C,a.style.lineHeight=A,r.style.height=A,r.style.width=A,m.style.height=A,m.style.width=A};return v(),t.add(this._editor.onDidChangeConfiguration(_=>{(_.hasChanged(50)||_.hasChanged(118)||_.hasChanged(119))&&v()})),{root:i,left:c,right:u,icon:r,colorspan:o,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:m,disposables:t}}renderElement(e,t,i){const{completion:r}=e;i.root.id=Srt(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:B6(e.score)},s=[];if(r.kind===19&&fxr.extract(e,s))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=s[0];else if(r.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=O7(this._modelService,this._languageService,Yn.from({scheme:"fake",path:e.textLabel}),Uy.FILE),l=O7(this._modelService,this._languageService,Yn.from({scheme:"fake",path:r.detail}),Uy.FILE);o.extraClasses=a.length>l.length?a:l}else r.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[O7(this._modelService,this._languageService,Yn.from({scheme:"fake",path:e.textLabel}),Uy.FOLDER),O7(this._modelService,this._languageService,Yn.from({scheme:"fake",path:r.detail}),Uy.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Qn.asClassNameArray(y3.toIcon(r.kind))));r.tags&&r.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof r.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=Cne(r.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=Cne(r.label.detail||""),i.detailsLabel.textContent=Cne(r.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?Mh(i.detailsLabel):bd(i.detailsLabel),Y1e(e)?(i.right.classList.add("can-expand-details"),Mh(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),bd(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};The=dxr([yne(1,Ds),yne(2,xs),yne(3,Hl)],The);function Cne(n){return n.replace(/\r\n|\r|\n/g,"")}var pxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},M7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gxr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},D2;he("editorSuggestWidget.background",{dark:ua,light:ua,hcDark:ua,hcLight:ua},T("editorSuggestWidgetBackground","Background color of the suggest widget."));he("editorSuggestWidget.border",{dark:Fb,light:Fb,hcDark:Fb,hcLight:Fb},T("editorSuggestWidgetBorder","Border color of the suggest widget."));const F7=he("editorSuggestWidget.foreground",{dark:vm,light:vm,hcDark:vm,hcLight:vm},T("editorSuggestWidgetForeground","Foreground color of the suggest widget."));he("editorSuggestWidget.selectedForeground",{dark:Kx,light:Kx,hcDark:Kx,hcLight:Kx},T("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));he("editorSuggestWidget.selectedIconForeground",{dark:uL,light:uL,hcDark:uL,hcLight:uL},T("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const mxr=he("editorSuggestWidget.selectedBackground",{dark:Gx,light:Gx,hcDark:Gx,hcLight:Gx},T("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));he("editorSuggestWidget.highlightForeground",{dark:bm,light:bm,hcDark:bm,hcLight:bm},T("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));he("editorSuggestWidget.focusHighlightForeground",{dark:O9,light:O9,hcDark:O9,hcLight:O9},T("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));he("editorSuggestWidgetStatus.foreground",{dark:Mn(F7,.5),light:Mn(F7,.5),hcDark:Mn(F7,.5),hcLight:Mn(F7,.5)},T("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class _xr{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof AS}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(qr.is(i))return qr.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let O5=D2=class{constructor(e,t,i,r,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Nc,this._pendingShowDetails=new Nc,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Zm,this._disposables=new mt,this._onDidSelect=new KT,this._onDidFocus=new KT,this._onDidHide=new Le,this._onDidShow=new Le,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new Le,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new T1e,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new vxr(this,e),this._persistedSize=new _xr(t,e);class s{constructor(f,g,m=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=m,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,m,v;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:_,defaultSize:b}=this.getLayoutInfo(),y=Math.round(_/2);let{width:C,height:x}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-x)<=y)&&(x=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:b.height),(!a.persistWidth||Math.abs(a.currentSize.width-C)<=y)&&(C=(v=(m=a.persistedSize)===null||m===void 0?void 0:m.width)!==null&&v!==void 0?v:b.width),this._persistedSize.store(new qr(C,x))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=lt(this.element.domNode,kt(".message")),this._listElement=lt(this.element.domNode,kt(".tree"));const l=this._disposables.add(o.createInstance(xhe,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new lxr(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const u=o.createInstance(The,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new n_("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>T("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:_,description:b}=h.completion.label;_&&b?f=T("label.full","{0} {1}, {2}",f,_,b):_?f=T("label.detail","{0} {1}",f,_):b&&(f=T("label.desc","{0}, {1}",f,b))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:m}=h.completion,v=GT("{0}{1}",m||"",g?typeof g=="string"?g:g.value:"");return T("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(cR({listInactiveFocusBackground:mxr,listInactiveFocusOutline:ys})),this._status=o.createInstance(Ehe,this.element.domNode,Gw);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);d(),this._disposables.add(r.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(r.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(117)&&(d(),c())})),this._ctxSuggestWidgetVisible=Bi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Bi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Bi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Bi.HasFocusedSuggestion.bindTo(i),this._disposables.add($a(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=fv(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],r=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(r),this._currentSuggestionDetails=Sl(o=>gxr(this,void 0,void 0,function*(){const s=bS(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>s.dispose());try{return yield i.resolve(o)}finally{s.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{r>=this._list.length||i!==this._list.element(r)||(this._ignoreFocusEvents=!0,this._list.splice(r,1,[i]),this._list.setFocus([r]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:Srt(r)}))}).catch(Oi)),this._onDidFocus.fire({item:i,index:r,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:bd(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=D2.LOADING_MESSAGE,bd(this._listElement,this._status.element),Mh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,wS(D2.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=D2.NO_SUGGESTIONS_MESSAGE,bd(this._listElement,this._status.element),Mh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,wS(D2.NO_SUGGESTIONS_MESSAGE);break;case 3:bd(this._messageElement),Mh(this._listElement,this._status.element),this._show();break;case 4:bd(this._messageElement),Mh(this._listElement,this._status.element),this._show();break;case 5:bd(this._messageElement),Mh(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=bS(()=>this._setState(1),t)))}showSuggestions(e,t,i,r,o){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(r?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=QW(()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(Y1e(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=QW(()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.height<i&&this._persistedSize.store(t.with(void 0,i))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&this._details.show(),this._positionDetails())}_layout(e){var t,i,r;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const o=nR(this.element.domNode.ownerDocument.body),s=this.getLayoutInfo();e||(e=s.defaultSize);let a=e.height,l=e.width;if(this._status.element.style.height=`${s.itemHeight}px`,this._state===2||this._state===1)a=s.itemHeight+s.borderHeight,l=s.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new qr(l,a),this._contentWidget.setPreference(2);else{const c=o.width-s.borderHeight-2*s.horizontalPadding;l>c&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=pl(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=f.top+g.top+g.height,v=Math.min(o.height-m-s.verticalPadding,d),_=f.top+g.top-s.verticalPadding,b=Math.min(_,d);let y=Math.min(Math.max(b,v)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),a<h&&(a=h),a>y&&(a=y);const C=150;a>v||this._forceRenderingAbove&&_>C?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=v),this.element.preferredSize=new qr(u,s.defaultSize.height),this.element.maxSize=new qr(c,y),this.element.minSize=new qr(220,h),this._cappedHeight=a===d?{wanted:(r=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&r!==void 0?r:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:i,height:r}=this.element.maxSize;e=Math.min(i,e),t=Math.min(r,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=Nh(this.editor.getOption(119)||e.lineHeight,8,1e3),i=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,r=this._details.widget.borderWidth,o=2*r;return{itemHeight:t,statusBarHeight:i,borderWidth:r,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new qr(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};O5.LOADING_MESSAGE=T("suggestWidget.loading","Loading...");O5.NO_SUGGESTIONS_MESSAGE=T("suggestWidget.noSuggestions","No suggestions.");O5=D2=pxr([M7(1,i_),M7(2,vi),M7(3,Hl),M7(4,di)],O5);class vxr{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:r}=this._widget.getLayoutInfo();return new qr(t+2*i+r,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var bxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},f2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},khe;class yxr{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const r=e.getOffsetAt(t),o=e.getPositionAt(r+1);this._marker=e.deltaDecorations([],[{range:J.fromPositions(t,o),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Cm=khe=class{static get(e){return e.getContribution(khe.ID)}constructor(e,t,i,r,o,s,a){this._memoryService=t,this._commandService=i,this._contextKeyService=r,this._instantiationService=o,this._logService=s,this._telemetryService=a,this._lineSuffix=new Nc,this._toDispose=new mt,this._selectors=new Cxr(d=>d.priority),this._onWillInsertSuggestItem=new Le,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(She,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=Bi.InsertMode.bindTo(r);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new U$(()=>{const d=this._instantiationService.createInstance(O5,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new ZEr(this.editor,d,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=Bi.MakesTextEdit.bindTo(this._contextKeyService),g=Bi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Bi.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(mi(()=>{f.reset(),g.reset(),m.reset()})),this._toDispose.add(d.onDidFocus(({item:v})=>{const _=this.editor.getPosition(),b=v.editStart.column,y=_.column;let C=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&y-b===v.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:_.lineNumber,startColumn:b,endLineNumber:_.lineNumber,endColumn:y})!==v.completion.insertText),f.set(C),g.set(!De.equals(v.editInsertEnd,v.editReplaceEnd)),m.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new w1(!0,!1,!1,!1,33))||mr&&v.toKeyCodeChord().equals(new w1(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new U$(()=>this._toDispose.add(new qY(this.editor,this.model)))),this._alternatives=this._toDispose.add(new U$(()=>this._toDispose.add(new bk(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(R5,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new yxr(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;h===-1&&(h=0);let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(117);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=Bi.AcceptSuggestionsOnEnter.bindTo(r),u=()=>{const d=this.editor.getOption(1);c.set(d==="on"||d==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=Rc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const r=this.editor.getModel(),o=r.getAlternativeVersionId(),{item:s}=e,a=[],l=new Va;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,!!(t&8));this._memoryService.memorize(r,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=Sv.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(m=>Is.replaceMove(J.lift(m.range),m.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new Eu;let m;const v=r.onDidChangeContent(C=>{if(C.isFlush){l.cancel(),v.dispose();return}for(const x of C.changes){const E=J.getEndPosition(x.range);(!m||De.isBefore(E,m))&&(m=E)}}),_=t;t|=2;let b=!1;const y=this.editor.onWillType(()=>{y.dispose(),b=!0,_&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(m&&s.completion.additionalTextEdits.some(x=>De.isBefore(m,J.getStartPosition(x.range))))return!1;b&&this.editor.pushUndoStop();const C=Sv.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(x=>Is.replaceMove(J.lift(x.range),x.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(_&2))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),C),h=C===!0?1:C===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=rN.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===rB.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Eu;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(m=>{s.completion.extensionId?tl(m):Oi(m)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();r.canUndo();){o!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,r,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,r,o){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:OZe(Cg(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Vcr(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:o})}getOverwriteInfo(e,t){Io(this.editor.hasModel());let i=this.editor.getOption(117).insertMode==="replace";t&&(i=!i);const r=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:r+s,overwriteAfter:o+a}}_alertCompletionItem(e){if(Cu(e.completion.additionalTextEdits)){const t=T("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);bu(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},r=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=o.editStart.column,l=s.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==o.completion.insertText};nn.once(this.model.onDidTrigger)(o=>{const s=[];nn.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{mo(s),i()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(mo(s),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!r(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let r=0;e&&(r|=4),t&&(r|=8),this._insertSuggestion(i,r)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};Cm.ID="editor.contrib.suggestController";Cm=khe=bxr([f2(1,jY),f2(2,_a),f2(3,vi),f2(4,di),f2(5,hp),f2(6,dp)],Cm);class Cxr{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class rB extends mn{constructor(){super({id:rB.id,label:T("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:at.and(de.writable,de.hasCompletionItemProvider,Bi.Visible.toNegated()),kbOpts:{kbExpr:de.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const r=Cm.get(t);if(!r)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),r.triggerSuggest(void 0,o,void 0)}}rB.id="editor.action.triggerSuggest";Vr(Cm.ID,Cm,2);Dt(rB);const rp=100+90,Wd=ac.bindToContribution(Cm.get);zt(new Wd({id:"acceptSelectedSuggestion",precondition:at.and(Bi.Visible,Bi.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:at.and(Bi.Visible,de.textInputFocus),weight:rp},{primary:3,kbExpr:at.and(Bi.Visible,de.textInputFocus,Bi.AcceptSuggestionsOnEnter,Bi.MakesTextEdit),weight:rp}],menuOpts:[{menuId:Gw,title:T("accept.insert","Insert"),group:"left",order:1,when:Bi.HasInsertAndReplaceRange.toNegated()},{menuId:Gw,title:T("accept.insert","Insert"),group:"left",order:1,when:at.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("insert"))},{menuId:Gw,title:T("accept.replace","Replace"),group:"left",order:1,when:at.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("replace"))}]}));zt(new Wd({id:"acceptAlternativeSelectedSuggestion",precondition:at.and(Bi.Visible,de.textInputFocus,Bi.HasFocusedSuggestion),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Gw,group:"left",order:2,when:at.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("insert")),title:T("accept.replace","Replace")},{menuId:Gw,group:"left",order:2,when:at.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("replace")),title:T("accept.insert","Insert")}]}));_r.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");zt(new Wd({id:"hideSuggestWidget",precondition:Bi.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:9,secondary:[1033]}}));zt(new Wd({id:"selectNextSuggestion",precondition:at.and(Bi.Visible,at.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));zt(new Wd({id:"selectNextPageSuggestion",precondition:at.and(Bi.Visible,at.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:12,secondary:[2060]}}));zt(new Wd({id:"selectLastSuggestion",precondition:at.and(Bi.Visible,at.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));zt(new Wd({id:"selectPrevSuggestion",precondition:at.and(Bi.Visible,at.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));zt(new Wd({id:"selectPrevPageSuggestion",precondition:at.and(Bi.Visible,at.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:11,secondary:[2059]}}));zt(new Wd({id:"selectFirstSuggestion",precondition:at.and(Bi.Visible,at.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));zt(new Wd({id:"focusSuggestion",precondition:at.and(Bi.Visible,Bi.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));zt(new Wd({id:"focusAndAcceptSuggestion",precondition:at.and(Bi.Visible,Bi.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));zt(new Wd({id:"toggleSuggestionDetails",precondition:at.and(Bi.Visible,Bi.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Gw,group:"right",order:1,when:at.and(Bi.DetailsVisible,Bi.CanResolve),title:T("detail.more","show less")},{menuId:Gw,group:"right",order:1,when:at.and(Bi.DetailsVisible.toNegated(),Bi.CanResolve),title:T("detail.less","show more")}]}));zt(new Wd({id:"toggleExplainMode",precondition:Bi.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));zt(new Wd({id:"toggleSuggestionFocus",precondition:Bi.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:2570,mac:{primary:778}}}));zt(new Wd({id:"insertBestCompletion",precondition:at.and(de.textInputFocus,at.equals("config.editor.tabCompletion","on"),R5.AtEnd,Bi.Visible.toNegated(),bk.OtherSuggestions.toNegated(),Rc.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(kd(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:rp,primary:2}}));zt(new Wd({id:"insertNextSuggestion",precondition:at.and(de.textInputFocus,at.equals("config.editor.tabCompletion","on"),bk.OtherSuggestions,Bi.Visible.toNegated(),Rc.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:2}}));zt(new Wd({id:"insertPrevSuggestion",precondition:at.and(de.textInputFocus,at.equals("config.editor.tabCompletion","on"),bk.OtherSuggestions,Bi.Visible.toNegated(),Rc.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:rp,kbExpr:de.textInputFocus,primary:1026}}));Dt(class extends mn{constructor(){super({id:"editor.action.resetSuggestSize",label:T("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){var t;(t=Cm.get(e))===null||t===void 0||t.resetWidgetSize()}});class wxr extends Ue{get selectedItem(){return this._selectedItem}constructor(e,t,i,r){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=r,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=ds(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=Cm.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,u)=>{var d;ks(_=>this.checkModelVersion(_));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=De.lift(c),m=u.map((_,b)=>{const C=e4.fromSuggestion(o,h,g,_,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),x=f.augments(C);return{index:b,valid:x,prefixLength:C.text.length,suggestItem:_}}).filter(_=>_&&_.valid&&_.prefixLength>0),v=FZe(m,sg(_=>_.prefixLength,Qy));return v?v.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(nn.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=e4.fromSuggestion(o,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Sxr(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,ks(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=Cm.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),r=this.editor.getModel();if(!(!t||!i||!r))return e4.fromSuggestion(e,r,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Cm.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Cm.get(this.editor);e==null||e.forceRenderingAbove()}}class e4{static fromSuggestion(e,t,i,r,o){let{insertText:s}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new rN().parse(s);c.children.length<100&&AU.adjustWhitespace(t,i,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(r,o);return new e4(J.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),s,r.completion.kind,a)}constructor(e,t,i,r){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=r}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new NXe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new oN(this.range,this.insertText)}}function Sxr(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var Exr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},uC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ihe;let op=Ihe=class extends Ue{static get(e){return e.getContribution(Ihe.ID)}constructor(e,t,i,r,o,s,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.configurationService=r,this.commandService=o,this.debounceService=s,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=iU("inlineCompletionModel",void 0),this.textModelVersionId=ds(this,-1),this.cursorPosition=ds(this,new De(1,1)),this.suggestWidgetAdaptor=this._register(new wxr(this.editor,()=>{var h,f;return(f=(h=this.model.get())===null||h===void 0?void 0:h.selectedInlineCompletion.get())===null||f===void 0?void 0:f.toSingleTextEdit(void 0)},h=>this.updateObservables(h,bf.Other),h=>{ks(f=>{var g;this.updateObservables(f,bf.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=Tc(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(vhe,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:rU(0),targetTextModel:this.model.map(h=>h==null?void 0:h.textModel)})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new ec(this.contextKeyService,this.model)),this._register(nn.runAndSubscribe(e.onDidChangeModel,()=>ks(h=>{this.model.set(void 0,h),this.updateObservables(h,bf.Other);const f=e.getModel();if(f){const g=t.createInstance(yhe,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,Tc(e.onDidChangeConfiguration,()=>e.getOption(117).preview),Tc(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),Tc(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const u=h=>{var f;return h.isUndoing?bf.Undo:h.isRedoing?bf.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?bf.AcceptWord:bf.Other};this._register(e.onDidChangeModelContent(h=>ks(f=>this.updateObservables(f,u(h))))),this._register(e.onDidChangeCursorPosition(h=>ks(f=>{var g;this.updateObservables(f,bf.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>ks(h=>{var f;this.updateObservables(h,bf.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([lD.Tab.id,lD.DeleteLeft.id,lD.DeleteRight.id,Mit,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&ks(g=>{var m;(m=this.model.get())===null||m===void 0||m.trigger(g)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||PS.dropDownVisible||ks(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(ts(h=>{var f;const g=(f=this.model.read(h))===null||f===void 0?void 0:f.state.read(h);g!=null&&g.suggestItem?g.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(mi(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let d;this._register(ts(h=>{const f=this.model.read(h),g=f==null?void 0:f.state.read(h);if(!f||!g||!g.inlineCompletion){d=void 0;return}if(g.inlineCompletion.semanticId!==d){d=g.inlineCompletion.semanticId;const m=f.textModel.getLineContent(g.ghostText.lineNumber);this.audioCueService.playAudioCue(Nr.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(m))})}})),this._register(new Yde(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let r;!t&&i&&this.editor.getOption(147)&&(r=T("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),bu(r?e+", "+r:e)}updateObservables(e,t){var i,r;const o=this.editor.getModel();this.textModelVersionId.set((i=o==null?void 0:o.getVersionId())!==null&&i!==void 0?i:-1,e,t),this.cursorPosition.set((r=this.editor.getPosition())!==null&&r!==void 0?r:new De(1,1),e)}shouldShowHoverAt(e){var t;const i=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return i?i.parts.some(r=>e.containsPosition(new De(i.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};op.ID="editor.contrib.inlineCompletionsController";op=Ihe=Exr([uC(1,di),uC(2,vi),uC(3,dr),uC(4,_a),uC(5,Og),uC(6,bn),uC(7,j6),uC(8,Qo)],op);var _E=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class KY extends mn{constructor(){super({id:KY.ID,label:T("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:at.and(de.writable,ec.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var i;return _E(this,void 0,void 0,function*(){const r=op.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.next()})}}KY.ID=Bit;class GY extends mn{constructor(){super({id:GY.ID,label:T("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:at.and(de.writable,ec.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var i;return _E(this,void 0,void 0,function*(){const r=op.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.previous()})}}GY.ID=Fit;class xxr extends mn{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:T("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:de.writable})}run(e,t){var i;return _E(this,void 0,void 0,function*(){const r=op.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.triggerExplicitly()})}}class Txr extends mn{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:T("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:at.and(de.writable,ec.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:at.and(de.writable,ec.inlineSuggestionVisible)},menuOpts:[{menuId:ue.InlineSuggestionToolbar,title:T("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var i;return _E(this,void 0,void 0,function*(){const r=op.get(t);yield(i=r==null?void 0:r.model.get())===null||i===void 0?void 0:i.acceptNextWord(r.editor)})}}class kxr extends mn{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:T("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:at.and(de.writable,ec.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:ue.InlineSuggestionToolbar,title:T("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var i;return _E(this,void 0,void 0,function*(){const r=op.get(t);yield(i=r==null?void 0:r.model.get())===null||i===void 0?void 0:i.acceptNextLine(r.editor)})}}class Ixr extends mn{constructor(){super({id:Mit,label:T("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:ec.inlineSuggestionVisible,menuOpts:[{menuId:ue.InlineSuggestionToolbar,title:T("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:at.and(ec.inlineSuggestionVisible,de.tabMovesFocus.toNegated(),ec.inlineSuggestionHasIndentationLessThanTabSize,Bi.Visible.toNegated(),de.hoverFocused.toNegated())}})}run(e,t){var i;return _E(this,void 0,void 0,function*(){const r=op.get(t);r&&((i=r.model.get())===null||i===void 0||i.accept(r.editor),r.editor.focus())})}}class YY extends mn{constructor(){super({id:YY.ID,label:T("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:ec.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return _E(this,void 0,void 0,function*(){const i=op.get(t);ks(r=>{var o;(o=i==null?void 0:i.model.get())===null||o===void 0||o.stop(r)})})}}YY.ID="editor.action.inlineSuggest.hide";class QY extends up{constructor(){super({id:QY.ID,title:T("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:ue.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:at.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return _E(this,void 0,void 0,function*(){const i=e.get(dr),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)})}}QY.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Lxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},GO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Dxr{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Lhe=class{constructor(e,t,i,r,o,s){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=r,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=op.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const r=i.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId))return new gV(1e3,this,J.fromPositions(this._editor.getModel().validatePosition(r.positionBefore||r.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new gV(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new gV(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const i=op.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new Dxr(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new mt,r=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,r,i);const o=r.controller.model.get(),s=this._instantiationService.createInstance(PS,this._editor,!1,rU(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),o.triggerExplicitly(),i.add(s),i}renderScreenReaderText(e,t,i){const r=kt,o=r("div.hover-row.markdown-hover"),s=lt(o,r("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new E1({editor:this._editor},this._languageService,this._openerService)),l=c=>{i.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=T("inlineSuggestionFollows","Suggestion:"),d=i.add(a.render(new Gc().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};i.add(ts(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.ghostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else Lc(s)})),e.fragment.appendChild(o)}};Lhe=Lxr([GO(1,xs),GO(2,rf),GO(3,O1),GO(4,di),GO(5,dp)],Lhe);Vr(op.ID,op,3);Dt(xxr);Dt(KY);Dt(GY);Dt(Txr);Dt(kxr);Dt(Ixr);Dt(YY);ws(QY);mI.register(Lhe);function Dh(n,e){let t=0;for(let i=0;i<n.length;i++)n.charAt(i)===" "?t+=e:t++;return t}function t4(n,e,t){n=n<0?0:n;let i="";if(!t){const r=Math.floor(n/e);n=n%e;for(let o=0;o<r;o++)i+=" "}for(let r=0;r<n;r++)i+=" ";return i}var Axr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Nxr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function Ert(n,e,t,i,r){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(n.getLanguageId()).indentationRules;if(!o)return[];for(i=Math.min(i,n.getLineCount());t<=i&&o.unIndentedLinePattern;){const v=n.getLineContent(t);if(!o.unIndentedLinePattern.test(v))break;t++}if(t>i-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=n.getOptions(),c=(v,_)=>(_=_||1,zp.shiftIndent(v,v.length+_,s,a,l)),u=(v,_)=>(_=_||1,zp.unshiftIndent(v,v.length+_,s,a,l)),d=[];let h;const f=n.getLineContent(t);let g=f;if(r!=null){h=r;const v=Ko(f);g=h+f.substring(v.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(v.length)),f!==g&&d.push(Is.replaceMove(new kn(t,1,t,v.length+1),pz(h,a,l)))}else h=Ko(f);let m=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(m=c(m),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(m=c(m)),t++;for(let v=t;v<=i;v++){const _=n.getLineContent(v),b=Ko(_),y=m+_.substring(b.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(y)&&(m=u(m),h=u(h)),b!==m&&d.push(Is.replaceMove(new kn(v,1,v,b.length+1),pz(m,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(_))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(y)?(h=c(h),m=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(y)?m=c(m):m=h)}return d}class XY extends mn{constructor(){super({id:XY.ID,label:T("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:de.writable})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),o=t.getSelection();if(!o)return;const s=new Mxr(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}XY.ID="editor.action.indentationToSpaces";class ZY extends mn{constructor(){super({id:ZY.ID,label:T("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:de.writable})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),o=t.getSelection();if(!o)return;const s=new Fxr(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}ZY.ID="editor.action.indentationToTabs";class Q1e extends mn{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Rv),r=e.get(Ds),o=t.getModel();if(!o)return;const s=r.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?T("configuredTabSize","Configured Tab Size"):u===s.tabSize?T("defaultTabSize","Default Tab Size"):u===a.tabSize?T("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:T({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&o&&!o.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?o.updateOptions({tabSize:d}):o.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class JY extends Q1e{constructor(){super(!1,!1,{id:JY.ID,label:T("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}JY.ID="editor.action.indentUsingTabs";class eQ extends Q1e{constructor(){super(!0,!1,{id:eQ.ID,label:T("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}eQ.ID="editor.action.indentUsingSpaces";class tQ extends Q1e{constructor(){super(!0,!0,{id:tQ.ID,label:T("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}tQ.ID="editor.action.changeTabDisplaySize";class nQ extends mn{constructor(){super({id:nQ.ID,label:T("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Ds),r=t.getModel();if(!r)return;const o=i.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(o.insertSpaces,o.tabSize)}}nQ.ID="editor.action.detectIndentation";class Rxr extends mn{constructor(){super({id:"editor.action.reindentlines",label:T("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:de.writable})}run(e,t){const i=e.get(rs),r=t.getModel();if(!r)return;const o=Ert(r,i,1,r.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class Oxr extends mn{constructor(){super({id:"editor.action.reindentselectedlines",label:T("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:de.writable})}run(e,t){const i=e.get(rs),r=t.getModel();if(!r)return;const o=t.getSelections();if(o===null)return;const s=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=Ert(r,i,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Pxr{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const r of this._edits)t.addEditOperation(J.lift(r.range),r.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let P5=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new mt,this.callOnModel=new mt,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:s,insertSpaces:a}=i.getOptions(),l=[],c={shiftIndent:f=>zp.shiftIndent(f,f.length+1,o,s,a),unshiftIndent:f=>zp.unshiftIndent(f,f.length+1,o,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(i,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=i.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const f=RM(r,i,i.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=Ko(d),m=Dh(f,o),v=Dh(g,o);if(m!==v){const _=t4(m,o,a);l.push({range:new J(u,1,u,g.length+1),text:_}),d=_+d.substr(g.length)}else{const _=xJe(i,u,this._languageConfigurationService);if(_===0||_===8)return}}}const h=u;for(;u<e.endLineNumber;){if(!/\S/.test(i.getLineContent(u+1))){u++;continue}break}if(u!==e.endLineNumber){const g=RM(r,{tokenization:{getLineTokens:m=>i.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,v)=>i.getLanguageIdAtPosition(m,v)},getLineContent:m=>m===h?d:i.getLineContent(m)},i.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const m=Dh(g,o),v=Dh(Ko(i.getLineContent(u+1)),o);if(m!==v){const _=m-v;for(let b=u+1;b<=e.endLineNumber;b++){const y=i.getLineContent(b),C=Ko(y),E=Dh(C,o)+_,k=t4(E,o,a);k!==C&&l.push({range:new J(b,1,b,C.length+1),text:k})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new Pxr(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const r=e.tokenization.getLineTokens(t);if(r.getCount()>0){const o=r.findTokenIndexAtOffset(i);if(o>=0&&r.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};P5.ID="editor.contrib.autoIndentOnPaste";P5=Axr([Nxr(1,rs)],P5);function xrt(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let r="";for(let s=0;s<t;s++)r+=" ";const o=new RegExp(r,"gi");for(let s=1,a=n.getLineCount();s<=a;s++){let l=n.getLineFirstNonWhitespaceColumn(s);if(l===0&&(l=n.getLineMaxColumn(s)),l===1)continue;const c=new J(s,1,s,l),u=n.getValueInRange(c),d=i?u.replace(/\t/ig,r):u.replace(o," ");e.addEditOperation(c,d)}}class Mxr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),xrt(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class Fxr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),xrt(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}Vr(P5.ID,P5,2);Dt(XY);Dt(ZY);Dt(JY);Dt(eQ);Dt(tQ);Dt(nQ);Dt(Rxr);Dt(Oxr);var NU=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Trt{constructor(e,t){this.range=e,this.direction=t}}class X1e{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new X1e(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}resolve(e){return NU(this,void 0,void 0,function*(){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return yield this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,i;return NU(this,void 0,void 0,function*(){try{const r=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=r==null?void 0:r.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(i=r==null?void 0:r.label)!==null&&i!==void 0?i:this.hint.label,this._isResolved=!0}catch(r){tl(r),this._isResolved=!1}})}}class M5{static create(e,t,i,r){return NU(this,void 0,void 0,function*(){const o=[],s=e.ordered(t).reverse().map(a=>i.map(l=>NU(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,r);c!=null&&c.hints.length&&o.push([c,a])}catch(c){tl(c)}})));if(yield Promise.all(s.flat()),r.isCancellationRequested||t.isDisposed())throw new cE;return new M5(i,o,t)})}constructor(e,t,i){this._disposables=new mt,this.ranges=e,this.provider=new Set;const r=[];for(const[o,s]of t){this._disposables.add(o),this.provider.add(s);for(const a of o.hints){const l=i.validatePosition(a.position);let c="before";const u=M5._getRangeAtPosition(i,l);let d;u.getStartPosition().isBefore(l)?(d=J.fromPositions(u.getStartPosition(),l),c="after"):(d=J.fromPositions(l,u.getEndPosition()),c="before"),r.push(new X1e(a,new Trt(d,c),s))}}this.items=r.sort((o,s)=>De.compare(o.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,r=e.getWordAtPosition(t);if(r)return new J(i,r.startColumn,i,r.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),s=t.column-1,a=o.findTokenIndexAtOffset(s);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===s&&a<o.getCount()-1&&(l=o.getStartOffset(a+1),c=o.getEndOffset(a+1))),new J(i,l+1,i,c+1)}}function Bxr(n){return Yn.from({scheme:Gi.command,path:n.id,query:n.arguments&&encodeURIComponent(JSON.stringify(n.arguments))}).toString()}var n4=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function $xr(n,e,t,i){var r;return n4(this,void 0,void 0,function*(){const o=n.get(bh),s=n.get(t_),a=n.get(_a),l=n.get(di),c=n.get(za);if(yield i.item.resolve(nr.None),!i.part.location)return;const u=i.part.location,d=[],h=new Set(xc.getMenuItems(ue.EditorContext).map(g=>oL(g)?g.command.id:OY()));for(const g of zu.all())h.has(g.desc.id)&&d.push(new Pd(g.desc.id,zm.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>n4(this,void 0,void 0,function*(){const m=yield o.createModelReference(u.uri);try{const v=new ZA(m.object.textEditorModel,J.getStartPosition(u.range)),_=i.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,v,_)}finally{m.dispose()}})));if(i.part.command){const{command:g}=i.part;d.push(new oc),d.push(new Pd(g.id,g.title,void 0,!0,()=>n4(this,void 0,void 0,function*(){var m;try{yield a.executeCommand(g.id,...(m=g.arguments)!==null&&m!==void 0?m:[])}catch(v){c.notify({severity:WG.Error,source:i.item.provider.displayName,message:v})}})))}const f=e.getOption(126);s.showContextMenu({domForShadowRoot:f&&(r=e.getDomNode())!==null&&r!==void 0?r:void 0,getAnchor:()=>{const g=pl(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function krt(n,e,t,i){return n4(this,void 0,void 0,function*(){const o=yield n.get(bh).createModelReference(i.uri);yield t.invokeWithinContext(s=>n4(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(vi),c=fh.inPeekEditor.getValue(l),u=!a&&t.getOption(87)&&!c;return new nB({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new ZA(o.object.textEditorModel,J.getStartPosition(i.range)),J.lift(i.range))})),o.dispose()})}var Vxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},p2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},A2=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},bV;class RU{constructor(){this._entries=new hE(50)}get(e){const t=RU._key(e);return this._entries.get(t)}set(e,t){const i=RU._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const Irt=or("IInlayHintsCache");vr(Irt,RU,1);class Dhe{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class Hxr{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let yk=bV=class{static get(e){var t;return(t=e.getContribution(bV.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,i,r,o,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=r,this._commandService=o,this._notificationService=s,this._instaService=a,this._disposables=new mt,this._sessionDisposables=new mt,this._decorationsMetadata=new Map,this._ruleFactory=new I6(this._editor),this._activeRenderMode=0,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(139)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(mi(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const o=new Set,s=new $o(()=>A2(this,void 0,void 0,function*(){const a=Date.now();r==null||r.dispose(!0),r=new Va;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=yield M5.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!o.has(d)&&(o.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){Oi(c)}finally{r.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(mi(()=>r==null?void 0:r.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(s.delay,1250);s.schedule(l)})),e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(Py.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new mt,t=e.add(new xY(this._editor)),i=new mt;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(r=>{const[o]=r,s=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!s||!a){i.clear();return}const l=new Va;i.add(mi(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Hxr(s,o.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new J(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),i.add(mi(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(r=>A2(this,void 0,void 0,function*(){const o=this._getInlayHintLabelPart(r);if(o){const s=o.part;s.location?this._instaService.invokeFunction(krt,r,this._editor,s.location):cle.is(s.command)&&(yield this._invokeCommand(s.command,o.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>A2(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),yield i.item.resolve(nr.None),Cu(i.item.hint.textEdits))){const r=i.item.hint.textEdits.map(o=>Is.replace(J.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",r),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>A2(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction($xr,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const i=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(i instanceof kS&&(i==null?void 0:i.attachedData)instanceof Dhe)return i.attachedData}_invokeCommand(e,t){var i;return A2(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(i=e.arguments)!==null&&i!==void 0?i:[])}catch(r){this._notificationService.notify({severity:WG.Error,source:t.provider.displayName,message:r})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,r]of this._decorationsMetadata){if(t.has(r.item))continue;const o=e.getDecorationRange(i);if(o){const s=new Trt(o,r.item.anchor.direction),a=r.item.with({anchor:s});t.set(r.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),r=[];for(const o of i.sort(J.compareRangesUsingStarts)){const s=t.validateRange(new J(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));r.length===0||!J.areIntersectingOrTouching(r[r.length-1],s)?r.push(s):r[r.length-1]=J.plusRange(r[r.length-1],s)}return r}_updateHintsDecorators(e,t){var i,r;const o=[],s=(m,v,_,b,y)=>{const C={content:_,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:b,attachedData:y};o.push({item:m,classNameRef:v,decoration:{range:m.anchor.range,options:{description:"InlayHint",showIfCollapsed:m.anchor.range.isEmpty(),collapseOnReplaceEdit:!m.anchor.range.isEmpty(),stickiness:0,[m.anchor.direction]:this._activeRenderMode===0?C:void 0}}})},a=(m,v)=>{const _=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(m,_," ",v?tv.Right:tv.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);for(const m of t){m.hint.paddingLeft&&a(m,!1);const v=typeof m.hint.label=="string"?[{label:m.hint.label}]:m.hint.label;for(let _=0;_<v.length;_++){const b=v[_],y=_===0,C=_===v.length-1,x={fontSize:`${l}px`,fontFamily:`var(${h}), ${Uh.fontFamily}`,verticalAlign:d?"baseline":"middle",unicodeBidi:"isolate"};Cu(m.hint.textEdits)&&(x.cursor="default"),this._fillInColors(x,m.hint),(b.command||b.location)&&((i=this._activeInlayHintPart)===null||i===void 0?void 0:i.part.item)===m&&this._activeInlayHintPart.part.index===_&&(x.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(x.color=Gs(Oor),x.cursor="pointer")),u&&(y&&C?(x.padding=`1px ${Math.max(1,l/4)|0}px`,x.borderRadius=`${l/4|0}px`):y?(x.padding=`1px 0 1px ${Math.max(1,l/4)|0}px`,x.borderRadius=`${l/4|0}px 0 0 ${l/4|0}px`):C?(x.padding=`1px ${Math.max(1,l/4)|0}px 1px 0`,x.borderRadius=`0 ${l/4|0}px ${l/4|0}px 0`):x.padding="1px 0 1px 0"),s(m,this._ruleFactory.createClassNameRef(x),Wxr(b.label),C&&!m.hint.paddingRight?tv.Right:tv.None,new Dhe(m,_))}if(m.hint.paddingRight&&a(m,!0),o.length>bV._MAX_DECORATORS)break}const f=[];for(const m of e)for(const{id:v}of(r=this._editor.getDecorationsInRange(m))!==null&&r!==void 0?r:[]){const _=this._decorationsMetadata.get(v);_&&(f.push(v),_.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const g=Sv.capture(this._editor);this._editor.changeDecorations(m=>{const v=m.deltaDecorations(f,o.map(_=>_.decoration));for(let _=0;_<v.length;_++){const b=o[_];this._decorationsMetadata.set(v[_],b)}}),g.restore(this._editor)}_fillInColors(e,t){t.kind===jW.Parameter?(e.backgroundColor=Gs(Bor),e.color=Gs(For)):t.kind===jW.Type?(e.backgroundColor=Gs(Mor),e.color=Gs(Por)):(e.backgroundColor=Gs(Vy),e.color=Gs($y))}_getLayoutInfo(){const e=this._editor.getOption(139),t=e.padding,i=this._editor.getOption(52),r=this._editor.getOption(49);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const s=e.fontFamily||r;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===r&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};yk.ID="editor.contrib.InlayHints";yk._MAX_DECORATORS=1500;yk=bV=Vxr([p2(1,bn),p2(2,Og),p2(3,Irt),p2(4,_a),p2(5,za),p2(6,di)],yk);function Wxr(n){const e=" ";return n.replace(/[ \t]/g,e)}_r.registerCommand("_executeInlayHintProvider",(n,...e)=>A2(void 0,void 0,void 0,function*(){const[t,i]=e;Io(Yn.isUri(t)),Io(J.isIRange(i));const{inlayHintsProvider:r}=n.get(bn),o=yield n.get(bh).createModelReference(t);try{const s=yield M5.create(r,o.object.textEditorModel,[J.lift(i)],nr.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}}));var zxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},YO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$3e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Uxr=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};class V3e extends gV{constructor(e,t,i,r){super(10,t,e.item.anchor.range,i,r,!0),this.part=e}}let Ahe=class extends bU{constructor(e,t,i,r,o,s){super(e,t,i,r,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!yk.get(this._editor)||e.target.type!==6)return null;const r=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return r instanceof kS&&r.attachedData instanceof Dhe?new V3e(r.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof V3e?new Ya(r=>$3e(this,void 0,void 0,function*(){var o,s,a,l;const{part:c}=e;if(yield c.item.resolve(i),i.isCancellationRequested)return;let u;typeof c.item.hint.tooltip=="string"?u=new Gc().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(u=c.item.hint.tooltip),u&&r.emitOne(new K_(this,e.range,[u],!1,0)),Cu(c.item.hint.textEdits)&&r.emitOne(new K_(this,e.range,[new Gc().appendText(T("hint.dbl","Double-click to insert"))],!1,10001));let d;if(typeof c.part.tooltip=="string"?d=new Gc().appendText(c.part.tooltip):c.part.tooltip&&(d=c.part.tooltip),d&&r.emitOne(new K_(this,e.range,[d],!1,1)),c.part.location||c.part.command){let v;const b=this._editor.getOption(77)==="altKey"?mr?T("links.navigate.kb.meta.mac","cmd + click"):T("links.navigate.kb.meta","ctrl + click"):mr?T("links.navigate.kb.alt.mac","option + click"):T("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?v=new Gc().appendText(T("hint.defAndCommand","Go to Definition ({0}), right click for more",b)):c.part.location?v=new Gc().appendText(T("hint.def","Go to Definition ({0})",b)):c.part.command&&(v=new Gc(`[${T("hint.cmd","Execute Command")}](${Bxr(c.part.command)} "${c.part.command.title}") (${b})`,{isTrusted:!0})),v&&r.emitOne(new K_(this,e.range,[v],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,i);try{for(var f=!0,g=Uxr(h),m;m=yield g.next(),o=m.done,!o;f=!0){l=m.value,f=!1;const v=l;r.emitOne(v)}}catch(v){s={error:v}}finally{try{!f&&!o&&(a=g.return)&&(yield a.call(g))}finally{if(s)throw s.error}}})):Ya.EMPTY}_resolveInlayHintLabelPartHover(e,t){return $3e(this,void 0,void 0,function*(){if(!e.part.location)return Ya.EMPTY;const{uri:i,range:r}=e.part.location,o=yield this._resolverService.createModelReference(i);try{const s=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?I1e(this._languageFeaturesService.hoverProvider,s,new De(r.startLineNumber,r.startColumn),t).filter(a=>!zA(a.hover.contents)).map(a=>new K_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Ya.EMPTY}finally{o.dispose()}})}};Ahe=zxr([YO(1,xs),YO(2,rf),YO(3,dr),YO(4,bh),YO(5,bn)],Ahe);Vr(yk.ID,yk,1);mI.register(Ahe);class jxr{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new kn(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new kn(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var qxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kxr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},yV;let FS=yV=class{static get(e){return e.getContribution(yV.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;(i=this.currentRequest)===null||i===void 0||i.cancel();const r=this.editor.getSelection(),o=this.editor.getModel();if(!o||!r)return;let s=r;if(s.startLineNumber!==s.endLineNumber)return;const a=new Ztt(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Sl(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=J.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new kn(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new jxr(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:yV.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=vS(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Oi)}).catch(Oi)):Promise.resolve(void 0)}};FS.ID="editor.contrib.inPlaceReplaceController";FS.DECORATION=Ri.register({description:"in-place-replace",className:"valueSetReplacement"});FS=yV=qxr([Kxr(1,r_)],FS);class Gxr extends mn{constructor(){super({id:"editor.action.inPlaceReplace.up",label:T("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=FS.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class Yxr extends mn{constructor(){super({id:"editor.action.inPlaceReplace.down",label:T("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=FS.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}Vr(FS.ID,FS,4);Dt(Gxr);Dt(Yxr);class Qxr extends mn{constructor(){super({id:"expandLineSelection",label:T("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:de.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const r=t._getViewModel();r.model.pushStackElement(),r.setCursorStates(i.source,3,fc.expandLineSelection(r,r.getCursorStates())),r.revealPrimaryCursor(i.source,!0)}}Dt(Qxr);class Xxr{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=Zxr(e,this._cursors);for(let r=0,o=i.length;r<o;r++){const s=i[r];t.addEditOperation(s.range,s.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function Zxr(n,e){e.sort((s,a)=>s.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let i=0,r=0;const o=e.length;for(let s=1,a=n.getLineCount();s<=a;s++){const l=n.getLineContent(s),c=l.length+1;let u=0;if(r<o&&e[r].lineNumber===s&&(u=e[r].column,r++,u===c)||l.length===0)continue;const d=dv(l);let h=0;if(d===-1)h=1;else if(d!==l.length-1)h=d+2;else continue;h=Math.max(u,h),t[i++]=Is.delete(new J(s,h,s,c))}return t}class Lrt{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const r=[];for(let s=i.startLineNumber;s<=i.endLineNumber;s++)r.push(e.getLineContent(s));const o=r.join(` `);o===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new J(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":` `):this._isCopyingDown?t.addEditOperation(new J(i.startLineNumber,1,i.startLineNumber,1),o+` `):t.addEditOperation(new J(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),` `+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let r=i.startLineNumber,o=i.startColumn,s=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(r=r+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(s=s+this._endLineNumberDelta,a=1),i=kn.createWithDirection(r,o,s,a,this._selectionDirection)}return i}}var Jxr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eTr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Nhe=class{constructor(e,t,i,r){this._languageConfigurationService=r,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumber<r.endLineNumber&&r.endColumn===1&&(this._moveEndPositionDown=!0,r=r.setEndPosition(r.endLineNumber-1,e.getLineMaxColumn(r.endLineNumber-1)));const{tabSize:o,indentSize:s,insertSpaces:a}=e.getOptions(),l=this.buildIndentConverter(o,s,a),c={tokenization:{getLineTokens:u=>e.tokenization.getLineTokens(u),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(u,d)=>e.getLanguageIdAtPosition(u,d)},getLineContent:null};if(r.startLineNumber===r.endLineNumber&&e.getLineMaxColumn(r.startLineNumber)===1){const u=r.startLineNumber,d=this._isMovingDown?u+1:u-1;e.getLineMaxColumn(d)===1?t.addEditOperation(new J(1,1,1,1),null):(t.addEditOperation(new J(u,1,u,1),e.getLineContent(d)),t.addEditOperation(new J(d,1,d,e.getLineMaxColumn(d)),null)),r=new kn(d,1,d,1)}else{let u,d;if(this._isMovingDown){u=r.endLineNumber+1,d=e.getLineContent(u),t.addEditOperation(new J(u-1,e.getLineMaxColumn(u-1),u,e.getLineMaxColumn(u)),null);let h=d;if(this.shouldAutoIndent(e,r)){const f=this.matchEnterRule(e,l,o,u,r.startLineNumber-1);if(f!==null){const m=Ko(e.getLineContent(u)),v=f+Dh(m,o);h=t4(v,o,a)+this.trimStart(d)}else{c.getLineContent=v=>v===r.startLineNumber?e.getLineContent(u):e.getLineContent(v);const m=RM(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber,l,this._languageConfigurationService);if(m!==null){const v=Ko(e.getLineContent(u)),_=Dh(m,o),b=Dh(v,o);_!==b&&(h=t4(_,o,a)+this.trimStart(d))}}t.addEditOperation(new J(r.startLineNumber,1,r.startLineNumber,1),h+` `);const g=this.matchEnterRuleMovingDown(e,l,o,r.startLineNumber,u,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,g);else{c.getLineContent=v=>v===r.startLineNumber?h:v>=r.startLineNumber+1&&v<=r.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v);const m=RM(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber+1,l,this._languageConfigurationService);if(m!==null){const v=Ko(e.getLineContent(r.startLineNumber)),_=Dh(m,o),b=Dh(v,o);if(_!==b){const y=_-b;this.getIndentEditsOfMovingBlock(e,t,r,o,a,y)}}}}else t.addEditOperation(new J(r.startLineNumber,1,r.startLineNumber,1),h+` `)}else if(u=r.startLineNumber-1,d=e.getLineContent(u),t.addEditOperation(new J(u,1,u+1,1),null),t.addEditOperation(new J(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` `+d),this.shouldAutoIndent(e,r)){c.getLineContent=f=>f===u?e.getLineContent(r.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,o,r.startLineNumber,r.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,h);else{const f=RM(this._autoIndent,c,e.getLanguageIdAtPosition(r.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=Ko(e.getLineContent(r.startLineNumber)),m=Dh(f,o),v=Dh(g,o);if(m!==v){const _=m-v;this.getIndentEditsOfMovingBlock(e,t,r,o,a,_)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:r=>zp.shiftIndent(r,r.length+1,e,t,i),unshiftIndent:r=>zp.unshiftIndent(r,r.length+1,e,t,i)}}parseEnterResult(e,t,i,r,o){if(o){let s=o.indentation;o.indentAction===Xa.None||o.indentAction===Xa.Indent?s=o.indentation+o.appendText:o.indentAction===Xa.IndentOutdent?s=o.indentation:o.indentAction===Xa.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=Ko(e.getLineContent(r));let c=Ko(s);const u=xJe(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=Dh(c,i),h=Dh(l,i);return d-h}}return null}matchEnterRuleMovingDown(e,t,i,r,o,s){if(dv(s)>=0){const a=e.getLineMaxColumn(o),l=aD(this._autoIndent,e,new J(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,r,l)}else{let a=r-1;for(;a>=1;){const u=e.getLineContent(a);if(dv(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=aD(this._autoIndent,e,new J(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,r,c)}}matchEnterRule(e,t,i,r,o,s){let a=o;for(;a>=1;){let u;if(a===o&&s!==void 0?u=s:u=e.getLineContent(a),dv(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=aD(this._autoIndent,e,new J(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,r,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),r=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==r||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,r,o,s){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=Ko(l),d=Dh(c,r)+s,h=t4(d,r,o);h!==c&&(t.addEditOperation(new J(a,1,a,c.length+1),h),a===i.endLineNumber&&i.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};Nhe=Jxr([eTr(3,rs)],Nhe);class Yw{static getCollator(){return Yw._COLLATOR||(Yw._COLLATOR=new Intl.Collator),Yw._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=tTr(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const r=Drt(e,t,i);if(!r)return!1;for(let o=0,s=r.before.length;o<s;o++)if(r.before[o]!==r.after[o])return!0;return!1}}Yw._COLLATOR=null;function Drt(n,e,t){const i=e.startLineNumber;let r=e.endLineNumber;if(e.endColumn===1&&r--,i>=r)return null;const o=[];for(let a=i;a<=r;a++)o.push(n.getLineContent(a));let s=o.slice(0);return s.sort(Yw.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:i,endLineNumber:r,before:o,after:s}}function tTr(n,e,t){const i=Drt(n,e,t);return i?Is.replace(new J(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(` `)):null}class Art extends mn{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));i.sort((s,a)=>J.compareRangesUsingStarts(s.selection,a.selection));let r=i[0];for(let s=1;s<i.length;s++){const a=i[s];r.selection.endLineNumber===a.selection.startLineNumber&&(r.index<a.index?a.ignore=!0:(r.ignore=!0,r=a))}const o=[];for(const s of i)o.push(new Lrt(s.selection,this.down,s.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class nTr extends Art{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:T("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class iTr extends Art{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:T("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class rTr extends mn{constructor(){super({id:"editor.action.duplicateSelection",label:T("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:de.writable,menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const r=[],o=t.getSelections(),s=t.getModel();for(const a of o)if(a.isEmpty())r.push(new Lrt(a,!0));else{const l=new kn(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);r.push(new slr(l,s.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class Nrt extends mn{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(rs),r=[],o=t.getSelections()||[],s=t.getOption(12);for(const a of o)r.push(new Nhe(a,this.down,s,i));t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class oTr extends Nrt{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:T("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class sTr extends Nrt{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:T("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class Rrt extends mn{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const o of i)if(!Yw.canRun(t.getModel(),o,this.descending))return;const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=new Yw(i[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class aTr extends Rrt{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:T("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:de.writable})}}class lTr extends Rrt{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:T("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:de.writable})}}class cTr extends mn{constructor(){super({id:"editor.action.removeDuplicateLines",label:T("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:de.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;const r=[],o=[];let s=0;for(const a of t.getSelections()){const l=new Set,c=[];for(let f=a.startLineNumber;f<=a.endLineNumber;f++){const g=i.getLineContent(f);l.has(g)||(c.push(g),l.add(g))}const u=new kn(a.startLineNumber,1,a.endLineNumber,i.getLineMaxColumn(a.endLineNumber)),d=a.startLineNumber-s,h=new kn(d,1,d+c.length-1,c[c.length-1].length);r.push(Is.replace(u,c.join(` `))),o.push(h),s+=a.endLineNumber-a.startLineNumber+1-c.length}t.pushUndoStop(),t.executeEdits(this.id,r,o),t.pushUndoStop()}}class iQ extends mn{constructor(){super({id:iQ.ID,label:T("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:ml(2089,2102),weight:100}})}run(e,t,i){let r=[];i.reason==="auto-save"&&(r=(t.getSelections()||[]).map(a=>new De(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new Xxr(o,r);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}iQ.ID="editor.action.trimTrailingWhitespace";class uTr extends mn{constructor(){super({id:"editor.action.deleteLines",label:T("lines.delete","Delete Line"),alias:"Delete Line",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),r=t.getModel();if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;let o=0;const s=[],a=[];for(let l=0,c=i.length;l<c;l++){const u=i[l];let d=u.startLineNumber,h=u.endLineNumber,f=1,g=r.getLineMaxColumn(h);h<r.getLineCount()?(h+=1,g=1):d>1&&(d-=1,f=r.getLineMaxColumn(d)),s.push(Is.replace(new kn(d,f,h,g),"")),a.push(new kn(d-o,u.positionColumn,d-o,u.positionColumn)),o+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let s=o.endLineNumber;return o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(s-=1),{startLineNumber:o.startLineNumber,selectionStartColumn:o.selectionStartColumn,endLineNumber:s,positionColumn:o.positionColumn}});t.sort((o,s)=>o.startLineNumber===s.startLineNumber?o.endLineNumber-s.endLineNumber:o.startLineNumber-s.startLineNumber);const i=[];let r=t[0];for(let o=1;o<t.length;o++)r.endLineNumber+1>=t[o].startLineNumber?r.endLineNumber=t[o].endLineNumber:(i.push(r),r=t[o]);return i.push(r),i}}class dTr extends mn{constructor(){super({id:"editor.action.indentLines",label:T("lines.indent","Indent Line"),alias:"Indent Line",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Ps.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class hTr extends mn{constructor(){super({id:"editor.action.outdentLines",label:T("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2140,weight:100}})}run(e,t){lD.Outdent.runEditorCommand(e,t,null)}}class fTr extends mn{constructor(){super({id:"editor.action.insertLineBefore",label:T("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Ps.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class pTr extends mn{constructor(){super({id:"editor.action.insertLineAfter",label:T("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Ps.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Ort extends mn{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),r=this._getRangesToDelete(t),o=[];for(let l=0,c=r.length-1;l<c;l++){const u=r[l],d=r[l+1];J.intersectRanges(u,d)===null?o.push(u):r[l+1]=J.plusRange(u,d)}o.push(r[r.length-1]);const s=this._getEndCursorState(i,o),a=o.map(l=>Is.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class gTr extends Ort{constructor(){super({id:"deleteAllLeft",label:T("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const r=[];let o=0;return t.forEach(s=>{let a;if(s.endColumn===1&&o>0){const l=s.startLineNumber-o;a=new kn(l,s.startColumn,l,s.startColumn)}else a=new kn(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);o+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?i=a:r.push(a)}),i&&r.unshift(i),r}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const r=e.getModel();return r===null?[]:(i.sort(J.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const s=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:r.getLineLength(s)+1;return new J(s,a,o.startLineNumber,1)}else return new J(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new J(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class mTr extends Ort{constructor(){super({id:"deleteAllRight",label:T("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const r=[];for(let o=0,s=t.length,a=0;o<s;o++){const l=t[o],c=new kn(l.startLineNumber-a,l.startColumn,l.startLineNumber-a,l.startColumn);l.intersectRanges(e)?i=c:r.push(c)}return i&&r.unshift(i),r}_getRangesToDelete(e){const t=e.getModel();if(t===null)return[];const i=e.getSelections();if(i===null)return[];const r=i.map(o=>{if(o.isEmpty()){const s=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===s?new J(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new J(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return r.sort(J.compareRangesUsingStarts),r}}class _Tr extends mn{constructor(){super({id:"editor.action.joinLines",label:T("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(i===null)return;let r=t.getSelection();if(r===null)return;i.sort(J.compareRangesUsingStarts);const o=[],s=i.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(r.equalsSelection(h)&&(r=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new kn(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new kn(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let h=0,f=o.length;h<f;h++){const g=o[h],m=g.startLineNumber,v=1;let _=0,b,y;const C=a.getLineLength(g.endLineNumber)-g.endColumn;if(g.isEmpty()||g.startLineNumber===g.endLineNumber){const k=g.getStartPosition();k.lineNumber<a.getLineCount()?(b=m+1,y=a.getLineMaxColumn(b)):(b=k.lineNumber,y=a.getLineMaxColumn(k.lineNumber))}else b=g.endLineNumber,y=a.getLineMaxColumn(b);let x=a.getLineContent(m);for(let k=m+1;k<=b;k++){const L=a.getLineContent(k),D=a.getLineFirstNonWhitespaceColumn(k);if(D>=1){let A=!0;x===""&&(A=!1),A&&(x.charAt(x.length-1)===" "||x.charAt(x.length-1)===" ")&&(A=!1,x=x.replace(/[\s\uFEFF\xA0]+$/g," "));const O=L.substr(D-1);x+=(A?" ":"")+O,A?_=O.length+1:_=O.length}else _=0}const E=new J(m,v,b,y);if(!E.isEmpty()){let k;g.isEmpty()?(l.push(Is.replace(E,x)),k=new kn(E.startLineNumber-d,x.length-_+1,m-d,x.length-_+1)):g.startLineNumber===g.endLineNumber?(l.push(Is.replace(E,x)),k=new kn(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Is.replace(E,x)),k=new kn(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,x.length-C)),J.intersectRanges(E,r)!==null?u=k:c.push(k)}d+=E.endLineNumber-E.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class vTr extends mn{constructor(){super({id:"editor.action.transpose",label:T("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:de.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const r=t.getModel();if(r===null)return;const o=[];for(let s=0,a=i.length;s<a;s++){const l=i[s];if(!l.isEmpty())continue;const c=l.getStartPosition(),u=r.getLineMaxColumn(c.lineNumber);if(c.column>=u){if(c.lineNumber===r.getLineCount())continue;const d=new J(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new Hc(new kn(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new J(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new K0e(d,h,new kn(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class vR extends mn{run(e,t){const i=t.getSelections();if(i===null)return;const r=t.getModel();if(r===null)return;const o=t.getOption(129),s=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new J(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);s.push(Is.replace(u,this._modifyText(d,o)))}else{const l=r.getValueInRange(a);s.push(Is.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class bTr extends vR{constructor(){super({id:"editor.action.transformToUppercase",label:T("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:de.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class yTr extends vR{constructor(){super({id:"editor.action.transformToLowercase",label:T("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:de.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class _I{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class F5 extends vR{constructor(){super({id:"editor.action.transformToTitlecase",label:T("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:de.writable})}_modifyText(e,t){const i=F5.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,r=>r.toLocaleUpperCase()):e}}F5.titleBoundary=new _I("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class Qw extends vR{constructor(){super({id:"editor.action.transformToSnakecase",label:T("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:de.writable})}_modifyText(e,t){const i=Qw.caseBoundary.get(),r=Qw.singleLetters.get();return!i||!r?e:e.replace(i,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}}Qw.caseBoundary=new _I("(\\p{Ll})(\\p{Lu})","gmu");Qw.singleLetters=new _I("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class B5 extends vR{constructor(){super({id:"editor.action.transformToCamelcase",label:T("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:de.writable})}_modifyText(e,t){const i=B5.wordBoundary.get();if(!i)return e;const r=e.split(i);return r.shift()+r.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}B5.wordBoundary=new _I("[_\\s-]","gm");class o1 extends vR{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:T("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:de.writable})}_modifyText(e,t){const i=o1.caseBoundary.get(),r=o1.singleLetters.get(),o=o1.underscoreBoundary.get();return!i||!r||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}}o1.caseBoundary=new _I("(\\p{Ll})(\\p{Lu})","gmu");o1.singleLetters=new _I("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");o1.underscoreBoundary=new _I("(\\S)(_)(\\S)","gm");Dt(nTr);Dt(iTr);Dt(rTr);Dt(oTr);Dt(sTr);Dt(aTr);Dt(lTr);Dt(cTr);Dt(iQ);Dt(uTr);Dt(dTr);Dt(hTr);Dt(fTr);Dt(pTr);Dt(gTr);Dt(mTr);Dt(_Tr);Dt(vTr);Dt(bTr);Dt(yTr);Qw.caseBoundary.isSupported()&&Qw.singleLetters.isSupported()&&Dt(Qw);B5.wordBoundary.isSupported()&&Dt(B5);F5.titleBoundary.isSupported()&&Dt(F5);o1.isSupported()&&Dt(o1);var CTr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Rhe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},CV;const Prt=new sn("LinkedEditingInputVisible",!1),wTr="linked-editing-decoration";let BS=CV=class extends Ue{static get(e){return e.getContribution(CV.ID)}constructor(e,t,i,r,o){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new mt),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=Prt.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new mt),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(s=>{(s.hasChanged(69)||s.hasChanged(92))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(nn.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new jm(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=r.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new jm(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{r.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const r=t.getValueInRange(i);if(this._currentWordPattern){const s=r.match(this._currentWordPattern);if((s?s[0].length:0)!==r.length)return this.clearRanges()}const o=[];for(let s=1,a=this._currentDecorations.length;s<a;s++){const l=this._currentDecorations.getRange(s);if(l)if(l.startLineNumber!==l.endLineNumber)o.push({range:l,text:r});else{let c=t.getValueInRange(l),u=r,d=l.startColumn,h=l.endColumn;const f=YT(c,u);d+=f,c=c.substr(f),u=u.substr(f);const g=KW(c,u);h-=g,c=c.substr(0,c.length-g),u=u.substr(0,u.length-g),(d!==h||u.length!==0)&&o.push({range:new J(l.startLineNumber,d,l.endLineNumber,h),text:u})}}if(o.length!==0)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const s=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(s)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}updateRanges(e=!1){return Rhe(this,void 0,void 0,function*(){if(!this._editor.hasModel()){this.clearRanges();return}const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1){this.clearRanges();return}const i=this._editor.getModel(),r=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===r){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=r;const o=Sl(s=>Rhe(this,void 0,void 0,function*(){try{const a=new Eu(!1),l=yield Mrt(this._providers,i,t,s);if(this._debounceInformation.update(i,a.elapsed()),o!==this._currentRequest||(this._currentRequest=null,r!==i.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let u=!1;for(let h=0,f=c.length;h<f;h++)if(J.containsPosition(c[h],t)){if(u=!0,h!==0){const g=c[h];c.splice(h,1),c.unshift(g)}break}if(!u){this.clearRanges();return}const d=c.map(h=>({range:h,options:CV.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(a){Dv(a)||Oi(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};BS.ID="editor.contrib.linkedEditing";BS.DECORATION=Ri.register({description:"linked-editing",stickiness:0,className:wTr});BS=CV=CTr([B7(1,vi),B7(2,bn),B7(3,rs),B7(4,Og)],BS);class STr extends mn{constructor(){super({id:"editor.action.linkedEditing",label:T("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:at.and(de.writable,de.hasRenameProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(eo),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Yn.isUri(r)&&De.isIPosition(o)?i.openCodeEditor({resource:r},i.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},Oi):super.runCommand(e,t)}run(e,t){const i=BS.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const ETr=ac.bindToContribution(BS.get);zt(new ETr({id:"cancelLinkedEditingInput",precondition:Prt,handler:n=>n.clearRanges(),kbOpts:{kbExpr:de.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function Mrt(n,e,t,i){const r=n.ordered(e);return yZe(r.map(o=>()=>Rhe(this,void 0,void 0,function*(){try{return yield o.provideLinkedEditingRanges(e,t,i)}catch(s){tl(s);return}})),o=>!!o&&Cu(o==null?void 0:o.ranges))}he("editor.linkedEditingBackground",{dark:ze.fromHex("#f00").transparent(.3),light:ze.fromHex("#f00").transparent(.3),hcDark:ze.fromHex("#f00").transparent(.3),hcLight:ze.white},T("editorLinkedEditingBackground","Background color when the editor auto renames on type."));A0("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(bn);return Mrt(i,e,t,nr.None)});Vr(BS.ID,BS,1);Dt(STr);var Frt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let xTr=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return Frt(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))})}};class OU{constructor(e){this._disposables=new mt;let t=[];for(const[i,r]of e){const o=i.links.map(s=>new xTr(s,r));t=OU._union(t,o),Jbe(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let r,o,s,a;for(r=0,s=0,o=e.length,a=t.length;r<o&&s<a;){const l=e[r],c=t[s];if(J.areIntersectingOrTouching(l.range,c.range)){r++;continue}J.compareRangesUsingStarts(l.range,c.range)<0?(i.push(l),r++):(i.push(c),s++)}for(;r<o;r++)i.push(e[r]);for(;s<a;s++)i.push(t[s]);return i}}function Brt(n,e,t){const i=[],r=n.ordered(e).reverse().map((o,s)=>Promise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[s]=[a,o])},tl));return Promise.all(r).then(()=>{const o=new OU(s0(i));return t.isCancellationRequested?(o.dispose(),new OU([])):o})}_r.registerCommand("_executeLinkProvider",(n,...e)=>Frt(void 0,void 0,void 0,function*(){let[t,i]=e;Io(t instanceof Yn),typeof i!="number"&&(i=0);const{linkProvider:r}=n.get(bn),o=n.get(Ds).getModel(t);if(!o)return[];const s=yield Brt(r,o,nr.None);if(!s)return[];for(let l=0;l<Math.min(i,s.links.length);l++)yield s.links[l].resolve(nr.None);const a=s.links.slice(0);return s.dispose(),a}));var TTr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},kTr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Ohe;let sN=Ohe=class extends Ue{static get(e){return e.getContribution(Ohe.ID)}constructor(e,t,i,r,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=r,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new $o(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new xY(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}computeLinksNow(){return kTr(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Sl(t=>Brt(this.providers,e,t));try{const t=new Eu(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Oi(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",i=[],r=Object.keys(this.currentOccurrences);for(const s of r){const a=this.currentOccurrences[s];i.push(a.decorationId)}const o=[];if(e)for(const s of e)o.push(CD.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l<c;l++){const u=new CD(e[l],a[l]);this.currentOccurrences[u.decorationId]=u}})}_onEditorMouseMove(e,t){const i=this.editor.getOption(77)==="altKey";if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const r=this.getLinkOccurrence(e.target.position);r&&this.editor.changeDecorations(o=>{r.activate(o,i),this.activeLinkDecorationId=r.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(77)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:r}=e;r.resolve(nr.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===Gi.file&&o.startsWith(`${Gi.file}:`)){const a=Yn.parse(o);if(a.scheme===Gi.file){const l=qv(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=Hcr(s,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const s=o instanceof Error?o.message:o;s==="invalid"?this.notificationService.warn(T("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):s==="missing"?this.notificationService.warn(T("missing.url","Failed to open this link because its target is missing.")):Oi(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const r=this.currentOccurrences[i.id];if(r)return r}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};sN.ID="editor.linkDetector";sN=Ohe=TTr([$7(1,rf),$7(2,za),$7(3,bn),$7(4,Og)],sN);const H3e={general:Ri.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Ri.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class CD{static decoration(e,t){return{range:e.range,options:CD._getOptions(e,t,!1)}}static _getOptions(e,t,i){const r=Object.assign({},i?H3e.active:H3e.general);return r.hoverMessage=ITr(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,CD._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,CD._getOptions(this.link,t,!1))}}function ITr(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?T("links.navigate.executeCmd","Execute command"):T("links.navigate.follow","Follow link"),r=e?mr?T("links.navigate.kb.meta.mac","cmd + click"):T("links.navigate.kb.meta","ctrl + click"):mr?T("links.navigate.kb.alt.mac","option + click"):T("links.navigate.kb.alt","alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=T("tooltip.explanation","Execute command {0}",l)}}return new Gc("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${r})`)}else return new Gc().appendText(`${i} (${r})`)}class LTr extends mn{constructor(){super({id:"editor.action.openLink",label:T("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=sN.get(t);if(!i||!t.hasModel())return;const r=t.getSelections();for(const o of r){const s=i.getLinkOccurrence(o.getEndPosition());s&&i.openLinkOccurrence(s,!1)}}}Vr(sN.ID,sN,1);Dt(LTr);class Phe extends Ue{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(116);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}Phe.ID="editor.contrib.longLinesHelper";Vr(Phe.ID,Phe,2);const V7=he("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},T("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);he("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},T("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);he("editor.wordHighlightTextBackground",{light:V7,dark:V7,hcDark:V7,hcLight:V7},T("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const H7=he("editor.wordHighlightBorder",{light:null,dark:null,hcDark:ys,hcLight:ys},T("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));he("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:ys,hcLight:ys},T("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));he("editor.wordHighlightTextBorder",{light:H7,dark:H7,hcDark:H7,hcLight:H7},T("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const DTr=he("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},T("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ATr=he("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},T("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),NTr=he("editorOverviewRuler.wordHighlightTextForeground",{dark:wP,light:wP,hcDark:wP,hcLight:wP},T("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),RTr=Ri.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Gs(ATr),position:np.Center},minimap:{color:Gs(DG),position:jh.Inline}}),OTr=Ri.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Gs(NTr),position:np.Center},minimap:{color:Gs(DG),position:jh.Inline}}),PTr=Ri.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Gs(wP),position:np.Center},minimap:{color:Gs(DG),position:jh.Inline}}),MTr=Ri.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),FTr=Ri.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Gs(DTr),position:np.Center},minimap:{color:Gs(DG),position:jh.Inline}});function BTr(n){return n===C3.Write?RTr:n===C3.Text?OTr:FTr}function $Tr(n){return n?MTr:PTr}e_((n,e)=>{const t=n.getColor(B0e);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var VTr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},HTr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Mhe;function vE(n,e){const t=e.filter(i=>!n.find(r=>r.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),r=t.length===1?T("cursorAdded","Cursor added: {0}",i):T("cursorsAdded","Cursors added: {0}",i);wS(r)}}class WTr extends mn{constructor(){super({id:"editor.action.insertCursorAbove",label:T("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let r=!0;i&&i.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,fc.addCursorUp(o,s,r)),o.revealTopMostCursor(i.source),vE(s,o.getCursorStates())}}class zTr extends mn{constructor(){super({id:"editor.action.insertCursorBelow",label:T("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let r=!0;i&&i.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,fc.addCursorDown(o,s,r)),o.revealBottomMostCursor(i.source),vE(s,o.getCursorStates())}}class UTr extends mn{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:T("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let r=e.startLineNumber;r<e.endLineNumber;r++){const o=t.getLineMaxColumn(r);i.push(new kn(r,o,r,o))}e.endColumn>1&&i.push(new kn(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),r=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),a=[];r.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),vE(s,o.getCursorStates())}}class jTr extends mn{constructor(){super({id:"editor.action.addCursorsToBottom",label:T("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),r=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=r;l++)o.push(new kn(l,i[0].startColumn,l,i[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),vE(a,s.getCursorStates())}}class qTr extends mn{constructor(){super({id:"editor.action.addCursorsToTop",label:T("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),r=[];for(let a=i[0].startLineNumber;a>=1;a--)r.push(new kn(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();r.length>0&&t.setSelections(r),vE(s,o.getCursorStates())}}class W7{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class $5{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new $5(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let r=!1,o,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(r=!0,o=!0,s=!0):(o=i.wholeWord,s=i.matchCase);const l=e.getSelection();let c,u=null;if(l.isEmpty()){const d=e.getConfiguredWordAtPosition(l.getStartPosition());if(!d)return null;c=d.word,u=new kn(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` `);return new $5(e,t,r,c,o,s,u)}constructor(e,t,i,r,o,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=r,this.wholeWord=o,this.matchCase=s,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new W7(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new W7(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new kn(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new W7(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new W7(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new kn(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class Ck extends Ue{static get(e){return e.getContribution(Ck.ID)}constructor(e){super(),this._sessionDispose=this._register(new mt),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=$5.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(r=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(r=>{(r.matchCase||r.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new kn(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const r=e.getState().matchCase;if(!$rt(this._editor.getModel(),t,r)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l<c;l++)a[l]=this._expandEmptyToWord(s,t[l]);this._editor.setSelections(a);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex){const r=this._editor.getModel();i.searchScope?t=r.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=r.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const r=this._editor.getSelection();for(let o=0,s=t.length;o<s;o++){const a=t[o];if(a.range.intersectRanges(r)){t[o]=t[0],t[0]=a;break}}this._setSelections(t.map(o=>new kn(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Ck.ID="editor.contrib.multiCursorController";class bR extends mn{run(e,t){const i=Ck.get(t);if(!i)return;const r=t._getViewModel();if(r){const o=r.getCursorStates(),s=Bd.get(t);if(s)this._run(i,s);else{const a=e.get(di).createInstance(Bd,t);this._run(i,a),a.dispose()}vE(o,r.getCursorStates())}}}class KTr extends bR{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:T("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:2082,weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class GTr extends bR{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:T("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class YTr extends bR{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:T("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:ml(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class QTr extends bR{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:T("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class XTr extends bR{constructor(){super({id:"editor.action.selectHighlights",label:T("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:3114,weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class ZTr extends bR{constructor(){super({id:"editor.action.changeAll",label:T("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:at.and(de.writable,de.editorTextFocus),kbOpts:{kbExpr:de.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class JTr{constructor(e,t,i,r,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=r,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(J.compareRangesUsingStarts)),this._cachedFindMatches}}let V5=Mhe=class extends Ue{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new $o(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(r=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(r=>{this._isEnabled&&(r.selection.isEmpty()?r.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(r=>{this._setState(null)})),this._register(e.onDidChangeModelContent(r=>{this._isEnabled&&this.updateSoon.schedule()}));const i=Bd.get(e);i&&this._register(i.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(Mhe._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const r=i.getSelection();if(r.startLineNumber!==r.endLineNumber)return null;const o=Ck.get(i);if(!o)return null;const s=Bd.get(i);if(!s)return null;let a=o.getSession(s);if(!a){const u=i.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!$rt(i.getModel(),u,h))return null}a=$5.create(i,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new JTr(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),r=this.editor.getSelections();r.sort(J.compareRangesUsingStarts);const o=[];for(let l=0,c=0,u=i.length,d=r.length;l<u;){const h=i[l];if(c>=d)o.push(h),l++;else{const f=J.compareRangesUsingStarts(h,r[c]);f<0?((r[c].isEmpty()||!J.areIntersecting(h,r[c]))&&o.push(h),l++):(f>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=o.map(l=>({range:l,options:$Tr(s)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};V5.ID="editor.contrib.selectionHighlighter";V5=Mhe=VTr([HTr(1,bn)],V5);function $rt(n,e,t){const i=W3e(n,e[0],!t);for(let r=1,o=e.length;r<o;r++){const s=e[r];if(s.isEmpty())return!1;const a=W3e(n,s,!t);if(i!==a)return!1}return!0}function W3e(n,e,t){const i=n.getValueInRange(e);return t?i.toLowerCase():i}class ekr extends mn{constructor(){super({id:"editor.action.focusNextCursor",label:T("mutlicursor.focusNextCursor","Focus Next Cursor"),description:{description:T("mutlicursor.focusNextCursor.description","Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=Array.from(r.getCursorStates()),s=o.shift();s&&(o.push(s),r.setCursorStates(i.source,3,o),r.revealPrimaryCursor(i.source,!0),vE(o,r.getCursorStates()))}}class tkr extends mn{constructor(){super({id:"editor.action.focusPreviousCursor",label:T("mutlicursor.focusPreviousCursor","Focus Previous Cursor"),description:{description:T("mutlicursor.focusPreviousCursor.description","Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=Array.from(r.getCursorStates()),s=o.pop();s&&(o.unshift(s),r.setCursorStates(i.source,3,o),r.revealPrimaryCursor(i.source,!0),vE(o,r.getCursorStates()))}}Vr(Ck.ID,Ck,4);Vr(V5.ID,V5,1);Dt(WTr);Dt(zTr);Dt(UTr);Dt(KTr);Dt(GTr);Dt(YTr);Dt(QTr);Dt(XTr);Dt(ZTr);Dt(jTr);Dt(qTr);Dt(ekr);Dt(tkr);var Vrt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const wk={Visible:new sn("parameterHintsVisible",!1),MultipleSignatures:new sn("parameterHintsMultipleSignatures",!1)};function Hrt(n,e,t,i,r){return Vrt(this,void 0,void 0,function*(){const o=n.ordered(e);for(const s of o)try{const a=yield s.provideSignatureHelp(e,t,r,i);if(a)return a}catch(a){tl(a)}})}_r.registerCommand("_executeSignatureHelpProvider",(n,...e)=>Vrt(void 0,void 0,void 0,function*(){const[t,i,r]=e;Io(Yn.isUri(t)),Io(De.isIPosition(i)),Io(typeof r=="string"||!r);const o=n.get(bn),s=yield n.get(bh).createModelReference(t);try{const a=yield Hrt(o.signatureHelpProvider,s.object.textEditorModel,De.lift(i),{triggerKind:Yb.Invoke,isRetrigger:!1,triggerCharacter:r},nr.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var nkr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},AC;(function(n){n.Default={type:0};class e{constructor(r,o){this.request=r,this.previouslyActiveHints=o,this.type=2}}n.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}n.Active=t})(AC||(AC={}));class rQ extends Ue{constructor(e,t,i=rQ.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new Le),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=AC.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Nc),this.triggerChars=new nz,this.retriggerChars=new nz,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new jm(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(r=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(r=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(r=>this.onCursorChange(r))),this._register(this.editor.onDidChangeModelContent(r=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(r=>this.onDidType(r))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=AC.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(Oi)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,r=this.editor.getOption(85).cycle;if((e<2||i)&&!r){this.cancel();return}this.updateActiveSignature(i&&r?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,r=this.editor.getOption(85).cycle;if((e<2||i)&&!r){this.cancel();return}this.updateActiveSignature(i&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new AC.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return nkr(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const r=this._pendingTriggers.reduce(ikr);this._pendingTriggers=[];const o={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new AC.Pending(Sl(l=>Hrt(this.providers,s,a,o,l)),i);try{const l=yield this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new AC.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=AC.Default),Oi(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const r=i.charCodeAt(0);this.triggerChars.add(r),this.retriggerChars.add(r)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Yb.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Yb.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Yb.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}rQ.DEFAULT_DELAY=120;function ikr(n,e){switch(e.triggerKind){case Yb.Invoke:return e;case Yb.ContentChange:return n;case Yb.TriggerCharacter:default:return e}}var rkr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Fhe;const pf=kt,okr=Da("parameter-hints-next",Ht.chevronDown,T("parameterHintsNextIcon","Icon for show next parameter hint.")),skr=Da("parameter-hints-previous",Ht.chevronUp,T("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let PU=Fhe=class extends Ue{constructor(e,t,i,r,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new mt),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new E1({editor:e},o,r)),this.keyVisible=wk.Visible.bindTo(i),this.keyMultipleSignatures=wk.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=pf(".editor-widget.parameter-hints-widget"),t=lt(e,pf(".phwrapper"));t.tabIndex=-1;const i=lt(t,pf(".controls")),r=lt(i,pf(".button"+Qn.asCSSSelector(skr))),o=lt(i,pf(".overloads")),s=lt(i,pf(".button"+Qn.asCSSSelector(okr)));this._register(tt(r,"click",h=>{zi.stop(h),this.previous()})),this._register(tt(s,"click",h=>{zi.stop(h),this.next()}));const a=pf(".body"),l=new A6(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=lt(a,pf(".signature")),u=lt(a,pf(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(nn.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const r=e.signatures[e.activeSignature];if(!r)return;const o=lt(this.domNodes.signature,pf(".code")),s=this.editor.getOption(50);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=r.parameters.length>0,l=(t=r.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,r,l);else{const d=lt(o,pf("span"));d.textContent=r.label}const c=r.parameters[l];if(c!=null&&c.documentation){const d=pf("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}lt(this.domNodes.docs,pf("p",{},d))}if(r.documentation!==void 0)if(typeof r.documentation=="string")lt(this.domNodes.docs,pf("p",{},r.documentation));else{const d=this.renderMarkdownDocs(r.documentation);lt(this.domNodes.docs,d.element)}const u=this.hasDocs(r,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=r.parameters[l];Array.isArray(h.label)?d=r.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),r.documentation&&(d+=typeof r.documentation=="string"?`, ${r.documentation}`:`, ${r.documentation.value}`),this.announcedLabel!==d&&(bu(T("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&zx(t.documentation).length>0||t&&typeof t.documentation=="object"&&zx(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&zx(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&zx(e.documentation.value).length>0)}renderParameters(e,t,i){const[r,o]=this.getParameterLabelOffsets(t,i),s=document.createElement("span");s.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),lt(e,s,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const r=new RegExp(`(\\W|^)${tp(i.label)}(?=\\W|$)`,"g");r.test(e.label);const o=r.lastIndex-i.label.length;return o>=0?[o,r.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return Fhe.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};PU.ID="editor.widget.parameterHintsWidget";PU=Fhe=rkr([wne(2,vi),wne(3,rf),wne(4,xs)],PU);he("editorHoverWidget.highlightForeground",{dark:bm,light:bm,hcDark:bm,hcLight:bm},T("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var akr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},z3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Bhe;let Sk=Bhe=class extends Ue{static get(e){return e.getContribution(Bhe.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new rQ(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var o;r?(this.widget.value.show(),this.widget.value.render(r)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new dE(()=>this._register(t.createInstance(PU,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Sk.ID="editor.controller.parameterHints";Sk=Bhe=akr([z3e(1,di),z3e(2,bn)],Sk);class lkr extends mn{constructor(){super({id:"editor.action.triggerParameterHints",label:T("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:de.hasSignatureHelpProvider,kbOpts:{kbExpr:de.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=Sk.get(t);i==null||i.trigger({triggerKind:Yb.Invoke})}}Vr(Sk.ID,Sk,2);Dt(lkr);const Z1e=100+75,J1e=ac.bindToContribution(Sk.get);zt(new J1e({id:"closeParameterHints",precondition:wk.Visible,handler:n=>n.cancel(),kbOpts:{weight:Z1e,kbExpr:de.focus,primary:9,secondary:[1033]}}));zt(new J1e({id:"showPrevParameterHint",precondition:at.and(wk.Visible,wk.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:Z1e,kbExpr:de.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));zt(new J1e({id:"showNextParameterHint",precondition:at.and(wk.Visible,wk.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:Z1e,kbExpr:de.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var ckr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const oQ=new sn("renameInputVisible",!1,T("renameInputVisible","Whether the rename input widget is visible"));let $he=class{constructor(e,t,i,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=r,this._disposables=new mt,this.allowEditorOverflow=!0,this._visibleContextKey=oQ.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",T("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,i,r,o;if(!this._input||!this._domNode)return;const s=e.getColor(Rb),a=e.getColor(P0e);this._domNode.style.backgroundColor=String((t=e.getColor(ua))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((i=e.getColor(ZZe))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((r=e.getColor(XZe))!==null&&r!==void 0?r:"");const l=e.getColor(JZe);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,r]=this._acceptKeybindings;return this._label.innerText=T({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(i))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(r))===null||t===void 0?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,i,r,o,s){this._domNode.classList.toggle("preview",o),this._position=new De(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",r.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new mt;return new Promise(l=>{this._currentCancelInput=c=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(c),!0),this._currentAcceptInput=c=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:o&&c})},a.add(s.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>{var c;return this.cancelInput(!(!((c=this._domNode)===null||c===void 0)&&c.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};$he=ckr([Sne(2,Hl),Sne(3,Qo),Sne(4,vi)],$he);var ukr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jE=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},xT=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Vhe;class eCe{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return xT(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const r=this._providers[this._providerRenameIdx];if(!r.resolveRenameLocation)break;const o=yield r.resolveRenameLocation(this.model,this.position,e);if(o){if(o.rejectReason){t.push(o.rejectReason);continue}return o}}const i=this.model.getWordAtPosition(this.position);return i?{range:new J(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(` `):void 0}:{range:J.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` `):void 0}})}provideRenameEdits(e,t){return xT(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,r){return xT(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(` `)};const s=yield o.provideRenameEdits(this.model,this.position,e,r);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(s.rejectReason),r)}else return this._provideRenameEdits(e,t+1,i.concat(T("no result","No result.")),r);return s})}}function dkr(n,e,t,i){return xT(this,void 0,void 0,function*(){const r=new eCe(e,t,n),o=yield r.resolveRenameLocation(nr.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:r.provideRenameEdits(i,nr.None)})}let Ek=Vhe=class{static get(e){return e.getContribution(Vhe.ID)}constructor(e,t,i,r,o,s,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=r,this._progressService=o,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new mt,this._cts=new Va,this._renameInputField=this._disposableStore.add(this._instaService.createInstance($he,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return xT(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Va,!this.editor.hasModel())return;const i=this.editor.getPosition(),r=new eCe(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!r.hasProvider())return;const o=new IS(this.editor,5,void 0,this._cts.token);let s;try{const g=r.resolveRenameLocation(o.token);this._progressService.showWhile(g,250),s=yield g}catch(g){(e=qh.get(this.editor))===null||e===void 0||e.showMessage(g||T("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{o.dispose()}if(!s)return;if(s.rejectReason){(t=qh.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,i);return}if(o.token.isCancellationRequested)return;const a=new IS(this.editor,5,s.range,this._cts.token),l=this.editor.getSelection();let c=0,u=s.text.length;!J.isEmpty(l)&&!J.spansMultipleLines(l)&&J.containsRange(s.range,l)&&(c=Math.max(0,l.startColumn-s.range.startColumn),u=Math.min(s.range.endColumn,l.endColumn)-s.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(s.range,s.text,c,u,d,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const f=_G(r.provideRenameEdits(h.newName,a.token),a.token).then(g=>xT(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(J.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:T("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:T("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(m=>{m.ariaSummary&&bu(T("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,m.ariaSummary))}).catch(m=>{this._notificationService.error(T("rename.failedApply","Rename failed to apply edits")),this._logService.error(m)})}}),g=>{this._notificationService.error(T("rename.failed","Rename failed to compute edits")),this._logService.error(g)}).finally(()=>{a.dispose()});return this._progressService.showWhile(f,250),f})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Ek.ID="editor.contrib.renameController";Ek=Vhe=ukr([jE(1,di),jE(2,za),jE(3,F6),jE(4,gE),jE(5,hp),jE(6,k0e),jE(7,bn)],Ek);class hkr extends mn{constructor(){super({id:"editor.action.rename",label:T("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:at.and(de.writable,de.hasRenameProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(eo),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Yn.isUri(r)&&De.isIPosition(o)?i.openCodeEditor({resource:r},i.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},Oi):super.runCommand(e,t)}run(e,t){const i=Ek.get(t);return i?i.run():Promise.resolve()}}Vr(Ek.ID,Ek,4);Dt(hkr);const tCe=ac.bindToContribution(Ek.get);zt(new tCe({id:"acceptRenameInput",precondition:oQ,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:at.and(de.focus,at.not("isComposing")),primary:3}}));zt(new tCe({id:"acceptRenameInputWithPreview",precondition:at.and(oQ,at.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:at.and(de.focus,at.not("isComposing")),primary:1024+3}}));zt(new tCe({id:"cancelRenameInput",precondition:oQ,handler:n=>n.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:de.focus,primary:9,secondary:[1033]}}));A0("_executeDocumentRenameProvider",function(n,e,t,...i){const[r]=i;Io(typeof r=="string");const{renameProvider:o}=n.get(bn);return dkr(o,e,t,r)});A0("_executePrepareRename",function(n,e,t){return xT(this,void 0,void 0,function*(){const{renameProvider:i}=n.get(bn),o=yield new eCe(e,t,i).resolveRenameLocation(nr.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o})});Hs.as(Nv.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:T("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function fkr(n){for(let e=0,t=n.length;e<t;e+=4){const i=n[e+0],r=n[e+1],o=n[e+2],s=n[e+3];n[e+0]=s,n[e+1]=o,n[e+2]=r,n[e+3]=i}}function pkr(n){const e=new Uint8Array(n.buffer,n.byteOffset,n.length*4);return dXe()||fkr(e),CG.wrap(e)}function Wrt(n){const e=new Uint32Array(gkr(n));let t=0;if(e[t++]=n.id,n.type==="full")e[t++]=1,e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length;else{e[t++]=2,e[t++]=n.deltas.length;for(const i of n.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return pkr(e)}function gkr(n){let e=0;if(e+=1+1,n.type==="full")e+=1+n.data.length;else{e+=1,e+=(1+1+1)*n.deltas.length;for(const t of n.deltas)t.data&&(e+=t.data.length)}return e}var $S=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function sQ(n){return n&&!!n.data}function zrt(n){return n&&Array.isArray(n.edits)}class mkr{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Urt(n,e){return n.has(e)}function _kr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function jrt(n,e,t,i,r){return $S(this,void 0,void 0,function*(){const o=_kr(n,e),s=yield Promise.all(o.map(a=>$S(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?i:null,r)}catch(u){c=u,l=null}return(!l||!sQ(l)&&!zrt(l))&&(l=null),new mkr(a,l,c)})));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null})}function vkr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class bkr{constructor(e,t){this.provider=e,this.tokens=t}}function ykr(n,e){return n.has(e)}function qrt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function nCe(n,e,t,i){return $S(this,void 0,void 0,function*(){const r=qrt(n,e),o=yield Promise.all(r.map(s=>$S(this,void 0,void 0,function*(){let a;try{a=yield s.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){tl(l),a=null}return(!a||!sQ(a))&&(a=null),new bkr(s,a)})));for(const s of o)if(s.tokens)return s;return o.length>0?o[0]:null})}_r.registerCommand("_provideDocumentSemanticTokensLegend",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t]=e;Io(t instanceof Yn);const i=n.get(Ds).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(bn),o=vkr(r,i);return o?o[0].getLegend():n.get(_a).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));_r.registerCommand("_provideDocumentSemanticTokens",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t]=e;Io(t instanceof Yn);const i=n.get(Ds).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(bn);if(!Urt(r,i))return n.get(_a).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=yield jrt(r,i,null,null,nr.None);if(!o)return;const{provider:s,tokens:a}=o;if(!a||!sQ(a))return;const l=Wrt({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}));_r.registerCommand("_provideDocumentRangeSemanticTokensLegend",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t,i]=e;Io(t instanceof Yn);const r=n.get(Ds).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=n.get(bn),s=qrt(o,r);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!i||!J.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=yield nCe(o,r,J.lift(i),nr.None);if(a)return a.provider.getLegend()}));_r.registerCommand("_provideDocumentRangeSemanticTokens",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t,i]=e;Io(t instanceof Yn),Io(J.isIRange(i));const r=n.get(Ds).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=n.get(bn),s=yield nCe(o,r,J.lift(i),nr.None);if(!(!s||!s.tokens))return Wrt({id:0,type:"full",data:s.tokens.data})}));const iCe="editor.semanticHighlighting";function Hhe(n,e,t){var i;const r=(i=t.getValue(iCe,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))===null||i===void 0?void 0:i.enabled;return typeof r=="boolean"?r:e.getColorTheme().semanticHighlighting}var Krt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cb=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},CC;let Whe=class extends Ue{constructor(e,t,i,r,o,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new H5(u,e,i,o,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];Hhe(u,i,r)?d||a(u):d&&l(u,d)}};this._register(t.onModelAdded(u=>{Hhe(u,i,r)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(r.onDidChangeConfiguration(u=>{u.affectsConfiguration(iCe)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Whe=Krt([cb(0,zG),cb(1,Ds),cb(2,Hl),cb(3,dr),cb(4,Og),cb(5,bn)],Whe);let H5=CC=class extends Ue{constructor(e,t,i,r,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:CC.REQUEST_MIN_DELAY,max:CC.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new $o(()=>this._fetchDocumentSemanticTokensNow(),CC.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const s=()=>{mo(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),mo(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Urt(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Va,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=jrt(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Eu(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,o)}},l=>{l&&(Dv(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Oi(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,r,o){o=Math.min(o,i.length-r,e.length-t);for(let s=0;s<o;s++)i[r+s]=e[t+s]}_setDocumentSemanticTokens(e,t,i,r){const o=this._currentDocumentResponse,s=()=>{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(zrt(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(CC._copy(l,u-g,c,d-g,g),d-=g),f.data&&(CC._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&CC._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(sQ(t)){this._currentDocumentResponse=new Ckr(e,t.resultId,t.data);const a=pet(t,i,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};H5.REQUEST_MIN_DELAY=300;H5.REQUEST_MAX_DELAY=2e3;H5=CC=Krt([cb(1,zG),cb(2,Hl),cb(3,Og),cb(4,bn)],H5);class Ckr{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}uY(Whe);var wkr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},QO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let W5=class extends Ue{constructor(e,t,i,r,o,s){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=r,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new $o(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(iCe)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!Hhe(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!ykr(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),r=Sl(s=>Promise.resolve(nCe(this._provider,e,t,s))),o=new Eu(!1);return r.then(s=>{if(this._debounceInformation.update(e,o.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,pet(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};W5.ID="editor.contrib.viewportSemanticTokens";W5=wkr([QO(1,zG),QO(2,Hl),QO(3,dr),QO(4,Og),QO(5,bn)],W5);Vr(W5.ID,W5,1);class Skr{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const r of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,r),this._addWordRanges(o,e,r),this._addWhitespaceLine(o,e,r),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const r=t.getWordAtPosition(i);if(!r)return;const{word:o,startColumn:s}=r,a=i.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=o.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(JC(d)&&sb(u))break;u=d}for(l+=1;c<o.length;c++){const d=o.charCodeAt(c);if(sb(d)&&JC(u))break;if(d===95||d===45)break;u=d}l<c&&e.push({range:new J(i.lineNumber,s+l,i.lineNumber,s+c)})}_addWordRanges(e,t,i){const r=t.getWordAtPosition(i);r&&e.push({range:new J(i.lineNumber,r.startColumn,i.lineNumber,r.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new J(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var Ekr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xkr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},aQ=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},zhe;class rCe{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new rCe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let aN=zhe=class{static get(e){return e.getContribution(zhe.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return aQ(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield Yrt(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(112),nr.None).then(o=>{var s;if(!(!Cu(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Ia(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<o.length;a++)o[a]=o[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new rCe(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(o=>o.mov(e));const r=this._state.map(o=>kn.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}})}};aN.ID="editor.contrib.smartSelectController";aN=zhe=Ekr([xkr(1,bn)],aN);class Grt extends mn{constructor(e,t){super(t),this._forward=e}run(e,t){return aQ(this,void 0,void 0,function*(){const i=aN.get(t);i&&(yield i.run(this._forward))})}}class Tkr extends Grt{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:T("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"1_basic",title:T({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}_r.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class kkr extends Grt{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:T("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"1_basic",title:T({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}Vr(aN.ID,aN,4);Dt(Tkr);Dt(kkr);function Yrt(n,e,t,i,r){return aQ(this,void 0,void 0,function*(){const o=n.all(e).concat(new Skr(i.selectSubwords));o.length===1&&o.unshift(new yf);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(Cu(c)&&c.length===t.length)for(let u=0;u<t.length;u++){a[u]||(a[u]=[]);for(const d of c[u])J.isIRange(d.range)&&J.containsPosition(d.range,t[u])&&a[u].push(J.lift(d.range))}},tl));return yield Promise.all(s),a.map(l=>{if(l.length===0)return[];l.sort((h,f)=>De.isBefore(h.getStartPosition(),f.getStartPosition())?1:De.isBefore(f.getStartPosition(),h.getStartPosition())||De.isBefore(h.getEndPosition(),f.getEndPosition())?-1:De.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||J.containsRange(h,u)&&!J.equalsRange(h,u))&&(c.push(h),u=h);if(!i.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;h<c.length;h++){const f=c[h-1],g=c[h];if(g.startLineNumber!==f.startLineNumber||g.endLineNumber!==f.endLineNumber){const m=new J(f.startLineNumber,e.getLineFirstNonWhitespaceColumn(f.startLineNumber),f.endLineNumber,e.getLineLastNonWhitespaceColumn(f.endLineNumber));m.containsRange(f)&&!m.equalsRange(f)&&g.containsRange(m)&&!g.equalsRange(m)&&d.push(m);const v=new J(f.startLineNumber,1,f.endLineNumber,e.getLineMaxColumn(f.endLineNumber));v.containsRange(f)&&!v.equalsRange(m)&&g.containsRange(v)&&!g.equalsRange(v)&&d.push(v)}d.push(g)}return d})})}_r.registerCommand("_executeSelectionRangeProvider",function(n,...e){return aQ(this,void 0,void 0,function*(){const[t,i]=e;Io(Yn.isUri(t));const r=n.get(bn).selectionRangeProvider,o=yield n.get(bh).createModelReference(t);try{return Yrt(r,o.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},nr.None)}finally{o.dispose()}})});const Ikr=Object.freeze({View:{value:T("view","View"),original:"View"},Help:{value:T("help","Help"),original:"Help"},Test:{value:T("test","Test"),original:"Test"},File:{value:T("file","File"),original:"File"},Preferences:{value:T("preferences","Preferences"),original:"Preferences"},Developer:{value:T({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer"),original:"Developer"}});var Lkr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class U3e{constructor(e,t,i,r=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=r}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Ia(this.startLineNumbers,e.startLineNumbers)&&Ia(this.endLineNumbers,e.endLineNumbers)}}const j3e=R1("stickyScrollViewLayer",{createHTML:n=>n}),Ene="data-sticky-line-index",q3e="data-sticky-is-line",Dkr="data-sticky-is-line-number",K3e="data-sticky-is-folding-icon";class Akr extends Ue{constructor(e){super(),this._editor=e,this._foldingIconStore=new mt,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(66),this._stickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof AS),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(114)&&t(),i.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const r=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const s=[...e.startLineNumbers];e.showEndForLine!==null&&(s[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=s}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(r,t,i)}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Ic(this._lineNumbersDomNode),Ic(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}_renderRootNode(e,t,i=1/0){return Lkr(this,void 0,void 0,function*(){const r=this._editor.getLayoutInfo();for(const[s,a]of this._lineNumbers.entries()){const l=e[s],c=a>=i||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(s,a,t,r):this._updateTopAndZIndexOfStickyLine(l);c&&(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._stickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(o===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(tt(this._lineNumbersDomNode,Yt.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(tt(this._lineNumbersDomNode,Yt.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,r){const o=this._editor._getViewModel();if(!o)return;const s=o.coordinatesConverter.convertModelPositionToViewPosition(new De(t,1)).lineNumber,a=o.getViewLineRenderingData(s),l=this._editor.getOption(67);let c;try{c=Vh.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new fE(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new rR(2e3),h=T6(u,d);let f;j3e?f=j3e.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(Ene,String(e)),g.setAttribute(q3e,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const m=document.createElement("span");m.setAttribute(Ene,String(e)),m.setAttribute(Dkr,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=r.contentLeft;m.style.width=`${v}px`;const _=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?_.innerText=t.toString():l.renderType===2&&(_.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),_.className="sticky-line-number-inner",_.style.lineHeight=`${this._lineHeight}px`,_.style.width=`${r.lineNumbersWidth}px`,_.style.paddingLeft=`${r.lineNumbersLeft}px`,m.appendChild(_);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(_),m.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new Nkr(e,t,g,m,b,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,r=e.lineDomNode,o=e.lineNumberDomNode,s=i===this._lineNumbers.length-1,a="0",l="1";r.style.zIndex=s?a:l,o.style.zIndex=s?a:l;const c=`${i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${i*this._lineHeight}px`;return r.style.top=s?c:u,o.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||i==="never")return;const r=e.regions,o=r.findRange(t),s=r.getStartLineNumber(o);if(!(t===s))return;const l=r.isCollapsed(o),c=new Rkr(l,s,r.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(K3e,""),c}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._stickyLines.length&&this._stickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=W0e(t.characterMapping,e,0);return new De(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,Ene);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,q3e)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,K3e)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Nkr{constructor(e,t,i,r,o,s){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=r,this.foldingIcon=o,this.characterMapping=s}}class Rkr{constructor(e,t,i,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=Qn.asClassName(e?HY:VY)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class i4{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class MU{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Qrt{constructor(e,t,i,r){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=r}}var lQ=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},z5=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},G3e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},r4;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(r4||(r4={}));var hw;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(hw||(hw={}));let Uhe=class extends Ue{constructor(e,t,i,r){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new jm(300)),this._updateOperation=this._register(new mt);const o=new jhe(i),s=new Khe(this._editor,i),a=new qhe(this._editor,t);switch(r){case r4.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(a);break;case r4.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case r4.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,i){return G3e(this,void 0,void 0,function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger(()=>G3e(this,void 0,void 0,function*(){for(const r of this._modelProviders){const{statusPromise:o,modelPromise:s}=r.computeStickyModel(e,t,i);this._modelPromise=s;const a=yield o;if(this._modelPromise!==s)return null;switch(a){case hw.CANCELED:return this._updateOperation.clear(),null;case hw.VALID:return r.stickyModel}}return null})).catch(r=>(Oi(r),null))})}};Uhe=lQ([z5(1,rs),z5(2,bn)],Uhe);class Xrt{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,hw.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const r=Sl(o=>this.createModelFromProvider(e,t,o));return{statusPromise:r.then(o=>this.isModelValid(o)?i.isCancellationRequested?hw.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,o),hw.VALID):this._invalid()).then(void 0,o=>(Oi(o),hw.CANCELED)),modelPromise:r}}isModelValid(e){return!0}isProviderValid(e){return!0}}let jhe=class extends Xrt{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return Cy.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,r){var o;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(r,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new Qrt(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(tr.first(e.children.values())instanceof yrt){const a=tr.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,i=u.children}}else i=e.children;const r=[],o=Array.from(i.values()).sort((a,l)=>{const c=new i4(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new i4(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of o)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new MU(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const s of o.children.values())i.push(this._stickyModelFromOutlineElement(s,o.symbol.selectionRange.startLineNumber));i.sort((o,s)=>this._comparator(o.range,s.range));const r=new i4(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new MU(r,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof hhe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};jhe=lQ([z5(0,bn)],jhe);class Zrt extends Xrt{constructor(e){super(),this._foldingLimitReporter=new _rt(e)}createStickyModel(e,t,i,r){const o=this._fromFoldingRegions(r);return new Qrt(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],r=new MU(void 0,[],void 0);for(let o=0;o<t;o++){const s=e.getParentIndex(o);let a;s!==-1?a=i[s]:a=r;const l=new MU(new i4(e.getStartLineNumber(o),e.getEndLineNumber(o)+1),[],a);a.children.push(l),i.push(l)}return r}}let qhe=class extends Zrt{constructor(e,t){super(e),this._languageConfigurationService=t}createModelFromProvider(e,t,i){return new V1e(e,this._languageConfigurationService,this._foldingLimitReporter).compute(i)}};qhe=lQ([z5(1,rs)],qhe);let Khe=class extends Zrt{constructor(e,t){super(e),this._languageFeaturesService=t}isProviderValid(e){return v0.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,t,i){const r=v0.getFoldingRangeProviders(this._languageFeaturesService,e);return new W1e(e,r,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};Khe=lQ([z5(1,bn)],Khe);var Okr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Y3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Q3e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Pkr{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let Ghe=class extends Ue{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new Le),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new mt),this._updateSoon=this._register(new $o(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new Uhe(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}update(){var e;return Q3e(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Va,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return Q3e(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),i=t.getVersionId(),r=yield this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=r)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,r,o){if(t.children.length===0)return;let s=o;const a=[];for(let u=0;u<t.children.length;u++){const d=t.children[u];d.range&&a.push(d.range.startLineNumber)}const l=this.updateIndex(p3(a,e.startLineNumber,(u,d)=>u-d)),c=this.updateIndex(p3(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,i.push(new Pkr(h,f-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,i,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,i,r,o)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let r=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,r,0,-1);const o=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(o)for(const s of o)r=r.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return r}};Ghe=Okr([Y3e(1,bn),Y3e(2,rs)],Ghe);var Mkr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},g2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},xne=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Yhe;let b0=Yhe=class extends Ue{constructor(e,t,i,r,o,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=r,this._contextKeyService=a,this._sessionStore=new mt,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new Akr(this._editor),this._stickyLineCandidateProvider=new Ghe(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new U3e([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(114)||u.hasChanged(72)||u.hasChanged(66)||u.hasChanged(109))&&this._readConfiguration()})),this._register(tt(l,Yt.CONTEXT_MENU,u=>xne(this,void 0,void 0,function*(){this._onContextMenu(u)}))),this._stickyScrollFocusedContextKey=de.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=de.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(c0(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(tt(l,Yt.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(Yhe.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new mt,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(J.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new mt),t=this._register(new xY(this._editor,{extractLineNumberFromMouseEvent:o=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return s?s.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const s=o.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new J(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},r=this._stickyScrollWidget.getDomNode();this._register($a(r,Yt.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const u=new De(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new De(c,1)}this._revealPosition(l)})),this._register($a(r,Yt.MOUSE_MOVE,o=>{if(o.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(tt(r,Yt.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,s])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new Va;e.add(mi(()=>u.dispose(!0)));let d;AY(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new De(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(mi(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(mi(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(o=>xne(this,void 0,void 0,function*(){if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);s&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(krt,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new Zp(e);this._contextMenuService.showContextMenu({menuId:ue.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;hrt(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const r=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll()}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const r of e.ranges)if(i>=r.fromLineNumber&&i<=r.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}_renderStickyScroll(e=1/0){var t,i;return xne(this,void 0,void 0,function*(){const r=this._editor.getModel();if(!r||r.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===r.getVersionId())if(this._foldingModel=(i=yield(t=v0.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}})}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let r=0;const o=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new i4(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,m=f*e,v=this._editor.getBottomForLineNumber(d)-i,_=this._editor.getTopForLineNumber(h)-i,b=this._editor.getBottomForLineNumber(h)-i;if(g>_&&g<=b){o.push(d),s.push(h+1),r=b-m;break}else m>v&&m<=b&&(o.push(d),s.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=s,new U3e(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};b0.ID="store.contrib.stickyScrollController";b0=Yhe=Mkr([g2(1,t_),g2(2,bn),g2(3,di),g2(4,rs),g2(5,Og),g2(6,vi)],b0);var Fkr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Bkr extends up{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:T("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:T({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:Ikr.View,toggled:{condition:at.equals("config.editor.stickyScroll.enabled",!0),title:T("stickyScroll","Sticky Scroll"),mnemonicTitle:T({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:ue.CommandPalette},{id:ue.MenubarAppearanceMenu,group:"4_editor",order:3},{id:ue.StickyScrollContext}]})}run(e){return Fkr(this,void 0,void 0,function*(){const t=e.get(dr),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)})}}const cQ=100;class $kr extends Av{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:T("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:T({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:at.and(at.has("config.editor.stickyScroll.enabled"),de.stickyScrollVisible),menu:[{id:ue.CommandPalette}]})}runEditorCommand(e,t){var i;(i=b0.get(t))===null||i===void 0||i.focus()}}class Vkr extends Av{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:T("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:cQ,primary:18}})}runEditorCommand(e,t){var i;(i=b0.get(t))===null||i===void 0||i.focusNext()}}class Hkr extends Av{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:T("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:cQ,primary:16}})}runEditorCommand(e,t){var i;(i=b0.get(t))===null||i===void 0||i.focusPrevious()}}class Wkr extends Av{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:T("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:cQ,primary:3}})}runEditorCommand(e,t){var i;(i=b0.get(t))===null||i===void 0||i.goToFocused()}}class zkr extends Av{constructor(){super({id:"editor.action.selectEditor",title:{value:T("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:cQ,primary:9}})}runEditorCommand(e,t){var i;(i=b0.get(t))===null||i===void 0||i.selectEditor()}}Vr(b0.ID,b0,1);ws(Bkr);ws($kr);ws(Hkr);ws(Vkr);ws(Wkr);ws(zkr);var oCe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},TT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ukr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},hx;class jkr{constructor(e,t,i,r,o,s){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=r,this.command=o,this.completion=s}}let Qhe=class extends EJi{constructor(e,t,i,r,o,s){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=r,this._suggestMemoryService=s}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){var e;const t=[],{items:i}=this.completionModel,r=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},i),o=tr.slice(i,r),s=tr.slice(i,0,r);let a=5;for(const l of tr.concat(o,s)){if(l.score===pv.Default)continue;const c=new J(l.editStart.lineNumber,l.editStart.column,l.editInsertEnd.lineNumber,l.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),u=l.completion.insertTextRules&&l.completion.insertTextRules&4?{snippet:l.completion.insertText}:l.completion.insertText;t.push(new jkr(c,u,(e=l.filterTextLow)!==null&&e!==void 0?e:l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(nr.None)}return t}};Qhe=oCe([TT(5,jY)],Qhe);let Xhe=class{constructor(e,t,i,r){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=r}provideInlineCompletions(e,t,i,r){var o;return Ukr(this,void 0,void 0,function*(){if(i.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(kL.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(kL.valueFor(s,l)!=="inline")return;let c=e.getWordAtPosition(t),u;if(c!=null&&c.word||(u=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!u||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let d;const h=e.getValueInRange(new J(t.lineNumber,1,t.lineNumber,t.column));if(!u&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,c))){const f=new B3e(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),d=this._lastResult}else{const f=yield j1e(this._languageFeatureService.completionProvider,e,t,new A5(void 0,void 0,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},r);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const m=new WC(f.items,t.column,new B3e(h,0),z_.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);d=new Qhe(e,t.lineNumber,c,m,f,this._suggestMemoryService)}return this._lastResult=d,d})}handleItemDidShow(e,t){t.completion.resolve(nr.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const r=e.getValueInRange(J.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((i=s.triggerCharacters)===null||i===void 0)&&i.includes(r)&&o.add(s);if(o.size!==0)return{providers:o,ch:r}}};Xhe=oCe([TT(1,bn),TT(2,B1),TT(3,jY)],Xhe);let FU=hx=class{constructor(e,t,i,r){if(++hx._counter===1){const o=r.createInstance(Xhe,(s,a)=>{var l;return((l=i.listCodeEditors().find(u=>u.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});hx._disposable=t.inlineCompletionsProvider.register("*",o)}}dispose(){var e;--hx._counter===0&&((e=hx._disposable)===null||e===void 0||e.dispose(),hx._disposable=void 0)}};FU._counter=0;FU=hx=oCe([TT(1,bn),TT(2,eo),TT(3,di)],FU);Vr("suggest.inlineCompletionsProvider",FU,0);class qkr extends mn{constructor(){super({id:"editor.action.forceRetokenize",label:T("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const r=new Eu;i.tokenization.forceTokenization(i.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}Dt(qkr);class uQ extends up{constructor(){super({id:uQ.ID,title:{value:T({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!AA.getTabFocusMode();AA.setTabFocusMode(t),bu(t?T("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):T("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}uQ.ID="editor.action.toggleTabFocusMode";ws(uQ);var Kkr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Gkr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Zhe=class extends Ue{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},r){var o;super(),this._link=t,this._enabled=!0,this.el=lt(e,kt("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new ar(this.el,"click")),a=this._register(new ar(this.el,"keypress")),l=nn.chain(a.event,d=>d.map(h=>new hs(h)).filter(h=>h.keyCode===3)),c=this._register(new ar(this.el,Jo.Tap)).event;this._register(Zo.addTarget(this.el));const u=nn.any(s.event,l,c);this._register(u(d=>{this.enabled&&(zi.stop(d,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};Zhe=Kkr([Gkr(3,rf)],Zhe);var Jrt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eot=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Ykr=26;let Jhe=class extends Ue{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(efe))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,Ykr)}};Jhe=Jrt([eot(1,di)],Jhe);let efe=class extends Ue{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(E1,{}),this.element=kt("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=kt("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ic(this.element)}show(e){Ic(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=lt(this.element,kt("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(kt(`div${Qn.asCSSSelector(e.icon)}`));const r=lt(this.element,kt("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=lt(this.element,kt("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(Zhe,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const o=lt(this.element,kt("div.action-container"));this.actionBar=this._register(new wg(o)),this.actionBar.push(this._register(new Pd("banner.close","Close Banner",Qn.asClassName(Ttt),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};efe=Jrt([eot(0,di)],efe);var sCe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wD=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},pu=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Qkr=Da("extensions-warning-message",Ht.warning,T("warningIcon","Icon shown with a warning message in the extensions editor."));let lN=class extends Ue{constructor(e,t,i,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const s=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=s)a={message:T("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new CR};else if(o.ambiguousCharacterCount>=s)a={message:T("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new bE};else if(o.invisibleCharacterCount>=s)a={message:T("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new yR};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:Qkr,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(Jhe,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(124)&&(this._options=e.getOption(124),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=Xkr(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?TZi:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new tfe(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Zkr(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};lN.ID="editor.contrib.unicodeHighlighter";lN=sCe([wD(1,r_),wD(2,Eet),wD(3,di)],lN);function Xkr(n,e){return{nonBasicASCII:e.nonBasicASCII===vf?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===vf?!n:e.includeComments,includeStrings:e.includeStrings===vf?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let tfe=class extends Ue{constructor(e,t,i,r){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new $o(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const r of t.ranges)i.push({range:r,options:BU.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!lye(t,e))return null;const i=t.getValueInRange(e.range);return{reason:tot(i,this._options),inComment:cye(t,e),inString:uye(t,e)}}};tfe=sCe([wD(3,r_)],tfe);class Zkr extends Ue{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new $o(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const o=S0e.computeUnicodeHighlights(this._model,this._options,r);for(const s of o.ranges)i.ranges.push(s);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const r of i.ranges)t.push({range:r,options:BU.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return lye(t,e)?{reason:tot(i,this._options),inComment:cye(t,e),inString:uye(t,e)}:null}}let nfe=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),r=this._editor.getContribution(lN.ID);if(!r)return[];const o=[],s=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=i.getValueInRange(l.range).codePointAt(0),h=Tne(d);let f;switch(c.reason.kind){case 0:{C6(c.reason.confusableWith)?f=T("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,Tne(c.reason.confusableWith.codePointAt(0))):f=T("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,Tne(c.reason.confusableWith.codePointAt(0)));break}case 1:f=T("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=T("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},m=T("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${oB.ID}?${encodeURIComponent(JSON.stringify(g))}`,_=new Gc("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m);o.push(new K_(this,l.range,[_],!1,a++))}return o}renderHoverParts(e,t){return Ait(e,t,this._editor,this._languageService,this._openerService)}};nfe=sCe([wD(1,xs),wD(2,rf)],nfe);function ife(n){return`U+${n.toString(16).padStart(4,"0")}`}function Tne(n){let e=`\`${ife(n)}\``;return Qb.isInvisibleCharacter(n)||(e+=` "${`${Jkr(n)}`}"`),e}function Jkr(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function tot(n,e){return S0e.computeUnicodeHighlightReason(n,e)}class BU{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let r=this.map.get(i);return r||(r=Ri.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,r)),r}}BU.instance=new BU;class eIr extends mn{constructor(){super({id:bE.ID,label:T("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,i){return pu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(dr);r&&this.runAction(r)})}runAction(e){return pu(this,void 0,void 0,function*(){yield e.updateValue(ih.includeComments,!1,2)})}}class tIr extends mn{constructor(){super({id:bE.ID,label:T("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,i){return pu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(dr);r&&this.runAction(r)})}runAction(e){return pu(this,void 0,void 0,function*(){yield e.updateValue(ih.includeStrings,!1,2)})}}class bE extends mn{constructor(){super({id:bE.ID,label:T("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,i){return pu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(dr);r&&this.runAction(r)})}runAction(e){return pu(this,void 0,void 0,function*(){yield e.updateValue(ih.ambiguousCharacters,!1,2)})}}bE.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class yR extends mn{constructor(){super({id:yR.ID,label:T("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,i){return pu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(dr);r&&this.runAction(r)})}runAction(e){return pu(this,void 0,void 0,function*(){yield e.updateValue(ih.invisibleCharacters,!1,2)})}}yR.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class CR extends mn{constructor(){super({id:CR.ID,label:T("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,i){return pu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(dr);r&&this.runAction(r)})}runAction(e){return pu(this,void 0,void 0,function*(){yield e.updateValue(ih.nonBasicASCII,!1,2)})}}CR.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class oB extends mn{constructor(){super({id:oB.ID,label:T("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return pu(this,void 0,void 0,function*(){const{codePoint:r,reason:o,inString:s,inComment:a}=i,l=String.fromCodePoint(r),c=e.get(Rv),u=e.get(dr);function d(g){return Qb.isInvisibleCharacter(g)?T("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",ife(g)):T("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${ife(g)} "${l}"`)}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:T("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>pu(this,void 0,void 0,function*(){iIr(u,[g])})});if(h.push({label:d(r),run:()=>nIr(u,[r])}),a){const g=new eIr;h.push({label:g.label,run:()=>pu(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(s){const g=new tIr;h.push({label:g.label,run:()=>pu(this,void 0,void 0,function*(){return g.runAction(u)})})}if(o.kind===0){const g=new bE;h.push({label:g.label,run:()=>pu(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(o.kind===1){const g=new yR;h.push({label:g.label,run:()=>pu(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(o.kind===2){const g=new CR;h.push({label:g.label,run:()=>pu(this,void 0,void 0,function*(){return g.runAction(u)})})}else rIr(o);const f=yield c.pick(h,{title:T("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}oB.ID="editor.action.unicodeHighlight.showExcludeOptions";function nIr(n,e){return pu(this,void 0,void 0,function*(){const t=n.getValue(ih.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const r of e)i[String.fromCodePoint(r)]=!0;yield n.updateValue(ih.allowedCharacters,i,2)})}function iIr(n,e){var t;return pu(this,void 0,void 0,function*(){const i=(t=n.inspect(ih.allowedLocales).user)===null||t===void 0?void 0:t.value;let r;typeof i=="object"&&i?r=Object.assign({},i):r={};for(const o of e)r[o]=!0;yield n.updateValue(ih.allowedLocales,r,2)})}function rIr(n){throw new Error(`Unexpected value: ${n}`)}Dt(bE);Dt(yR);Dt(CR);Dt(oB);Vr(lN.ID,lN,1);mI.register(nfe);var oIr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},X3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sIr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const not="ignoreUnusualLineTerminators";function aIr(n,e,t){n.setModelProperty(e.uri,not,t)}function lIr(n,e){return n.getModelProperty(e.uri,not)}let U5=class extends Ue{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(r=>{r.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return sIr(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||lIr(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=yield this._dialogService.confirm({title:T("unusualLineTerminators.title","Unusual Line Terminators"),message:T("unusualLineTerminators.message","Detected unusual line terminators"),detail:T("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Cg(e.uri)),primaryButton:T({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:T("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){aIr(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};U5.ID="editor.contrib.unusualLineTerminatorsDetector";U5=oIr([X3e(1,M6),X3e(2,eo)],U5);Vr(U5.ID,U5,1);var cIr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Z3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},rfe;const dQ=new sn("hasWordHighlights",!1);function iot(n,e,t,i){const r=n.ordered(e);return yZe(r.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,tl)),Cu)}class rot{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Sl(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new J(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const r=t.startLineNumber,o=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=i.length;!l&&c<u;c++){const d=i.getRange(c);d&&d.startLineNumber===r&&d.startColumn<=o&&d.endColumn>=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class uIr extends rot{constructor(e,t,i,r){super(e,t,i),this._providers=r}_compute(e,t,i,r){return iot(this._providers,e,t.getPosition(),r).then(o=>o||[])}}class dIr extends rot{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,r){return vS(250,r).then(()=>{if(!t.isEmpty())return[];const o=e.getWordAtPosition(t.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,i,!1).map(a=>({range:a.range,kind:C3.Text}))})}isValid(e,t,i){const r=t.isEmpty();return this._selectionIsEmpty!==r?!1:super.isValid(e,t,i)}}function hIr(n,e,t,i){return n.has(e)?new uIr(e,t,i,n):new dIr(e,t,i)}A0("_executeDocumentHighlights",(n,e,t)=>{const i=n.get(bn);return iot(i.documentHighlightProvider,e,t,nr.None)});class fIr{constructor(e,t,i,r){this.toUnhook=new mt,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=i,this._hasWordHighlights=dQ.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(o)})),this.toUnhook.add(e.onDidChangeModelContent(o=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{const s=this.editor.getOption(80);this.occurrencesHighlight!==s&&(this.occurrencesHighlight=s,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(J.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);bu(`${s}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);bu(`${s}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,i=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<i){this._stopAll();return}const o=this.workerRequest&&this.workerRequest.isValid(this.model,e,this.decorations);if(this.lastCursorPositionChangeTime=new Date().getTime(),o)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();const s=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=hIr(this.providers,this.model,this.editor.getSelection(),this.editor.getOption(129)),this.workerRequest.result.then(a=>{s===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},Oi)}}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:BTr(t.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const t of this.linkedHighlighters())(t==null?void 0:t.editor.getModel())===this.editor.getModel()&&(t._stopAll(),t.decorations.set(e),t._hasWordHighlights.set(t.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let xk=rfe=class extends Ue{static get(e){return e.getContribution(rfe.ID)}constructor(e,t,i){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new fIr(e,i.documentHighlightProvider,()=>tr.map(this.linkedContributions,o=>o.wordHighlighter),t))};this._register(e.onDidChangeModel(o=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),r()})),r()}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};xk.ID="editor.contrib.wordHighlighter";xk=rfe=cIr([Z3e(1,vi),Z3e(2,bn)],xk);class oot extends mn{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=xk.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class pIr extends oot{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:T("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:dQ,kbOpts:{kbExpr:de.editorTextFocus,primary:65,weight:100}})}}class gIr extends oot{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:T("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:dQ,kbOpts:{kbExpr:de.editorTextFocus,primary:1089,weight:100}})}}class mIr extends mn{constructor(){super({id:"editor.action.wordHighlight.trigger",label:T("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:dQ.toNegated(),kbOpts:{kbExpr:de.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const r=xk.get(t);r&&r.restoreViewState(!0)}}Vr(xk.ID,xk,0);Dt(pIr);Dt(gIr);Dt(mIr);class hQ extends ac{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const r=bg(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new De(l.positionLineNumber,l.positionColumn),u=this._move(r,o,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>Dr.fromModelSelection(l))),a.length===1){const l=new De(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new kn(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new kn(t.lineNumber,t.column,t.lineNumber,t.column)}}class yE extends hQ{_move(e,t,i,r){return Zr.moveWordLeft(e,t,i,r)}}class CE extends hQ{_move(e,t,i,r){return Zr.moveWordRight(e,t,i,r)}}class _Ir extends yE{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class vIr extends yE{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class bIr extends yE{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:at.and(de.textInputFocus,(e=at.and(k6,eY))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class yIr extends yE{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class CIr extends yE{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class wIr extends yE{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:at.and(de.textInputFocus,(e=at.and(k6,eY))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class SIr extends yE{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Lv.wordSeparators.defaultValue),t,i,r)}}class EIr extends yE{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Lv.wordSeparators.defaultValue),t,i,r)}}class xIr extends CE{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class TIr extends CE{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:at.and(de.textInputFocus,(e=at.and(k6,eY))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class kIr extends CE{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class IIr extends CE{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class LIr extends CE{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:at.and(de.textInputFocus,(e=at.and(k6,eY))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class DIr extends CE{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class AIr extends CE{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Lv.wordSeparators.defaultValue),t,i,r)}}class NIr extends CE{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Lv.wordSeparators.defaultValue),t,i,r)}}class fQ extends ac{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const r=e.get(rs);if(!t.hasModel())return;const o=bg(t.getOption(129)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:o,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Hc(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class aCe extends fQ{_delete(e,t){const i=Zr.deleteWordLeft(e,t);return i||new J(1,1,1,1)}}class lCe extends fQ{_delete(e,t){const i=Zr.deleteWordRight(e,t);if(i)return i;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new J(r,o,r,o)}}class RIr extends aCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:de.writable})}}class OIr extends aCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:de.writable})}}class PIr extends aCe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class MIr extends lCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:de.writable})}}class FIr extends lCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:de.writable})}}class BIr extends lCe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class $Ir extends mn{constructor(){super({id:"deleteInsideWord",precondition:de.writable,label:T("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const r=bg(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Zr.deleteInsideWord(r,o,l);return new Hc(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}zt(new _Ir);zt(new vIr);zt(new bIr);zt(new yIr);zt(new CIr);zt(new wIr);zt(new xIr);zt(new TIr);zt(new kIr);zt(new IIr);zt(new LIr);zt(new DIr);zt(new SIr);zt(new EIr);zt(new AIr);zt(new NIr);zt(new RIr);zt(new OIr);zt(new PIr);zt(new MIr);zt(new FIr);zt(new BIr);Dt($Ir);class VIr extends fQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=OG.deleteWordPartLeft(e);return i||new J(1,1,1,1)}}class HIr extends fQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=OG.deleteWordPartRight(e);if(i)return i;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new J(r,o,r,o)}}class sot extends hQ{_move(e,t,i,r){return OG.moveWordPartLeft(e,t,i)}}class WIr extends sot{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}_r.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class zIr extends sot{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}_r.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class aot extends hQ{_move(e,t,i,r){return OG.moveWordPartRight(e,t,i)}}class UIr extends aot{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class jIr extends aot{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}zt(new VIr);zt(new HIr);zt(new WIr);zt(new zIr);zt(new UIr);zt(new jIr);class ofe extends Ue{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=qh.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new Gc(T("editor.simple.readonly","Cannot edit in read-only input")):t=new Gc(T("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}ofe.ID="editor.contrib.readOnlyMessageController";Vr(ofe.ID,ofe,2);class sfe extends Ue{constructor(e){super(),this.editor=e,this.widget=null,vv&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new pQ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}sfe.ID="editor.contrib.iPadShowKeyboard";class pQ extends Ue{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(tt(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(tt(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return pQ.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}pQ.ID="editor.contrib.ShowKeyboardWidget";Vr(sfe.ID,sfe,3);var qIr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},J3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},afe;let cN=afe=class extends Ue{static get(e){return e.getContribution(afe.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(Ks.onDidChange(r=>this.stop())),this._register(this._editor.onKeyUp(r=>r.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new gQ(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};cN.ID="editor.contrib.inspectTokens";cN=afe=qIr([J3e(1,fp),J3e(2,xs)],cN);class KIr extends mn{constructor(){super({id:"editor.action.inspectTokens",label:rue.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=cN.get(t);i==null||i.launch()}}function GIr(n){let e="";for(let t=0,i=n.length;t<i;t++){const r=n.charCodeAt(t);switch(r){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(r)}}return e}function YIr(n,e){const t=Ks.get(e);if(t)return t;const i=n.encodeLanguageId(e);return{getInitialState:()=>DA,tokenize:(r,o,s)=>L0e(e,s),tokenizeEncoded:(r,o,s)=>kG(i,s)}}class gQ extends Ue{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=YIr(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return gQ._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;s=o.substring(l,c)}Lc(this._domNode,kt("h2.tm-token",void 0,GIr(s),kt("span.tm-token-length",void 0,`${s.length} ${s.length===1?"char":"chars"}`))),lt(this._domNode,kt("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(r<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(r<<1)+1]):null;lt(this._domNode,kt("table.tm-metadata-table",void 0,kt("tbody",void 0,kt("tr",void 0,kt("td.tm-metadata-key",void 0,"language"),kt("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),kt("tr",void 0,kt("td.tm-metadata-key",void 0,"token type"),kt("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),kt("tr",void 0,kt("td.tm-metadata-key",void 0,"font style"),kt("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),kt("tr",void 0,kt("td.tm-metadata-key",void 0,"foreground"),kt("td.tm-metadata-value",void 0,`${a?ze.Format.CSS.formatHex(a.foreground):"-?-"}`)),kt("tr",void 0,kt("td.tm-metadata-key",void 0,"background"),kt("td.tm-metadata-value",void 0,`${a?ze.Format.CSS.formatHex(a.background):"-?-"}`))))),lt(this._domNode,kt("hr.tokens-inspect-separator")),i<t.tokens1.length&<(this._domNode,kt("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=Ks.getColorMap(),i=Kc.getLanguageId(e),r=Kc.getTokenType(e),o=Kc.getFontStyle(e),s=Kc.getForeground(e),a=Kc.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:r,fontStyle:o,foreground:t[s],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),r=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:r.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}gQ._ID="editor.contrib.inspectTokensWidget";Vr(cN.ID,cN,4);Dt(KIr);var QIr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},e5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},PP;let $U=PP=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Hs.as(cI.Quickaccess)}provide(e){const t=new mt;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const r=this.registry.getQuickAccessProvider(i.substr(PP.PREFIX.length));r&&r.prefix&&r.prefix!==PP.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==PP.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,r=i||"…";return{prefix:i,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:T("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}};$U.PREFIX="?";$U=PP=QIr([e5e(0,Rv),e5e(1,Qo)],$U);Hs.as(cI.Quickaccess).registerQuickAccessProvider({ctor:$U,prefix:"",helpEntries:[{description:oue.helpQuickAccessActionLabel}]});class lot{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const r=new mt;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=r.add(new Nc);return o.value=this.doProvide(e,t),r.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),r}doProvide(e,t){var i;const r=new mt,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},a=ent(o);if(a){let l=(i=o.saveViewState())!==null&&i!==void 0?i:void 0;r.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},r.add(gS(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}r.add(mi(()=>this.clearDecorations(o))),r.add(this.provideWithTextEditor(s,e,t))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&wS(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return Jtt(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Gs(_Je),position:np.Full}}}],[s,a]=i.deltaDecorations(r,o);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class mQ extends lot{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=T("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,Ue.None}provideWithTextEditor(e,t,i){const r=e.editor,o=new mt;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(r,t.value.trim().substr(mQ.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};s(),o.add(t.onDidChangeValue(()=>s()));const a=ent(r);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(mi(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),r=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:r+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?T("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):T("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?T("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,o):T("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",r.lineNumber,r.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const r=this.getModel(e);if(!r)return!1;const o={lineNumber:t,column:i};return r.validatePosition(o).equals(o)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}}mQ.PREFIX=":";var XIr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ZIr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let j5=class extends mQ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=nn.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};j5=XIr([ZIr(0,eo)],j5);let cCe=class cot extends mn{constructor(){super({id:cot.ID,label:Rz.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Rv).quickAccess.show(j5.PREFIX)}};cCe.ID="editor.action.gotoLine";Dt(cCe);Hs.as(cI.Quickaccess).registerQuickAccessProvider({ctor:j5,prefix:j5.PREFIX,helpEntries:[{description:Rz.gotoLineActionLabel,commandId:cCe.ID}]});const uot=[void 0,[]];function kne(n,e,t=0,i=0){const r=e;return r.values&&r.values.length>1?JIr(n,r.values,t,i):dot(n,e,t,i)}function JIr(n,e,t,i){let r=0;const o=[];for(const s of e){const[a,l]=dot(n,s,t,i);if(typeof a!="number")return uot;r+=a,o.push(...l)}return[r,e2r(o)]}function dot(n,e,t,i){const r=ik(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],B6(r)]:uot}function e2r(n){const e=n.sort((r,o)=>r.start-o.start),t=[];let i;for(const r of e)!i||!t2r(i,r)?(i=r,t.push(r)):(i.start=Math.min(i.start,r.start),i.end=Math.max(i.end,r.end));return t}function t2r(n,e){return!(n.end<e.start||e.end<n.start)}function t5e(n){return n.startsWith('"')&&n.endsWith('"')}const hot=" ";function lfe(n){typeof n!="string"&&(n="");const e=n.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:r}=n5e(n),o=t.indexOf(uv)>=0,s=t5e(n);let a;const l=n.split(hot);if(l.length>1)for(const c of l){const u=t5e(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=n5e(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:r,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function n5e(n){let e;eu?e=n.replace(/\//g,uv):e=n.replace(/\\/g,uv);const t=uer(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function i5e(n){return Array.isArray(n)?lfe(n.map(e=>e.original).join(hot)):lfe(n.original)}var n2r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},XO=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},SD;let Zb=SD=class extends lot{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,T("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),Ue.None}provideWithTextEditor(e,t,i){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):Ue.None}doProvideWithoutEditorSymbols(e,t,i,r){const o=new mt;return this.provideLabelPick(i,T("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),XO(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,o))||r.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,r))}),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return XO(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new vG,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),i.complete(!0))}));return t.add(mi(()=>i.complete(!1))),i.p})}doProvideWithEditorSymbols(e,t,i,r){var o;const s=e.editor,a=new mt;a.add(i.onDidAccept(d=>{const[h]=i.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,preserveFocus:d.inBackground}),d.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=d=>XO(this,void 0,void 0,function*(){c==null||c.dispose(!0),i.busy=!1,c=new Va(r),i.busy=!0;try{const h=lfe(i.value.substr(SD.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(r.isCancellationRequested)return;if(f.length>0){if(i.items=f,d&&h.original.length===0){const g=rz(f,m=>!!(m.type!=="separator"&&m.range&&J.containsPosition(m.range.decoration,d)));g&&(i.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(i,T("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,T("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(i.busy=!1)}});return a.add(i.onDidChangeValue(()=>u(void 0))),u((o=s.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(i.onDidChangeActive(()=>{const[d]=i.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}doGetSymbolPicks(e,t,i,r){var o,s;return XO(this,void 0,void 0,function*(){const a=yield e;if(r.isCancellationRequested)return[];const l=t.original.indexOf(SD.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=i5e(t.values[0]),d=i5e(t.values.slice(1))):u=t;let h;const f=(s=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||s===void 0?void 0:s.call(o);f&&(h=[{iconClass:f==="right"?Qn.asClassName(Ht.splitHorizontal):Qn.asClassName(Ht.splitVertical),tooltip:f==="right"?T("openToSide","Open to the Side"):T("openToBottom","Open to the Bottom")}]);const g=[];for(let _=0;_<a.length;_++){const b=a[_],y=ler(b.name),C=`$(${UW.toIcon(b.kind).id}) ${y}`,x=C.length-y.length;let E=b.containerName;i!=null&&i.extraContainerLabel&&(E?E=`${i.extraContainerLabel} • ${E}`:E=i.extraContainerLabel);let k,L,D,A;if(t.original.length>c){let P=!1;if(u!==t&&([k,L]=kne(C,Object.assign(Object.assign({},t),{values:void 0}),c,x),typeof k=="number"&&(P=!0)),typeof k!="number"&&([k,L]=kne(C,u,c,x),typeof k!="number"))continue;if(!P&&d){if(E&&d.original.length>0&&([D,A]=kne(E,d)),typeof D!="number")continue;typeof k=="number"&&(k+=D)}}const O=b.tags&&b.tags.indexOf(1)>=0;g.push({index:_,kind:b.kind,score:k,label:C,ariaLabel:rer(b.name,b.kind),description:E,highlights:O?void 0:{label:L,description:A},range:{selection:J.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:O,buttons:h})}const m=g.sort((_,b)=>l?this.compareByKindAndScore(_,b):this.compareByScore(_,b));let v=[];if(l){let C=function(){b&&typeof _=="number"&&y>0&&(b.label=GT(Lne[_]||Ine,y))},_,b,y=0;for(const x of m)_!==x.kind?(C(),_=x.kind,y=1,b={type:"separator"},v.push(b)):y++,v.push(x);C()}else m.length>0&&(v=[{label:T("symbols","symbols ({0})",g.length),type:"separator"},...m]);return v})}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=Lne[e.kind]||Ine,r=Lne[t.kind]||Ine,o=i.localeCompare(r);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return XO(this,void 0,void 0,function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}};Zb.PREFIX="@";Zb.SCOPE_PREFIX=":";Zb.PREFIX_BY_CATEGORY=`${SD.PREFIX}${SD.SCOPE_PREFIX}`;Zb=SD=n2r([r5e(0,bn),r5e(1,WY)],Zb);const Ine=T("property","properties ({0})"),Lne={5:T("method","methods ({0})"),11:T("function","functions ({0})"),8:T("_constructor","constructors ({0})"),12:T("variable","variables ({0})"),4:T("class","classes ({0})"),22:T("struct","structs ({0})"),23:T("event","events ({0})"),24:T("operator","operators ({0})"),10:T("interface","interfaces ({0})"),2:T("namespace","namespaces ({0})"),3:T("package","packages ({0})"),25:T("typeParameter","type parameters ({0})"),1:T("modules","modules ({0})"),6:T("property","properties ({0})"),9:T("enum","enumerations ({0})"),21:T("enumMember","enumeration members ({0})"),14:T("string","strings ({0})"),0:T("file","files ({0})"),17:T("array","arrays ({0})"),15:T("number","numbers ({0})"),16:T("boolean","booleans ({0})"),18:T("object","objects ({0})"),19:T("key","keys ({0})"),7:T("field","fields ({0})"),13:T("constant","constants ({0})")};var i2r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Dne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let cfe=class extends Zb{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=nn.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};cfe=i2r([Dne(0,eo),Dne(1,bn),Dne(2,WY)],cfe);class sB extends mn{constructor(){super({id:sB.ID,label:t5.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:de.hasDocumentSymbolProvider,kbOpts:{kbExpr:de.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Rv).quickAccess.show(Zb.PREFIX,{itemActivation:A_.NONE})}}sB.ID="editor.action.quickOutline";Dt(sB);Hs.as(cI.Quickaccess).registerQuickAccessProvider({ctor:cfe,prefix:Zb.PREFIX,helpEntries:[{description:t5.quickOutlineActionLabel,prefix:Zb.PREFIX,commandId:sB.ID},{description:t5.quickOutlineByCategoryActionLabel,prefix:Zb.PREFIX_BY_CATEGORY}]});function Ane(n,e){return e&&(n.stack||n.stacktrace)?T("stackTrace.format","{0}: {1}",s5e(n),o5e(n.stack)||o5e(n.stacktrace)):s5e(n)}function o5e(n){return Array.isArray(n)?n.join(` `):n}function s5e(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?T("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||T("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function fot(n=null,e=!1){if(!n)return T("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=s0(n),i=fot(t[0],e);return t.length>1?T("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Od(n))return n;if(n.detail){const t=n.detail;if(t.error)return Ane(t.error,e);if(t.exception)return Ane(t.exception,e)}return n.stack?Ane(n,e):n.message?n.message:T("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function r2r(n){var e;const t=new Map;for(const i of n)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}class o4{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),r=new Map,o=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,r);c>0&&o.push({key:s,score:c})}}return o}static termFrequencies(e){return r2r(o4.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const r=i.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(r.length>1)for(const o of r)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const r=[];for(const o of i.textChunks){const s=o4.termFrequencies(o);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);r.push({text:o,tf:s})}this.chunkCount+=r.length,this.documents.set(i.key,{chunks:r})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const r of i.tf.keys()){const o=this.chunkOccurrences.get(r);if(typeof o=="number"){const s=o-1;s<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,s)}}}}computeSimilarityScore(e,t,i){let r=0;for(const[o,s]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;r+=c*s}return r}computeEmbedding(e){const t=o4.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,r]of e){const o=this.computeIdf(i);o>0&&(t[i]=r*o)}return t}}function o2r(n){var e,t;const i=n.slice(0);i.sort((o,s)=>s.score-o.score);const r=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(r>0)for(const o of i)o.score/=r;return i}var ZO=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},IL;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(IL||(IL={}));function Nne(n){const e=n;return Array.isArray(e.items)}function a5e(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class s2r extends Ue{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var r;const o=new mt;e.canAcceptInBackground=!!(!((r=this.options)===null||r===void 0)&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=o.add(new Nc),l=()=>ZO(this,void 0,void 0,function*(){const c=a.value=new mt;s==null||s.dispose(!0),e.busy=!1,s=new Va(t);const u=s.token,d=e.value.substr(this.prefix.length).trim(),h=this._getPicks(d,c,u,i),f=(m,v)=>{var _;let b,y;if(Nne(m)?(b=m.items,y=m.active):b=m,b.length===0){if(v)return!1;(d.length>0||e.hideInput)&&(!((_=this.options)===null||_===void 0)&&_.noResultsPick)&&(_3(this.options.noResultsPick)?b=[this.options.noResultsPick(d)]:b=[this.options.noResultsPick])}return e.items=b,y&&(e.activeItems=[y]),!0},g=m=>ZO(this,void 0,void 0,function*(){let v=!1,_=!1;yield Promise.all([(()=>ZO(this,void 0,void 0,function*(){typeof m.mergeDelay=="number"&&(yield vS(m.mergeDelay),u.isCancellationRequested)||_||(v=f(m.picks,!0))}))(),(()=>ZO(this,void 0,void 0,function*(){e.busy=!0;try{const b=yield m.additionalPicks;if(u.isCancellationRequested)return;let y,C;Nne(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let x,E;if(Nne(b)?(x=b.items,E=b.active):x=b,x.length>0||!v){let k;if(!C&&!E){const L=e.activeItems[0];L&&y.indexOf(L)!==-1&&(k=L)}f({items:[...y,...x],active:C||E||k})}}finally{u.isCancellationRequested||(e.busy=!1),_=!0}}))()])});if(h!==null)if(a5e(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const m=yield h;if(u.isCancellationRequested)return;a5e(m)?yield g(m):f(m)}finally{u.isCancellationRequested||(e.busy=!1)}}});return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(({button:c,item:u})=>ZO(this,void 0,void 0,function*(){var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),m=typeof g=="number"?g:yield g;if(t.isCancellationRequested)return;switch(m){case IL.NO_ACTION:break;case IL.CLOSE_PICKER:e.hide();break;case IL.REFRESH_PICKER:l();break;case IL.REMOVE_ITEM:{const v=e.items.indexOf(u);if(v!==-1){const _=e.items.slice(),b=_.splice(v,1),y=e.activeItems.filter(x=>x!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=_,y&&(e.activeItems=y),e.keepScrollPosition=C}break}}}}}))),o}}var pot=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ax=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Rne=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},fx,Dl;let Tk=fx=class extends s2r{constructor(e,t,i,r,o,s){super(fx.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=r,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(kk)),this.options=e}_getPicks(e,t,i,r){var o,s,a,l;return Rne(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(i);if(i.isCancellationRequested)return[];const u=gS(()=>{const _=new o4;_.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[y.label+(y.commandAlias?` ${y.commandAlias}`:"")]})));const b=_.calculateScores(e,i);return o2r(b).filter(y=>y.score>fx.TFIDF_THRESHOLD).slice(0,fx.TFIDF_MAX_RESULTS)}),d=[];for(const _ of c){const b=(o=fx.WORD_FILTER(e,_.label))!==null&&o!==void 0?o:void 0,y=_.commandAlias&&(s=fx.WORD_FILTER(e,_.commandAlias))!==null&&s!==void 0?s:void 0;if(b||y)_.highlights={label:b,detail:this.options.showAlias?y:void 0},d.push(_);else if(e===_.commandId)d.push(_);else if(e.length>=3){const C=u();if(i.isCancellationRequested)return[];const x=C.find(E=>E.key===_.commandId);x&&(_.tfIdfScore=x.score,d.push(_))}}const h=new Map;for(const _ of d){const b=h.get(_.label);b?(_.description=_.commandId,b.description=b.commandId):h.set(_.label,_)}d.sort((_,b)=>{if(_.tfIdfScore&&b.tfIdfScore)return _.tfIdfScore===b.tfIdfScore?_.label.localeCompare(b.label):b.tfIdfScore-_.tfIdfScore;if(_.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const y=this.commandsHistory.peek(_.commandId),C=this.commandsHistory.peek(b.commandId);if(y&&C)return y>C?-1:1;if(y)return-1;if(C)return 1;if(this.options.suggestedCommandIds){const x=this.options.suggestedCommandIds.has(_.commandId),E=this.options.suggestedCommandIds.has(b.commandId);if(x&&E)return 0;if(x)return-1;if(E)return 1}return _.label.localeCompare(b.label)});const f=[];let g=!1,m=!0,v=!!this.options.suggestedCommandIds;for(let _=0;_<d.length;_++){const b=d[_];_===0&&this.commandsHistory.peek(b.commandId)&&(f.push({type:"separator",label:T("recentlyUsed","recently used")}),g=!0),m&&b.tfIdfScore!==void 0&&(f.push({type:"separator",label:T("suggested","similar commands")}),m=!1),v&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&(!((a=this.options.suggestedCommandIds)===null||a===void 0)&&a.has(b.commandId))&&(f.push({type:"separator",label:T("commonlyUsed","commonly used")}),g=!0,v=!1),g&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&!(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(b.commandId))&&(f.push({type:"separator",label:T("morecCommands","other commands")}),g=!1),f.push(this.toCommandPick(b,r))}return this.hasAdditionalCommandPicks(e,i)?{picks:f,additionalPicks:(()=>Rne(this,void 0,void 0,function*(){var _;const b=yield this.getAdditionalCommandPicks(c,d,e,i);if(i.isCancellationRequested)return[];const y=b.map(C=>this.toCommandPick(C,r));return m&&((_=y[0])===null||_===void 0?void 0:_.type)!=="separator"&&y.unshift({type:"separator",label:T("suggested","similar commands")}),y}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),r=i?T("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:()=>Rne(this,void 0,void 0,function*(){var o,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){Dv(a)||this.dialogService.error(T("canNotRun","Command '{0}' resulted in an error",e.label),fot(a))}})})}};Tk.PREFIX=">";Tk.TFIDF_THRESHOLD=.5;Tk.TFIDF_MAX_RESULTS=5;Tk.WORD_FILTER=yye(o5,vfr,ket);Tk=fx=pot([Ax(1,di),Ax(2,Qo),Ax(3,_a),Ax(4,dp),Ax(5,M6)],Tk);let kk=Dl=class extends Ue{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Dl.getConfiguredCommandHistoryLength(this.configurationService),Dl.cache&&Dl.cache.limit!==this.configuredCommandsHistoryLength&&(Dl.cache.limit=this.configuredCommandsHistoryLength,Dl.saveState(this.storageService)))}load(){const e=this.storageService.get(Dl.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=Dl.cache=new hE(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((o,s)=>o.value-s.value),r.forEach(o=>i.set(o.key,o.value))}Dl.counter=this.storageService.getNumber(Dl.PREF_KEY_COUNTER,0,Dl.counter)}push(e){Dl.cache&&(Dl.cache.set(e,Dl.counter++),Dl.saveState(this.storageService))}peek(e){var t;return(t=Dl.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!Dl.cache)return;const t={usesLRU:!0,entries:[]};Dl.cache.forEach((i,r)=>t.entries.push({key:r,value:i})),e.store(Dl.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(Dl.PREF_KEY_COUNTER,Dl.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const o=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof o=="number"?o:Dl.DEFAULT_COMMANDS_HISTORY_LENGTH}};kk.DEFAULT_COMMANDS_HISTORY_LENGTH=50;kk.PREF_KEY_CACHE="commandPalette.mru.cache";kk.PREF_KEY_COUNTER="commandPalette.mru.counter";kk.counter=1;kk=Dl=pot([Ax(0,i_),Ax(1,dr)],kk);class a2r extends Tk{constructor(e,t,i,r,o,s){super(e,t,i,r,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:Tye(i.label)||i.id});return t}}var l2r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},m2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},l5e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let q5=class extends a2r{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,r,o,s){super({showAlias:!1},e,i,r,o,s),this.codeEditorService=t}getCommandPicks(){return l5e(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return l5e(this,void 0,void 0,function*(){return[]})}};q5=l2r([m2(0,di),m2(1,eo),m2(2,Qo),m2(3,_a),m2(4,dp),m2(5,M6)],q5);class aB extends mn{constructor(){super({id:aB.ID,label:Oz.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Rv).quickAccess.show(q5.PREFIX)}}aB.ID="editor.action.quickCommand";Dt(aB);Hs.as(cI.Quickaccess).registerQuickAccessProvider({ctor:q5,prefix:q5.PREFIX,helpEntries:[{description:Oz.quickCommandHelp,commandId:aB.ID}]});var c2r=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ufe=class extends RS{constructor(e,t,i,r,o,s,a){super(!0,e,t,i,r,o,s,a)}};ufe=c2r([_2(1,vi),_2(2,eo),_2(3,za),_2(4,di),_2(5,i_),_2(6,dr)],ufe);Vr(RS.ID,ufe,4);class u2r extends mn{constructor(){super({id:"editor.action.toggleHighContrast",label:sue.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(fp),r=i.getColorTheme();fv(r.type)?(i.setTheme(this._originalThemeName||(OA(r.type)?vD:Iy)),this._originalThemeName=null):(i.setTheme(OA(r.type)?CT:wT),this._originalThemeName=r.themeName)}}Dt(u2r);const d2r=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:rnt,Emitter:ont,KeyCode:snt,KeyMod:ant,MarkerSeverity:hnt,MarkerTag:fnt,Position:lnt,Range:cnt,Selection:unt,SelectionDirection:dnt,Token:gnt,Uri:pnt,editor:mnt,languages:_nt},Symbol.toStringTag,{value:"Module"}));function h2r(){return new Worker("/editor.worker-94ffd778.js")}function f2r(){return new Worker("/json.worker-8dd963f3.js")}function p2r(){return new Worker("/css.worker-c3850ceb.js")}function g2r(){return new Worker("/html.worker-88b237e1.js")}function m2r(){return new Worker("/ts.worker-72c9fe54.js")}Xxn({dsn:{}.VITE_SENTRY_URL,integrations:[new Qxn],tracesSampleRate:1});gh.use(X0t).init({resources:{en:{translation:ZQi}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const _2r=Jyt,v2r=new T0t({defaultOptions:{queries:{retry:1}}});self.MonacoEnvironment={getWorker(n,e){return e==="json"?new f2r:e==="css"||e==="scss"||e==="less"?new p2r:e==="html"||e==="handlebars"||e==="razor"?new g2r:e==="typescript"||e==="javascript"?new m2r:new h2r}};JK.config({monaco:d2r});JK.init().then();const b2r=document.getElementById("root");jQe(b2r).render(p(ae.StrictMode,{children:p(A0t,{client:v2r,children:p(W6e,{store:GD,children:p(JQi,{children:p(_2r,{children:p(Zxn,{children:p(qCn,{})})})})})})}));const dfe=eXi();export{En as $,Ha as A,pr as B,Qt as C,Rf as D,L1 as E,pa as F,el as G,dt as H,Cn as I,Gt as J,rLr as K,lA as L,_gn as M,Lse as N,vgn as O,Ke as P,mgn as Q,ae as R,ns as S,Pi as T,kWe as U,u8e as V,BN as W,Ci as X,jyn as Y,emt as Z,K6 as _,Ti as a,wu as a$,Ont as a0,ps as a1,Yo as a2,hLr as a3,yfn as a4,QN as a5,$n as a6,Di as a7,Zt as a8,SLr as a9,_i as aA,Yj as aB,Sr as aC,Zi as aD,N9e as aE,cme as aF,sS as aG,AK as aH,Gj as aI,R9e as aJ,L2r as aK,Y2r as aL,qp as aM,yGe as aN,hme as aO,EN as aP,Ac as aQ,Dc as aR,gl as aS,W2r as aT,A1 as aU,cp as aV,a6 as aW,ZS as aX,Zk as aY,Fl as aZ,Hm as a_,wi as aa,Ur as ab,dme as ac,Ui as ad,Ar as ae,LK as af,Cbe as ag,kK as ah,DK as ai,ji as aj,e0 as ak,mm as al,_H as am,wge as an,oS as ao,Fme as ap,Po as aq,N1 as ar,fLr as as,bGe as at,LGe as au,EGe as av,SGe as aw,tn as ax,vt as ay,_F as az,ELr as b,DGe as b$,Xc as b0,r0 as b1,Oc as b2,Qi as b3,T1 as b4,cK as b5,dK as b6,t0 as b7,O9e as b8,uK as b9,ft as bA,LF as bB,Dg as bC,rl as bD,Pk as bE,fF as bF,Q1t as bG,Fi as bH,tu as bI,dF as bJ,Tu as bK,GS as bL,aE as bM,il as bN,P_e as bO,fse as bP,QS as bQ,Tg as bR,kxe as bS,YS as bT,ALr as bU,FLr as bV,kLr as bW,zEt as bX,JS as bY,pLr as bZ,NGe as b_,iA as ba,un as bb,ce as bc,qy as bd,Hve as be,C0 as bf,Ms as bg,Vq as bh,KWe as bi,uLr as bj,Li as bk,WLr as bl,Oo as bm,Ign as bn,SK as bo,EK as bp,_o as bq,MN as br,GUt as bs,D1 as bt,kv as bu,K as bv,wl as bw,rpn as bx,M9e as by,STe as bz,p as c,lLr as c$,oE as c0,Fh as c1,Ls as c2,vo as c3,WGe as c4,fGe as c5,ppn as c6,qEt as c7,Tpn as c8,i0 as c9,Npn as cA,Tb as cB,Yy as cC,Lw as cD,ipn as cE,kGe as cF,ake as cG,Ro as cH,shn as cI,Tl as cJ,E2r as cK,mbe as cL,lGe as cM,fbe as cN,Lhn as cO,QLr as cP,Rbn as cQ,Mbn as cR,Pbn as cS,Wbn as cT,Obn as cU,jhn as cV,Sqt as cW,gfn as cX,sfn as cY,lfn as cZ,ifn as c_,F2r as ca,B2r as cb,pbe as cc,wLr as cd,M2r as ce,tYe as cf,wK as cg,xge as ch,lbe as ci,_be as cj,IK as ck,O8e as cl,vbe as cm,G8e as cn,CLr as co,xK as cp,Ph as cq,afn as cr,We as cs,wo as ct,ls as cu,pd as cv,Vm as cw,rc as cx,w2r as cy,dpn as cz,tf as d,RLr as d$,J2r as d0,wWe as d1,D2r as d2,z2r as d3,Aae as d4,I2r as d5,$m as d6,b3t as d7,NLr as d8,AGe as d9,ume as dA,l3 as dB,TK as dC,Lg as dD,ap as dE,A2r as dF,CH as dG,wH as dH,GWe as dI,nS as dJ,aLr as dK,yLr as dL,OYe as dM,bpn as dN,Cpn as dO,bLr as dP,ypn as dQ,wpn as dR,Epn as dS,fpn as dT,Fhn as dU,iS as dV,NK as dW,lgn as dX,cgn as dY,Hbn as dZ,ZC as d_,i2t as da,x2r as db,sme as dc,egn as dd,Sf as de,ign as df,a3 as dg,wfn as dh,N2r as di,$Lr as dj,Cgn as dk,T2r as dl,Vgn as dm,jLr as dn,qLr as dp,qgn as dq,GLr as dr,YLr as ds,mLr as dt,npn as du,gLr as dv,Rfn as dw,Efn as dx,Sfn as dy,ame as dz,Te as e,qAt as e$,wgn as e0,ygn as e1,zT as e2,ogn as e3,MLr as e4,PLr as e5,OLr as e6,BLr as e7,Fpn as e8,Sgn as e9,Q2r as eA,tLr as eB,_v as eC,VLr as eD,KLr as eE,zLr as eF,$Ge as eG,$gn as eH,Bgn as eI,BGe as eJ,ULr as eK,nLr as eL,R2r as eM,Ogn as eN,eE as eO,nE as eP,Fa as eQ,tE as eR,Ec as eS,ko as eT,cwt as eU,QCt as eV,FGe as eW,pg as eX,Gk as eY,Egn as eZ,Ngn as e_,hfe as ea,kg as eb,ed as ec,td as ed,X2r as ee,V$t as ef,rgn as eg,ngn as eh,Zpn as ei,ZLr as ej,DLr as ek,ILr as el,Mpn as em,LLr as en,Cfn as eo,XLr as ep,jgn as eq,Ugn as er,Tgn as es,l6 as et,Hgn as eu,Mgn as ev,Lgn as ew,Pgn as ex,Oy as ey,HLr as ez,lc as f,oZi as f$,sLr as f0,oLr as f1,R_e as f2,TLr as f3,Kpn as f4,_pn as f5,ext as f6,KEt as f7,XC as f8,Thn as f9,opn as fA,vLr as fB,gpn as fC,xLr as fD,dLr as fE,k2r as fF,oGe as fG,xhn as fH,ube as fI,O2r as fJ,GEt as fK,EWe as fL,whn as fM,qcn as fN,W$t as fO,P2r as fP,kmn as fQ,ea as fR,k_e as fS,Kk as fT,ma as fU,Bt as fV,$t as fW,Z8e as fX,$s as fY,Go as fZ,OT as f_,Ehn as fa,Pc as fb,Ipe as fc,US as fd,Lfn as fe,H2r as ff,hGe as fg,tpn as fh,epn as fi,YN as fj,NT as fk,cLr as fl,_Lr as fm,TWe as fn,xfn as fo,Shn as fp,L7e as fq,U2r as fr,$2r as fs,V2r as ft,j2r as fu,aGe as fv,Dfn as fw,Am as fx,qpn as fy,jpn as fz,sE as g,$Ct as g0,rS as g1,J$t as g2,QD as g3,JLr as g4,l9 as g5,bt as h,Un as i,N as j,Ng as k,S2r as l,go as m,nl as n,Bo as o,w as p,wgt as q,Ae as r,Nt as s,sp as t,pe as u,XQt as v,hgn as w,ci as x,C2r as y,ni as z};
cải xoăn